blob: a8583056208367a3cff0f354453ad3714baceda1 [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% %
cristy7e41fe82010-12-04 23:12:08 +000020% Copyright 1999-2011 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
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"
cristyb51dff52011-05-19 16:55:47 +000044#include "magick/locale_.h"
cristy3ed852e2009-09-05 21:47:34 +000045#include "magick/option.h"
46#include "magick/string_.h"
47#include "magick/utility.h"
48#include "magick/version.h"
49
50/*
51 Define declarations.
52*/
53#define MagickURLFilename "index.html"
54
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*/
73MagickExport const char *GetMagickCopyright(void)
74{
75 return(MagickCopyright);
76}
77
78/*
79%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80% %
81% %
82% %
cristyb28d6472009-10-17 20:13:35 +000083% 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*/
98MagickExport const char *GetMagickFeatures(void)
99{
100 return(MagickFeatures);
101}
102
103/*
104%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105% %
106% %
107% %
cristy3ed852e2009-09-05 21:47:34 +0000108% 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*/
121MagickExport 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 {
cristyb51dff52011-05-19 16:55:47 +0000143 (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
cristy3ed852e2009-09-05 21:47:34 +0000144 DirectorySeparator,MagickURLFilename);
145 if (IsPathAccessible(path) != MagickFalse)
146 return(ConstantString(path));
147 element=(const char *) GetNextValueInLinkedList(paths);
148 }
149 return(ConstantString(MagickHomeURL));
150}
151
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*/
172MagickExport const char *GetMagickPackageName(void)
173{
174 return(MagickPackageName);
175}
176
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%
cristybb503372010-05-27 20:51:26 +0000192% const char *GetMagickQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +0000193%
194% A description of each parameter follows:
195%
196% o depth: the quantum depth is returned as a number.
197%
198*/
cristybb503372010-05-27 20:51:26 +0000199MagickExport const char *GetMagickQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +0000200{
cristybb503372010-05-27 20:51:26 +0000201 if (depth != (size_t *) NULL)
202 *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
cristy3ed852e2009-09-05 21:47:34 +0000203 return(MagickQuantumDepth);
204}
205
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%
cristybb503372010-05-27 20:51:26 +0000221% const char *GetMagickQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +0000222%
223% A description of each parameter follows:
224%
225% o range: the quantum range is returned as a number.
226%
227*/
cristybb503372010-05-27 20:51:26 +0000228MagickExport const char *GetMagickQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +0000229{
cristybb503372010-05-27 20:51:26 +0000230 if (range != (size_t *) NULL)
231 *range=(size_t) QuantumRange;
cristy3ed852e2009-09-05 21:47:34 +0000232 return(MagickQuantumRange);
233}
234
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*/
255MagickExport const char *GetMagickReleaseDate(void)
256{
257 return(MagickReleaseDate);
258}
259
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%
cristybb503372010-05-27 20:51:26 +0000276% const char *GetMagickVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +0000277%
278% A description of each parameter follows:
279%
280% o version: the ImageMagick version is returned as a number.
281%
282*/
cristybb503372010-05-27 20:51:26 +0000283MagickExport const char *GetMagickVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +0000284{
cristybb503372010-05-27 20:51:26 +0000285 if (version != (size_t *) NULL)
cristy3ed852e2009-09-05 21:47:34 +0000286 *version=MagickLibVersion;
287 return(MagickVersion);
288}