]> 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/option.h"
45 #include "magick/string_.h"
46 #include "magick/utility.h"
47 #include "magick/version.h"
48 \f
49 /*
50   Define declarations.
51 */
52 #define MagickURLFilename  "index.html"
53 \f
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 */
72 MagickExport const char *GetMagickCopyright(void)
73 {
74   return(MagickCopyright);
75 }
76 \f
77 /*
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79 %                                                                             %
80 %                                                                             %
81 %                                                                             %
82 %   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 */
97 MagickExport const char *GetMagickFeatures(void)
98 {
99   return(MagickFeatures);
100 }
101 \f
102 /*
103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104 %                                                                             %
105 %                                                                             %
106 %                                                                             %
107 %   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 */
120 MagickExport 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 \f
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 */
171 MagickExport const char *GetMagickPackageName(void)
172 {
173   return(MagickPackageName);
174 }
175 \f
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 %
191 %      const char *GetMagickQuantumDepth(size_t *depth)
192 %
193 %  A description of each parameter follows:
194 %
195 %    o depth: the quantum depth is returned as a number.
196 %
197 */
198 MagickExport const char *GetMagickQuantumDepth(size_t *depth)
199 {
200   if (depth != (size_t *) NULL)
201     *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
202   return(MagickQuantumDepth);
203 }
204 \f
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 %
220 %      const char *GetMagickQuantumRange(size_t *range)
221 %
222 %  A description of each parameter follows:
223 %
224 %    o range: the quantum range is returned as a number.
225 %
226 */
227 MagickExport const char *GetMagickQuantumRange(size_t *range)
228 {
229   if (range != (size_t *) NULL)
230     *range=(size_t) QuantumRange;
231   return(MagickQuantumRange);
232 }
233 \f
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 */
254 MagickExport const char *GetMagickReleaseDate(void)
255 {
256   return(MagickReleaseDate);
257 }
258 \f
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 %
275 %      const char *GetMagickVersion(size_t *version)
276 %
277 %  A description of each parameter follows:
278 %
279 %    o version: the ImageMagick version is returned as a number.
280 %
281 */
282 MagickExport const char *GetMagickVersion(size_t *version)
283 {
284   if (version != (size_t *) NULL)
285     *version=MagickLibVersion;
286   return(MagickVersion);
287 }