blob: d78fb2240688229ca5c8e33bf0573932ad7b0c7d [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
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% %
cristy1454be72011-12-19 01:52:48 +000020% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
cristy3ed852e2009-09-05 21:47:34 +000021% 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
cristy4c08aed2011-07-01 19:47:50 +000039#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"
cristyd1dd6e42011-09-04 01:46:08 +000048#include "MagickCore/utility-private.h"
cristy4c08aed2011-07-01 19:47:50 +000049#include "MagickCore/version.h"
cristy3ed852e2009-09-05 21:47:34 +000050
51/*
52 Define declarations.
53*/
54#define MagickURLFilename "index.html"
55
56/*
57%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58% %
59% %
60% %
61% G e t M a g i c k C o p y r i g h t %
62% %
63% %
64% %
65%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66%
67% GetMagickCopyright() returns the ImageMagick API copyright as a string.
68%
69% The format of the GetMagickCopyright method is:
70%
71% const char *GetMagickCopyright(void)
72%
73*/
74MagickExport const char *GetMagickCopyright(void)
75{
76 return(MagickCopyright);
77}
78
79/*
80%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81% %
82% %
83% %
cristyb28d6472009-10-17 20:13:35 +000084% G e t M a g i c k F e a t u r e s %
85% %
86% %
87% %
88%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
89%
90% GetMagickFeatures() returns the ImageMagick features.
91%
92% The format of the GetMagickFeatures method is:
93%
94% const char *GetMagickFeatures(void)
95%
96% No parameters are required.
97%
98*/
99MagickExport const char *GetMagickFeatures(void)
100{
101 return(MagickFeatures);
102}
103
104/*
105%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106% %
107% %
108% %
cristy3ed852e2009-09-05 21:47:34 +0000109% G e t M a g i c k H o m e U R L %
110% %
111% %
112% %
113%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114%
115% GetMagickHomeURL() returns the ImageMagick home URL.
116%
117% The format of the GetMagickHomeURL method is:
118%
119% char *GetMagickHomeURL(void)
120%
121*/
122MagickExport char *GetMagickHomeURL(void)
123{
124 char
125 path[MaxTextExtent];
126
127 const char
128 *element;
129
130 ExceptionInfo
131 *exception;
132
133 LinkedListInfo
134 *paths;
135
136 exception=AcquireExceptionInfo();
137 paths=GetConfigurePaths(MagickURLFilename,exception);
138 exception=DestroyExceptionInfo(exception);
139 if (paths == (LinkedListInfo *) NULL)
140 return(ConstantString(MagickHomeURL));
141 element=(const char *) GetNextValueInLinkedList(paths);
142 while (element != (const char *) NULL)
143 {
cristyb51dff52011-05-19 16:55:47 +0000144 (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
cristy3ed852e2009-09-05 21:47:34 +0000145 DirectorySeparator,MagickURLFilename);
146 if (IsPathAccessible(path) != MagickFalse)
147 return(ConstantString(path));
148 element=(const char *) GetNextValueInLinkedList(paths);
149 }
150 return(ConstantString(MagickHomeURL));
151}
152
153/*
154%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155% %
156% %
157% %
158% G e t M a g i c k P a c k a g e N a m e %
159% %
160% %
161% %
162%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163%
164% GetMagickPackageName() returns the ImageMagick package name.
165%
166% The format of the GetMagickName method is:
167%
168% const char *GetMagickName(void)
169%
170% No parameters are required.
171%
172*/
173MagickExport const char *GetMagickPackageName(void)
174{
175 return(MagickPackageName);
176}
177
178/*
179%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180% %
181% %
182% %
183% G e t M a g i c k Q u a n t u m D e p t h %
184% %
185% %
186% %
187%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188%
189% GetMagickQuantumDepth() returns the ImageMagick quantum depth.
190%
191% The format of the GetMagickQuantumDepth method is:
192%
cristybb503372010-05-27 20:51:26 +0000193% const char *GetMagickQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +0000194%
195% A description of each parameter follows:
196%
197% o depth: the quantum depth is returned as a number.
198%
199*/
cristybb503372010-05-27 20:51:26 +0000200MagickExport const char *GetMagickQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +0000201{
cristybb503372010-05-27 20:51:26 +0000202 if (depth != (size_t *) NULL)
203 *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
cristy3ed852e2009-09-05 21:47:34 +0000204 return(MagickQuantumDepth);
205}
206
207/*
208%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209% %
210% %
211% %
212% G e t M a g i c k Q u a n t u m R a n g e %
213% %
214% %
215% %
216%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217%
218% GetMagickQuantumRange() returns the ImageMagick quantum range.
219%
220% The format of the GetMagickQuantumRange method is:
221%
cristybb503372010-05-27 20:51:26 +0000222% const char *GetMagickQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +0000223%
224% A description of each parameter follows:
225%
226% o range: the quantum range is returned as a number.
227%
228*/
cristybb503372010-05-27 20:51:26 +0000229MagickExport const char *GetMagickQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +0000230{
cristybb503372010-05-27 20:51:26 +0000231 if (range != (size_t *) NULL)
232 *range=(size_t) QuantumRange;
cristy3ed852e2009-09-05 21:47:34 +0000233 return(MagickQuantumRange);
234}
235
236/*
237%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238% %
239% %
240% %
241% G e t M a g i c k R e l e a s e D a t e %
242% %
243% %
244% %
245%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246%
247% GetMagickReleaseDate() returns the ImageMagick release date.
248%
249% The format of the GetMagickReleaseDate method is:
250%
251% const char *GetMagickReleaseDate(void)
252%
253% No parameters are required.
254%
255*/
256MagickExport const char *GetMagickReleaseDate(void)
257{
258 return(MagickReleaseDate);
259}
260
261/*
262%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263% %
264% %
265% %
266% G e t M a g i c k V e r s i o n %
267% %
268% %
269% %
270%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271%
272% GetMagickVersion() returns the ImageMagick API version as a string and
273% as a number.
274%
275% The format of the GetMagickVersion method is:
276%
cristybb503372010-05-27 20:51:26 +0000277% const char *GetMagickVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +0000278%
279% A description of each parameter follows:
280%
281% o version: the ImageMagick version is returned as a number.
282%
283*/
cristybb503372010-05-27 20:51:26 +0000284MagickExport const char *GetMagickVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +0000285{
cristybb503372010-05-27 20:51:26 +0000286 if (version != (size_t *) NULL)
cristy3ed852e2009-09-05 21:47:34 +0000287 *version=MagickLibVersion;
288 return(MagickVersion);
289}