option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadCoderCache(coder_cache,(const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadCoderCache(coder_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% IsCoderTreeInstantiated() determines if the coder tree is instantiated.
-% If not, it instantiates the tree and returns it.
+% IsCoderTreeInstantiated() determines if the coder tree is instantiated. If
+% not, it instantiates the tree and returns it.
%
% The format of the IsCoderInstantiated method is:
%
ActivateSemaphoreInfo(&coder_semaphore);
LockSemaphoreInfo(coder_semaphore);
if (coder_cache == (SplayTreeInfo *) NULL)
- (void) AcquireCoderCache(MagickCoderFilename,exception);
+ coder_cache=AcquireCoderCache(MagickCoderFilename,exception);
UnlockSemaphoreInfo(coder_semaphore);
}
return(coder_cache != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
*/
static MagickBooleanType
IsColorCacheInstantiated(ExceptionInfo *),
- LoadColorCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadColorCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadColorCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadColorCache(color_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
*q;
assert(exception != (ExceptionInfo *) NULL);
- if (color_cache == (LinkedListInfo *) NULL)
- if (IfMagickFalse(IsColorCacheInstantiated(exception)))
- return((const ColorInfo *) NULL);
+ if (IfMagickFalse(IsColorCacheInstantiated(exception)))
+ return((const ColorInfo *) NULL);
/*
Strip names of whitespace.
*/
%
% The format of the LoadColorCache method is:
%
-% MagickBooleanType LoadColorCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadColorCache(LinkedListInfo *color_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(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
"Loading color file \"%s\" ...",filename);
if (xml == (char *) NULL)
return(MagickFalse);
- if (color_cache == (LinkedListInfo *) NULL)
- {
- color_cache=NewLinkedList(0);
- if (color_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
color_info=(ColorInfo *) NULL;
token=AcquireString(xml);
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadColorCache(xml,path,depth+1,exception);
+ status&=LoadColorCache(color_cache,xml,path,depth+1,
+ exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
*/
static MagickBooleanType
IsConfigureCacheInstantiated(ExceptionInfo *),
- LoadConfigureCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadConfigureCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% AcquireConfigureCache() caches one or more configure configuration files which
+% AcquireConfigureCache() caches one or more configure configurations which
% provides a mapping between configure attributes and a configure name.
%
% The format of the AcquireConfigureCache method is:
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadConfigureCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadConfigureCache(configure_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
(void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
- configure_info=(const ConfigureInfo **)
- RelinquishMagickMemory((void *) configure_info);
+ configure_info=(const ConfigureInfo **) RelinquishMagickMemory((void *)
+ configure_info);
return(MagickTrue);
}
\f
%
% The format of the LoadConfigureCache method is:
%
-% MagickBooleanType LoadConfigureCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_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 LoadConfigureCache(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
*/
(void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
"Loading configure file \"%s\" ...",filename);
- if (configure_cache == (LinkedListInfo *) NULL)
- {
- configure_cache=NewLinkedList(0);
- if (configure_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
configure_info=(ConfigureInfo *) NULL;
token=AcquireString((char *) xml);
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadConfigureCache(xml,path,depth+1,exception);
+ status&=LoadConfigureCache(configure_cache,xml,path,
+ depth+1,exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
*/
static MagickBooleanType
IsDelegateCacheInstantiated(ExceptionInfo *),
- LoadDelegateCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadDelegateCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadDelegateCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadDelegateCache(delegate_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
}
#endif
if (IfMagickTrue(IsLinkedListEmpty(delegate_cache)))
- status&=LoadDelegateCache(DelegateMap,"built-in",0,exception);
+ status&=LoadDelegateCache(delegate_cache,DelegateMap,"built-in",0,
+ exception);
return(delegate_cache);
}
\f
*p;
assert(exception != (ExceptionInfo *) NULL);
- if (delegate_cache == (LinkedListInfo *) NULL)
- if( IfMagickFalse(IsDelegateCacheInstantiated(exception)) )
- return((const DelegateInfo *) NULL);
+ if (IfMagickFalse(IsDelegateCacheInstantiated(exception)))
+ return((const DelegateInfo *) NULL);
/*
Search for named delegate.
*/
%
% The format of the LoadDelegateCache method is:
%
-% MagickBooleanType LoadDelegateCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_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 LoadDelegateCache(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
"Loading delegate configuration file \"%s\" ...",filename);
if (xml == (const char *) NULL)
return(MagickFalse);
- if (delegate_cache == (LinkedListInfo *) NULL)
- {
- delegate_cache=NewLinkedList(0);
- if (delegate_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
delegate_info=(DelegateInfo *) NULL;
token=AcquireString(xml);
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadDelegateCache(xml,path,depth+1,exception);
+ status&=LoadDelegateCache(delegate_cache,xml,path,
+ depth+1,exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
*/
static MagickBooleanType
IsLocaleTreeInstantiated(ExceptionInfo *),
- LoadLocaleCache(const char *,const char *,const char *,const size_t,
- ExceptionInfo *);
+ LoadLocaleCache(SplayTreeInfo *,const char *,const char *,const char *,
+ const size_t,ExceptionInfo *);
\f
#if defined(MAGICKCORE_HAVE_STRTOD_L)
/*
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),locale,0,exception);
+ status&=LoadLocaleCache(locale_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),locale,0,
+ exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyLocaleOptions(options);
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),locale,0,exception);
+ status&=LoadLocaleCache(locale_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),locale,0,
+ exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyLocaleOptions(options);
}
#endif
if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
- status&=LoadLocaleCache(LocaleMap,"built-in",locale,0,exception);
+ status&=LoadLocaleCache(locale_cache,LocaleMap,"built-in",locale,0,
+ exception);
return(locale_cache);
}
\f
*/
static MagickBooleanType IsLocaleTreeInstantiated(ExceptionInfo *exception)
{
- if (locale_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&locale_semaphore);
- LockSemaphoreInfo(locale_semaphore);
if (locale_cache == (SplayTreeInfo *) NULL)
{
- char
- *locale;
-
- register const char
- *p;
-
- locale=(char *) NULL;
- p=setlocale(LC_CTYPE,(const char *) NULL);
- if (p != (const char *) NULL)
- locale=ConstantString(p);
- if (locale == (char *) NULL)
- locale=GetEnvironmentValue("LC_ALL");
- if (locale == (char *) NULL)
- locale=GetEnvironmentValue("LC_MESSAGES");
- if (locale == (char *) NULL)
- locale=GetEnvironmentValue("LC_CTYPE");
- if (locale == (char *) NULL)
- locale=GetEnvironmentValue("LANG");
- if (locale == (char *) NULL)
- locale=ConstantString("C");
- locale_cache=AcquireLocaleSplayTree(LocaleFilename,locale,exception);
- locale=DestroyString(locale);
+ if (locale_semaphore == (SemaphoreInfo *) NULL)
+ ActivateSemaphoreInfo(&locale_semaphore);
+ LockSemaphoreInfo(locale_semaphore);
+ if (locale_cache == (SplayTreeInfo *) NULL)
+ {
+ char
+ *locale;
+
+ register const char
+ *p;
+
+ locale=(char *) NULL;
+ p=setlocale(LC_CTYPE,(const char *) NULL);
+ if (p != (const char *) NULL)
+ locale=ConstantString(p);
+ if (locale == (char *) NULL)
+ locale=GetEnvironmentValue("LC_ALL");
+ if (locale == (char *) NULL)
+ locale=GetEnvironmentValue("LC_MESSAGES");
+ if (locale == (char *) NULL)
+ locale=GetEnvironmentValue("LC_CTYPE");
+ if (locale == (char *) NULL)
+ locale=GetEnvironmentValue("LANG");
+ if (locale == (char *) NULL)
+ locale=ConstantString("C");
+ locale_cache=AcquireLocaleSplayTree(LocaleFilename,locale,exception);
+ locale=DestroyString(locale);
+ }
+ UnlockSemaphoreInfo(locale_semaphore);
}
- UnlockSemaphoreInfo(locale_semaphore);
return(locale_cache != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
}
\f
%
% The format of the LoadLocaleCache method is:
%
-% MagickBooleanType LoadLocaleCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
+% const char *xml,const char *filename,const size_t depth,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
return(y);
}
-static MagickBooleanType LoadLocaleCache(const char *xml,const char *filename,
- const char *locale,const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
+ const char *xml,const char *filename,const char *locale,const size_t depth,
+ ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
"Loading locale configure file \"%s\" ...",filename);
if (xml == (const char *) NULL)
return(MagickFalse);
- if (locale_cache == (SplayTreeInfo *) NULL)
- {
- locale_cache=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL,
- DestroyLocaleNode);
- if (locale_cache == (SplayTreeInfo *) NULL)
- return(MagickFalse);
- }
status=MagickTrue;
locale_info=(LocaleInfo *) NULL;
*tag='\0';
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadLocaleCache(xml,path,locale,depth+1,exception);
+ status&=LoadLocaleCache(locale_cache,xml,path,locale,
+ depth+1,exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
static MagickBooleanType
IsLogCacheInstantiated(ExceptionInfo *),
- LoadLogCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadLogCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadLogCache((const char *) GetStringInfoDatum(option),
+ status&=LoadLogCache(log_cache,(const char *) GetStringInfoDatum(option),
GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% IsLogCacheInstantiated() determines if the log list is instantiated. If not,
-% it instantiates the list and returns it.
+% IsLogCacheInstantiated() determines if the log list is instantiated. If
+% not, it instantiates the list and returns it.
%
% The format of the IsLogInstantiated method is:
%
"encoding=\"UTF-8\" standalone=\"yes\"?>\n");
(void) FormatLocaleFile(log_info->file,"<log>\n");
}
- (void) FormatLocaleFile(log_info->file," <event>%s</event>\n",text);
+ (void) FormatLocaleFile(log_info->file," <event>%s</event>\n",text);
(void) fflush(log_info->file);
}
if ((log_info->handler_mask & MethodHandler) != 0)
%
% The format of the LoadLogCache method is:
%
-% MagickBooleanType LoadLogCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadLogCache(LinkedListInfo *log_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(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+ const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
*/
if (xml == (const char *) NULL)
return(MagickFalse);
- if (log_cache == (LinkedListInfo *) NULL)
- {
- log_cache=NewLinkedList(0);
- if (log_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
token=AcquireString((const char *) xml);
for (q=(const char *) xml; *q != '\0'; )
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status&=LoadLogCache(xml,path,depth+1,exception);
+ status&=LoadLogCache(log_cache,xml,path,depth+1,
+ exception);
xml=DestroyString(xml);
}
}
*/
static MagickBooleanType
IsMagicCacheInstantiated(ExceptionInfo *),
- LoadMagicCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadMagicCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
while (option != (const StringInfo *) NULL)
{
(void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
- status&=LoadMagicCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadMagicCache(magic_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
%
% The format of the LoadMagicCache method is:
%
-% MagickBooleanType LoadMagicCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadMagicCache(LinkedListInfo *magic_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(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
"Loading magic configure file \"%s\" ...",filename);
if (xml == (char *) NULL)
return(MagickFalse);
- if (magic_cache == (LinkedListInfo *) NULL)
- {
- magic_cache=NewLinkedList(0);
- if (magic_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
magic_info=(MagicInfo *) NULL;
token=AcquireString(xml);
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadMagicCache(xml,path,depth+1,exception);
+ status&=LoadMagicCache(magic_cache,xml,path,depth+1,
+ exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",magick_info->name);
if (magick_list == (SplayTreeInfo *) NULL)
return((MagickInfo *) NULL);
+ if (magick_info->thread_support == NoThreadSupport)
+ magick_info->semaphore=AcquireSemaphoreInfo();
status=AddValueToSplayTree(magick_list,magick_info->name,magick_info);
if (status == MagickFalse)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
*/
static MagickBooleanType
IsMimeCacheInstantiated(ExceptionInfo *),
- LoadMimeCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadMimeCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% AcquireMimeCache() caches one or more magic configurations which provides a
-% mapping between magic attributes and a magic name.
+% AcquireMimeCache() caches one or more magic configurations which provides
+% a mapping between magic attributes and a magic name.
%
% The format of the AcquireMimeCache method is:
%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadMimeCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadMimeCache(mime_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
}
#endif
if (IsLinkedListEmpty(mime_cache) != MagickFalse)
- status&=LoadMimeCache(MimeMap,"built-in",0,exception);
+ status&=LoadMimeCache(mime_cache,MimeMap,"built-in",0,exception);
return(mime_cache);
}
\f
%
% The format of the LoadMimeCache method is:
%
-% MagickBooleanType LoadMimeCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadMimeCache(LinkedListInfo *mime_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 LoadMimeCache(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
const char
*attribute;
"Loading mime map \"%s\" ...",filename);
if (xml == (const char *) NULL)
return(MagickFalse);
- if (mime_cache == (LinkedListInfo *) NULL)
- {
- mime_cache=NewLinkedList(0);
- if (mime_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
mime_map=NewXMLTree(xml,exception);
if (mime_map == (XMLTreeInfo *) NULL)
return(MagickFalse);
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadMimeCache(xml,path,depth+1,exception);
+ status&=LoadMimeCache(mime_cache,xml,path,depth+1,exception);
xml=DestroyString(xml);
}
}
*/
static MagickBooleanType
IsPolicyCacheInstantiated(ExceptionInfo *),
- LoadPolicyCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadPolicyCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadPolicyCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadPolicyCache(policy_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
%
% The format of the LoadPolicyCache method is:
%
-% MagickBooleanType LoadPolicyCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_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(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
"Loading policy file \"%s\" ...",filename);
if (xml == (char *) NULL)
return(MagickFalse);
- if (policy_cache == (LinkedListInfo *) NULL)
- {
- policy_cache=NewLinkedList(0);
- if (policy_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
policy_info=(PolicyInfo *) NULL;
token=AcquireString(xml);
xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status=LoadPolicyCache(xml,path,depth+1,exception);
+ status&=LoadPolicyCache(policy_cache,xml,path,depth+1,
+ exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
#endif
entry=SetMagickInfo("JPEG");
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_JPEG_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJPEGImage;
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("JPG");
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_JPEG_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJPEGImage;
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("PJPEG");
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_JPEG_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJPEGImage;
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
entry->format_type=ImplicitFormatType;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString("Raw CCITT Group4");
entry->mime_type=ConstantString("image/tiff");
entry->module=ConstantString("TIFF");
entry->endian_support=MagickTrue;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString("Pyramid encoded TIFF");
entry->mime_type=ConstantString("image/tiff");
entry->module=ConstantString("TIFF");
entry->seekable_stream=MagickTrue;
entry->stealth=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString(TIFFDescription);
if (*version != '\0')
entry->version=ConstantString(version);
entry->endian_support=MagickTrue;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString(TIFFDescription);
if (*version != '\0')
entry->version=ConstantString(version);
entry->endian_support=MagickTrue;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
- entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString("Tagged Image File Format (64-bit)");
if (*version != '\0')
entry->version=ConstantString(version);