static LinkedListInfo *AcquireDelegateCache(const char *filename,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
LinkedListInfo
- *delegate_cache,
- *options;
+ *delegate_cache;
MagickStatusType
status;
if (delegate_cache == (LinkedListInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
status=MagickTrue;
- options=GetConfigureOptions(filename,exception);
- option=(const StringInfo *) GetNextValueInLinkedList(options);
#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- while (option != (const StringInfo *) NULL)
{
- status&=LoadDelegateCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ options=GetConfigureOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+ while (option != (const StringInfo *) NULL)
+ {
+ status&=LoadDelegateCache((const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
#endif
- options=DestroyConfigureOptions(options);
if (IfMagickTrue(IsLinkedListEmpty(delegate_cache)))
status&=LoadDelegateCache(DelegateMap,"built-in",0,exception);
return(delegate_cache);
static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename,
const char *locale,ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
- LinkedListInfo
- *options;
-
MagickStatusType
status;
if (locale_cache == (SplayTreeInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
status=MagickTrue;
- options=GetLocaleOptions(filename,exception);
- option=(const StringInfo *) GetNextValueInLinkedList(options);
#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- while (option != (const StringInfo *) NULL)
{
- status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),locale,0,exception);
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ options=GetLocaleOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
- }
-#endif
- options=DestroyLocaleOptions(options);
-#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
+ while (option != (const StringInfo *) NULL)
{
- options=GetLocaleOptions("english.xml",exception);
+ status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),locale,0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
- while (option != (const StringInfo *) NULL)
+ }
+ options=DestroyLocaleOptions(options);
+ if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
{
- status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),locale,0,exception);
+ options=GetLocaleOptions("english.xml",exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+ while (option != (const StringInfo *) NULL)
+ {
+ status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),locale,0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyLocaleOptions(options);
}
- options=DestroyLocaleOptions(options);
- }
+ }
#endif
if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
status&=LoadLocaleCache(LocaleMap,"built-in",locale,0,exception);
MagickExport LinkedListInfo *AcquireMimeCache(const char *filename,
ExceptionInfo *exception)
{
-#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- return(LoadMimeCache(MimeMap,"built-in",0,exception));
-#else
- const StringInfo
- *option;
-
LinkedListInfo
- *mime_cache,
- *options;
+ *mime_cache;
MagickStatusType
status;
if (mime_cache == (LinkedListInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
status=MagickTrue;
- options=GetConfigureOptions(filename,exception);
- option=(const StringInfo *) GetNextValueInLinkedList(options);
- while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
{
- status&=LoadMimeCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ options=GetConfigureOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+ while (option != (const StringInfo *) NULL)
+ {
+ status&=LoadMimeCache((const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
- if ((mime_cache == (LinkedListInfo *) NULL) ||
- (IsLinkedListEmpty(mime_cache) != MagickFalse))
+#endif
+ if (IsLinkedListEmpty(mime_cache) != MagickFalse)
status&=LoadMimeCache(MimeMap,"built-in",0,exception);
- else
- ClearMagickException(exception);
return(mime_cache);
-#endif
}
\f
/*
static SplayTreeInfo *AcquireTypeCache(const char *filename,
ExceptionInfo *exception)
{
- char
- *font_path,
- path[MaxTextExtent];
-
- const StringInfo
- *option;
-
- LinkedListInfo
- *options;
-
MagickStatusType
status;
if (type_cache == (SplayTreeInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
status=MagickTrue;
- *path='\0';
- options=GetConfigureOptions(filename,exception);
- option=(const StringInfo *) GetNextValueInLinkedList(options);
#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- while (option != (const StringInfo *) NULL)
{
- (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
- status&=LoadTypeCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ char
+ *font_path,
+ path[MaxTextExtent];
+
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ *path='\0';
+ options=GetConfigureOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
- }
-#endif
- options=DestroyConfigureOptions(options);
- font_path=GetEnvironmentValue("MAGICK_FONT_PATH");
-#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- if (font_path != (char *) NULL)
+ while (option != (const StringInfo *) NULL)
{
- char
- *option;
-
- /*
- Search MAGICK_FONT_PATH.
- */
- (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
- DirectorySeparator,filename);
- option=FileToString(path,~0UL,exception);
- if (option != (void *) NULL)
- {
- status&=LoadTypeCache(option,path,0,exception);
- option=DestroyString(option);
- }
- font_path=DestroyString(font_path);
+ (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
+ status&=LoadTypeCache((const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
}
+ options=DestroyConfigureOptions(options);
+ font_path=GetEnvironmentValue("MAGICK_FONT_PATH");
+ if (font_path != (char *) NULL)
+ {
+ char
+ *option;
+
+ /*
+ Search MAGICK_FONT_PATH.
+ */
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
+ DirectorySeparator,filename);
+ option=FileToString(path,~0UL,exception);
+ if (option != (void *) NULL)
+ {
+ status&=LoadTypeCache(option,path,0,exception);
+ option=DestroyString(option);
+ }
+ font_path=DestroyString(font_path);
+ }
+ }
#endif
if (GetNumberOfNodesInSplayTree(type_cache) == 0)
status&=LoadTypeCache(TypeMap,"built-in",0,exception);