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