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