2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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 %
13 % MagickCore Version and Copyright Methods %
20 % Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
26 % http://www.imagemagick.org/script/license.php %
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. %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 #include "MagickCore/studio.h"
40 #include "MagickCore/configure.h"
41 #include "MagickCore/exception.h"
42 #include "MagickCore/exception-private.h"
43 #include "MagickCore/hashmap.h"
44 #include "MagickCore/locale_.h"
45 #include "MagickCore/option.h"
46 #include "MagickCore/string_.h"
47 #include "MagickCore/utility.h"
48 #include "MagickCore/utility-private.h"
49 #include "MagickCore/version.h"
54 #define MagickURLFilename "index.html"
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 % G e t M a g i c k C o p y r i g h t %
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 % GetMagickCopyright() returns the ImageMagick API copyright as a string.
69 % The format of the GetMagickCopyright method is:
71 % const char *GetMagickCopyright(void)
74 MagickExport const char *GetMagickCopyright(void)
76 return(MagickCopyright);
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 % G e t M a g i c k D e l e g a t e s %
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90 % GetMagickDelegates() returns the ImageMagick delegate libraries.
92 % The format of the GetMagickDelegates method is:
94 % const char *GetMagickDelegates(void)
96 % No parameters are required.
99 MagickExport const char *GetMagickDelegates(void)
101 return(MagickDelegates);
105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 % G e t M a g i c k F e a t u r e s %
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115 % GetMagickFeatures() returns the ImageMagick features.
117 % The format of the GetMagickFeatures method is:
119 % const char *GetMagickFeatures(void)
121 % No parameters are required.
124 MagickExport const char *GetMagickFeatures(void)
126 return(MagickFeatures);
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134 % G e t M a g i c k H o m e U R L %
138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 % GetMagickHomeURL() returns the ImageMagick home URL.
142 % The format of the GetMagickHomeURL method is:
144 % char *GetMagickHomeURL(void)
147 MagickExport char *GetMagickHomeURL(void)
161 exception=AcquireExceptionInfo();
162 paths=GetConfigurePaths(MagickURLFilename,exception);
163 exception=DestroyExceptionInfo(exception);
164 if (paths == (LinkedListInfo *) NULL)
165 return(ConstantString(MagickHomeURL));
166 element=(const char *) GetNextValueInLinkedList(paths);
167 while (element != (const char *) NULL)
169 (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
170 DirectorySeparator,MagickURLFilename);
171 if (IsPathAccessible(path) != MagickFalse)
172 return(ConstantString(path));
173 element=(const char *) GetNextValueInLinkedList(paths);
175 return(ConstantString(MagickHomeURL));
179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183 % G e t M a g i c k P a c k a g e N a m e %
187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
189 % GetMagickPackageName() returns the ImageMagick package name.
191 % The format of the GetMagickName method is:
193 % const char *GetMagickName(void)
195 % No parameters are required.
198 MagickExport const char *GetMagickPackageName(void)
200 return(MagickPackageName);
204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 % G e t M a g i c k Q u a n t u m D e p t h %
212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214 % GetMagickQuantumDepth() returns the ImageMagick quantum depth.
216 % The format of the GetMagickQuantumDepth method is:
218 % const char *GetMagickQuantumDepth(size_t *depth)
220 % A description of each parameter follows:
222 % o depth: the quantum depth is returned as a number.
225 MagickExport const char *GetMagickQuantumDepth(size_t *depth)
227 if (depth != (size_t *) NULL)
228 *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
229 return(MagickQuantumDepth);
233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
237 % G e t M a g i c k Q u a n t u m R a n g e %
241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243 % GetMagickQuantumRange() returns the ImageMagick quantum range.
245 % The format of the GetMagickQuantumRange method is:
247 % const char *GetMagickQuantumRange(size_t *range)
249 % A description of each parameter follows:
251 % o range: the quantum range is returned as a number.
254 MagickExport const char *GetMagickQuantumRange(size_t *range)
256 if (range != (size_t *) NULL)
257 *range=(size_t) QuantumRange;
258 return(MagickQuantumRange);
262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 % G e t M a g i c k R e l e a s e D a t e %
270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272 % GetMagickReleaseDate() returns the ImageMagick release date.
274 % The format of the GetMagickReleaseDate method is:
276 % const char *GetMagickReleaseDate(void)
278 % No parameters are required.
281 MagickExport const char *GetMagickReleaseDate(void)
283 return(MagickReleaseDate);
287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 % G e t M a g i c k V e r s i o n %
295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
297 % GetMagickVersion() returns the ImageMagick API version as a string and
300 % The format of the GetMagickVersion method is:
302 % const char *GetMagickVersion(size_t *version)
304 % A description of each parameter follows:
306 % o version: the ImageMagick version is returned as a number.
309 MagickExport const char *GetMagickVersion(size_t *version)
311 if (version != (size_t *) NULL)
312 *version=MagickLibVersion;
313 return(MagickVersion);
317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321 % L i s t M a g i c k V e r s i o n %
325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
327 % ListMagickVersion() identifies the ImageMagick version by printing its
328 % attributes to the file. Attributes include the copyright, features, and
331 % The format of the ListMagickVersion method is:
333 % void ListMagickVersion(FILE *file)
335 % A description of each parameter follows:
337 % o file: the file, typically stdout.
340 MagickExport void ListMagickVersion(FILE *file)
342 (void) FormatLocaleFile(file,"Version: %s\n",
343 GetMagickVersion((size_t *) NULL));
344 (void) FormatLocaleFile(file,"Copyright: %s\n",GetMagickCopyright());
345 (void) FormatLocaleFile(file,"Features: %s\n",GetMagickFeatures());
346 (void) FormatLocaleFile(file,"Delegates: %s\n\n",GetMagickDelegates());