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