]> granicus.if.org Git - imagemagick/blob - magick/version.c
(no commit message)
[imagemagick] / magick / version.c
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %                                                                             %
4 %                                                                             %
5 %                                                                             %
6 %               V   V  EEEEE  RRRR   SSSSS  IIIII   OOO   N   N               %
7 %               V   V  E      R   R  SS       I    O   O  NN  N               %
8 %               V   V  EEE    RRRR    SSS     I    O   O  N N N               %
9 %                V V   E      R R       SS    I    O   O  N  NN               %
10 %                 V    EEEEE  R  R   SSSSS  IIIII   OOO   N   N               %
11 %                                                                             %
12 %                                                                             %
13 %                   MagickCore Version and Copyright Methods                  %
14 %                                                                             %
15 %                              Software Design                                %
16 %                                John Cristy                                  %
17 %                               September 2002                                %
18 %                                                                             %
19 %                                                                             %
20 %  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
21 %  dedicated to making software imaging solutions freely available.           %
22 %                                                                             %
23 %  You may not use this file except in compliance with the License.  You may  %
24 %  obtain a copy of the License at                                            %
25 %                                                                             %
26 %    http://www.imagemagick.org/script/license.php                            %
27 %                                                                             %
28 %  Unless required by applicable law or agreed to in writing, software        %
29 %  distributed under the License is distributed on an "AS IS" BASIS,          %
30 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
31 %  See the License for the specific language governing permissions and        %
32 %  limitations under the License.                                             %
33 %                                                                             %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 %
36 %
37 */
38 \f
39 #include "magick/studio.h"
40 #include "magick/configure.h"
41 #include "magick/exception.h"
42 #include "magick/exception-private.h"
43 #include "magick/hashmap.h"
44 #include "magick/locale_.h"
45 #include "magick/option.h"
46 #include "magick/string_.h"
47 #include "magick/utility.h"
48 #include "magick/version.h"
49 \f
50 /*
51   Define declarations.
52 */
53 #define MagickURLFilename  "index.html"
54 \f
55 /*
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %                                                                             %
58 %                                                                             %
59 %                                                                             %
60 %   G e t M a g i c k C o p y r i g h t                                       %
61 %                                                                             %
62 %                                                                             %
63 %                                                                             %
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %
66 %  GetMagickCopyright() returns the ImageMagick API copyright as a string.
67 %
68 %  The format of the GetMagickCopyright method is:
69 %
70 %      const char *GetMagickCopyright(void)
71 %
72 */
73 MagickExport const char *GetMagickCopyright(void)
74 {
75   return(MagickCopyright);
76 }
77 \f
78 /*
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80 %                                                                             %
81 %                                                                             %
82 %                                                                             %
83 %   G e t M a g i c k F e a t u r e s                                         %
84 %                                                                             %
85 %                                                                             %
86 %                                                                             %
87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 %
89 %  GetMagickFeatures() returns the ImageMagick features.
90 %
91 %  The format of the GetMagickFeatures method is:
92 %
93 %      const char *GetMagickFeatures(void)
94 %
95 %  No parameters are required.
96 %
97 */
98 MagickExport const char *GetMagickFeatures(void)
99 {
100   return(MagickFeatures);
101 }
102 \f
103 /*
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 %                                                                             %
106 %                                                                             %
107 %                                                                             %
108 %   G e t M a g i c k H o m e U R L                                           %
109 %                                                                             %
110 %                                                                             %
111 %                                                                             %
112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
113 %
114 %  GetMagickHomeURL() returns the ImageMagick home URL.
115 %
116 %  The format of the GetMagickHomeURL method is:
117 %
118 %      char *GetMagickHomeURL(void)
119 %
120 */
121 MagickExport char *GetMagickHomeURL(void)
122 {
123   char
124     path[MaxTextExtent];
125
126   const char
127     *element;
128
129   ExceptionInfo
130     *exception;
131
132   LinkedListInfo
133     *paths;
134
135   exception=AcquireExceptionInfo();
136   paths=GetConfigurePaths(MagickURLFilename,exception);
137   exception=DestroyExceptionInfo(exception);
138   if (paths == (LinkedListInfo *) NULL)
139     return(ConstantString(MagickHomeURL));
140   element=(const char *) GetNextValueInLinkedList(paths);
141   while (element != (const char *) NULL)
142   {
143     (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
144       DirectorySeparator,MagickURLFilename);
145     if (IsPathAccessible(path) != MagickFalse)
146       return(ConstantString(path));
147     element=(const char *) GetNextValueInLinkedList(paths);
148   }
149   return(ConstantString(MagickHomeURL));
150 }
151 \f
152 /*
153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 %                                                                             %
155 %                                                                             %
156 %                                                                             %
157 %   G e t M a g i c k P a c k a g e N a m e                                   %
158 %                                                                             %
159 %                                                                             %
160 %                                                                             %
161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
162 %
163 %  GetMagickPackageName() returns the ImageMagick package name.
164 %
165 %  The format of the GetMagickName method is:
166 %
167 %      const char *GetMagickName(void)
168 %
169 %  No parameters are required.
170 %
171 */
172 MagickExport const char *GetMagickPackageName(void)
173 {
174   return(MagickPackageName);
175 }
176 \f
177 /*
178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 %                                                                             %
180 %                                                                             %
181 %                                                                             %
182 %   G e t M a g i c k Q u a n t u m D e p t h                                 %
183 %                                                                             %
184 %                                                                             %
185 %                                                                             %
186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187 %
188 %  GetMagickQuantumDepth() returns the ImageMagick quantum depth.
189 %
190 %  The format of the GetMagickQuantumDepth method is:
191 %
192 %      const char *GetMagickQuantumDepth(size_t *depth)
193 %
194 %  A description of each parameter follows:
195 %
196 %    o depth: the quantum depth is returned as a number.
197 %
198 */
199 MagickExport const char *GetMagickQuantumDepth(size_t *depth)
200 {
201   if (depth != (size_t *) NULL)
202     *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
203   return(MagickQuantumDepth);
204 }
205 \f
206 /*
207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 %                                                                             %
209 %                                                                             %
210 %                                                                             %
211 %   G e t M a g i c k Q u a n t u m R a n g e                                 %
212 %                                                                             %
213 %                                                                             %
214 %                                                                             %
215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 %
217 %  GetMagickQuantumRange() returns the ImageMagick quantum range.
218 %
219 %  The format of the GetMagickQuantumRange method is:
220 %
221 %      const char *GetMagickQuantumRange(size_t *range)
222 %
223 %  A description of each parameter follows:
224 %
225 %    o range: the quantum range is returned as a number.
226 %
227 */
228 MagickExport const char *GetMagickQuantumRange(size_t *range)
229 {
230   if (range != (size_t *) NULL)
231     *range=(size_t) QuantumRange;
232   return(MagickQuantumRange);
233 }
234 \f
235 /*
236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
237 %                                                                             %
238 %                                                                             %
239 %                                                                             %
240 %   G e t M a g i c k R e l e a s e D a t e                                   %
241 %                                                                             %
242 %                                                                             %
243 %                                                                             %
244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
245 %
246 %  GetMagickReleaseDate() returns the ImageMagick release date.
247 %
248 %  The format of the GetMagickReleaseDate method is:
249 %
250 %      const char *GetMagickReleaseDate(void)
251 %
252 %  No parameters are required.
253 %
254 */
255 MagickExport const char *GetMagickReleaseDate(void)
256 {
257   return(MagickReleaseDate);
258 }
259 \f
260 /*
261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
262 %                                                                             %
263 %                                                                             %
264 %                                                                             %
265 %   G e t M a g i c k V e r s i o n                                           %
266 %                                                                             %
267 %                                                                             %
268 %                                                                             %
269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 %
271 %  GetMagickVersion() returns the ImageMagick API version as a string and
272 %  as a number.
273 %
274 %  The format of the GetMagickVersion method is:
275 %
276 %      const char *GetMagickVersion(size_t *version)
277 %
278 %  A description of each parameter follows:
279 %
280 %    o version: the ImageMagick version is returned as a number.
281 %
282 */
283 MagickExport const char *GetMagickVersion(size_t *version)
284 {
285   if (version != (size_t *) NULL)
286     *version=MagickLibVersion;
287   return(MagickVersion);
288 }