static SplayTreeInfo *AcquireCoderCache(const char *filename,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
- LinkedListInfo
- *options;
-
MagickStatusType
status;
i;
SplayTreeInfo
- *coder_cache;
+ *cache;
/*
Load external coder map.
*/
- coder_cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory,
+ cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory,
DestroyCoderNode);
- if (coder_cache == (SplayTreeInfo *) NULL)
+ if (cache == (SplayTreeInfo *) 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&=LoadCoderCache(coder_cache,(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&=LoadCoderCache(cache,(const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
/*
Load built-in coder map.
*/
coder_info->name=(char *) p->name;
coder_info->exempt=MagickTrue;
coder_info->signature=MagickCoreSignature;
- status&=AddValueToSplayTree(coder_cache,ConstantString(coder_info->magick),
+ status&=AddValueToSplayTree(cache,ConstantString(coder_info->magick),
coder_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",coder_info->name);
}
- return(coder_cache);
+ return(cache);
}
\f
/*
%
% The format of the LoadCoderCache coder is:
%
-% MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
-% const char *xml,const char *filename,const size_t depth,
-% ExceptionInfo *exception)
+% MagickBooleanType LoadCoderCache(SplayTreeInfo *cache,const char *xml,
+% const char *filename,const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
- const char *xml,const char *filename,const size_t depth,
- ExceptionInfo *exception)
+static MagickBooleanType LoadCoderCache(SplayTreeInfo *cache,const char *xml,
+ const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MagickPathExtent],
file_xml=FileToXML(path,~0UL);
if (file_xml != (char *) NULL)
{
- status&=LoadCoderCache(coder_cache,file_xml,path,depth+1,
+ status&=LoadCoderCache(cache,file_xml,path,depth+1,
exception);
file_xml=DestroyString(file_xml);
}
continue;
if (LocaleCompare(keyword,"/>") == 0)
{
- status=AddValueToSplayTree(coder_cache,ConstantString(
- coder_info->magick),coder_info);
+ status=AddValueToSplayTree(cache,ConstantString(coder_info->magick),
+ coder_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
static LinkedListInfo *AcquireColorCache(const char *filename,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
LinkedListInfo
- *color_cache,
- *options;
+ *cache;
MagickStatusType
status;
/*
Load external color map.
*/
- color_cache=NewLinkedList(0);
- if (color_cache == (LinkedListInfo *) NULL)
+ cache=NewLinkedList(0);
+ if (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&=LoadColorCache(color_cache,(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&=LoadColorCache(cache,(const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
/*
Load built-in color map.
*/
color_info->compliance=(ComplianceType) p->compliance;
color_info->exempt=MagickTrue;
color_info->signature=MagickCoreSignature;
- status&=AppendValueToLinkedList(color_cache,color_info);
+ status&=AppendValueToLinkedList(cache,color_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",color_info->name);
}
- return(color_cache);
+ return(cache);
}
-
-
+\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
%
% The format of the LoadColorCache method is:
%
-% MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
-% const char *xml,const char *filename,const size_t depth,
-% ExceptionInfo *exception)
+% MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml,
+% const char *filename,const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
- const char *xml,const char *filename,const size_t depth,
- ExceptionInfo *exception)
+static MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml,
+ const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MagickPathExtent],
file_xml=FileToXML(path,~0UL);
if (file_xml != (char *) NULL)
{
- status&=LoadColorCache(color_cache,file_xml,path,depth+1,
+ status&=LoadColorCache(cache,file_xml,path,depth+1,
exception);
file_xml=DestroyString(file_xml);
}
continue;
if (LocaleCompare(keyword,"/>") == 0)
{
- status=AppendValueToLinkedList(color_cache,color_info);
+ status=AppendValueToLinkedList(cache,color_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
static LinkedListInfo *AcquireConfigureCache(const char *filename,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
LinkedListInfo
- *configure_cache,
- *options;
+ *cache;
MagickStatusType
status;
/*
Load external configure map.
*/
- configure_cache=NewLinkedList(0);
- if (configure_cache == (LinkedListInfo *) NULL)
+ cache=NewLinkedList(0);
+ if (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&=LoadConfigureCache(configure_cache,(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&=LoadConfigureCache(cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
/*
Load built-in configure map.
*/
configure_info->value=(char *) p->value;
configure_info->exempt=MagickTrue;
configure_info->signature=MagickCoreSignature;
- status&=AppendValueToLinkedList(configure_cache,configure_info);
+ status&=AppendValueToLinkedList(cache,configure_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
configure_info->name);
}
- return(configure_cache);
+ return(cache);
}
\f
/*
%
% The format of the LoadConfigureCache method is:
%
-% MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
+% MagickBooleanType LoadConfigureCache(LinkedListInfo *cache,
% const char *xml,const char *filename,const size_t depth,
% ExceptionInfo *exception)
%
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
+static MagickBooleanType LoadConfigureCache(LinkedListInfo *cache,
const char *xml,const char *filename,const size_t depth,
ExceptionInfo *exception)
{
file_xml=FileToXML(path,~0UL);
if (file_xml != (char *) NULL)
{
- status&=LoadConfigureCache(configure_cache,file_xml,path,
- depth+1,exception);
+ status&=LoadConfigureCache(cache,file_xml,path,depth+1,
+ exception);
file_xml=DestroyString(file_xml);
}
}
continue;
if (LocaleCompare(keyword,"/>") == 0)
{
- status=AppendValueToLinkedList(configure_cache,configure_info);
+ status=AppendValueToLinkedList(cache,configure_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
static LinkedListInfo *AcquireLogCache(const char *filename,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
LinkedListInfo
- *log_cache,
- *options;
+ *cache;
MagickStatusType
status;
/*
Load external log map.
*/
- log_cache=NewLinkedList(0);
- if (log_cache == (LinkedListInfo *) NULL)
+ cache=NewLinkedList(0);
+ if (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&=LoadLogCache(log_cache,(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&=LoadLogCache(cache,(const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
/*
Load built-in log map.
*/
log_info->filename=ConstantString(p->filename);
log_info->format=ConstantString(p->format);
log_info->signature=MagickCoreSignature;
- status&=AppendValueToLinkedList(log_cache,log_info);
+ status&=AppendValueToLinkedList(cache,log_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",log_info->name);
}
- return(log_cache);
+ return(cache);
}
\f
/*
%
% The format of the LoadLogCache method is:
%
-% MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+% MagickBooleanType LoadLogCache(LinkedListInfo *cache,const char *xml,
% const char *filename,const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+static MagickBooleanType LoadLogCache(LinkedListInfo *cache,const char *xml,
const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
file_xml=FileToXML(path,~0UL);
if (file_xml != (char *) NULL)
{
- status&=LoadLogCache(log_cache,file_xml,path,depth+1,
+ status&=LoadLogCache(cache,file_xml,path,depth+1,
exception);
file_xml=DestroyString(file_xml);
}
continue;
if (LocaleCompare(keyword,"</logmap>") == 0)
{
- status=AppendValueToLinkedList(log_cache,log_info);
+ status=AppendValueToLinkedList(cache,log_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",filename);
}
}
token=DestroyString(token);
- if (log_cache == (LinkedListInfo *) NULL)
+ if (cache == (LinkedListInfo *) NULL)
return(MagickFalse);
return(status != 0 ? MagickTrue : MagickFalse);
}
static LinkedListInfo *AcquireMagicCache(const char *filename,
ExceptionInfo *exception)
{
- char
- path[MagickPathExtent];
-
- const StringInfo
- *option;
-
LinkedListInfo
- *magic_cache,
- *options;
+ *cache;
MagickStatusType
status;
/*
Load external magic map.
*/
- magic_cache=NewLinkedList(0);
- if (magic_cache == (LinkedListInfo *) NULL)
+ cache=NewLinkedList(0);
+ if (cache == (LinkedListInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
status=MagickTrue;
- *path='\0';
- options=GetConfigureOptions(filename,exception);
- option=(const StringInfo *) GetNextValueInLinkedList(options);
- while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
{
- (void) CopyMagickString(path,GetStringInfoPath(option),MagickPathExtent);
- status&=LoadMagicCache(magic_cache,(const char *)
- GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+ char
+ path[MagickPathExtent];
+
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ *path='\0';
+ options=GetConfigureOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+ while (option != (const StringInfo *) NULL)
+ {
+ (void) CopyMagickString(path,GetStringInfoPath(option),MagickPathExtent);
+ status&=LoadMagicCache(cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
/*
Load built-in magic map.
*/
magic_info->length=p->length;
magic_info->exempt=MagickTrue;
magic_info->signature=MagickCoreSignature;
- status&=InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,
+ status&=InsertValueInSortedLinkedList(cache,CompareMagickInfoSize,
NULL,magic_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",magic_info->name);
}
- return(magic_cache);
+ return(cache);
}
\f
/*
%
% The format of the LoadMagicCache method is:
%
-% MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
-% const char *xml,const char *filename,const size_t depth,
-% ExceptionInfo *exception)
+% MagickBooleanType LoadMagicCache(LinkedListInfo *cache,const char *xml,
+% const char *filename,const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
- const char *xml,const char *filename,const size_t depth,
- ExceptionInfo *exception)
+static MagickBooleanType LoadMagicCache(LinkedListInfo *cache,const char *xml,
+ const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MagickPathExtent],
file_xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status&=LoadMagicCache(magic_cache,file_xml,path,depth+1,
+ status&=LoadMagicCache(cache,file_xml,path,depth+1,
exception);
file_xml=DestroyString(file_xml);
}
continue;
if (LocaleCompare(keyword,"/>") == 0)
{
- status=InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,
+ status=InsertValueInSortedLinkedList(cache,CompareMagickInfoSize,
NULL,magic_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
We don't run the benchmark when we can not write out a device profile. The
first GPU device will be used.
*/
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
if (CanWriteProfileToFile(filename) == MagickFalse)
+#endif
{
for (i = 0; i < clEnv->number_devices; i++)
clEnv->devices[i]->score=1.0;
static LinkedListInfo *AcquirePolicyCache(const char *filename,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
LinkedListInfo
- *options,
- *policy_cache;
+ *cache;
MagickStatusType
status;
/*
Load external policy map.
*/
- policy_cache=NewLinkedList(0);
- if (policy_cache == (LinkedListInfo *) NULL)
+ cache=NewLinkedList(0);
+ if (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&=LoadPolicyCache(policy_cache,(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&=LoadPolicyCache(cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
/*
Load built-in policy map.
*/
policy_info->value=(char *) p->value;
policy_info->exempt=MagickTrue;
policy_info->signature=MagickCoreSignature;
- status&=AppendValueToLinkedList(policy_cache,policy_info);
+ status&=AppendValueToLinkedList(cache,policy_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",policy_info->name);
}
- return(policy_cache);
+ return(cache);
}
\f
/*
%
% The format of the LoadPolicyCache method is:
%
-% MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
-% const char *xml,const char *filename,const size_t depth,
-% ExceptionInfo *exception)
+% MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml,
+% const char *filename,const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
- const char *xml,const char *filename,const size_t depth,
- ExceptionInfo *exception)
+static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml,
+ const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MagickPathExtent],
file_xml=FileToXML(path,~0UL);
if (file_xml != (char *) NULL)
{
- status&=LoadPolicyCache(policy_cache,file_xml,path,
+ status&=LoadPolicyCache(cache,file_xml,path,
depth+1,exception);
file_xml=DestroyString(file_xml);
}
continue;
if (LocaleCompare(keyword,"/>") == 0)
{
- status=AppendValueToLinkedList(policy_cache,policy_info);
+ status=AppendValueToLinkedList(cache,policy_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
MagickExport ThresholdMap *GetThresholdMap(const char *map_id,
ExceptionInfo *exception)
{
- const StringInfo
- *option;
-
- LinkedListInfo
- *options;
-
ThresholdMap
*map;
map=GetThresholdMapFile(MinimalThresholdMap,"built-in",map_id,exception);
if (map != (ThresholdMap *) NULL)
return(map);
- options=GetConfigureOptions(ThresholdsFilename,exception);
- option=(const StringInfo *) GetNextValueInLinkedList(options);
- while (option != (const StringInfo *) NULL)
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
{
- map=GetThresholdMapFile((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),map_id,exception);
- if (map != (ThresholdMap *) NULL)
- break;
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ options=GetConfigureOptions(ThresholdsFilename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+ while (option != (const StringInfo *) NULL)
+ {
+ map=GetThresholdMapFile((const char *) GetStringInfoDatum(option),
+ GetStringInfoPath(option),map_id,exception);
+ if (map != (ThresholdMap *) NULL)
+ break;
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
+ }
+ options=DestroyConfigureOptions(options);
}
- options=DestroyConfigureOptions(options);
+#endif
return(map);
}
\f