MagickCore  7.1.0
Convert, Edit, Or Compose Bitmap Images
configure.c
Go to the documentation of this file.
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % %
4 % %
5 % %
6 % CCCC OOO N N FFFFF IIIII GGGG U U RRRR EEEEE %
7 % C O O NN N F I G U U R R E %
8 % C O O N N N FFF I G GG U U RRRR EEE %
9 % C O O N NN F I G G U U R R E %
10 % CCCC OOO N N F IIIII GGG UUU R R EEEEE %
11 % %
12 % %
13 % MagickCore Image Configure Methods %
14 % %
15 % Software Design %
16 % Cristy %
17 % July 2003 %
18 % %
19 % %
20 % Copyright @ 2003 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
22 % %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
25 % %
26 % https://imagemagick.org/script/license.php %
27 % %
28 % Unless required by applicable law or agreed to in writing, software %
29 % distributed under the License is distributed on an "AS IS" BASIS, %
30 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31 % See the License for the specific language governing permissions and %
32 % limitations under the License. %
33 % %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 %
36 %
37 */
38 
39 /*
40  Include declarations.
41 */
42 #include "MagickCore/studio.h"
43 #include "MagickCore/blob.h"
44 #include "MagickCore/client.h"
45 #include "MagickCore/configure.h"
47 #include "MagickCore/exception.h"
49 #include "MagickCore/linked-list.h"
50 #include "MagickCore/log.h"
51 #include "MagickCore/memory_.h"
52 #include "MagickCore/semaphore.h"
53 #include "MagickCore/string_.h"
55 #include "MagickCore/token.h"
56 #include "MagickCore/utility.h"
58 #include "MagickCore/version.h"
59 #include "MagickCore/xml-tree.h"
61 
62 /*
63  Define declarations.
64 */
65 #define ConfigureFilename "configure.xml"
66 
67 /*
68  Typedef declarations.
69 */
70 typedef struct _ConfigureMapInfo
71 {
72  const char
73  *name,
74  *value;
76 
77 /*
78  Static declarations.
79 */
80 
81 static LinkedListInfo
83 
84 static SemaphoreInfo
86 
87 /*
88  Forward declarations.
89 */
90 static MagickBooleanType
92 
93 #if !MAGICKCORE_ZERO_CONFIGURATION_SUPPORT
94 static MagickBooleanType
95  LoadConfigureCache(LinkedListInfo *,const char *,const char *,const size_t,
96  ExceptionInfo *);
97 #endif
98 
99 /*
100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101 % %
102 % %
103 % %
104 % A c q u i r e C o n f i g u r e C a c h e %
105 % %
106 % %
107 % %
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 %
110 % AcquireConfigureCache() caches one or more configure configurations which
111 % provides a mapping between configure attributes and a configure name.
112 %
113 % The format of the AcquireConfigureCache method is:
114 %
115 % LinkedListInfo *AcquireConfigureCache(const char *filename,
116 % ExceptionInfo *exception)
117 %
118 % A description of each parameter follows:
119 %
120 % o filename: the font file name.
121 %
122 % o exception: return any errors or warnings in this structure.
123 %
124 */
125 static inline void AddConfigureKey(LinkedListInfo *cache,const char *path,
126  const char *name,const char *value,MagickBooleanType exempt)
127 {
129  *configure_info;
130 
131  configure_info=(ConfigureInfo *) AcquireMagickMemory(sizeof(*configure_info));
132  if (configure_info == (ConfigureInfo *) NULL)
133  return;
134  (void) memset(configure_info,0,sizeof(*configure_info));
135  if (exempt == MagickTrue)
136  {
137  configure_info->path=(char *) path;
138  configure_info->name=(char *) name;
139  configure_info->value=(char *) value;
140  }
141  else
142  {
143  configure_info->path=ConstantString(path);
144  configure_info->name=ConstantString(name);
145  configure_info->value=ConstantString(value);
146  }
147  configure_info->exempt=exempt;
148  configure_info->signature=MagickCoreSignature;
149  (void) AppendValueToLinkedList(cache,configure_info);
150 }
151 
152 static LinkedListInfo *AcquireConfigureCache(const char *filename,
153  ExceptionInfo *exception)
154 {
155  char
156  head_path[MagickPathExtent],
157  path[MagickPathExtent];
158 
160  *cache;
161 
162  /*
163  Load external configure map.
164  */
165  cache=NewLinkedList(0);
166 #if !MAGICKCORE_ZERO_CONFIGURATION_SUPPORT
167  {
168  const StringInfo
169  *option;
170 
172  *options;
173 
175  status;
176 
177  options=GetConfigureOptions(filename,exception);
178  option=(const StringInfo *) GetNextValueInLinkedList(options);
179  while (option != (const StringInfo *) NULL)
180  {
181  status=LoadConfigureCache(cache,(const char *)
182  GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
183  if (status == MagickTrue)
184  break;
185  option=(const StringInfo *) GetNextValueInLinkedList(options);
186  }
187  options=DestroyConfigureOptions(options);
188  }
189 #else
190  magick_unreferenced(filename);
191  magick_unreferenced(exception);
192 #endif
193  /*
194  Load built-in configure.
195  */
196  AddConfigureKey(cache,"[built-in]","NAME","ImageMagick",MagickTrue);
197  /*
198  Load runtime configuration.
199  */
200  AddConfigureKey(cache,"[built-in]","QuantumDepth",GetMagickQuantumDepth(
201  (size_t *)NULL),MagickTrue);
202  AddConfigureKey(cache,"[built-in]","FEATURES",GetMagickFeatures(),
203  MagickTrue);
204  AddConfigureKey(cache,"[built-in]","DELEGATES",GetMagickDelegates(),
205  MagickTrue);
206  (void) AcquireUniqueFilename(path);
207  GetPathComponent(path,HeadPath,head_path);
208  AddConfigureKey(cache,"[built-in]","MAGICK_TEMPORARY_PATH",head_path,
209  MagickFalse);
210  return(cache);
211 }
212 
213 /*
214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
215 % %
216 % %
217 % %
218 + C o n f i g u r e C o m p o n e n t G e n e s i s %
219 % %
220 % %
221 % %
222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223 %
224 % ConfigureComponentGenesis() instantiates the configure component.
225 %
226 % The format of the ConfigureComponentGenesis method is:
227 %
228 % MagickBooleanType ConfigureComponentGenesis(void)
229 %
230 */
232 {
233  if (configure_semaphore == (SemaphoreInfo *) NULL)
235  return(MagickTrue);
236 }
237 
238 /*
239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240 % %
241 % %
242 % %
243 + C o n f i g u r e C o m p o n e n t T e r m i n u s %
244 % %
245 % %
246 % %
247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
248 %
249 % ConfigureComponentTerminus() destroys the configure component.
250 %
251 % The format of the ConfigureComponentTerminus method is:
252 %
253 % ConfigureComponentTerminus(void)
254 %
255 */
256 
257 static void *DestroyConfigureElement(void *configure_info)
258 {
260  *p;
261 
262  p=(ConfigureInfo *) configure_info;
263  if (p->exempt == MagickFalse)
264  {
265  if (p->value != (char *) NULL)
266  p->value=DestroyString(p->value);
267  if (p->name != (char *) NULL)
268  p->name=DestroyString(p->name);
269  if (p->path != (char *) NULL)
270  p->path=DestroyString(p->path);
271  }
273  return((void *) NULL);
274 }
275 
277 {
278  if (configure_semaphore == (SemaphoreInfo *) NULL)
281  if (configure_cache != (LinkedListInfo *) NULL)
286 }
287 
288 /*
289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290 % %
291 % %
292 % %
293 % D e s t r o y C o n f i g u r e O p t i o n s %
294 % %
295 % %
296 % %
297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298 %
299 % DestroyConfigureOptions() releases memory associated with an configure
300 % options.
301 %
302 % The format of the DestroyProfiles method is:
303 %
304 % LinkedListInfo *DestroyConfigureOptions(Image *image)
305 %
306 % A description of each parameter follows:
307 %
308 % o image: the image.
309 %
310 */
311 
312 static void *DestroyOptions(void *option)
313 {
314  return(DestroyStringInfo((StringInfo *) option));
315 }
316 
318 {
319  assert(options != (LinkedListInfo *) NULL);
320  return(DestroyLinkedList(options,DestroyOptions));
321 }
322 
323 /*
324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325 % %
326 % %
327 % %
328 + G e t C o n f i g u r e I n f o %
329 % %
330 % %
331 % %
332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
333 %
334 % GetConfigureInfo() searches the configure list for the specified name and if
335 % found returns attributes for that element.
336 %
337 % The format of the GetConfigureInfo method is:
338 %
339 % const ConfigureInfo *GetConfigureInfo(const char *name,
340 % ExceptionInfo *exception)
341 %
342 % A description of each parameter follows:
343 %
344 % o configure_info: GetConfigureInfo() searches the configure list for the
345 % specified name and if found returns attributes for that element.
346 %
347 % o name: the configure name.
348 %
349 % o exception: return any errors or warnings in this structure.
350 %
351 */
353  ExceptionInfo *exception)
354 {
355  const ConfigureInfo
356  *p;
357 
358  assert(exception != (ExceptionInfo *) NULL);
359  if (IsConfigureCacheInstantiated(exception) == MagickFalse)
360  return((const ConfigureInfo *) NULL);
361  /*
362  Search for configure tag.
363  */
367  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
368  {
370  return(p);
371  }
372  while (p != (const ConfigureInfo *) NULL)
373  {
374  if (LocaleCompare(name,p->name) == 0)
375  break;
377  }
378  if (p != (ConfigureInfo *) NULL)
382  return(p);
383 }
384 
385 /*
386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
387 % %
388 % %
389 % %
390 % G e t C o n f i g u r e I n f o L i s t %
391 % %
392 % %
393 % %
394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
395 %
396 % GetConfigureInfoList() returns any configure options that match the
397 % specified pattern.
398 %
399 % The format of the GetConfigureInfoList function is:
400 %
401 % const ConfigureInfo **GetConfigureInfoList(const char *pattern,
402 % size_t *number_options,ExceptionInfo *exception)
403 %
404 % A description of each parameter follows:
405 %
406 % o pattern: Specifies a pointer to a text string containing a pattern.
407 %
408 % o number_options: This integer returns the number of configure options in
409 % the list.
410 %
411 % o exception: return any errors or warnings in this structure.
412 %
413 */
414 
415 #if defined(__cplusplus) || defined(c_plusplus)
416 extern "C" {
417 #endif
418 
419 static int ConfigureInfoCompare(const void *x,const void *y)
420 {
421  const ConfigureInfo
422  **p,
423  **q;
424 
425  p=(const ConfigureInfo **) x,
426  q=(const ConfigureInfo **) y;
427  if (LocaleCompare((*p)->path,(*q)->path) == 0)
428  return(LocaleCompare((*p)->name,(*q)->name));
429  return(LocaleCompare((*p)->path,(*q)->path));
430 }
431 
432 #if defined(__cplusplus) || defined(c_plusplus)
433 }
434 #endif
435 
436 MagickExport const ConfigureInfo **GetConfigureInfoList(const char *pattern,
437  size_t *number_options,ExceptionInfo *exception)
438 {
439  const ConfigureInfo
440  **options;
441 
442  const ConfigureInfo
443  *p;
444 
445  ssize_t
446  i;
447 
448  /*
449  Allocate configure list.
450  */
451  assert(pattern != (char *) NULL);
452  assert(number_options != (size_t *) NULL);
453  if (IsEventLogging() != MagickFalse)
454  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
455  *number_options=0;
456  p=GetConfigureInfo("*",exception);
457  if (p == (const ConfigureInfo *) NULL)
458  return((const ConfigureInfo **) NULL);
459  options=(const ConfigureInfo **) AcquireQuantumMemory((size_t)
460  GetNumberOfElementsInLinkedList(configure_cache)+1UL,sizeof(*options));
461  if (options == (const ConfigureInfo **) NULL)
462  return((const ConfigureInfo **) NULL);
463  /*
464  Generate configure list.
465  */
469  for (i=0; p != (const ConfigureInfo *) NULL; )
470  {
471  if ((p->stealth == MagickFalse) &&
472  (GlobExpression(p->name,pattern,MagickFalse) != MagickFalse))
473  options[i++]=p;
475  }
477  qsort((void *) options,(size_t) i,sizeof(*options),ConfigureInfoCompare);
478  options[i]=(ConfigureInfo *) NULL;
479  *number_options=(size_t) i;
480  return(options);
481 }
482 
483 /*
484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
485 % %
486 % %
487 % %
488 % G e t C o n f i g u r e L i s t %
489 % %
490 % %
491 % %
492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
493 %
494 % GetConfigureList() returns any configure options that match the specified
495 % pattern.
496 %
497 % The format of the GetConfigureList function is:
498 %
499 % char **GetConfigureList(const char *pattern,
500 % size_t *number_options,ExceptionInfo *exception)
501 %
502 % A description of each parameter follows:
503 %
504 % o pattern: Specifies a pointer to a text string containing a pattern.
505 %
506 % o number_options: This integer returns the number of options in the list.
507 %
508 % o exception: return any errors or warnings in this structure.
509 %
510 */
511 
512 #if defined(__cplusplus) || defined(c_plusplus)
513 extern "C" {
514 #endif
515 
516 static int ConfigureCompare(const void *x,const void *y)
517 {
518  char
519  **p,
520  **q;
521 
522  p=(char **) x;
523  q=(char **) y;
524  return(LocaleCompare(*p,*q));
525 }
526 
527 #if defined(__cplusplus) || defined(c_plusplus)
528 }
529 #endif
530 
531 MagickExport char **GetConfigureList(const char *pattern,
532  size_t *number_options,ExceptionInfo *exception)
533 {
534  char
535  **options;
536 
537  const ConfigureInfo
538  *p;
539 
540  ssize_t
541  i;
542 
543  /*
544  Allocate configure list.
545  */
546  assert(pattern != (char *) NULL);
547  assert(number_options != (size_t *) NULL);
548  if (IsEventLogging() != MagickFalse)
549  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
550  *number_options=0;
551  p=GetConfigureInfo("*",exception);
552  if (p == (const ConfigureInfo *) NULL)
553  return((char **) NULL);
554  options=(char **) AcquireQuantumMemory((size_t)
555  GetNumberOfElementsInLinkedList(configure_cache)+1UL,sizeof(*options));
556  if (options == (char **) NULL)
557  return((char **) NULL);
561  for (i=0; p != (const ConfigureInfo *) NULL; )
562  {
563  if ((p->stealth == MagickFalse) &&
564  (GlobExpression(p->name,pattern,MagickFalse) != MagickFalse))
565  options[i++]=ConstantString(p->name);
567  }
569  qsort((void *) options,(size_t) i,sizeof(*options),ConfigureCompare);
570  options[i]=(char *) NULL;
571  *number_options=(size_t) i;
572  return(options);
573 }
574 
575 /*
576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
577 % %
578 % %
579 % %
580 % G e t C o n f i g u r e O p t i o n %
581 % %
582 % %
583 % %
584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
585 %
586 % GetConfigureOption() returns the value associated with the configure option.
587 %
588 % The format of the GetConfigureOption method is:
589 %
590 % char *GetConfigureOption(const char *option)
591 %
592 % A description of each parameter follows:
593 %
594 % o configure_info: The configure info.
595 %
596 */
597 MagickExport char *GetConfigureOption(const char *option)
598 {
599  const char
600  *value;
601 
602  const ConfigureInfo
603  *configure_info;
604 
606  *exception;
607 
608  assert(option != (const char *) NULL);
609  if (IsEventLogging() != MagickFalse)
610  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",option);
611  exception=AcquireExceptionInfo();
612  configure_info=GetConfigureInfo(option,exception);
613  exception=DestroyExceptionInfo(exception);
614  if (configure_info == (ConfigureInfo *) NULL)
615  return((char *) NULL);
616  value=GetConfigureValue(configure_info);
617  if ((value == (const char *) NULL) || (*value == '\0'))
618  return((char *) NULL);
619  return(ConstantString(value));
620 }
621 
622 /*
623 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
624 % %
625 % %
626 % %
627 % G e t C o n f i g u r e O p t i o n s %
628 % %
629 % %
630 % %
631 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
632 %
633 % GetConfigureOptions() returns any Magick configuration options associated
634 % with the specified filename.
635 %
636 % The format of the GetConfigureOptions method is:
637 %
638 % LinkedListInfo *GetConfigureOptions(const char *filename,
639 % ExceptionInfo *exception)
640 %
641 % A description of each parameter follows:
642 %
643 % o filename: the configure file name.
644 %
645 % o exception: return any errors or warnings in this structure.
646 %
647 */
649  ExceptionInfo *exception)
650 {
651  char
652  path[MagickPathExtent];
653 
654  const char
655  *element;
656 
658  *options,
659  *paths;
660 
661  StringInfo
662  *xml;
663 
664  assert(filename != (const char *) NULL);
665  assert(exception != (ExceptionInfo *) NULL);
666  if (IsEventLogging() != MagickFalse)
667  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
668  (void) CopyMagickString(path,filename,MagickPathExtent);
669  /*
670  Load XML from configuration files to linked-list.
671  */
672  options=NewLinkedList(0);
673  paths=GetConfigurePaths(filename,exception);
674  if (paths != (LinkedListInfo *) NULL)
675  {
677  element=(const char *) GetNextValueInLinkedList(paths);
678  while (element != (const char *) NULL)
679  {
680  (void) FormatLocaleString(path,MagickPathExtent,"%s%s",element,
681  filename);
683  "Searching for configure file: \"%s\"",path);
684  xml=ConfigureFileToStringInfo(path);
685  if (xml != (StringInfo *) NULL)
686  (void) AppendValueToLinkedList(options,xml);
687  element=(const char *) GetNextValueInLinkedList(paths);
688  }
690  }
691 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
692  if (GetNumberOfElementsInLinkedList(options) == 0)
693  {
694  char
695  *blob;
696 
697  blob=(char *) NTResourceToBlob(filename);
698  if (blob != (char *) NULL)
699  {
700  xml=AcquireStringInfo(0);
701  SetStringInfoLength(xml,strlen(blob)+1);
702  SetStringInfoDatum(xml,(unsigned char *) blob);
703  SetStringInfoPath(xml,filename);
704  (void) AppendValueToLinkedList(options,xml);
705  }
706  }
707 #endif
708  if (GetNumberOfElementsInLinkedList(options) == 0)
710  "UnableToOpenConfigureFile","`%s'",filename);
711  ResetLinkedListIterator(options);
712  return(options);
713 }
714 
715 /*
716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
717 % %
718 % %
719 % %
720 % G e t C o n f i g u r e P a t h s %
721 % %
722 % %
723 % %
724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
725 %
726 % GetConfigurePaths() returns any Magick configuration paths associated
727 % with the specified filename.
728 %
729 % The format of the GetConfigurePaths method is:
730 %
731 % LinkedListInfo *GetConfigurePaths(const char *filename,
732 % ExceptionInfo *exception)
733 %
734 % A description of each parameter follows:
735 %
736 % o filename: the configure file name.
737 %
738 % o exception: return any errors or warnings in this structure.
739 %
740 */
742  ExceptionInfo *exception)
743 {
744 #define RegistryKey "ConfigurePath"
745 #define MagickCoreDLL "CORE_RL_MagickCore_.dll"
746 #define MagickCoreDebugDLL "CORE_DB_MagickCore_.dll"
747 
748  char
749  path[MagickPathExtent];
750 
752  *paths;
753 
754  assert(filename != (const char *) NULL);
755  assert(exception != (ExceptionInfo *) NULL);
756  if (IsEventLogging() != MagickFalse)
757  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
758  (void) CopyMagickString(path,filename,MagickPathExtent);
759  paths=NewLinkedList(0);
760  {
761  char
762  *configure_path;
763 
764  /*
765  Search $MAGICK_CONFIGURE_PATH.
766  */
767  configure_path=GetEnvironmentValue("MAGICK_CONFIGURE_PATH");
768  if (configure_path != (char *) NULL)
769  {
770  char
771  *p,
772  *q;
773 
774  for (p=configure_path-1; p != (char *) NULL; )
775  {
776  (void) CopyMagickString(path,p+1,MagickPathExtent);
777  q=strchr(path,DirectoryListSeparator);
778  if (q != (char *) NULL)
779  *q='\0';
780  q=path+strlen(path)-1;
781  if ((q >= path) && (*q != *DirectorySeparator))
784  (void) AppendValueToLinkedList(paths,ConstantString(path));
785  p=strchr(p+1,DirectoryListSeparator);
786  }
787  configure_path=DestroyString(configure_path);
788  }
789  }
790 #if defined(MAGICKCORE_INSTALLED_SUPPORT)
791 #if defined(MAGICKCORE_SHARE_PATH)
793 #endif
794 #if defined(MAGICKCORE_SHAREARCH_PATH)
796  MAGICKCORE_SHAREARCH_PATH));
797 #endif
798 #if defined(MAGICKCORE_CONFIGURE_PATH)
801 #endif
802 #if defined(MAGICKCORE_DOCUMENTATION_PATH)
805 #endif
806 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_PATH))
807  {
808  unsigned char
809  *key_value;
810 
811  /*
812  Locate file via registry key.
813  */
814  key_value=NTRegistryKeyLookup(RegistryKey);
815  if (key_value != (unsigned char *) NULL)
816  {
817  (void) FormatLocaleString(path,MagickPathExtent,"%s%s",(char *)
818  key_value,DirectorySeparator);
819  (void) AppendValueToLinkedList(paths,ConstantString(path));
820  key_value=(unsigned char *) RelinquishMagickMemory(key_value);
821  }
822  }
823 #endif
824 #else
825  {
826  char
827  *home;
828 
829  /*
830  Search under MAGICK_HOME.
831  */
832  home=GetEnvironmentValue("MAGICK_HOME");
833  if (home != (char *) NULL)
834  {
835 #if !defined(MAGICKCORE_POSIX_SUPPORT) || defined( __VMS )
836  (void) FormatLocaleString(path,MagickPathExtent,"%s%s",home,
838  (void) AppendValueToLinkedList(paths,ConstantString(path));
839 #else
840  (void) FormatLocaleString(path,MagickPathExtent,"%s/etc/%s/",home,
842  (void) AppendValueToLinkedList(paths,ConstantString(path));
843  (void) FormatLocaleString(path,MagickPathExtent,"%s/share/%s/",home,
845  (void) AppendValueToLinkedList(paths,ConstantString(path));
846  (void) FormatLocaleString(path,MagickPathExtent,"%s",
847  MAGICKCORE_SHAREARCH_PATH);
848  (void) AppendValueToLinkedList(paths,ConstantString(path));
849 #endif
850  home=DestroyString(home);
851  }
852  }
853  if (*GetClientPath() != '\0')
854  {
855 #if !defined(MAGICKCORE_POSIX_SUPPORT) || defined( __VMS )
858  (void) AppendValueToLinkedList(paths,ConstantString(path));
859 #else
860  char
861  prefix[MagickPathExtent];
862 
863  /*
864  Search based on executable directory if directory is known.
865  */
867  ChopPathComponents(prefix,1);
868  (void) FormatLocaleString(path,MagickPathExtent,"%s/etc/%s/",prefix,
870  (void) AppendValueToLinkedList(paths,ConstantString(path));
871  (void) FormatLocaleString(path,MagickPathExtent,"%s/share/%s/",prefix,
873  (void) AppendValueToLinkedList(paths,ConstantString(path));
874  (void) FormatLocaleString(path,MagickPathExtent,"%s",
875  MAGICKCORE_SHAREARCH_PATH);
876  (void) AppendValueToLinkedList(paths,ConstantString(path));
877 #endif
878  }
879  /*
880  Search current directory.
881  */
882  (void) AppendValueToLinkedList(paths,ConstantString(""));
883 #endif
884  {
885  char
886  *home;
887 
888  home=GetEnvironmentValue("XDG_CONFIG_HOME");
889 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__)
890  if (home == (char *) NULL)
891  home=GetEnvironmentValue("LOCALAPPDATA");
892  if (home == (char *) NULL)
893  home=GetEnvironmentValue("APPDATA");
894  if (home == (char *) NULL)
895  home=GetEnvironmentValue("USERPROFILE");
896 #endif
897  if (home != (char *) NULL)
898  {
899  /*
900  Search $XDG_CONFIG_HOME/ImageMagick.
901  */
902  (void) FormatLocaleString(path,MagickPathExtent,"%s%sImageMagick%s",
904  (void) AppendValueToLinkedList(paths,ConstantString(path));
905  home=DestroyString(home);
906  }
907  home=GetEnvironmentValue("HOME");
908  if (home != (char *) NULL)
909  {
910  /*
911  Search $HOME/.config/ImageMagick.
912  */
914  "%s%s.config%sImageMagick%s",home,DirectorySeparator,
916  (void) AppendValueToLinkedList(paths,ConstantString(path));
917  home=DestroyString(home);
918  }
919  }
920 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
921  {
922  char
923  module_path[MagickPathExtent];
924 
925  if ((NTGetModulePath(MagickCoreDLL,module_path) != MagickFalse) ||
926  (NTGetModulePath(MagickCoreDebugDLL,module_path) != MagickFalse))
927  {
928  unsigned char
929  *key_value;
930 
931  /*
932  Search module path.
933  */
934  (void) FormatLocaleString(path,MagickPathExtent,"%s%s",module_path,
936  key_value=NTRegistryKeyLookup(RegistryKey);
937  if (key_value == (unsigned char *) NULL)
938  (void) AppendValueToLinkedList(paths,ConstantString(path));
939  else
940  key_value=(unsigned char *) RelinquishMagickMemory(key_value);
941  }
942  if (NTGetModulePath("Magick.dll",module_path) != MagickFalse)
943  {
944  /*
945  Search PerlMagick module path.
946  */
947  (void) FormatLocaleString(path,MagickPathExtent,"%s%s",module_path,
949  (void) AppendValueToLinkedList(paths,ConstantString(path));
950  (void) FormatLocaleString(path,MagickPathExtent,"%s%s",module_path,
951  "\\inc\\lib\\auto\\Image\\Magick\\");
952  (void) AppendValueToLinkedList(paths,ConstantString(path));
953  }
954  }
955 #endif
956  if (GetNumberOfElementsInLinkedList(paths) == 0)
958  "no configuration paths found","`%s'",filename);
959  return(paths);
960 }
961 
962 /*
963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
964 % %
965 % %
966 % %
967 % G e t C o n f i g u r e V a l u e %
968 % %
969 % %
970 % %
971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
972 %
973 % GetConfigureValue() returns the value associated with the configure info.
974 %
975 % The format of the GetConfigureValue method is:
976 %
977 % const char *GetConfigureValue(const ConfigureInfo *configure_info)
978 %
979 % A description of each parameter follows:
980 %
981 % o configure_info: The configure info.
982 %
983 */
984 MagickExport const char *GetConfigureValue(const ConfigureInfo *configure_info)
985 {
986  if (IsEventLogging() != MagickFalse)
987  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
988  assert(configure_info != (ConfigureInfo *) NULL);
989  assert(configure_info->signature == MagickCoreSignature);
990  return(configure_info->value);
991 }
992 
993 /*
994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
995 % %
996 % %
997 % %
998 + I s C o n f i g u r e C a c h e I n s t a n t i a t e d %
999 % %
1000 % %
1001 % %
1002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1003 %
1004 % IsConfigureCacheInstantiated() determines if the configure list is
1005 % instantiated. If not, it instantiates the list and returns it.
1006 %
1007 % The format of the IsConfigureInstantiated method is:
1008 %
1009 % MagickBooleanType IsConfigureCacheInstantiated(ExceptionInfo *exception)
1010 %
1011 % A description of each parameter follows.
1012 %
1013 % o exception: return any errors or warnings in this structure.
1014 %
1015 */
1017 {
1018  if (configure_cache == (LinkedListInfo *) NULL)
1019  {
1020  if (configure_semaphore == (SemaphoreInfo *) NULL)
1023  if (configure_cache == (LinkedListInfo *) NULL)
1026  }
1027  return(configure_cache != (LinkedListInfo *) NULL ? MagickTrue : MagickFalse);
1028 }
1029 
1030 /*
1031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1032 % %
1033 % %
1034 % %
1035 % L i s t C o n f i g u r e I n f o %
1036 % %
1037 % %
1038 % %
1039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1040 %
1041 % ListConfigureInfo() lists the configure info to a file.
1042 %
1043 % The format of the ListConfigureInfo method is:
1044 %
1045 % MagickBooleanType ListConfigureInfo(FILE *file,ExceptionInfo *exception)
1046 %
1047 % A description of each parameter follows.
1048 %
1049 % o file: An pointer to a FILE.
1050 %
1051 % o exception: return any errors or warnings in this structure.
1052 %
1053 */
1055  ExceptionInfo *exception)
1056 {
1057  const char
1058  *name,
1059  *path,
1060  *value;
1061 
1062  const ConfigureInfo
1063  **configure_info;
1064 
1065  ssize_t
1066  i;
1067 
1068  size_t
1069  number_options;
1070 
1071  ssize_t
1072  j;
1073 
1074  if (file == (const FILE *) NULL)
1075  file=stdout;
1076  configure_info=GetConfigureInfoList("*",&number_options,exception);
1077  if (configure_info == (const ConfigureInfo **) NULL)
1078  return(MagickFalse);
1079  path=(const char *) NULL;
1080  for (i=0; i < (ssize_t) number_options; i++)
1081  {
1082  if (configure_info[i]->stealth != MagickFalse)
1083  continue;
1084  if ((path == (const char *) NULL) ||
1085  (LocaleCompare(path,configure_info[i]->path) != 0))
1086  {
1087  if (configure_info[i]->path != (char *) NULL)
1088  (void) FormatLocaleFile(file,"\nPath: %s\n\n",
1089  configure_info[i]->path);
1090  (void) FormatLocaleFile(file,"Name Value\n");
1091  (void) FormatLocaleFile(file,
1092  "-------------------------------------------------"
1093  "------------------------------\n");
1094  }
1095  path=configure_info[i]->path;
1096  name="unknown";
1097  if (configure_info[i]->name != (char *) NULL)
1098  name=configure_info[i]->name;
1099  (void) FormatLocaleFile(file,"%s",name);
1100  for (j=(ssize_t) strlen(name); j <= 20; j++)
1101  (void) FormatLocaleFile(file," ");
1102  (void) FormatLocaleFile(file," ");
1103  value="unknown";
1104  if (configure_info[i]->value != (char *) NULL)
1105  value=configure_info[i]->value;
1106  (void) FormatLocaleFile(file,"%s",value);
1107  (void) FormatLocaleFile(file,"\n");
1108  }
1109  (void) fflush(file);
1110  configure_info=(const ConfigureInfo **) RelinquishMagickMemory((void *)
1111  configure_info);
1112  return(MagickTrue);
1113 }
1114 
1115 #if !MAGICKCORE_ZERO_CONFIGURATION_SUPPORT
1116 /*
1117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1118 % %
1119 % %
1120 % %
1121 + L o a d C o n f i g u r e C a c h e %
1122 % %
1123 % %
1124 % %
1125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1126 %
1127 % LoadConfigureCache() loads the configure configurations which provides a
1128 % mapping between configure attributes and a configure name.
1129 %
1130 % The format of the LoadConfigureCache method is:
1131 %
1132 % MagickBooleanType LoadConfigureCache(LinkedListInfo *cache,
1133 % const char *xml,const char *filename,const size_t depth,
1134 % ExceptionInfo *exception)
1135 %
1136 % A description of each parameter follows:
1137 %
1138 % o xml: The configure list in XML format.
1139 %
1140 % o filename: The configure list filename.
1141 %
1142 % o depth: depth of <include /> statements.
1143 %
1144 % o exception: return any errors or warnings in this structure.
1145 %
1146 */
1148  const char *xml,const char *filename,const size_t depth,
1149  ExceptionInfo *exception)
1150 {
1151  char
1152  keyword[MagickPathExtent],
1153  *token;
1154 
1156  *configure_info;
1157 
1158  const char
1159  *q;
1160 
1162  status;
1163 
1164  size_t
1165  extent;
1166 
1167  /*
1168  Load the configure map file.
1169  */
1171  "Loading configure file \"%s\" ...",filename);
1172  status=MagickTrue;
1173  configure_info=(ConfigureInfo *) NULL;
1174  token=AcquireString(xml);
1175  extent=strlen(token)+MagickPathExtent;
1176  for (q=(char *) xml; *q != '\0'; )
1177  {
1178  /*
1179  Interpret XML.
1180  */
1181  (void) GetNextToken(q,&q,extent,token);
1182  if (*token == '\0')
1183  break;
1184  (void) CopyMagickString(keyword,token,MagickPathExtent);
1185  if (LocaleNCompare(keyword,"<!DOCTYPE",9) == 0)
1186  {
1187  /*
1188  Doctype element.
1189  */
1190  while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
1191  (void) GetNextToken(q,&q,extent,token);
1192  continue;
1193  }
1194  if (LocaleNCompare(keyword,"<!--",4) == 0)
1195  {
1196  /*
1197  Comment element.
1198  */
1199  while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
1200  (void) GetNextToken(q,&q,extent,token);
1201  continue;
1202  }
1203  if (LocaleCompare(keyword,"<include") == 0)
1204  {
1205  /*
1206  Include element.
1207  */
1208  while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
1209  {
1210  (void) CopyMagickString(keyword,token,MagickPathExtent);
1211  (void) GetNextToken(q,&q,extent,token);
1212  if (*token != '=')
1213  continue;
1214  (void) GetNextToken(q,&q,extent,token);
1215  if (LocaleCompare(keyword,"file") == 0)
1216  {
1217  if (depth > MagickMaxRecursionDepth)
1218  (void) ThrowMagickException(exception,GetMagickModule(),
1219  ConfigureError,"IncludeElementNestedTooDeeply","`%s'",token);
1220  else
1221  {
1222  char
1223  path[MagickPathExtent],
1224  *file_xml;
1225 
1226  GetPathComponent(filename,HeadPath,path);
1227  if (*path != '\0')
1230  if (*token == *DirectorySeparator)
1231  (void) CopyMagickString(path,token,MagickPathExtent);
1232  else
1233  (void) ConcatenateMagickString(path,token,MagickPathExtent);
1234  file_xml=FileToXML(path,~0UL);
1235  if (file_xml != (char *) NULL)
1236  {
1237  status&=LoadConfigureCache(cache,file_xml,path,depth+1,
1238  exception);
1239  file_xml=DestroyString(file_xml);
1240  }
1241  }
1242  }
1243  }
1244  continue;
1245  }
1246  if (LocaleCompare(keyword,"<configure") == 0)
1247  {
1248  /*
1249  Configure element.
1250  */
1251  configure_info=(ConfigureInfo *) AcquireCriticalMemory(
1252  sizeof(*configure_info));
1253  (void) memset(configure_info,0,sizeof(*configure_info));
1254  configure_info->path=ConstantString(filename);
1255  configure_info->exempt=MagickFalse;
1256  configure_info->signature=MagickCoreSignature;
1257  continue;
1258  }
1259  if (configure_info == (ConfigureInfo *) NULL)
1260  continue;
1261  if ((LocaleCompare(keyword,"/>") == 0) ||
1262  (LocaleCompare(keyword,"</policy>") == 0))
1263  {
1264  status=AppendValueToLinkedList(cache,configure_info);
1265  if (status == MagickFalse)
1266  (void) ThrowMagickException(exception,GetMagickModule(),
1267  ResourceLimitError,"MemoryAllocationFailed","`%s'",
1268  configure_info->name);
1269  configure_info=(ConfigureInfo *) NULL;
1270  continue;
1271  }
1272  /*
1273  Parse configure element.
1274  */
1275  (void) GetNextToken(q,(const char **) NULL,extent,token);
1276  if (*token != '=')
1277  continue;
1278  (void) GetNextToken(q,&q,extent,token);
1279  (void) GetNextToken(q,&q,extent,token);
1280  switch (*keyword)
1281  {
1282  case 'N':
1283  case 'n':
1284  {
1285  if (LocaleCompare((char *) keyword,"name") == 0)
1286  {
1287  configure_info->name=ConstantString(token);
1288  break;
1289  }
1290  break;
1291  }
1292  case 'S':
1293  case 's':
1294  {
1295  if (LocaleCompare((char *) keyword,"stealth") == 0)
1296  {
1297  configure_info->stealth=IsStringTrue(token);
1298  break;
1299  }
1300  break;
1301  }
1302  case 'V':
1303  case 'v':
1304  {
1305  if (LocaleCompare((char *) keyword,"value") == 0)
1306  {
1307  configure_info->value=ConstantString(token);
1308  break;
1309  }
1310  break;
1311  }
1312  default:
1313  break;
1314  }
1315  }
1316  token=(char *) RelinquishMagickMemory(token);
1317  return(status != 0 ? MagickTrue : MagickFalse);
1318 }
1319 #endif
char * name
Definition: configure.h:30
#define MagickMaxRecursionDepth
Definition: studio.h:338
#define MAGICKCORE_CONFIGURE_PATH
MagickExport char * GetConfigureOption(const char *option)
Definition: configure.c:597
MagickExport const char * GetMagickDelegates(void)
Definition: version.c:100
MagickExport size_t ConcatenateMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
Definition: string.c:392
MagickExport void SetStringInfoPath(StringInfo *string_info, const char *path)
Definition: string.c:1784
MagickExport void UnlockSemaphoreInfo(SemaphoreInfo *semaphore_info)
Definition: semaphore.c:449
#define MAGICKCORE_CONFIGURE_RELATIVE_PATH
MagickExport void ResetLinkedListIterator(LinkedListInfo *list_info)
Definition: linked-list.c:959
static MagickBooleanType IsConfigureCacheInstantiated(ExceptionInfo *)
Definition: configure.c:1016
char * value
Definition: configure.h:30
MagickExport LinkedListInfo * DestroyLinkedList(LinkedListInfo *list_info, void *(*relinquish_value)(void *))
Definition: linked-list.c:219
static int ConfigureCompare(const void *x, const void *y)
Definition: configure.c:516
MagickExport SemaphoreInfo * AcquireSemaphoreInfo(void)
Definition: semaphore.c:192
MagickExport MagickBooleanType InsertValueInLinkedList(LinkedListInfo *list_info, const size_t index, const void *value)
Definition: linked-list.c:447
MagickPrivate void ConfigureComponentTerminus(void)
Definition: configure.c:276
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
Definition: exception.c:115
MagickExport MagickBooleanType AppendValueToLinkedList(LinkedListInfo *list_info, const void *value)
Definition: linked-list.c:111
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
Definition: locale.c:466
MagickExport size_t CopyMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
Definition: string.c:731
MagickExport void * RemoveElementByValueFromLinkedList(LinkedListInfo *list_info, const void *value)
Definition: linked-list.c:756
static LinkedListInfo * configure_cache
Definition: configure.c:82
MagickExport const char * GetMagickFeatures(void)
Definition: version.c:238
#define RegistryKey
MagickExport const ConfigureInfo * GetConfigureInfo(const char *name, ExceptionInfo *exception)
Definition: configure.c:352
static void * DestroyConfigureElement(void *configure_info)
Definition: configure.c:257
MagickExport MagickBooleanType AcquireUniqueFilename(char *path)
Definition: utility.c:111
Definition: log.h:52
MagickExport void * GetNextValueInLinkedList(LinkedListInfo *list_info)
Definition: linked-list.c:305
MagickExport MagickBooleanType ListConfigureInfo(FILE *file, ExceptionInfo *exception)
Definition: configure.c:1054
#define MAGICKCORE_SHARE_PATH
#define MagickCoreSignature
MagickExport void LockSemaphoreInfo(SemaphoreInfo *semaphore_info)
Definition: semaphore.c:293
#define MAGICKCORE_SHARE_RELATIVE_PATH
MagickExport unsigned char * GetStringInfoDatum(const StringInfo *string_info)
Definition: string.c:1178
const char * value
Definition: configure.c:73
MagickExport LinkedListInfo * GetConfigureOptions(const char *filename, ExceptionInfo *exception)
Definition: configure.c:648
MagickExport void GetPathComponent(const char *path, PathType type, char *component)
Definition: utility.c:1225
MagickExport ssize_t FormatLocaleFile(FILE *file, const char *magick_restrict format,...)
Definition: locale.c:371
MagickBooleanType
Definition: magick-type.h:161
#define DirectorySeparator
Definition: studio.h:256
unsigned int MagickStatusType
Definition: magick-type.h:125
MagickExport char * AcquireString(const char *source)
Definition: string.c:94
MagickExport MagickBooleanType GlobExpression(const char *magick_restrict expression, const char *magick_restrict pattern, const MagickBooleanType case_insensitive)
Definition: token.c:354
MagickExport void * AcquireCriticalMemory(const size_t size)
Definition: memory.c:626
MagickExport StringInfo * DestroyStringInfo(StringInfo *string_info)
Definition: string.c:815
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
Definition: memory.c:665
MagickExport int LocaleNCompare(const char *p, const char *q, const size_t length)
Definition: locale.c:1524
MagickExport magick_hot_spot size_t GetNextToken(const char *magick_restrict start, const char **magick_restrict end, const size_t extent, char *magick_restrict token)
Definition: token.c:176
struct _ConfigureMapInfo ConfigureMapInfo
#define MagickCoreDebugDLL
MagickExport const char * GetMagickQuantumDepth(size_t *depth)
Definition: version.c:416
#define MagickPathExtent
MagickExport MagickBooleanType IsStringTrue(const char *value)
Definition: string.c:1388
MagickExport MagickBooleanType IsEventLogging(void)
Definition: log.c:763
char * path
Definition: configure.h:30
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
Definition: exception.c:1145
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
Definition: log.c:1699
MagickExport char * GetEnvironmentValue(const char *name)
Definition: string.c:1145
MagickExport StringInfo * ConfigureFileToStringInfo(const char *filename)
Definition: string.c:570
MagickExport LinkedListInfo * NewLinkedList(const size_t capacity)
Definition: linked-list.c:713
MagickExport StringInfo * AcquireStringInfo(const size_t length)
Definition: string.c:151
MagickExport int LocaleCompare(const char *p, const char *q)
Definition: locale.c:1406
#define GetMagickModule()
Definition: log.h:28
MagickExport LinkedListInfo * GetConfigurePaths(const char *filename, ExceptionInfo *exception)
Definition: configure.c:741
MagickExport const char * GetStringInfoPath(const StringInfo *string_info)
Definition: string.c:1265
#define ConfigureFilename
Definition: configure.c:65
MagickExport const char * GetConfigureValue(const ConfigureInfo *configure_info)
Definition: configure.c:984
size_t signature
Definition: configure.h:39
MagickBooleanType exempt
Definition: configure.h:35
MagickBooleanType stealth
Definition: configure.h:35
static MagickBooleanType LoadConfigureCache(LinkedListInfo *, const char *, const char *, const size_t, ExceptionInfo *)
Definition: configure.c:1147
MagickExport void SetStringInfoLength(StringInfo *string_info, const size_t length)
Definition: string.c:1708
#define MagickCoreDLL
MagickExport char * DestroyString(char *string)
Definition: string.c:788
MagickExport void * AcquireMagickMemory(const size_t size)
Definition: memory.c:552
MagickExport void ActivateSemaphoreInfo(SemaphoreInfo **semaphore_info)
Definition: semaphore.c:98
MagickExport size_t GetNumberOfElementsInLinkedList(const LinkedListInfo *list_info)
Definition: linked-list.c:348
static LinkedListInfo * AcquireConfigureCache(const char *filename, ExceptionInfo *exception)
Definition: configure.c:152
const char * name
Definition: configure.c:73
static void * DestroyOptions(void *option)
Definition: configure.c:312
MagickExport void * RelinquishMagickMemory(void *memory)
Definition: memory.c:1162
#define magick_unreferenced(x)
MagickPrivate void ChopPathComponents(char *, const size_t)
#define MAGICKCORE_DOCUMENTATION_PATH
MagickExport char ** GetConfigureList(const char *pattern, size_t *number_options, ExceptionInfo *exception)
Definition: configure.c:531
#define MagickPrivate
static SemaphoreInfo * configure_semaphore
Definition: configure.c:85
MagickPrivate char * FileToXML(const char *, const size_t)
Definition: xml-tree.c:524
#define MagickExport
MagickPrivate MagickBooleanType ConfigureComponentGenesis(void)
Definition: configure.c:231
static void AddConfigureKey(LinkedListInfo *cache, const char *path, const char *name, const char *value, MagickBooleanType exempt)
Definition: configure.c:125
MagickExport const ConfigureInfo ** GetConfigureInfoList(const char *pattern, size_t *number_options, ExceptionInfo *exception)
Definition: configure.c:436
MagickExport void RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
Definition: semaphore.c:351
MagickExport LinkedListInfo * DestroyConfigureOptions(LinkedListInfo *options)
Definition: configure.c:317
static int ConfigureInfoCompare(const void *x, const void *y)
Definition: configure.c:419
MagickExport char * ConstantString(const char *source)
Definition: string.c:678
#define DirectoryListSeparator
Definition: studio.h:257
MagickExport void SetStringInfoDatum(StringInfo *string_info, const unsigned char *source)
Definition: string.c:1675
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *exception)
Definition: exception.c:418
MagickExport const char * GetClientPath(void)
Definition: client.c:88