]> granicus.if.org Git - imagemagick/blob - MagickCore/version.c
(no commit message)
[imagemagick] / MagickCore / 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-2013 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 "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"
50 \f
51 /*
52   Define declarations.
53 */
54 #define MagickURLFilename  "index.html"
55 \f
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 */
74 MagickExport const char *GetMagickCopyright(void)
75 {
76   return(MagickCopyright);
77 }
78 \f
79 /*
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 %                                                                             %
82 %                                                                             %
83 %                                                                             %
84 %   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 */
99 MagickExport const char *GetMagickFeatures(void)
100 {
101   return(MagickFeatures);
102 }
103 \f
104 /*
105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106 %                                                                             %
107 %                                                                             %
108 %                                                                             %
109 %   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 */
122 MagickExport 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   {
144     (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
145       DirectorySeparator,MagickURLFilename);
146     if (IsPathAccessible(path) != MagickFalse)
147       return(ConstantString(path));
148     element=(const char *) GetNextValueInLinkedList(paths);
149   }
150   return(ConstantString(MagickHomeURL));
151 }
152 \f
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 */
173 MagickExport const char *GetMagickPackageName(void)
174 {
175   return(MagickPackageName);
176 }
177 \f
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 %
193 %      const char *GetMagickQuantumDepth(size_t *depth)
194 %
195 %  A description of each parameter follows:
196 %
197 %    o depth: the quantum depth is returned as a number.
198 %
199 */
200 MagickExport const char *GetMagickQuantumDepth(size_t *depth)
201 {
202   if (depth != (size_t *) NULL)
203     *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
204   return(MagickQuantumDepth);
205 }
206 \f
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 %
222 %      const char *GetMagickQuantumRange(size_t *range)
223 %
224 %  A description of each parameter follows:
225 %
226 %    o range: the quantum range is returned as a number.
227 %
228 */
229 MagickExport const char *GetMagickQuantumRange(size_t *range)
230 {
231   if (range != (size_t *) NULL)
232     *range=(size_t) QuantumRange;
233   return(MagickQuantumRange);
234 }
235 \f
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 */
256 MagickExport const char *GetMagickReleaseDate(void)
257 {
258   return(MagickReleaseDate);
259 }
260 \f
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 %
277 %      const char *GetMagickVersion(size_t *version)
278 %
279 %  A description of each parameter follows:
280 %
281 %    o version: the ImageMagick version is returned as a number.
282 %
283 */
284 MagickExport const char *GetMagickVersion(size_t *version)
285 {
286   if (version != (size_t *) NULL)
287     *version=MagickLibVersion;
288   return(MagickVersion);
289 }