MagickExport const CoderInfo *GetCoderInfo(const char *name,
ExceptionInfo *exception)
{
+ const CoderInfo
+ *coder_info;
+
assert(exception != (ExceptionInfo *) NULL);
if (IsCoderTreeInstantiated(exception) == MagickFalse)
return((const CoderInfo *) NULL);
+ LockSemaphoreInfo(coder_semaphore);
if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
{
ResetSplayTreeIterator(coder_list);
- return((const CoderInfo *) GetNextValueInSplayTree(coder_list));
+ coder_info=(const CoderInfo *) GetNextValueInSplayTree(coder_list);
+ UnlockSemaphoreInfo(coder_semaphore);
+ return(coder_info);
}
- return((const CoderInfo *) GetValueFromSplayTree(coder_list,name));
+ coder_info=(const CoderInfo *) GetValueFromSplayTree(coder_list,name);
+ UnlockSemaphoreInfo(coder_semaphore);
+ return(coder_info);
}
\f
/*
if (color_list == (LinkedListInfo *) NULL)
if (IfMagickFalse(IsColorListInstantiated(exception)))
return((const ColorInfo *) NULL);
- if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
- return((const ColorInfo *) GetValueFromLinkedList(color_list,0));
/*
Strip names of whitespace.
*/
- (void) CopyMagickString(colorname,name,MaxTextExtent);
+ *colorname='\0';
+ if (name != (const char *) NULL)
+ (void) CopyMagickString(colorname,name,MaxTextExtent);
for (q=colorname; *q != '\0'; q++)
{
if (isspace((int) ((unsigned char) *q)) == 0)
LockSemaphoreInfo(color_semaphore);
ResetLinkedListIterator(color_list);
p=(const ColorInfo *) GetNextValueInLinkedList(color_list);
+ if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+ {
+ UnlockSemaphoreInfo(color_semaphore);
+ return(p);
+ }
while (p != (const ColorInfo *) NULL)
{
if (((p->compliance & compliance) != 0) &&
assert(exception != (ExceptionInfo *) NULL);
if (IsConfigureListInstantiated(exception) == MagickFalse)
return((const ConfigureInfo *) NULL);
- if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
- return((const ConfigureInfo *) GetValueFromLinkedList(configure_list,0));
/*
Search for configure tag.
*/
LockSemaphoreInfo(configure_semaphore);
ResetLinkedListIterator(configure_list);
p=(const ConfigureInfo *) GetNextValueInLinkedList(configure_list);
+ if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+ {
+ UnlockSemaphoreInfo(configure_semaphore);
+ return(p);
+ }
while (p != (const ConfigureInfo *) NULL)
{
if (LocaleCompare(name,p->name) == 0)
if (delegate_list == (LinkedListInfo *) NULL)
if( IfMagickFalse(IsDelegateListInstantiated(exception)) )
return((const DelegateInfo *) NULL);
- if ((LocaleCompare(decode,"*") == 0) && (LocaleCompare(encode,"*") == 0))
- return((const DelegateInfo *) GetValueFromLinkedList(delegate_list,0));
/*
Search for named delegate.
*/
LockSemaphoreInfo(delegate_semaphore);
ResetLinkedListIterator(delegate_list);
p=(const DelegateInfo *) GetNextValueInLinkedList(delegate_list);
+ if ((LocaleCompare(decode,"*") == 0) && (LocaleCompare(encode,"*") == 0))
+ {
+ UnlockSemaphoreInfo(delegate_semaphore);
+ return(p);
+ }
while (p != (const DelegateInfo *) NULL)
{
if (p->mode > 0)
MagickExport const LocaleInfo *GetLocaleInfo_(const char *tag,
ExceptionInfo *exception)
{
+ const LocaleInfo
+ *locale_info;
+
assert(exception != (ExceptionInfo *) NULL);
if (IsLocaleTreeInstantiated(exception) == MagickFalse)
return((const LocaleInfo *) NULL);
+ LockSemaphoreInfo(locale_semaphore);
if ((tag == (const char *) NULL) || (LocaleCompare(tag,"*") == 0))
{
ResetSplayTreeIterator(locale_list);
- return((const LocaleInfo *) GetNextValueInSplayTree(locale_list));
+ locale_info=(const LocaleInfo *) GetNextValueInSplayTree(locale_list);
+ UnlockSemaphoreInfo(locale_semaphore);
+ return(locale_info);
}
- return((const LocaleInfo *) GetValueFromSplayTree(locale_list,tag));
+ locale_info=(const LocaleInfo *) GetValueFromSplayTree(locale_list,tag);
+ UnlockSemaphoreInfo(locale_semaphore);
+ return(locale_info);
}
\f
/*
*log_list = (LinkedListInfo *) NULL;
static SemaphoreInfo
+ *event_semaphore = (SemaphoreInfo *) NULL,
*log_semaphore = (SemaphoreInfo *) NULL;
\f
/*
assert(exception != (ExceptionInfo *) NULL);
if (IsLogListInstantiated(exception) == MagickFalse)
return((LogInfo *) NULL);
- if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
- return((LogInfo *) GetValueFromLinkedList(log_list,0));
/*
Search for log tag.
*/
LockSemaphoreInfo(log_semaphore);
ResetLinkedListIterator(log_list);
p=(LogInfo *) GetNextValueInLinkedList(log_list);
+ if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+ {
+ UnlockSemaphoreInfo(log_semaphore);
+ return(p);
+ }
while (p != (LogInfo *) NULL)
{
if (LocaleCompare(name,p->name) == 0)
assert(exception != (ExceptionInfo *) NULL);
if (IsMagicListInstantiated(exception) == MagickFalse)
return((const MagicInfo *) NULL);
- if (magic == (const unsigned char *) NULL)
- return((const MagicInfo *) GetValueFromLinkedList(magic_list,0));
if (length == 0)
return((const MagicInfo *) NULL);
/*
LockSemaphoreInfo(magic_semaphore);
ResetLinkedListIterator(magic_list);
p=(const MagicInfo *) GetNextValueInLinkedList(magic_list);
+ if (magic == (const unsigned char *) NULL)
+ {
+ UnlockSemaphoreInfo(magic_semaphore);
+ return(p);
+ }
while (p != (const MagicInfo *) NULL)
{
assert(p->offset >= 0);
assert(exception != (ExceptionInfo *) NULL);
if (IsMagickTreeInstantiated(exception) == MagickFalse)
return((const MagickInfo *) NULL);
+ /*
+ Find name in list.
+ */
+ LockSemaphoreInfo(magick_semaphore);
+ ResetSplayTreeIterator(magick_list);
+ p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
{
#if defined(MAGICKCORE_MODULES_SUPPORT)
if (LocaleCompare(name,"*") == 0)
(void) OpenModules(exception);
#endif
- LockSemaphoreInfo(magick_semaphore);
ResetSplayTreeIterator(magick_list);
p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
UnlockSemaphoreInfo(magick_semaphore);
return(p);
}
- /*
- Find name in list.
- */
- LockSemaphoreInfo(magick_semaphore);
- ResetSplayTreeIterator(magick_list);
- p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
while (p != (const MagickInfo *) NULL)
{
if (LocaleCompare(p->name,name) == 0)
(void) InsertValueInLinkedList(mime_list,0,
RemoveElementByValueFromLinkedList(mime_list,p));
UnlockSemaphoreInfo(mime_semaphore);
- return(mime_info);
+ return(p);
}
\f
/*
*/
MagickExport ModuleInfo *GetModuleInfo(const char *tag,ExceptionInfo *exception)
{
+ ModuleInfo
+ *module_info;
+
if (IsModuleTreeInstantiated(exception) == MagickFalse)
return((ModuleInfo *) NULL);
+ LockSemaphoreInfo(module_semaphore);
+ ResetSplayTreeIterator(module_list);
if ((tag == (const char *) NULL) || (LocaleCompare(tag,"*") == 0))
{
- ModuleInfo
- *p;
-
#if defined(MAGICKCORE_MODULES_SUPPORT)
if (LocaleCompare(tag,"*") == 0)
(void) OpenModules(exception);
#endif
- LockSemaphoreInfo(module_semaphore);
- ResetSplayTreeIterator(module_list);
- p=(ModuleInfo *) GetNextValueInSplayTree(module_list);
+ module_info=(ModuleInfo *) GetNextValueInSplayTree(module_list);
UnlockSemaphoreInfo(module_semaphore);
- return(p);
+ return(module_info);
}
- return((ModuleInfo *) GetValueFromSplayTree(module_list,tag));
+ module_info=(ModuleInfo *) GetValueFromSplayTree(module_list,tag);
+ UnlockSemaphoreInfo(module_semaphore);
+ return(module_info);
}
\f
/*
assert(exception != (ExceptionInfo *) NULL);
if (IsPolicyListInstantiated(exception) == MagickFalse)
return((PolicyInfo *) NULL);
- if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
- return((PolicyInfo *) GetValueFromLinkedList(policy_list,0));
/*
Strip names of whitespace.
*/
- (void) CopyMagickString(policyname,name,MaxTextExtent);
+ *policyname='\0';
+ if (name != (const char *) NULL)
+ (void) CopyMagickString(policyname,name,MaxTextExtent);
for (q=policyname; *q != '\0'; q++)
{
if (isspace((int) ((unsigned char) *q)) == 0)
LockSemaphoreInfo(policy_semaphore);
ResetLinkedListIterator(policy_list);
p=(PolicyInfo *) GetNextValueInLinkedList(policy_list);
+ if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+ {
+ UnlockSemaphoreInfo(policy_semaphore);
+ return(p);
+ }
while (p != (PolicyInfo *) NULL)
{
if (LocaleCompare(policyname,p->name) == 0)
assert(exception != (ExceptionInfo *) NULL);
if (IsTypeTreeInstantiated(exception) == MagickFalse)
return((const TypeInfo *) NULL);
+ LockSemaphoreInfo(type_semaphore);
if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
{
ResetSplayTreeIterator(type_list);
- return((const TypeInfo *) GetNextValueInSplayTree(type_list));
+ type_info=(const TypeInfo *) GetNextValueInSplayTree(type_list);
+ UnlockSemaphoreInfo(type_semaphore);
+ return(type_info);
}
- return((const TypeInfo *) GetValueFromSplayTree(type_list,name));
+ type_info=(const TypeInfo *) GetValueFromSplayTree(type_list,name);
+ UnlockSemaphoreInfo(type_semaphore);
+ return(type_info);
}
\f
/*
if (attribute_flag[2] != 0)
channel=(ChannelType) argument_list[2].integer_reference;
channel_mask=SetImageChannelMask(image,channel);
- image=RadialBlurImage(image,geometry_info.rho,exception);
+ image=RotationalBlurImage(image,geometry_info.rho,exception);
if (image != (Image *) NULL)
(void) SetImageChannelMask(image,channel_mask);
break;