MagickCore  7.1.0
magick.c
Go to the documentation of this file.
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % %
4 % %
5 % %
6 % M M AAA GGGG IIIII CCCC K K %
7 % MM MM A A G I C K K %
8 % M M M AAAAA G GGG I C KKK %
9 % M M A A G G I C K K %
10 % M M A A GGGG IIIII CCCC K K %
11 % %
12 % %
13 % Methods to Read or List ImageMagick Image formats %
14 % %
15 % Software Design %
16 % Bob Friesenhahn %
17 % Cristy %
18 % November 1998 %
19 % %
20 % %
21 % Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization %
22 % dedicated to making software imaging solutions freely available. %
23 % %
24 % You may not use this file except in compliance with the License. You may %
25 % obtain a copy of the License at %
26 % %
27 % https://imagemagick.org/script/license.php %
28 % %
29 % Unless required by applicable law or agreed to in writing, software %
30 % distributed under the License is distributed on an "AS IS" BASIS, %
31 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
32 % See the License for the specific language governing permissions and %
33 % limitations under the License. %
34 % %
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 %
37 %
38 */
39 
40 /*
41  Include declarations.
42 */
43 #include "MagickCore/studio.h"
45 #include "MagickCore/blob.h"
47 #include "MagickCore/cache.h"
50 #include "MagickCore/client.h"
55 #include "MagickCore/draw.h"
56 #include "MagickCore/exception.h"
59 #include "MagickCore/log-private.h"
61 #include "MagickCore/magick.h"
63 #include "MagickCore/memory_.h"
66 #include "MagickCore/module.h"
68 #include "MagickCore/mutex.h"
70 #include "MagickCore/nt-feature.h"
74 #include "MagickCore/registry.h"
76 #include "MagickCore/resource_.h"
78 #include "MagickCore/policy.h"
80 #include "MagickCore/mutex.h"
81 #include "MagickCore/semaphore.h"
84 #include "MagickCore/splay-tree.h"
85 #include "MagickCore/static.h"
86 #include "MagickCore/string_.h"
88 #include "MagickCore/thread_.h"
91 #include "MagickCore/token.h"
92 #include "MagickCore/utility.h"
95 #if defined(MAGICKCORE_XML_DELEGATE)
96 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
97 # if !defined(__MINGW32__)
98 # include <win32config.h>
99 # endif
100 # endif
101 # include <libxml/parser.h>
102 #endif
103 
104 /*
105  Define declarations.
106 */
107 #if !defined(SIG_DFL)
108 # define SIG_DFL ((SignalHandler *) 0)
109 #endif
110 #if !defined(SIG_ERR)
111 # define SIG_ERR ((SignalHandler *) -1)
112 #endif
113 #if !defined(SIGMAX)
114 #define SIGMAX 64
115 #endif
116 
117 /*
118  Typedef declarations.
119 */
120 typedef void SignalHandler(int);
121 
122 /*
123  Global declarations.
124 */
125 static SemaphoreInfo
127 
128 static SignalHandler
130 
131 static SplayTreeInfo
133 
134 static volatile MagickBooleanType
138 
139 static int
141 
142 /*
143  Forward declarations.
144 */
145 static MagickBooleanType
147 
148 /*
149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 % %
151 % %
152 % %
153 % A c q u i r e M a g i c k I n f o %
154 % %
155 % %
156 % %
157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 %
159 % AcquireMagickInfo() allocates a MagickInfo structure and initializes the
160 % members to default values.
161 %
162 % The format of the AcquireMagickInfo method is:
163 %
164 % MagickInfo *AcquireMagickInfo(const char *magick_module,
165 % const char *name,const char *description)
166 %
167 % A description of each parameter follows:
168 %
169 % o magick_module: a character string that represents the module associated
170 % with the MagickInfo structure.
171 %
172 % o name: a character string that represents the image format associated
173 % with the MagickInfo structure.
174 %
175 % o description: a character string that represents the image format
176 % associated with the MagickInfo structure.
177 %
178 */
180  const char *name,const char *description)
181 {
182  MagickInfo
183  *magick_info;
184 
185  assert(magick_module != (const char *) NULL);
186  assert(name != (const char *) NULL);
187  assert(description != (const char *) NULL);
188  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",name);
189  magick_info=(MagickInfo *) AcquireCriticalMemory(sizeof(*magick_info));
190  (void) memset(magick_info,0,sizeof(*magick_info));
192  magick_info->name=ConstantString(name);
193  magick_info->description=ConstantString(description);
197  magick_info->signature=MagickCoreSignature;
198  return(magick_info);
199 }
200 
201 /*
202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203 % %
204 % %
205 % %
206 + G e t I m a g e D e c o d e r %
207 % %
208 % %
209 % %
210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
211 %
212 % GetImageDecoder() returns the image decoder.
213 %
214 % The format of the GetImageDecoder method is:
215 %
216 % DecodeImageHandler *GetImageDecoder(const MagickInfo *magick_info)
217 %
218 % A description of each parameter follows:
219 %
220 % o magick_info: The magick info.
221 %
222 */
224 {
225  if (magick_info == (MagickInfo *) NULL)
226  return((DecodeImageHandler *) NULL);
227  assert(magick_info->signature == MagickCoreSignature);
228  return(magick_info->decoder);
229 }
230 
231 /*
232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
233 % %
234 % %
235 % %
236 + G e t I m a g e E n c o d e r %
237 % %
238 % %
239 % %
240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241 %
242 % GetImageEncoder() returns the image encoder.
243 %
244 % The format of the GetImageEncoder method is:
245 %
246 % EncodeImageHandler *GetImageEncoder(const MagickInfo *magick_info)
247 %
248 % A description of each parameter follows:
249 %
250 % o magick_info: The magick info.
251 %
252 */
254 {
255  if (magick_info == (MagickInfo *) NULL)
256  return((EncodeImageHandler *) NULL);
257  assert(magick_info->signature == MagickCoreSignature);
258  return(magick_info->encoder);
259 }
260 
261 /*
262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263 % %
264 % %
265 % %
266 + G e t I m a g e M a g i c k %
267 % %
268 % %
269 % %
270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271 %
272 % GetImageMagick() searches for an image format that matches the specified
273 % magick string. If one is found, MagickTrue is returned otherwise
274 % MagickFalse.
275 %
276 % The format of the GetImageMagick method is:
277 %
278 % MagickBooleanType GetImageMagick(const unsigned char *magick,
279 % const size_t length,char *format)
280 %
281 % A description of each parameter follows:
282 %
283 % o magick: the image format we are searching for.
284 %
285 % o length: the length of the binary string.
286 %
287 % o format: the image format as determined by the magick bytes.
288 %
289 */
291  const size_t length,char *format)
292 {
294  *exception;
295 
297  status;
298 
299  const MagickInfo
300  *p;
301 
302  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
303  assert(magick != (const unsigned char *) NULL);
304  exception=AcquireExceptionInfo();
305  p=GetMagickInfo("*",exception);
306  exception=DestroyExceptionInfo(exception);
307  if (p == (const MagickInfo *) NULL)
308  return(MagickFalse);
309  status=MagickFalse;
313  while (p != (const MagickInfo *) NULL)
314  {
315  if ((p->magick != (IsImageFormatHandler *) NULL) &&
316  (p->magick(magick,length) != 0))
317  {
318  status=MagickTrue;
319  (void) CopyMagickString(format,p->name,MagickPathExtent);
320  break;
321  }
323  }
325  return(status);
326 }
327 
328 /*
329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330 % %
331 % %
332 % %
333 + G e t M a g i c k A d j o i n %
334 % %
335 % %
336 % %
337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
338 %
339 % GetMagickAdjoin() returns MagickTrue if the magick adjoin is MagickTrue.
340 %
341 % The format of the GetMagickAdjoin method is:
342 %
343 % MagickBooleanType GetMagickAdjoin(const MagickInfo *magick_info)
344 %
345 % A description of each parameter follows:
346 %
347 % o magick_info: The magick info.
348 %
349 */
351 {
352  assert(magick_info != (MagickInfo *) NULL);
353  assert(magick_info->signature == MagickCoreSignature);
354  return(((magick_info->flags & CoderAdjoinFlag) == 0) ? MagickFalse :
355  MagickTrue);
356 }
357 
358 /*
359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
360 % %
361 % %
362 % %
363 + G e t M a g i c k B l o b S u p p o r t %
364 % %
365 % %
366 % %
367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
368 %
369 % GetMagickBlobSupport() returns MagickTrue if the magick supports blobs.
370 %
371 % The format of the GetMagickBlobSupport method is:
372 %
373 % MagickBooleanType GetMagickBlobSupport(const MagickInfo *magick_info)
374 %
375 % A description of each parameter follows:
376 %
377 % o magick_info: The magick info.
378 %
379 */
381  const MagickInfo *magick_info)
382 {
383  assert(magick_info != (MagickInfo *) NULL);
384  assert(magick_info->signature == MagickCoreSignature);
385  return(((magick_info->flags & CoderBlobSupportFlag) == 0) ? MagickFalse :
386  MagickTrue);
387 }
388 
389 /*
390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
391 % %
392 % %
393 % %
394 + G e t M a g i c k D e c o d e r S e e k a b l e S t r e a m %
395 % %
396 % %
397 % %
398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 %
400 % GetMagickDecoderSeekableStream() returns MagickTrue if the magick supports a
401 % seekable stream in the decoder.
402 %
403 % The format of the GetMagickDecoderSeekableStream method is:
404 %
405 % MagickBooleanType GetMagickDecoderSeekableStream(
406 % const MagickInfo *magick_info)
407 %
408 % A description of each parameter follows:
409 %
410 % o magick_info: The magick info.
411 %
412 */
414  const MagickInfo *magick_info)
415 {
416  assert(magick_info != (MagickInfo *) NULL);
417  assert(magick_info->signature == MagickCoreSignature);
418  if ((magick_info->flags & CoderDecoderSeekableStreamFlag) == 0)
419  return(MagickFalse);
420  return(MagickTrue);
421 }
422 
423 /*
424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
425 % %
426 % %
427 % %
428 + G e t M a g i c k D e c o d e r T h r e a d S u p p o r t %
429 % %
430 % %
431 % %
432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
433 %
434 % GetMagickDecoderThreadSupport() returns MagickTrue if the decoder supports
435 % threads.
436 %
437 % The format of the GetMagickDecoderThreadSupport method is:
438 %
439 % MagickStatusType GetMagickDecoderThreadSupport(
440 % const MagickInfo *magick_info)
441 %
442 % A description of each parameter follows:
443 %
444 % o magick_info: The magick info.
445 %
446 */
448  const MagickInfo *magick_info)
449 {
450  assert(magick_info != (MagickInfo *) NULL);
451  assert(magick_info->signature == MagickCoreSignature);
452  return(((magick_info->flags & CoderDecoderThreadSupportFlag) == 0) ?
454 }
455 
456 /*
457 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
458 % %
459 % %
460 % %
461 + G e t M a g i c k D e s c r i p t i o n %
462 % %
463 % %
464 % %
465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
466 %
467 % GetMagickDescription() returns the magick description.
468 %
469 % The format of the GetMagickDescription method is:
470 %
471 % const char *GetMagickDescription(const MagickInfo *magick_info)
472 %
473 % A description of each parameter follows:
474 %
475 % o magick_info: The magick info.
476 %
477 */
478 MagickExport const char *GetMagickDescription(const MagickInfo *magick_info)
479 {
480  assert(magick_info != (MagickInfo *) NULL);
481  assert(magick_info->signature == MagickCoreSignature);
482  return(magick_info->description);
483 }
484 
485 /*
486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
487 % %
488 % %
489 % %
490 + G e t M a g i c k E n c o d e r S e e k a b l e S t r e a m %
491 % %
492 % %
493 % %
494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
495 %
496 % GetMagickEncoderSeekableStream() returns MagickTrue if the magick supports a
497 % seekable stream in the encoder.
498 %
499 % The format of the GetMagickEncoderSeekableStream method is:
500 %
501 % MagickBooleanType GetMagickEncoderSeekableStream(
502 % const MagickInfo *magick_info)
503 %
504 % A description of each parameter follows:
505 %
506 % o magick_info: The magick info.
507 %
508 */
510  const MagickInfo *magick_info)
511 {
512  assert(magick_info != (MagickInfo *) NULL);
513  assert(magick_info->signature == MagickCoreSignature);
514  if ((magick_info->flags & CoderEncoderSeekableStreamFlag) == 0)
515  return(MagickFalse);
516  return(MagickTrue);
517 }
518 
519 /*
520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
521 % %
522 % %
523 % %
524 + G e t M a g i c k E n c o d e r T h r e a d S u p p o r t %
525 % %
526 % %
527 % %
528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
529 %
530 % GetMagickEncoderThreadSupport() returns MagickTrue if the encoder supports
531 % threads.
532 %
533 % The format of the GetMagickEncoderThreadSupport method is:
534 %
535 % MagickStatusType GetMagickEncoderThreadSupport(
536 % const MagickInfo *magick_info)
537 %
538 % A description of each parameter follows:
539 %
540 % o magick_info: The magick info.
541 %
542 */
544  const MagickInfo *magick_info)
545 {
546  assert(magick_info != (MagickInfo *) NULL);
547  assert(magick_info->signature == MagickCoreSignature);
548  return(((magick_info->flags & CoderDecoderThreadSupportFlag) == 0) ?
550 }
551 
552 /*
553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
554 % %
555 % %
556 % %
557 + G e t M a g i c k E n d i a n S u p p o r t %
558 % %
559 % %
560 % %
561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
562 %
563 % GetMagickEndianSupport() returns the MagickTrue if the coder respects
564 % endianness other than MSBEndian.
565 %
566 % The format of the GetMagickEndianSupport method is:
567 %
568 % MagickBooleanType GetMagickEndianSupport(const MagickInfo *magick_info)
569 %
570 % A description of each parameter follows:
571 %
572 % o magick_info: The magick info.
573 %
574 */
576  const MagickInfo *magick_info)
577 {
578  assert(magick_info != (MagickInfo *) NULL);
579  assert(magick_info->signature == MagickCoreSignature);
580  return(((magick_info->flags & CoderEndianSupportFlag) == 0) ? MagickFalse :
581  MagickTrue);
582 }
583 
584 /*
585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586 % %
587 % %
588 % %
589 + G e t M a g i c k I n f o %
590 % %
591 % %
592 % %
593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
594 %
595 % GetMagickInfo() returns a pointer MagickInfo structure that matches
596 % the specified name. If name is NULL, the head of the image format list
597 % is returned.
598 %
599 % The format of the GetMagickInfo method is:
600 %
601 % const MagickInfo *GetMagickInfo(const char *name,Exception *exception)
602 %
603 % A description of each parameter follows:
604 %
605 % o name: the image format we are looking for.
606 %
607 % o exception: return any errors or warnings in this structure.
608 %
609 */
610 MagickExport const MagickInfo *GetMagickInfo(const char *name,
611  ExceptionInfo *exception)
612 {
613  const MagickInfo
614  *magick_info;
615 
616  /*
617  Find named module attributes.
618  */
619  assert(exception != (ExceptionInfo *) NULL);
620  if (IsMagickTreeInstantiated(exception) == MagickFalse)
621  return((const MagickInfo *) NULL);
622  magick_info=(const MagickInfo *) NULL;
623  if ((name != (const char *) NULL) && (*name != '\0'))
624  {
626  if (LocaleCompare(name,"*") == 0)
627 #if defined(MAGICKCORE_BUILD_MODULES)
628  (void) OpenModules(exception);
629 #else
631 #endif
632  else
633  {
634  magick_info=(const MagickInfo *) GetValueFromSplayTree(magick_list,
635  name);
636  if (magick_info == (const MagickInfo *) NULL)
637 #if defined(MAGICKCORE_BUILD_MODULES)
638  (void) OpenModule(name,exception);
639 #else
640  (void) RegisterStaticModule(name,exception);
641 #endif
642  }
644  }
645  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
647  if (magick_info == (const MagickInfo *) NULL)
648  magick_info=(const MagickInfo *) GetValueFromSplayTree(magick_list,name);
649  return(magick_info);
650 }
651 
652 /*
653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
654 % %
655 % %
656 % %
657 + G e t M a g i c k I n f o L i s t %
658 % %
659 % %
660 % %
661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
662 %
663 % GetMagickInfoList() returns any image formats that match the specified
664 % pattern.
665 %
666 % The format of the GetMagickInfoList function is:
667 %
668 % const MagickInfo **GetMagickInfoList(const char *pattern,
669 % size_t *number_formats,ExceptionInfo *exception)
670 %
671 % A description of each parameter follows:
672 %
673 % o pattern: Specifies a pointer to a text string containing a pattern.
674 %
675 % o number_formats: This integer returns the number of formats in the list.
676 %
677 % o exception: return any errors or warnings in this structure.
678 %
679 */
680 
681 #if defined(__cplusplus) || defined(c_plusplus)
682 extern "C" {
683 #endif
684 
685 static int MagickInfoCompare(const void *x,const void *y)
686 {
687  const MagickInfo
688  **p,
689  **q;
690 
691  p=(const MagickInfo **) x,
692  q=(const MagickInfo **) y;
693  return(LocaleCompare((*p)->name,(*q)->name));
694 }
695 
696 #if defined(__cplusplus) || defined(c_plusplus)
697 }
698 #endif
699 
700 MagickExport const MagickInfo **GetMagickInfoList(const char *pattern,
701  size_t *number_formats,ExceptionInfo *exception)
702 {
703  const MagickInfo
704  **formats;
705 
706  const MagickInfo
707  *p;
708 
709  ssize_t
710  i;
711 
712  /*
713  Allocate magick list.
714  */
715  assert(pattern != (char *) NULL);
716  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
717  assert(number_formats != (size_t *) NULL);
718  *number_formats=0;
719  p=GetMagickInfo("*",exception);
720  if (p == (const MagickInfo *) NULL)
721  return((const MagickInfo **) NULL);
722  formats=(const MagickInfo **) AcquireQuantumMemory((size_t)
723  GetNumberOfNodesInSplayTree(magick_list)+1UL,sizeof(*formats));
724  if (formats == (const MagickInfo **) NULL)
725  return((const MagickInfo **) NULL);
726  /*
727  Generate magick list.
728  */
732  for (i=0; p != (const MagickInfo *) NULL; )
733  {
734  if ((GetMagickStealth(p) == MagickFalse) &&
735  (GlobExpression(p->name,pattern,MagickFalse) != MagickFalse))
736  formats[i++]=p;
738  }
740  qsort((void *) formats,(size_t) i,sizeof(*formats),MagickInfoCompare);
741  formats[i]=(MagickInfo *) NULL;
742  *number_formats=(size_t) i;
743  return(formats);
744 }
745 
746 /*
747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
748 % %
749 % %
750 % %
751 + G e t M a g i c k L i s t %
752 % %
753 % %
754 % %
755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
756 %
757 % GetMagickList() returns any image formats that match the specified pattern.
758 %
759 % The format of the GetMagickList function is:
760 %
761 % char **GetMagickList(const char *pattern,size_t *number_formats,
762 % ExceptionInfo *exception)
763 %
764 % A description of each parameter follows:
765 %
766 % o pattern: Specifies a pointer to a text string containing a pattern.
767 %
768 % o number_formats: This integer returns the number of formats in the list.
769 %
770 % o exception: return any errors or warnings in this structure.
771 %
772 */
773 
774 #if defined(__cplusplus) || defined(c_plusplus)
775 extern "C" {
776 #endif
777 
778 static int MagickCompare(const void *x,const void *y)
779 {
780  const char
781  **p,
782  **q;
783 
784  p=(const char **) x;
785  q=(const char **) y;
786  return(LocaleCompare(*p,*q));
787 }
788 
789 #if defined(__cplusplus) || defined(c_plusplus)
790 }
791 #endif
792 
793 MagickExport char **GetMagickList(const char *pattern,
794  size_t *number_formats,ExceptionInfo *exception)
795 {
796  char
797  **formats;
798 
799  const MagickInfo
800  *p;
801 
802  ssize_t
803  i;
804 
805  /*
806  Allocate magick list.
807  */
808  assert(pattern != (char *) NULL);
809  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
810  assert(number_formats != (size_t *) NULL);
811  *number_formats=0;
812  p=GetMagickInfo("*",exception);
813  if (p == (const MagickInfo *) NULL)
814  return((char **) NULL);
815  formats=(char **) AcquireQuantumMemory((size_t)
816  GetNumberOfNodesInSplayTree(magick_list)+1UL,sizeof(*formats));
817  if (formats == (char **) NULL)
818  return((char **) NULL);
822  for (i=0; p != (const MagickInfo *) NULL; )
823  {
824  if ((GetMagickStealth(p) == MagickFalse) &&
825  (GlobExpression(p->name,pattern,MagickFalse) != MagickFalse))
826  formats[i++]=ConstantString(p->name);
828  }
830  qsort((void *) formats,(size_t) i,sizeof(*formats),MagickCompare);
831  formats[i]=(char *) NULL;
832  *number_formats=(size_t) i;
833  return(formats);
834 }
835 
836 /*
837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
838 % %
839 % %
840 % %
841 + G e t M a g i c k M i m e T y p e %
842 % %
843 % %
844 % %
845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
846 %
847 % GetMagickMimeType() returns the magick mime type.
848 %
849 % The format of the GetMagickMimeType method is:
850 %
851 % const char *GetMagickMimeType(const MagickInfo *magick_info)
852 %
853 % A description of each parameter follows:
854 %
855 % o magick_info: The magick info.
856 %
857 */
858 MagickExport const char *GetMagickMimeType(const MagickInfo *magick_info)
859 {
860  assert(magick_info != (MagickInfo *) NULL);
861  assert(magick_info->signature == MagickCoreSignature);
862  return(magick_info->mime_type);
863 }
864 
865 /*
866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
867 % %
868 % %
869 % %
870 + G e t M a g i c k M o d u l e N a m e %
871 % %
872 % %
873 % %
874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
875 %
876 % GetMagickModuleName() returns the magick module name.
877 %
878 % The format of the GetMagickModuleName method is:
879 %
880 % const char *GetMagickModuleName(const MagickInfo *magick_info)
881 %
882 % A description of each parameter follows:
883 %
884 % o magick_info: The magick info.
885 %
886 */
887 MagickExport const char *GetMagickModuleName(const MagickInfo *magick_info)
888 {
889  assert(magick_info != (MagickInfo *) NULL);
890  assert(magick_info->signature == MagickCoreSignature);
891  return(magick_info->magick_module);
892 }
893 
894 /*
895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896 % %
897 % %
898 % %
899 + G e t M a g i c k N a m e %
900 % %
901 % %
902 % %
903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
904 %
905 % GetMagickName() returns the magick name.
906 %
907 % The format of the GetMagickName method is:
908 %
909 % const char *GetMagickName(const MagickInfo *magick_info)
910 %
911 % A description of each parameter follows:
912 %
913 % o magick_info: The magick info.
914 %
915 */
916 MagickExport const char *GetMagickName(const MagickInfo *magick_info)
917 {
918  assert(magick_info != (MagickInfo *) NULL);
919  assert(magick_info->signature == MagickCoreSignature);
920  return(magick_info->name);
921 }
922 
923 /*
924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
925 % %
926 % %
927 % %
928 % G e t M a g i c k P r e c i s i o n %
929 % %
930 % %
931 % %
932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
933 %
934 % GetMagickPrecision() returns the maximum number of significant digits to be
935 % printed.
936 %
937 % The format of the GetMagickPrecision method is:
938 %
939 % int GetMagickPrecision(void)
940 %
941 */
943 {
944  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
945  return(SetMagickPrecision(0));
946 }
947 
948 /*
949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
950 % %
951 % %
952 % %
953 + G e t M a g i c k R a w S u p p o r t %
954 % %
955 % %
956 % %
957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
958 %
959 % GetMagickRawSupport() returns the MagickTrue if the coder is a raw format.
960 %
961 % The format of the GetMagickRawSupport method is:
962 %
963 % MagickBooleanType GetMagickRawSupport(const MagickInfo *magick_info)
964 %
965 % A description of each parameter follows:
966 %
967 % o magick_info: The magick info.
968 %
969 */
971  const MagickInfo *magick_info)
972 {
973  assert(magick_info != (MagickInfo *) NULL);
974  assert(magick_info->signature == MagickCoreSignature);
975  return(((magick_info->flags & CoderRawSupportFlag) == 0) ? MagickFalse :
976  MagickTrue);
977 }
978 
979 
980 /*
981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
982 % %
983 % %
984 % %
985 + G e t M a g i c k S t e a l t h %
986 % %
987 % %
988 % %
989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
990 %
991 % GetMagickStealth() returns MagickTrue if the magick is a stealth coder.
992 %
993 % The format of the GetMagickStealth method is:
994 %
995 % MagickBooleanType GetMagickStealth(const MagickInfo *magick_info)
996 %
997 % A description of each parameter follows:
998 %
999 % o magick_info: The magick info.
1000 %
1001 */
1003 {
1004  assert(magick_info != (MagickInfo *) NULL);
1005  assert(magick_info->signature == MagickCoreSignature);
1006  return(((magick_info->flags & CoderStealthFlag) == 0) ? MagickFalse :
1007  MagickTrue);
1008 }
1009 
1010 
1011 /*
1012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1013 % %
1014 % %
1015 % %
1016 + G e t M a g i c k U s e E x t e n s i o n %
1017 % %
1018 % %
1019 % %
1020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1021 %
1022 % GetMagickUseExtension() returns MagickTrue if the magick can use the
1023 % extension of the format if the format return by IsImageFormatHandler uses
1024 % the same coder.
1025 %
1026 % The format of the GetMagickUseExtension method is:
1027 %
1028 % MagickBooleanType GetMagickUseExtension(const MagickInfo *magick_info)
1029 %
1030 % A description of each parameter follows:
1031 %
1032 % o magick_info: The magick info.
1033 %
1034 */
1036  const MagickInfo *magick_info)
1037 {
1038  assert(magick_info != (MagickInfo *) NULL);
1039  assert(magick_info->signature == MagickCoreSignature);
1040  return(((magick_info->flags & CoderUseExtensionFlag) == 0) ? MagickFalse :
1041  MagickTrue);
1042 }
1043 
1044 /*
1045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1046 % %
1047 % %
1048 % %
1049 + I s M a g i c k T r e e I n s t a n t i a t e d %
1050 % %
1051 % %
1052 % %
1053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1054 %
1055 % IsMagickTreeInstantiated() determines if the magick tree is instantiated.
1056 % If not, it instantiates the tree and returns it.
1057 %
1058 % The format of the IsMagickTreeInstantiated() method is:
1059 %
1060 % IsMagickTreeInstantiated(Exceptioninfo *exception)
1061 %
1062 % A description of each parameter follows.
1063 %
1064 % o exception: return any errors or warnings in this structure.
1065 %
1066 */
1067 
1068 static void *DestroyMagickNode(void *magick_info)
1069 {
1070  MagickInfo
1071  *p;
1072 
1073  p=(MagickInfo *) magick_info;
1074  if (p->magick_module != (char *) NULL)
1076  if (p->note != (char *) NULL)
1077  p->note=DestroyString(p->note);
1078  if (p->mime_type != (char *) NULL)
1080  if (p->version != (char *) NULL)
1081  p->version=DestroyString(p->version);
1082  if (p->description != (char *) NULL)
1084  if (p->name != (char *) NULL)
1085  p->name=DestroyString(p->name);
1086  if (p->semaphore != (SemaphoreInfo *) NULL)
1088  return(RelinquishMagickMemory(p));
1089 }
1090 
1092 {
1093  (void) exception;
1095  {
1096  if (magick_semaphore == (SemaphoreInfo *) NULL)
1100  {
1101  magick_list=NewSplayTree(CompareSplayTreeString,(void *(*)(void *))
1102  NULL,DestroyMagickNode);
1103 #if defined(MAGICKCORE_MODULES_SUPPORT)
1104  (void) GetModuleInfo((char *) NULL,exception);
1105 #endif
1107  }
1109  }
1110  return(magick_list != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
1111 }
1112 
1113 /*
1114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1115 % %
1116 % %
1117 % %
1118 + I s M a g i c k C o n f l i c t %
1119 % %
1120 % %
1121 % %
1122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1123 %
1124 % IsMagickConflict() returns MagickTrue if the image format conflicts with a
1125 % logical drive (.e.g. X:).
1126 %
1127 % The format of the IsMagickConflict method is:
1128 %
1129 % MagickBooleanType IsMagickConflict(const char *magick)
1130 %
1131 % A description of each parameter follows:
1132 %
1133 % o magick: Specifies the image format.
1134 %
1135 */
1137 {
1138  assert(magick != (char *) NULL);
1139 #if defined(vms)
1140  return(VMSIsMagickConflict(magick));
1141 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
1142  return(NTIsMagickConflict(magick));
1143 #else
1144  return(MagickFalse);
1145 #endif
1146 }
1147 
1148 /*
1149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1150 % %
1151 % %
1152 % %
1153 + L i s t M a g i c k I n f o %
1154 % %
1155 % %
1156 % %
1157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1158 %
1159 % ListMagickInfo() lists the image formats to a file.
1160 %
1161 % The format of the ListMagickInfo method is:
1162 %
1163 % MagickBooleanType ListMagickInfo(FILE *file,ExceptionInfo *exception)
1164 %
1165 % A description of each parameter follows.
1166 %
1167 % o file: A file handle.
1168 %
1169 % o exception: return any errors or warnings in this structure.
1170 %
1171 */
1173  ExceptionInfo *exception)
1174 {
1175  const MagickInfo
1176  **magick_info;
1177 
1178  ssize_t
1179  i;
1180 
1181  size_t
1182  number_formats;
1183 
1184  ssize_t
1185  j;
1186 
1187  if (file == (FILE *) NULL)
1188  file=stdout;
1189  magick_info=GetMagickInfoList("*",&number_formats,exception);
1190  if (magick_info == (const MagickInfo **) NULL)
1191  return(MagickFalse);
1192  ClearMagickException(exception);
1193 #if !defined(MAGICKCORE_MODULES_SUPPORT)
1194  (void) FormatLocaleFile(file," Format Mode Description\n");
1195 #else
1196  (void) FormatLocaleFile(file," Format Module Mode Description\n");
1197 #endif
1198  (void) FormatLocaleFile(file,
1199  "--------------------------------------------------------"
1200  "-----------------------\n");
1201  for (i=0; i < (ssize_t) number_formats; i++)
1202  {
1203  if (GetMagickStealth(magick_info[i]) != MagickFalse)
1204  continue;
1205  (void) FormatLocaleFile(file,"%9s%c ",
1206  magick_info[i]->name != (char *) NULL ? magick_info[i]->name : "",
1207  GetMagickBlobSupport(magick_info[i]) != MagickFalse ? '*' : ' ');
1208 #if defined(MAGICKCORE_MODULES_SUPPORT)
1209  {
1210  char
1212 
1213  *magick_module='\0';
1214  if (magick_info[i]->magick_module != (char *) NULL)
1215  (void) CopyMagickString(magick_module,magick_info[i]->magick_module,
1219  magick_module[9]='\0';
1220  (void) FormatLocaleFile(file,"%9s ",magick_module);
1221  }
1222 #endif
1223  (void) FormatLocaleFile(file,"%c%c%c ",magick_info[i]->decoder ? 'r' : '-',
1224  magick_info[i]->encoder ? 'w' : '-',magick_info[i]->encoder != NULL &&
1225  GetMagickAdjoin(magick_info[i]) != MagickFalse ? '+' : '-');
1226  if (magick_info[i]->description != (char *) NULL)
1227  (void) FormatLocaleFile(file," %s",magick_info[i]->description);
1228  if (magick_info[i]->version != (char *) NULL)
1229  (void) FormatLocaleFile(file," (%s)",magick_info[i]->version);
1230  (void) FormatLocaleFile(file,"\n");
1231  if (magick_info[i]->note != (char *) NULL)
1232  {
1233  char
1234  **text;
1235 
1236  text=StringToList(magick_info[i]->note);
1237  if (text != (char **) NULL)
1238  {
1239  for (j=0; text[j] != (char *) NULL; j++)
1240  {
1241  (void) FormatLocaleFile(file," %s\n",text[j]);
1242  text[j]=DestroyString(text[j]);
1243  }
1244  text=(char **) RelinquishMagickMemory(text);
1245  }
1246  }
1247  }
1248  (void) FormatLocaleFile(file,"\n* native blob support\n");
1249  (void) FormatLocaleFile(file,"r read support\n");
1250  (void) FormatLocaleFile(file,"w write support\n");
1251  (void) FormatLocaleFile(file,"+ support for multiple images\n");
1252  (void) fflush(file);
1253  magick_info=(const MagickInfo **) RelinquishMagickMemory((void *)
1254  magick_info);
1255  return(MagickTrue);
1256 }
1257 
1258 /*
1259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1260 % %
1261 % %
1262 % %
1263 % I s M a g i c k C o r e I n s t a n t i a t e d %
1264 % %
1265 % %
1266 % %
1267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1268 %
1269 % IsMagickCoreInstantiated() returns MagickFalse if the ImageMagick
1270 % environment has not been instantiated; the ImageMagick environment
1271 % has been instantiated when MagickCoreGenesis() has been called but
1272 % MagickDestroy() has not been called.
1273 %
1274 % The format of the IsMagickCoreInstantiated method is:
1275 %
1276 % MagickBooleanType IsMagickCoreInstantiated(void)
1277 %
1278 */
1280 {
1281  return(magickcore_instantiated);
1282 }
1283 
1284 /*
1285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1286 % %
1287 % %
1288 % %
1289 + M a g i c k C o m p o n e n t G e n e s i s %
1290 % %
1291 % %
1292 % %
1293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 %
1295 % MagickComponentGenesis() instantiates the magick component.
1296 %
1297 % The format of the MagickComponentGenesis method is:
1298 %
1299 % MagickBooleanType MagickComponentGenesis(void)
1300 %
1301 */
1303 {
1304  if (magick_semaphore == (SemaphoreInfo *) NULL)
1306  return(MagickTrue);
1307 }
1308 
1309 /*
1310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1311 % %
1312 % %
1313 % %
1314 + M a g i c k C o m p o n e n t T e r m i n u s %
1315 % %
1316 % %
1317 % %
1318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1319 %
1320 % MagickComponentTerminus() destroys the magick component.
1321 %
1322 % The format of the MagickComponentTerminus method is:
1323 %
1324 % void MagickComponentTerminus(void)
1325 %
1326 */
1328 {
1329  if (magick_semaphore == (SemaphoreInfo *) NULL)
1332  if (magick_list != (SplayTreeInfo *) NULL)
1333  {
1336  }
1339 }
1340 
1341 /*
1342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1343 % %
1344 % %
1345 % %
1346 % M a g i c k C o r e G e n e s i s %
1347 % %
1348 % %
1349 % %
1350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1351 %
1352 % MagickCoreGenesis() initializes the MagickCore environment.
1353 %
1354 % The format of the MagickCoreGenesis function is:
1355 %
1356 % MagickCoreGenesis(const char *path,
1357 % const MagickBooleanType establish_signal_handlers)
1358 %
1359 % A description of each parameter follows:
1360 %
1361 % o path: the execution path of the current ImageMagick client.
1362 %
1363 % o establish_signal_handlers: set to MagickTrue to use MagickCore's own
1364 % signal handlers for common signals.
1365 %
1366 */
1367 
1368 static SignalHandler *SetMagickSignalHandler(int signal_number,
1369  SignalHandler *handler)
1370 {
1371 #if defined(MAGICKCORE_HAVE_SIGACTION) && defined(MAGICKCORE_HAVE_SIGEMPTYSET)
1372  int
1373  status;
1374 
1375  sigset_t
1376  mask;
1377 
1378  struct sigaction
1379  action,
1380  previous_action;
1381 
1382  sigemptyset(&mask);
1383  sigaddset(&mask,signal_number);
1384  sigprocmask(SIG_BLOCK,&mask,NULL);
1385  action.sa_mask=mask;
1386  action.sa_handler=handler;
1387  action.sa_flags=0;
1388 #if defined(SA_INTERRUPT)
1389  action.sa_flags|=SA_INTERRUPT;
1390 #endif
1391 #if defined(SA_ONSTACK)
1392  action.sa_flags|=SA_ONSTACK;
1393 #endif
1394  previous_action.sa_handler=SIG_DFL;
1395  status=sigaction(signal_number,&action,&previous_action);
1396  if (status < 0)
1397  return(SIG_ERR);
1398  sigprocmask(SIG_UNBLOCK,&mask,NULL);
1399  return(previous_action.sa_handler);
1400 #else
1401  return(signal(signal_number,handler));
1402 #endif
1403 }
1404 
1405 static void MagickSignalHandler(int signal_number)
1406 {
1408  (void) SetMagickSignalHandler(signal_number,signal_handlers[signal_number]);
1411 #if defined(SIGQUIT)
1412  if (signal_number == SIGQUIT)
1413  abort();
1414 #endif
1415 #if defined(SIGABRT)
1416  if (signal_number == SIGABRT)
1417  abort();
1418 #endif
1419 #if defined(SIGBUS)
1420  if (signal_number == SIGBUS)
1421  abort();
1422 #endif
1423 #if defined(SIGFPE)
1424  if (signal_number == SIGFPE)
1425  abort();
1426 #endif
1427 #if defined(SIGSEGV)
1428  if (signal_number == SIGSEGV)
1429  abort();
1430 #endif
1431 #if !defined(MAGICKCORE_HAVE__EXIT)
1432  exit(signal_number);
1433 #else
1434 #if defined(SIGHUP)
1435  if (signal_number == SIGHUP)
1436  _exit(signal_number);
1437 #endif
1438 #if defined(SIGINT)
1439  if (signal_number == SIGINT)
1440  _exit(signal_number);
1441 #endif
1442 #if defined(MAGICKCORE_HAVE_RAISE)
1443  if (signal_handlers[signal_number] != MagickSignalHandler)
1444  raise(signal_number);
1445 #endif
1446  _exit(signal_number); /* do not invoke registered atexit() methods */
1447 #endif
1448 }
1449 
1450 static SignalHandler *RegisterMagickSignalHandler(int signal_number)
1451 {
1453  *handler;
1454 
1455  handler=SetMagickSignalHandler(signal_number,MagickSignalHandler);
1456  if (handler == SIG_ERR)
1457  return(handler);
1458  if (handler != SIG_DFL)
1459  handler=SetMagickSignalHandler(signal_number,handler);
1460  else
1462  "Register handler for signal: %d",signal_number);
1463  return(handler);
1464 }
1465 
1466 MagickExport void MagickCoreGenesis(const char *path,
1467  const MagickBooleanType establish_signal_handlers)
1468 {
1469  char
1470  *events,
1471  execution_path[MagickPathExtent],
1472  filename[MagickPathExtent];
1473 
1474  /*
1475  Initialize the Magick environment.
1476  */
1477 #if defined(__has_feature)
1478 #if __has_feature(address_sanitizer)
1479  (void) putenv("MAGICK_THREAD_LIMIT=1");
1480 #endif
1481 #endif
1483  LockMagickMutex();
1485  {
1487  return;
1488  }
1489  (void) SemaphoreComponentGenesis();
1490  (void) ExceptionComponentGenesis();
1491  (void) LogComponentGenesis();
1492  (void) LocaleComponentGenesis();
1493  (void) RandomComponentGenesis();
1494  events=GetEnvironmentValue("MAGICK_DEBUG");
1495  if (events != (char *) NULL)
1496  {
1497  (void) SetLogEventMask(events);
1498  events=DestroyString(events);
1499  }
1500 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
1501  NTWindowsGenesis();
1502 #endif
1503  /*
1504  Set client name and execution path.
1505  */
1506 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
1507  if ((path != (const char *) NULL) && (IsPathAccessible(path) != MagickFalse))
1508 #else
1509  if ((path != (const char *) NULL) && (*path == *DirectorySeparator) &&
1510  (IsPathAccessible(path) != MagickFalse))
1511 #endif
1512  (void) CopyMagickString(execution_path,path,MagickPathExtent);
1513  else
1514  (void) GetExecutionPath(execution_path,MagickPathExtent);
1515  GetPathComponent(execution_path,TailPath,filename);
1516  (void) SetClientName(filename);
1517  GetPathComponent(execution_path,HeadPath,execution_path);
1518  (void) SetClientPath(execution_path);
1519  if (establish_signal_handlers != MagickFalse)
1520  {
1521  /*
1522  Set signal handlers.
1523  */
1524 #if defined(SIGABRT)
1525  if (signal_handlers[SIGABRT] == (SignalHandler *) NULL)
1526  signal_handlers[SIGABRT]=RegisterMagickSignalHandler(SIGABRT);
1527 #endif
1528 #if defined(SIGBUS)
1529  if (signal_handlers[SIGBUS] == (SignalHandler *) NULL)
1531 #endif
1532 #if defined(SIGSEGV)
1533  if (signal_handlers[SIGSEGV] == (SignalHandler *) NULL)
1534  signal_handlers[SIGSEGV]=RegisterMagickSignalHandler(SIGSEGV);
1535 #endif
1536 #if defined(SIGFPE)
1537  if (signal_handlers[SIGFPE] == (SignalHandler *) NULL)
1539 #endif
1540 #if defined(SIGHUP)
1541  if (signal_handlers[SIGHUP] == (SignalHandler *) NULL)
1543 #endif
1544 #if defined(SIGINT)
1545  if (signal_handlers[SIGINT] == (SignalHandler *) NULL)
1547 #endif
1548 #if defined(SIGQUIT)
1549  if (signal_handlers[SIGQUIT] == (SignalHandler *) NULL)
1550  signal_handlers[SIGQUIT]=RegisterMagickSignalHandler(SIGQUIT);
1551 #endif
1552 #if defined(SIGTERM)
1553  if (signal_handlers[SIGTERM] == (SignalHandler *) NULL)
1554  signal_handlers[SIGTERM]=RegisterMagickSignalHandler(SIGTERM);
1555 #endif
1556 #if defined(SIGXCPU)
1557  if (signal_handlers[SIGXCPU] == (SignalHandler *) NULL)
1558  signal_handlers[SIGXCPU]=RegisterMagickSignalHandler(SIGXCPU);
1559 #endif
1560 #if defined(SIGXFSZ)
1561  if (signal_handlers[SIGXFSZ] == (SignalHandler *) NULL)
1562  signal_handlers[SIGXFSZ]=RegisterMagickSignalHandler(SIGXFSZ);
1563 #endif
1564  }
1565  /*
1566  Instantiate magick resources.
1567  */
1568  (void) ConfigureComponentGenesis();
1569  (void) PolicyComponentGenesis();
1570 #if MAGICKCORE_ZERO_CONFIGURATION_SUPPORT
1571  (void) ZeroConfigurationPolicy;
1572 #endif
1573  (void) CacheComponentGenesis();
1574  (void) ResourceComponentGenesis();
1575  (void) CoderComponentGenesis();
1576  (void) MagickComponentGenesis();
1577 #if defined(MAGICKCORE_MODULES_SUPPORT)
1578  (void) ModuleComponentGenesis();
1579 #endif
1580  (void) DelegateComponentGenesis();
1581  (void) MagicComponentGenesis();
1582  (void) ColorComponentGenesis();
1583  (void) TypeComponentGenesis();
1584  (void) MimeComponentGenesis();
1585  (void) AnnotateComponentGenesis();
1586 #if defined(MAGICKCORE_X11_DELEGATE)
1587  (void) XComponentGenesis();
1588 #endif
1589  (void) RegistryComponentGenesis();
1590  (void) MonitorComponentGenesis();
1593 }
1594 
1595 /*
1596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1597 % %
1598 % %
1599 % %
1600 % M a g i c k C o r e T e r m i n u s %
1601 % %
1602 % %
1603 % %
1604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1605 %
1606 % MagickCoreTerminus() destroys the MagickCore environment.
1607 %
1608 % The format of the MagickCoreTerminus function is:
1609 %
1610 % MagickCoreTerminus(void)
1611 %
1612 */
1614 {
1616  return;
1619 #if defined(MAGICKCORE_X11_DELEGATE)
1620  XComponentTerminus();
1621 #endif
1622 #if defined(MAGICKCORE_XML_DELEGATE)
1623  xmlCleanupParser();
1624 #endif
1628 #if defined(MAGICKCORE_OPENCL_SUPPORT)
1629  OpenCLTerminus();
1630 #endif
1632 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
1633  NTWindowsTerminus();
1634 #endif
1638 #if !defined(MAGICKCORE_BUILD_MODULES)
1640 #endif
1641 #if defined(MAGICKCORE_MODULES_SUPPORT)
1643 #endif
1655 }
1656 
1657 /*
1658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1659 % %
1660 % %
1661 % %
1662 + R e g i s t e r M a g i c k I n f o %
1663 % %
1664 % %
1665 % %
1666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1667 %
1668 % RegisterMagickInfo() adds attributes for a particular image format to the
1669 % list of supported formats. The attributes include the image format name,
1670 % a method to read and/or write the format, whether the format supports the
1671 % saving of more than one frame to the same file or blob, whether the format
1672 % supports native in-memory I/O, and a brief description of the format.
1673 %
1674 % The format of the RegisterMagickInfo method is:
1675 %
1676 % MagickInfo *RegisterMagickInfo(MagickInfo *magick_info)
1677 %
1678 % A description of each parameter follows:
1679 %
1680 % o magick_info: the magick info.
1681 %
1682 */
1684 {
1686  status;
1687 
1688  /*
1689  Register a new image format.
1690  */
1691  assert(magick_info != (MagickInfo *) NULL);
1692  assert(magick_info->signature == MagickCoreSignature);
1693  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",magick_info->name);
1694  if (magick_list == (SplayTreeInfo *) NULL)
1695  return(MagickFalse);
1696  if ((GetMagickDecoderThreadSupport(magick_info) == MagickFalse) ||
1697  (GetMagickEncoderThreadSupport(magick_info) == MagickFalse))
1698  magick_info->semaphore=AcquireSemaphoreInfo();
1699  status=AddValueToSplayTree(magick_list,magick_info->name,magick_info);
1700  return(status);
1701 }
1702 
1703 /*
1704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1705 % %
1706 % %
1707 % %
1708 + R e s e t M a g i c k P r e c i s i o n %
1709 % %
1710 % %
1711 % %
1712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1713 %
1714 % ResetMagickPrecision() resets the magick_precision value.
1715 %
1716 % The format of the ResetMagickPrecision method is:
1717 %
1718 % void ResetMagickPrecision(void)
1719 %
1720 */
1722 {
1723  magick_precision=0;
1724 }
1725 
1726 /*
1727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1728 % %
1729 % %
1730 % %
1731 % S e t M a g i c k P r e c i s i o n %
1732 % %
1733 % %
1734 % %
1735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1736 %
1737 % SetMagickPrecision() sets the maximum number of significant digits to be
1738 % printed.
1739 %
1740 % An input argument of 0 returns the current precision setting.
1741 %
1742 % A negative value forces the precision to reset to a default value according
1743 % to the environment variable "MAGICK_PRECISION", the current 'policy'
1744 % configuration setting, or the default value of '6', in that order.
1745 %
1746 % The format of the SetMagickPrecision method is:
1747 %
1748 % int SetMagickPrecision(const int precision)
1749 %
1750 % A description of each parameter follows:
1751 %
1752 % o precision: set the maximum number of significant digits to be printed.
1753 %
1754 */
1755 MagickExport int SetMagickPrecision(const int precision)
1756 {
1757 #define MagickPrecision (4+MAGICKCORE_QUANTUM_DEPTH/8)
1758 
1759  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
1760  if (precision > 0)
1761  magick_precision=precision;
1762  if ((precision < 0) || (magick_precision == 0))
1763  {
1764  char
1765  *limit;
1766 
1767  /*
1768  Precision reset, or it has not been set yet
1769  */
1771  limit=GetEnvironmentValue("MAGICK_PRECISION");
1772  if (limit == (char *) NULL)
1773  limit=GetPolicyValue("system:precision");
1774  if (limit != (char *) NULL)
1775  {
1777  limit=DestroyString(limit);
1778  }
1779  }
1780  return(magick_precision);
1781 }
1782 
1783 /*
1784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1785 % %
1786 % %
1787 % %
1788 + U n r e g i s t e r M a g i c k I n f o %
1789 % %
1790 % %
1791 % %
1792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1793 %
1794 % UnregisterMagickInfo() removes a name from the magick info list. It returns
1795 % MagickFalse if the name does not exist in the list otherwise MagickTrue.
1796 %
1797 % The format of the UnregisterMagickInfo method is:
1798 %
1799 % MagickBooleanType UnregisterMagickInfo(const char *name)
1800 %
1801 % A description of each parameter follows:
1802 %
1803 % o name: a character string that represents the image format we are
1804 % looking for.
1805 %
1806 */
1808 {
1809  const MagickInfo
1810  *p;
1811 
1813  status;
1814 
1815  assert(name != (const char *) NULL);
1816  if (magick_list == (SplayTreeInfo *) NULL)
1817  return(MagickFalse);
1819  return(MagickFalse);
1823  while (p != (const MagickInfo *) NULL)
1824  {
1825  if (LocaleCompare(p->name,name) == 0)
1826  break;
1828  }
1831  return(status);
1832 }
MagickPrivate void AnnotateComponentTerminus(void)
Definition: annotate.c:189
MagickPrivate MagickBooleanType SemaphoreComponentGenesis(void)
Definition: semaphore.c:398
MagickExport MagickBooleanType GetMagickUseExtension(const MagickInfo *magick_info)
Definition: magick.c:1035
static int MagickInfoCompare(const void *x, const void *y)
Definition: magick.c:685
MagickPrivate MagickBooleanType ResourceComponentGenesis(void)
Definition: resource.c:1143
static void InitializeMagickMutex(void)
Definition: mutex.h:55
MagickPrivate void RandomComponentTerminus(void)
Definition: random.c:797
MagickExport MagickBooleanType AddValueToSplayTree(SplayTreeInfo *splay_tree, const void *key, const void *value)
Definition: splay-tree.c:154
char magick[MagickPathExtent]
Definition: image.h:480
MagickExport size_t ConcatenateMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
Definition: string.c:392
MagickPrivate MagickBooleanType IsMagickConflict(const char *magick)
Definition: magick.c:1136
MagickPrivate MagickBooleanType PolicyComponentGenesis(void)
Definition: policy.c:1013
MagickPrivate MagickBooleanType RegistryComponentGenesis(void)
Definition: registry.c:295
MagickPrivate MagickBooleanType MagicComponentGenesis(void)
Definition: magic.c:755
static void * DestroyMagickNode(void *magick_info)
Definition: magick.c:1068
MagickExport void UnlockSemaphoreInfo(SemaphoreInfo *semaphore_info)
Definition: semaphore.c:449
MagickExport MagickBooleanType RegisterStaticModule(const char *module, ExceptionInfo *exception)
Definition: static.c:217
MagickExport void RegisterStaticModules(void)
Definition: static.c:284
MagickPrivate MagickBooleanType ColorComponentGenesis(void)
MagickPrivate void PolicyComponentTerminus(void)
Definition: policy.c:1060
MagickPrivate MagickBooleanType CacheComponentGenesis(void)
MagickPrivate MagickBooleanType LogComponentGenesis(void)
Definition: log.c:1094
MagickPrivate MagickBooleanType ConfigureComponentGenesis(void)
Definition: configure.c:231
MagickPrivate MagickBooleanType CoderComponentGenesis(void)
Definition: coder.c:207
static int StringToInteger(const char *magick_restrict value)
MagickExport void MagickCoreTerminus(void)
Definition: magick.c:1613
MagickExport SemaphoreInfo * AcquireSemaphoreInfo(void)
Definition: semaphore.c:192
MagickExport MagickBooleanType GetMagickEncoderThreadSupport(const MagickInfo *magick_info)
Definition: magick.c:543
char * note
Definition: magick.h:70
MagickPrivate void LogComponentTerminus(void)
Definition: log.c:1150
MagickExport const char * GetMagickDescription(const MagickInfo *magick_info)
Definition: magick.c:478
char * magick_module
Definition: magick.h:70
char * version
Definition: magick.h:70
MagickPrivate void MonitorComponentTerminus(void)
Definition: monitor.c:98
char * name
Definition: magick.h:70
EncodeImageHandler * encoder
Definition: magick.h:81
MagickPrivate MagickBooleanType TypeComponentGenesis(void)
Definition: type.c:1347
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
Definition: exception.c:115
MagickPrivate MagickBooleanType DelegateComponentGenesis(void)
Definition: delegate.c:254
MagickExport size_t CopyMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
Definition: string.c:731
MagickBooleanType EncodeImageHandler(const ImageInfo *, Image *, ExceptionInfo *)
Definition: magick.h:62
static void MagickSignalHandler(int signal_number)
Definition: magick.c:1405
MagickExport const char * GetMagickName(const MagickInfo *magick_info)
Definition: magick.c:916
MagickPrivate MagickBooleanType MagickComponentGenesis(void)
Definition: magick.c:1302
MagickExport const char * SetClientName(const char *name)
Definition: client.c:115
MagickExport void MagickCoreGenesis(const char *path, const MagickBooleanType establish_signal_handlers)
Definition: magick.c:1466
MagickPrivate MagickBooleanType MonitorComponentGenesis(void)
Definition: monitor.c:73
MagickExport LogEventType SetLogEventMask(const char *events)
Definition: log.c:1764
Definition: log.h:52
size_t signature
Definition: magick.h:99
MagickExport const void * GetNextValueInSplayTree(SplayTreeInfo *splay_tree)
Definition: splay-tree.c:823
MagickExport MagickBooleanType GetMagickRawSupport(const MagickInfo *magick_info)
Definition: magick.c:970
#define MagickCoreSignature
MagickExport void LockSemaphoreInfo(SemaphoreInfo *semaphore_info)
Definition: semaphore.c:293
MagickExport MagickBooleanType GetMagickDecoderSeekableStream(const MagickInfo *magick_info)
Definition: magick.c:413
MagickPrivate void DelegateComponentTerminus(void)
Definition: delegate.c:300
SemaphoreInfo * semaphore
Definition: magick.h:96
static int MagickCompare(const void *x, const void *y)
Definition: magick.c:778
MagickExport void GetPathComponent(const char *path, PathType type, char *component)
Definition: utility.c:1221
MagickExport ssize_t FormatLocaleFile(FILE *file, const char *magick_restrict format,...)
Definition: locale.c:370
MagickBooleanType
Definition: magick-type.h:161
MagickExport char ** StringToList(const char *text)
Definition: string.c:2298
static volatile MagickBooleanType magick_list_initialized
Definition: magick.c:137
#define DirectorySeparator
Definition: studio.h:256
MagickPrivate MagickBooleanType ModuleComponentGenesis(void)
MagickExport MagickBooleanType ListMagickInfo(FILE *file, ExceptionInfo *exception)
Definition: magick.c:1172
#define magick_module
Definition: magick.h:31
MagickExport const char * SetClientPath(const char *path)
Definition: client.c:152
MagickPrivate void AsynchronousResourceComponentTerminus(void)
MagickExport MagickBooleanType GlobExpression(const char *magick_restrict expression, const char *magick_restrict pattern, const MagickBooleanType case_insensitive)
Definition: token.c:352
MagickPrivate MagickBooleanType RandomComponentGenesis(void)
Definition: random.c:772
MagickExport MagickBooleanType DeleteNodeByValueFromSplayTree(SplayTreeInfo *splay_tree, const void *value)
Definition: splay-tree.c:486
size_t length
Definition: image.h:477
MagickExport void * AcquireCriticalMemory(const size_t size)
Definition: memory.c:626
DecodeImageHandler * decoder
Definition: magick.h:78
MagickExport char ** GetMagickList(const char *pattern, size_t *number_formats, ExceptionInfo *exception)
Definition: magick.c:793
MagickExport MagickBooleanType GetImageMagick(const unsigned char *magick, const size_t length, char *format)
Definition: magick.c:290
MagickStatusType flags
Definition: magick.h:93
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
Definition: memory.c:665
MagickBooleanType IsImageFormatHandler(const unsigned char *, const size_t)
Definition: magick.h:65
MagickPrivate MagickBooleanType AnnotateComponentGenesis(void)
Definition: annotate.c:164
static void UnlockMagickMutex(void)
Definition: mutex.h:87
MagickExport MagickBooleanType VMSIsMagickConflict(const char *)
MagickPrivate void ColorComponentTerminus(void)
Definition: color.c:970
MagickExport SplayTreeInfo * DestroySplayTree(SplayTreeInfo *splay_tree)
Definition: splay-tree.c:682
#define MagickPathExtent
MagickExport MagickBooleanType GetMagickBlobSupport(const MagickInfo *magick_info)
Definition: magick.c:380
#define SIG_ERR
Definition: magick.c:111
MagickExport int GetMagickPrecision(void)
Definition: magick.c:942
MagickExport SplayTreeInfo * NewSplayTree(int(*compare)(const void *, const void *), void *(*relinquish_key)(void *), void *(*relinquish_value)(void *))
Definition: splay-tree.c:1141
MagickPrivate void ModuleComponentTerminus(void)
MagickPrivate MagickBooleanType ExceptionComponentGenesis(void)
Definition: exception.c:468
MagickExport MagickBooleanType GetMagickStealth(const MagickInfo *magick_info)
Definition: magick.c:1002
static MagickBooleanType IsMagickTreeInstantiated(ExceptionInfo *)
Definition: magick.c:1091
static SplayTreeInfo * magick_list
Definition: magick.c:132
MagickExport ModuleInfo * GetModuleInfo(const char *, ExceptionInfo *)
MagickPrivate void ExceptionComponentTerminus(void)
MagickExport DecodeImageHandler * GetImageDecoder(const MagickInfo *magick_info)
Definition: magick.c:223
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
Definition: log.c:1662
MagickExport MagickBooleanType IsPathAccessible(const char *path)
Definition: utility.c:1492
static SignalHandler * signal_handlers[SIGMAX]
Definition: magick.c:129
MagickExport const MagickInfo * GetMagickInfo(const char *name, ExceptionInfo *exception)
Definition: magick.c:610
IsImageFormatHandler * magick
Definition: magick.h:87
static void LockMagickMutex(void)
Definition: mutex.h:63
MagickExport MagickBooleanType GetMagickAdjoin(const MagickInfo *magick_info)
Definition: magick.c:350
MagickExport char * GetEnvironmentValue(const char *name)
Definition: string.c:1143
MagickPrivate void CacheComponentTerminus(void)
MagickExport EncodeImageHandler * GetImageEncoder(const MagickInfo *magick_info)
Definition: magick.c:253
MagickExport MagickBooleanType GetMagickEndianSupport(const MagickInfo *magick_info)
Definition: magick.c:575
MagickExport const void * GetValueFromSplayTree(SplayTreeInfo *splay_tree, const void *key)
Definition: splay-tree.c:921
MagickPrivate void ResourceComponentTerminus(void)
Definition: resource.c:1309
MagickPrivate void SemaphoreComponentTerminus(void)
Definition: semaphore.c:422
MagickPrivate MagickBooleanType OpenModules(ExceptionInfo *)
MagickExport int LocaleCompare(const char *p, const char *q)
Definition: locale.c:1401
MagickExport MagickBooleanType GetMagickDecoderThreadSupport(const MagickInfo *magick_info)
Definition: magick.c:447
MagickPrivate void ResetMagickPrecision(void)
Definition: magick.c:1721
MagickPrivate void MagicComponentTerminus(void)
Definition: magic.c:802
#define GetMagickModule()
Definition: log.h:28
MagickPrivate void TypeComponentTerminus(void)
Definition: type.c:1372
MagickExport int CompareSplayTreeString(const void *target, const void *source)
Definition: splay-tree.c:412
MagickPrivate MagickBooleanType GetExecutionPath(char *, const size_t)
MagickExport void ClearMagickException(ExceptionInfo *exception)
Definition: exception.c:164
MagickExport MagickBooleanType GetMagickEncoderSeekableStream(const MagickInfo *magick_info)
Definition: magick.c:509
#define SIG_DFL
Definition: magick.c:108
MagickExport MagickBooleanType UnregisterMagickInfo(const char *name)
Definition: magick.c:1807
MagickExport const MagickInfo ** GetMagickInfoList(const char *pattern, size_t *number_formats, ExceptionInfo *exception)
Definition: magick.c:700
void SignalHandler(int)
Definition: magick.c:120
static SignalHandler * RegisterMagickSignalHandler(int signal_number)
Definition: magick.c:1450
MagickExport char * DestroyString(char *string)
Definition: string.c:788
static volatile MagickBooleanType magickcore_instantiated
Definition: magick.c:135
MagickExport const char * GetMagickMimeType(const MagickInfo *magick_info)
Definition: magick.c:858
#define SIGMAX
Definition: magick.c:114
MagickExport void ActivateSemaphoreInfo(SemaphoreInfo **semaphore_info)
Definition: semaphore.c:98
char * description
Definition: magick.h:70
static int magick_precision
Definition: magick.c:140
MagickExport MagickBooleanType NTIsMagickConflict(const char *)
MagickExport const void * GetRootValueFromSplayTree(SplayTreeInfo *splay_tree)
Definition: splay-tree.c:877
MagickPrivate MagickBooleanType XComponentGenesis(void)
Definition: xwindow.c:10009
FILE * file
Definition: image.h:471
MagickExport char * GetPolicyValue(const char *name)
Definition: policy.c:531
static SignalHandler * SetMagickSignalHandler(int signal_number, SignalHandler *handler)
Definition: magick.c:1368
MagickExport MagickBooleanType IsMagickCoreInstantiated(void)
Definition: magick.c:1279
MagickExport void ResetSplayTreeIterator(SplayTreeInfo *splay_tree)
Definition: splay-tree.c:1472
MagickPrivate void CoderComponentTerminus(void)
Definition: coder.c:232
MagickExport void * RelinquishMagickMemory(void *memory)
Definition: memory.c:1162
MagickExport size_t GetNumberOfNodesInSplayTree(const SplayTreeInfo *splay_tree)
Definition: splay-tree.c:976
MagickExport void UnregisterStaticModules(void)
Definition: static.c:373
MagickPrivate void RegistryComponentTerminus(void)
Definition: registry.c:320
#define MagickPrecision
MagickPrivate MagickBooleanType MimeComponentGenesis(void)
Definition: mime.c:1032
MagickExport MagickInfo * AcquireMagickInfo(const char *magick_module, const char *name, const char *description)
Definition: magick.c:179
MagickPrivate MagickBooleanType LocaleComponentGenesis(void)
Definition: locale.c:1635
static volatile MagickBooleanType magickcore_signal_in_progress
Definition: magick.c:136
#define MagickPrivate
MagickExport int SetMagickPrecision(const int precision)
Definition: magick.c:1755
MagickPrivate void MagickComponentTerminus(void)
Definition: magick.c:1327
#define MagickExport
MagickExport MagickBooleanType RegisterMagickInfo(MagickInfo *magick_info)
Definition: magick.c:1683
MagickPrivate void MimeComponentTerminus(void)
Definition: mime.c:1078
MagickPrivate void ConfigureComponentTerminus(void)
Definition: configure.c:276
MagickPrivate MagickBooleanType OpenModule(const char *, ExceptionInfo *)
MagickExport const char * GetMagickModuleName(const MagickInfo *magick_info)
Definition: magick.c:887
MagickExport void RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
Definition: semaphore.c:351
MagickExport char * ConstantString(const char *source)
Definition: string.c:678
static SemaphoreInfo * magick_semaphore
Definition: magick.c:126
MagickPrivate void LocaleComponentTerminus(void)
Definition: locale.c:1663
char * mime_type
Definition: magick.h:70
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *exception)
Definition: exception.c:418
Image * DecodeImageHandler(const ImageInfo *, ExceptionInfo *)
Definition: magick.h:59