blob: b079287e957637f0a0e980b83baa582678d66a43 [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"
44#include "magick/option.h"
45#include "magick/string_.h"
46#include "magick/utility.h"
47#include "magick/version.h"
48
49/*
50 Define declarations.
51*/
52#define MagickURLFilename "index.html"
53
54/*
55%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56% %
57% %
58% %
59% G e t M a g i c k C o p y r i g h t %
60% %
61% %
62% %
63%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64%
65% GetMagickCopyright() returns the ImageMagick API copyright as a string.
66%
67% The format of the GetMagickCopyright method is:
68%
69% const char *GetMagickCopyright(void)
70%
71*/
72MagickExport const char *GetMagickCopyright(void)
73{
74 return(MagickCopyright);
75}
76
77/*
78%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79% %
80% %
81% %
cristyb28d6472009-10-17 20:13:35 +000082% G e t M a g i c k F e a t u r e s %
83% %
84% %
85% %
86%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87%
88% GetMagickFeatures() returns the ImageMagick features.
89%
90% The format of the GetMagickFeatures method is:
91%
92% const char *GetMagickFeatures(void)
93%
94% No parameters are required.
95%
96*/
97MagickExport const char *GetMagickFeatures(void)
98{
99 return(MagickFeatures);
100}
101
102/*
103%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104% %
105% %
106% %
cristy3ed852e2009-09-05 21:47:34 +0000107% G e t M a g i c k H o m e U R L %
108% %
109% %
110% %
111%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112%
113% GetMagickHomeURL() returns the ImageMagick home URL.
114%
115% The format of the GetMagickHomeURL method is:
116%
117% char *GetMagickHomeURL(void)
118%
119*/
120MagickExport char *GetMagickHomeURL(void)
121{
122 char
123 path[MaxTextExtent];
124
125 const char
126 *element;
127
128 ExceptionInfo
129 *exception;
130
131 LinkedListInfo
132 *paths;
133
134 exception=AcquireExceptionInfo();
135 paths=GetConfigurePaths(MagickURLFilename,exception);
136 exception=DestroyExceptionInfo(exception);
137 if (paths == (LinkedListInfo *) NULL)
138 return(ConstantString(MagickHomeURL));
139 element=(const char *) GetNextValueInLinkedList(paths);
140 while (element != (const char *) NULL)
141 {
142 (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",element,
143 DirectorySeparator,MagickURLFilename);
144 if (IsPathAccessible(path) != MagickFalse)
145 return(ConstantString(path));
146 element=(const char *) GetNextValueInLinkedList(paths);
147 }
148 return(ConstantString(MagickHomeURL));
149}
150
151/*
152%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
153% %
154% %
155% %
156% G e t M a g i c k P a c k a g e N a m e %
157% %
158% %
159% %
160%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161%
162% GetMagickPackageName() returns the ImageMagick package name.
163%
164% The format of the GetMagickName method is:
165%
166% const char *GetMagickName(void)
167%
168% No parameters are required.
169%
170*/
171MagickExport const char *GetMagickPackageName(void)
172{
173 return(MagickPackageName);
174}
175
176/*
177%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178% %
179% %
180% %
181% G e t M a g i c k Q u a n t u m D e p t h %
182% %
183% %
184% %
185%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186%
187% GetMagickQuantumDepth() returns the ImageMagick quantum depth.
188%
189% The format of the GetMagickQuantumDepth method is:
190%
cristybb503372010-05-27 20:51:26 +0000191% const char *GetMagickQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +0000192%
193% A description of each parameter follows:
194%
195% o depth: the quantum depth is returned as a number.
196%
197*/
cristybb503372010-05-27 20:51:26 +0000198MagickExport const char *GetMagickQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +0000199{
cristybb503372010-05-27 20:51:26 +0000200 if (depth != (size_t *) NULL)
201 *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
cristy3ed852e2009-09-05 21:47:34 +0000202 return(MagickQuantumDepth);
203}
204
205/*
206%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
207% %
208% %
209% %
210% G e t M a g i c k Q u a n t u m R a n g e %
211% %
212% %
213% %
214%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
215%
216% GetMagickQuantumRange() returns the ImageMagick quantum range.
217%
218% The format of the GetMagickQuantumRange method is:
219%
cristybb503372010-05-27 20:51:26 +0000220% const char *GetMagickQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +0000221%
222% A description of each parameter follows:
223%
224% o range: the quantum range is returned as a number.
225%
226*/
cristybb503372010-05-27 20:51:26 +0000227MagickExport const char *GetMagickQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +0000228{
cristybb503372010-05-27 20:51:26 +0000229 if (range != (size_t *) NULL)
230 *range=(size_t) QuantumRange;
cristy3ed852e2009-09-05 21:47:34 +0000231 return(MagickQuantumRange);
232}
233
234/*
235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236% %
237% %
238% %
239% G e t M a g i c k R e l e a s e D a t e %
240% %
241% %
242% %
243%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
244%
245% GetMagickReleaseDate() returns the ImageMagick release date.
246%
247% The format of the GetMagickReleaseDate method is:
248%
249% const char *GetMagickReleaseDate(void)
250%
251% No parameters are required.
252%
253*/
254MagickExport const char *GetMagickReleaseDate(void)
255{
256 return(MagickReleaseDate);
257}
258
259/*
260%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261% %
262% %
263% %
264% G e t M a g i c k V e r s i o n %
265% %
266% %
267% %
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269%
270% GetMagickVersion() returns the ImageMagick API version as a string and
271% as a number.
272%
273% The format of the GetMagickVersion method is:
274%
cristybb503372010-05-27 20:51:26 +0000275% const char *GetMagickVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +0000276%
277% A description of each parameter follows:
278%
279% o version: the ImageMagick version is returned as a number.
280%
281*/
cristybb503372010-05-27 20:51:26 +0000282MagickExport const char *GetMagickVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +0000283{
cristybb503372010-05-27 20:51:26 +0000284 if (version != (size_t *) NULL)
cristy3ed852e2009-09-05 21:47:34 +0000285 *version=MagickLibVersion;
286 return(MagickVersion);
287}