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