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