/src/imagemagick/MagickCore/version.c
Line | Count | Source (jump to first uncovered line) |
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 | | % Cristy % |
17 | | % September 2002 % |
18 | | % % |
19 | | % % |
20 | | % Copyright @ 1999 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 | | % https://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 "MagickCore/studio.h" |
40 | | #include "MagickCore/configure.h" |
41 | | #include "MagickCore/exception.h" |
42 | | #include "MagickCore/exception-private.h" |
43 | | #include "MagickCore/linked-list.h" |
44 | | #include "MagickCore/locale_.h" |
45 | | #include "MagickCore/option.h" |
46 | | #include "MagickCore/pixel.h" |
47 | | #include "MagickCore/string_.h" |
48 | | #include "MagickCore/utility.h" |
49 | | #include "MagickCore/utility-private.h" |
50 | | #include "MagickCore/version.h" |
51 | | #include "MagickCore/version-private.h" |
52 | | |
53 | | /* |
54 | | Define declarations. |
55 | | */ |
56 | 0 | #define MagickURLFilename "index.html" |
57 | | |
58 | | /* |
59 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
60 | | % % |
61 | | % % |
62 | | % % |
63 | | % G e t M a g i c k C o p y r i g h t % |
64 | | % % |
65 | | % % |
66 | | % % |
67 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
68 | | % |
69 | | % GetMagickCopyright() returns the ImageMagick API copyright as a string. |
70 | | % |
71 | | % The format of the GetMagickCopyright method is: |
72 | | % |
73 | | % const char *GetMagickCopyright(void) |
74 | | % |
75 | | */ |
76 | | MagickExport const char *GetMagickCopyright(void) |
77 | 0 | { |
78 | 0 | return(MagickCopyright); |
79 | 0 | } |
80 | | |
81 | | /* |
82 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
83 | | % % |
84 | | % % |
85 | | % % |
86 | | % G e t M a g i c k D e l e g a t e s % |
87 | | % % |
88 | | % % |
89 | | % % |
90 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
91 | | % |
92 | | % GetMagickDelegates() returns the ImageMagick delegate libraries. |
93 | | % |
94 | | % The format of the GetMagickDelegates method is: |
95 | | % |
96 | | % const char *GetMagickDelegates(void) |
97 | | % |
98 | | % No parameters are required. |
99 | | % |
100 | | */ |
101 | | MagickExport const char *GetMagickDelegates(void) |
102 | 0 | { |
103 | 0 | static const char |
104 | 0 | *delegates="" |
105 | | #if defined(MAGICKCORE_AUTOTRACE_DELEGATE) |
106 | | " autotrace" |
107 | | #endif |
108 | | #if defined(MAGICKCORE_BZLIB_DELEGATE) |
109 | | " bzlib" |
110 | | #endif |
111 | | #if defined(MAGICKCORE_CAIRO_DELEGATE) |
112 | | " cairo" |
113 | | #endif |
114 | | #if defined(MAGICKCORE_DMR_DELEGATE) |
115 | | " dmr" |
116 | | #endif |
117 | | #if defined(MAGICKCORE_DJVU_DELEGATE) |
118 | | " djvu" |
119 | | #endif |
120 | | #if defined(MAGICKCORE_DPS_DELEGATE) |
121 | | " dps" |
122 | | #endif |
123 | | #if defined(MAGICKCORE_EMF_DELEGATE) |
124 | | " emf" |
125 | | #endif |
126 | | #if defined(MAGICKCORE_FFTW_DELEGATE) |
127 | | " fftw" |
128 | | #endif |
129 | | #if defined(MAGICKCORE_FLIF_DELEGATE) |
130 | | " flif" |
131 | | #endif |
132 | | #if defined(MAGICKCORE_FONTCONFIG_DELEGATE) |
133 | | " fontconfig" |
134 | | #endif |
135 | | #if defined(MAGICKCORE_FPX_DELEGATE) |
136 | | " fpx" |
137 | | #endif |
138 | 0 | #if defined(MAGICKCORE_FREETYPE_DELEGATE) |
139 | 0 | " freetype" |
140 | 0 | #endif |
141 | | #if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) |
142 | | " gslib" |
143 | | #endif |
144 | | #if defined(MAGICKCORE_GVC_DELEGATE) |
145 | | " gvc" |
146 | | #endif |
147 | 0 | #if defined(MAGICKCORE_HEIC_DELEGATE) |
148 | 0 | " heic" |
149 | 0 | #endif |
150 | | #if defined(MAGICKCORE_JBIG_DELEGATE) |
151 | | " jbig" |
152 | | #endif |
153 | 0 | #if defined(MAGICKCORE_JPEG_DELEGATE) && defined(MAGICKCORE_PNG_DELEGATE) |
154 | 0 | " jng" |
155 | 0 | #endif |
156 | 0 | #if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) |
157 | 0 | " jp2" |
158 | 0 | #endif |
159 | 0 | #if defined(MAGICKCORE_JPEG_DELEGATE) |
160 | 0 | " jpeg" |
161 | 0 | #endif |
162 | 0 | #if defined(MAGICKCORE_JXL_DELEGATE) |
163 | 0 | " jxl" |
164 | 0 | #endif |
165 | 0 | #if defined(MAGICKCORE_LCMS_DELEGATE) |
166 | 0 | " lcms" |
167 | 0 | #endif |
168 | | #if defined(MAGICKCORE_LQR_DELEGATE) |
169 | | " lqr" |
170 | | #endif |
171 | | #if defined(MAGICKCORE_LTDL_DELEGATE) |
172 | | " ltdl" |
173 | | #endif |
174 | 0 | #if defined(MAGICKCORE_LZMA_DELEGATE) |
175 | 0 | " lzma" |
176 | 0 | #endif |
177 | | #if defined(MAGICKCORE_OPENEXR_DELEGATE) |
178 | | " openexr" |
179 | | #endif |
180 | | #if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) |
181 | | " pangocairo" |
182 | | #endif |
183 | 0 | #if defined(MAGICKCORE_PNG_DELEGATE) |
184 | 0 | " png" |
185 | 0 | #endif |
186 | | #if defined(MAGICKCORE_DPS_DELEGATE) || defined(MAGICKCORE_GS_DELEGATE) || \ |
187 | | defined(MAGICKCORE_WINDOWS_SUPPORT) |
188 | | " ps" |
189 | | #endif |
190 | | #if defined(MAGICKCORE_RAQM_DELEGATE) |
191 | | " raqm" |
192 | | #endif |
193 | 0 | #if defined(MAGICKCORE_RAW_R_DELEGATE) |
194 | 0 | " raw" |
195 | 0 | #endif |
196 | | #if defined(MAGICKCORE_RSVG_DELEGATE) |
197 | | " rsvg" |
198 | | #endif |
199 | 0 | #if defined(MAGICKCORE_TIFF_DELEGATE) |
200 | 0 | " tiff" |
201 | 0 | #endif |
202 | | #if defined(MAGICKCORE_UHDR_DELEGATE) |
203 | | " uhdr" |
204 | | #endif |
205 | 0 | #if defined(MAGICKCORE_WEBP_DELEGATE) |
206 | 0 | " webp" |
207 | 0 | #endif |
208 | | #if defined(MAGICKCORE_WMF_DELEGATE) || defined (MAGICKCORE_WMFLITE_DELEGATE) |
209 | | " wmf" |
210 | | #endif |
211 | | #if defined(MAGICKCORE_X11_DELEGATE) |
212 | | " x" |
213 | | #endif |
214 | | #if defined(MAGICKCORE_XML_DELEGATE) |
215 | | " xml" |
216 | | #endif |
217 | | #if defined(MAGICKCORE_ZIP_DELEGATE) |
218 | | " zip" |
219 | | #endif |
220 | 0 | #if defined(MAGICKCORE_ZLIB_DELEGATE) |
221 | 0 | " zlib" |
222 | 0 | #endif |
223 | | #if defined(MAGICKCORE_ZSTD_DELEGATE) |
224 | | " zstd" |
225 | | #endif |
226 | 0 | ; |
227 | 0 | if (*delegates == '\0') |
228 | 0 | return(delegates); |
229 | 0 | return(delegates+1); |
230 | 0 | } |
231 | | |
232 | | /* |
233 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
234 | | % % |
235 | | % % |
236 | | % % |
237 | | % G e t M a g i c k F e a t u r e s % |
238 | | % % |
239 | | % % |
240 | | % % |
241 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
242 | | % |
243 | | % GetMagickFeatures() returns the ImageMagick features. |
244 | | % |
245 | | % The format of the GetMagickFeatures method is: |
246 | | % |
247 | | % const char *GetMagickFeatures(void) |
248 | | % |
249 | | % No parameters are required. |
250 | | % |
251 | | */ |
252 | | MagickExport const char *GetMagickFeatures(void) |
253 | 0 | { |
254 | 0 | return "" |
255 | | #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG) |
256 | | "Debug " |
257 | | #endif |
258 | | #if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) |
259 | | "Channel-masks(64-bit) " |
260 | | #endif |
261 | 0 | #if defined(MAGICKCORE_CIPHER_SUPPORT) |
262 | 0 | "Cipher " |
263 | 0 | #endif |
264 | 0 | #if defined(MAGICKCORE_DPC_SUPPORT) |
265 | 0 | "DPC " |
266 | 0 | #endif |
267 | 0 | #if defined(MAGICKCORE_HDRI_SUPPORT) |
268 | 0 | "HDRI " |
269 | 0 | #endif |
270 | | #if defined(MAGICKCORE_BUILD_MODULES) |
271 | | "Modules " |
272 | | #endif |
273 | | #if defined(MAGICKCORE_OPENCL_SUPPORT) |
274 | | "OpenCL " |
275 | | #endif |
276 | | #if defined(MAGICKCORE_OPENMP_SUPPORT) |
277 | | "OpenMP" |
278 | | #if _OPENMP == 199810 |
279 | | "(1.0) " |
280 | | #elif _OPENMP == 200203 |
281 | | "(2.0) " |
282 | | #elif _OPENMP == 200505 |
283 | | "(2.5) " |
284 | | #elif _OPENMP == 200805 |
285 | | "(3.0) " |
286 | | #elif _OPENMP == 201107 |
287 | | "(3.1) " |
288 | | #elif _OPENMP == 201307 |
289 | | "(4.0) " |
290 | | #elif _OPENMP == 201511 |
291 | | "(4.5) " |
292 | | #elif _OPENMP == 201811 |
293 | | "(5.0) " |
294 | | #else |
295 | | " " |
296 | | #endif |
297 | | #endif |
298 | | #if defined(MAGICKCORE_HAVE_TCMALLOC) |
299 | | "TCMalloc " |
300 | | #endif |
301 | | #if MAGICKCORE_ZERO_CONFIGURATION_SUPPORT |
302 | | "Zero-configuration " |
303 | | #endif |
304 | | #if (MAGICKCORE_QUANTUM_DEPTH == 64) |
305 | | "Q64 (experimental, not for production) " |
306 | | #endif |
307 | 0 | ; |
308 | 0 | } |
309 | | |
310 | | /* |
311 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
312 | | % % |
313 | | % % |
314 | | % % |
315 | | % G e t M a g i c k H o m e U R L % |
316 | | % % |
317 | | % % |
318 | | % % |
319 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
320 | | % |
321 | | % GetMagickHomeURL() returns the ImageMagick home URL. |
322 | | % |
323 | | % The format of the GetMagickHomeURL method is: |
324 | | % |
325 | | % char *GetMagickHomeURL(void) |
326 | | % |
327 | | */ |
328 | | MagickExport char *GetMagickHomeURL(void) |
329 | 0 | { |
330 | 0 | char |
331 | 0 | path[MagickPathExtent]; |
332 | |
|
333 | 0 | const char |
334 | 0 | *element; |
335 | |
|
336 | 0 | ExceptionInfo |
337 | 0 | *exception; |
338 | |
|
339 | 0 | LinkedListInfo |
340 | 0 | *paths; |
341 | |
|
342 | 0 | exception=AcquireExceptionInfo(); |
343 | 0 | paths=GetConfigurePaths(MagickURLFilename,exception); |
344 | 0 | exception=DestroyExceptionInfo(exception); |
345 | 0 | if (paths == (LinkedListInfo *) NULL) |
346 | 0 | return(ConstantString(MagickHomeURL)); |
347 | 0 | element=(const char *) GetNextValueInLinkedList(paths); |
348 | 0 | while (element != (const char *) NULL) |
349 | 0 | { |
350 | 0 | (void) FormatLocaleString(path,MagickPathExtent,"%s%s%s",element, |
351 | 0 | DirectorySeparator,MagickURLFilename); |
352 | 0 | if (IsPathAccessible(path) != MagickFalse) |
353 | 0 | { |
354 | 0 | paths=DestroyLinkedList(paths,RelinquishMagickMemory); |
355 | 0 | return(ConstantString(path)); |
356 | 0 | } |
357 | 0 | element=(const char *) GetNextValueInLinkedList(paths); |
358 | 0 | } |
359 | 0 | paths=DestroyLinkedList(paths,RelinquishMagickMemory); |
360 | 0 | return(ConstantString(MagickHomeURL)); |
361 | 0 | } |
362 | | |
363 | | /* |
364 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
365 | | % % |
366 | | % % |
367 | | % % |
368 | | % G e t M a g i c k L i c e n s e % |
369 | | % % |
370 | | % % |
371 | | % % |
372 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
373 | | % |
374 | | % GetMagickLicense() returns the ImageMagick API license as a string. |
375 | | % |
376 | | % The format of the GetMagickLicense method is: |
377 | | % |
378 | | % const char *GetMagickLicense(void) |
379 | | % |
380 | | */ |
381 | | MagickExport const char *GetMagickLicense(void) |
382 | 0 | { |
383 | 0 | return(MagickAuthoritativeLicense); |
384 | 0 | } |
385 | | |
386 | | /* |
387 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
388 | | % % |
389 | | % % |
390 | | % % |
391 | | % G e t M a g i c k P a c k a g e N a m e % |
392 | | % % |
393 | | % % |
394 | | % % |
395 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
396 | | % |
397 | | % GetMagickPackageName() returns the ImageMagick package name. |
398 | | % |
399 | | % The format of the GetMagickName method is: |
400 | | % |
401 | | % const char *GetMagickName(void) |
402 | | % |
403 | | % No parameters are required. |
404 | | % |
405 | | */ |
406 | | MagickExport const char *GetMagickPackageName(void) |
407 | 0 | { |
408 | 0 | return(MagickPackageName); |
409 | 0 | } |
410 | | |
411 | | /* |
412 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
413 | | % % |
414 | | % % |
415 | | % % |
416 | | % G e t M a g i c k Q u a n t u m D e p t h % |
417 | | % % |
418 | | % % |
419 | | % % |
420 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
421 | | % |
422 | | % GetMagickQuantumDepth() returns the ImageMagick quantum depth. |
423 | | % |
424 | | % The format of the GetMagickQuantumDepth method is: |
425 | | % |
426 | | % const char *GetMagickQuantumDepth(size_t *depth) |
427 | | % |
428 | | % A description of each parameter follows: |
429 | | % |
430 | | % o depth: the quantum depth is returned as a number. |
431 | | % |
432 | | */ |
433 | | MagickExport const char *GetMagickQuantumDepth(size_t *depth) |
434 | 0 | { |
435 | 0 | if (depth != (size_t *) NULL) |
436 | 0 | *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH; |
437 | 0 | return(MagickQuantumDepth); |
438 | 0 | } |
439 | | |
440 | | /* |
441 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
442 | | % % |
443 | | % % |
444 | | % % |
445 | | % G e t M a g i c k Q u a n t u m R a n g e % |
446 | | % % |
447 | | % % |
448 | | % % |
449 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
450 | | % |
451 | | % GetMagickQuantumRange() returns the ImageMagick quantum range. |
452 | | % |
453 | | % The format of the GetMagickQuantumRange method is: |
454 | | % |
455 | | % const char *GetMagickQuantumRange(size_t *range) |
456 | | % |
457 | | % A description of each parameter follows: |
458 | | % |
459 | | % o range: the quantum range is returned as a number. |
460 | | % |
461 | | */ |
462 | | MagickExport const char *GetMagickQuantumRange(size_t *range) |
463 | 0 | { |
464 | 0 | if (range != (size_t *) NULL) |
465 | 0 | *range=(size_t) QuantumRange; |
466 | 0 | return(MagickQuantumRange); |
467 | 0 | } |
468 | | |
469 | | /* |
470 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
471 | | % % |
472 | | % % |
473 | | % % |
474 | | % G e t M a g i c k R e l e a s e D a t e % |
475 | | % % |
476 | | % % |
477 | | % % |
478 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
479 | | % |
480 | | % GetMagickReleaseDate() returns the ImageMagick release date. |
481 | | % |
482 | | % The format of the GetMagickReleaseDate method is: |
483 | | % |
484 | | % const char *GetMagickReleaseDate(void) |
485 | | % |
486 | | % No parameters are required. |
487 | | % |
488 | | */ |
489 | | MagickExport const char *GetMagickReleaseDate(void) |
490 | 0 | { |
491 | 0 | return(MagickReleaseDate); |
492 | 0 | } |
493 | | |
494 | | /* |
495 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
496 | | % % |
497 | | % % |
498 | | % % |
499 | | % G e t M a g i c k S i g n a t u r e % |
500 | | % % |
501 | | % % |
502 | | % % |
503 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
504 | | % |
505 | | % GetMagickSignature() returns a signature that uniquely encodes the |
506 | | % MagickCore library version, quantum depth, HDRI status, OS word size, |
507 | | % channel type, and endianness. |
508 | | % |
509 | | % The format of the GetMagickSignature method is: |
510 | | % |
511 | | % unsigned int GetMagickSignature(const StringInfo *nonce) |
512 | | % |
513 | | % A description of each parameter follows: |
514 | | % |
515 | | % o nonce: arbitrary data. |
516 | | % |
517 | | */ |
518 | | |
519 | | static unsigned int CRC32(const unsigned char *message,const size_t length) |
520 | 9.00k | { |
521 | 9.00k | ssize_t |
522 | 9.00k | i; |
523 | | |
524 | 9.00k | static MagickBooleanType |
525 | 9.00k | crc_initial = MagickFalse; |
526 | | |
527 | 9.00k | static unsigned int |
528 | 9.00k | crc_xor[256]; |
529 | | |
530 | 9.00k | unsigned int |
531 | 9.00k | crc; |
532 | | |
533 | | /* |
534 | | Generate a 32-bit cyclic redundancy check for the message. |
535 | | */ |
536 | 9.00k | if (crc_initial == MagickFalse) |
537 | 3 | { |
538 | 3 | unsigned int |
539 | 3 | j; |
540 | | |
541 | 3 | unsigned int |
542 | 3 | alpha; |
543 | | |
544 | 771 | for (j=0; j < 256; j++) |
545 | 768 | { |
546 | 768 | ssize_t |
547 | 768 | k; |
548 | | |
549 | 768 | alpha=j; |
550 | 6.91k | for (k=0; k < 8; k++) |
551 | 6.14k | alpha=(alpha & 0x01) ? (0xEDB88320 ^ (alpha >> 1)) : (alpha >> 1); |
552 | 768 | crc_xor[j]=alpha; |
553 | 768 | } |
554 | 3 | crc_initial=MagickTrue; |
555 | 3 | } |
556 | 9.00k | crc=0xFFFFFFFF; |
557 | 297k | for (i=0; i < (ssize_t) length; i++) |
558 | 288k | crc=crc_xor[(crc ^ message[i]) & 0xff] ^ (crc >> 8); |
559 | 9.00k | return(crc ^ 0xFFFFFFFF); |
560 | 9.00k | } |
561 | | |
562 | | MagickExport unsigned int GetMagickSignature(const StringInfo *nonce) |
563 | 9.00k | { |
564 | 9.00k | unsigned char |
565 | 9.00k | *p; |
566 | | |
567 | 9.00k | StringInfo |
568 | 9.00k | *version; |
569 | | |
570 | 9.00k | unsigned int |
571 | 9.00k | signature; |
572 | | |
573 | 9.00k | version=AcquireStringInfo(MagickPathExtent); |
574 | 9.00k | p=GetStringInfoDatum(version); |
575 | 9.00k | signature=MAGICKCORE_QUANTUM_DEPTH; |
576 | 9.00k | (void) memcpy(p,&signature,sizeof(signature)); |
577 | 9.00k | p+=(ptrdiff_t) sizeof(signature); |
578 | 9.00k | signature=MAGICKCORE_HDRI_ENABLE; |
579 | 9.00k | (void) memcpy(p,&signature,sizeof(signature)); |
580 | 9.00k | p+=(ptrdiff_t) sizeof(signature); |
581 | 9.00k | signature=MagickLibInterface; |
582 | 9.00k | (void) memcpy(p,&signature,sizeof(signature)); |
583 | 9.00k | p+=(ptrdiff_t) sizeof(signature); |
584 | 9.00k | signature=1; /* endianness */ |
585 | 9.00k | (void) memcpy(p,&signature,sizeof(signature)); |
586 | 9.00k | p+=(ptrdiff_t) sizeof(signature); |
587 | | #if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) |
588 | | signature=sizeof(ChannelType); |
589 | | (void) memcpy(p,&signature,sizeof(signature)); |
590 | | p+=(ptrdiff_t) sizeof(signature); |
591 | | #endif |
592 | 9.00k | SetStringInfoLength(version,(size_t) (p-GetStringInfoDatum(version))); |
593 | 9.00k | if (nonce != (const StringInfo *) NULL) |
594 | 9.00k | ConcatenateStringInfo(version,nonce); |
595 | 9.00k | signature=CRC32(GetStringInfoDatum(version),GetStringInfoLength(version)); |
596 | 9.00k | version=DestroyStringInfo(version); |
597 | 9.00k | return(signature); |
598 | 9.00k | } |
599 | | |
600 | | /* |
601 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
602 | | % % |
603 | | % % |
604 | | % % |
605 | | % G e t M a g i c k V e r s i o n % |
606 | | % % |
607 | | % % |
608 | | % % |
609 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
610 | | % |
611 | | % GetMagickVersion() returns the ImageMagick API version as a string and |
612 | | % as a number. |
613 | | % |
614 | | % The format of the GetMagickVersion method is: |
615 | | % |
616 | | % const char *GetMagickVersion(size_t *version) |
617 | | % |
618 | | % A description of each parameter follows: |
619 | | % |
620 | | % o version: the ImageMagick version is returned as a number. |
621 | | % |
622 | | */ |
623 | | MagickExport const char *GetMagickVersion(size_t *version) |
624 | 0 | { |
625 | 0 | if (version != (size_t *) NULL) |
626 | 0 | *version=MagickLibVersion; |
627 | 0 | return(MagickVersion); |
628 | 0 | } |
629 | | |
630 | | /* |
631 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
632 | | % % |
633 | | % % |
634 | | % % |
635 | | % L i s t M a g i c k V e r s i o n % |
636 | | % % |
637 | | % % |
638 | | % % |
639 | | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
640 | | % |
641 | | % ListMagickVersion() identifies the ImageMagick version by printing its |
642 | | % attributes to the file. Attributes include the copyright, features, and |
643 | | % delegates. |
644 | | % |
645 | | % The format of the ListMagickVersion method is: |
646 | | % |
647 | | % void ListMagickVersion(FILE *file) |
648 | | % |
649 | | % A description of each parameter follows: |
650 | | % |
651 | | % o file: the file, typically stdout. |
652 | | % |
653 | | */ |
654 | | MagickExport void ListMagickVersion(FILE *file) |
655 | 0 | { |
656 | 0 | (void) FormatLocaleFile(file,"Version: %s\n", |
657 | 0 | GetMagickVersion((size_t *) NULL));; |
658 | 0 | (void) FormatLocaleFile(file,"Copyright: %s\n",GetMagickCopyright()); |
659 | 0 | (void) FormatLocaleFile(file,"License: %s\n",GetMagickLicense()); |
660 | 0 | (void) FormatLocaleFile(file,"Features: %s\n",GetMagickFeatures()); |
661 | 0 | (void) FormatLocaleFile(file,"Delegates (built-in): %s\n", |
662 | 0 | GetMagickDelegates()); |
663 | | #if defined(MAGICKCORE_MSC_VER) |
664 | | (void) FormatLocaleFile(file,"Compiler: Visual Studio %d (%d)\n", |
665 | | MAGICKCORE_MSC_VER,_MSC_FULL_VER); |
666 | | #elif defined(__clang__) |
667 | | (void) FormatLocaleFile(file,"Compiler: clang (%d.%d.%d)\n",__clang_major__, |
668 | 0 | __clang_minor__,__clang_patchlevel__); |
669 | | #elif defined(__GNUC__) |
670 | | (void) FormatLocaleFile(file,"Compiler: gcc (%d.%d)\n",__GNUC__, |
671 | | __GNUC_MINOR__); |
672 | | #elif defined(__MINGW32_MAJOR_VERSION) |
673 | | (void) FormatLocaleFile(file,"Compiler: MinGW (%d.%d)\n", |
674 | | __MINGW32_MAJOR_VERSION,__MINGW32_MINOR_VERSION); |
675 | | #elif defined(__MINGW64_VERSION_MAJOR) |
676 | | (void) FormatLocaleFile(file,"Compiler: MinGW-w64 (%d.%d)\n", |
677 | | __MINGW64_VERSION_MAJOR ,__MINGW64_VERSION_MINOR); |
678 | | #endif |
679 | 0 | if (IsEventLogging() != MagickFalse) |
680 | 0 | { |
681 | 0 | (void) FormatLocaleFile(file,"Wizard attributes: "); |
682 | 0 | (void) FormatLocaleFile(file,"QuantumRange=%g; ",(double) QuantumRange); |
683 | 0 | (void) FormatLocaleFile(file,"QuantumScale=%.*g; ",GetMagickPrecision(), |
684 | 0 | (double) QuantumScale); |
685 | 0 | (void) FormatLocaleFile(file,"MagickEpsilon=%.*g; ",GetMagickPrecision(), |
686 | 0 | (double) MagickEpsilon); |
687 | 0 | (void) FormatLocaleFile(file,"MaxMap=%g; ",(double) MaxMap); |
688 | 0 | (void) FormatLocaleFile(file,"MagickPathExtent=%g; ", |
689 | 0 | (double) MagickPathExtent); |
690 | 0 | (void) FormatLocaleFile(file,"sizeof(Quantum)=%g; ",(double) |
691 | 0 | sizeof(Quantum)); |
692 | 0 | (void) FormatLocaleFile(file,"sizeof(MagickSizeType)=%g; ",(double) |
693 | 0 | sizeof(MagickSizeType)); |
694 | 0 | (void) FormatLocaleFile(file,"sizeof(MagickOffsetType)=%g",(double) |
695 | 0 | sizeof(MagickOffsetType)); |
696 | 0 | } |
697 | 0 | } |