% July 2003 %
% %
% %
-% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
% The format of the GetLocaleInfoList function is:
%
% const LocaleInfo **GetLocaleInfoList(const char *pattern,
-% unsigned long *number_messages,ExceptionInfo *exception)
+% size_t *number_messages,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
#endif
MagickExport const LocaleInfo **GetLocaleInfoList(const char *pattern,
- unsigned long *number_messages,ExceptionInfo *exception)
+ size_t *number_messages,ExceptionInfo *exception)
{
const LocaleInfo
**messages;
register const LocaleInfo
*p;
- register long
+ register ssize_t
i;
/*
*/
assert(pattern != (char *) NULL);
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
- assert(number_messages != (unsigned long *) NULL);
+ assert(number_messages != (size_t *) NULL);
*number_messages=0;
p=GetLocaleInfo_("*",exception);
if (p == (const LocaleInfo *) NULL)
/*
Generate locale list.
*/
- (void) LockSemaphoreInfo(locale_semaphore);
+ LockSemaphoreInfo(locale_semaphore);
ResetSplayTreeIterator(locale_list);
p=(const LocaleInfo *) GetNextValueInSplayTree(locale_list);
for (i=0; p != (const LocaleInfo *) NULL; )
messages[i++]=p;
p=(const LocaleInfo *) GetNextValueInSplayTree(locale_list);
}
- (void) UnlockSemaphoreInfo(locale_semaphore);
+ UnlockSemaphoreInfo(locale_semaphore);
qsort((void *) messages,(size_t) i,sizeof(*messages),LocaleInfoCompare);
messages[i]=(LocaleInfo *) NULL;
- *number_messages=(unsigned long) i;
+ *number_messages=(size_t) i;
return(messages);
}
\f
%
% The format of the GetLocaleList function is:
%
-% char **GetLocaleList(const char *pattern,unsigned long *number_messages,
+% char **GetLocaleList(const char *pattern,size_t *number_messages,
% Exceptioninfo *exception)
%
% A description of each parameter follows:
#endif
MagickExport char **GetLocaleList(const char *pattern,
- unsigned long *number_messages,ExceptionInfo *exception)
+ size_t *number_messages,ExceptionInfo *exception)
{
char
**messages;
register const LocaleInfo
*p;
- register long
+ register ssize_t
i;
/*
*/
assert(pattern != (char *) NULL);
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
- assert(number_messages != (unsigned long *) NULL);
+ assert(number_messages != (size_t *) NULL);
*number_messages=0;
p=GetLocaleInfo_("*",exception);
if (p == (const LocaleInfo *) NULL)
GetNumberOfNodesInSplayTree(locale_list)+1UL,sizeof(*messages));
if (messages == (char **) NULL)
return((char **) NULL);
- (void) LockSemaphoreInfo(locale_semaphore);
+ LockSemaphoreInfo(locale_semaphore);
p=(const LocaleInfo *) GetNextValueInSplayTree(locale_list);
for (i=0; p != (const LocaleInfo *) NULL; )
{
messages[i++]=ConstantString(p->tag);
p=(const LocaleInfo *) GetNextValueInSplayTree(locale_list);
}
- (void) UnlockSemaphoreInfo(locale_semaphore);
+ UnlockSemaphoreInfo(locale_semaphore);
qsort((void *) messages,(size_t) i,sizeof(*messages),LocaleTagCompare);
messages[i]=(char *) NULL;
- *number_messages=(unsigned long) i;
+ *number_messages=(size_t) i;
return(messages);
}
\f
}
paths=DestroyLinkedList(paths,RelinquishMagickMemory);
}
-#if defined(__WINDOWS__)
+#if defined(MAGICKCORE_WINDOWS_SUPPORT)
{
char
*blob;
{
if (locale_semaphore == (SemaphoreInfo *) NULL)
AcquireSemaphoreInfo(&locale_semaphore);
- (void) LockSemaphoreInfo(locale_semaphore);
+ LockSemaphoreInfo(locale_semaphore);
if ((locale_list == (SplayTreeInfo *) NULL) &&
(instantiate_locale == MagickFalse))
{
locale=DestroyString(locale);
instantiate_locale=MagickTrue;
}
- (void) UnlockSemaphoreInfo(locale_semaphore);
+ UnlockSemaphoreInfo(locale_semaphore);
}
return(locale_list != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
}
const LocaleInfo
**locale_info;
- register long
+ register ssize_t
i;
- unsigned long
+ size_t
number_messages;
if (file == (const FILE *) NULL)
if (locale_info == (const LocaleInfo **) NULL)
return(MagickFalse);
path=(const char *) NULL;
- for (i=0; i < (long) number_messages; i++)
+ for (i=0; i < (ssize_t) number_messages; i++)
{
if (locale_info[i]->stealth != MagickFalse)
continue;
% The format of the LoadLocaleList method is:
%
% MagickBooleanType LoadLocaleList(const char *xml,const char *filename,
-% const unsigned long depth,ExceptionInfo *exception)
+% const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
*/
-static void ChopLocaleComponents(char *path,const unsigned long components)
+static void ChopLocaleComponents(char *path,const size_t components)
{
- long
- count;
-
register char
*p;
+ ssize_t
+ count;
+
if (*path == '\0')
return;
p=path+strlen(path)-1;
if (*p == '/')
*p='\0';
- for (count=0; (count < (long) components) && (p > path); p--)
+ for (count=0; (count < (ssize_t) components) && (p > path); p--)
if (*p == '/')
{
*p='\0';
count++;
}
- if (count < (long) components)
+ if (count < (ssize_t) components)
*path='\0';
}
static MagickBooleanType LoadLocaleList(const char *xml,const char *filename,
- const char *locale,const unsigned long depth,ExceptionInfo *exception)
+ const char *locale,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
{
if (locale_semaphore == (SemaphoreInfo *) NULL)
AcquireSemaphoreInfo(&locale_semaphore);
- (void) LockSemaphoreInfo(locale_semaphore);
+ LockSemaphoreInfo(locale_semaphore);
if (locale_list != (SplayTreeInfo *) NULL)
locale_list=DestroySplayTree(locale_list);
instantiate_locale=MagickFalse;
- (void) UnlockSemaphoreInfo(locale_semaphore);
+ UnlockSemaphoreInfo(locale_semaphore);
DestroySemaphoreInfo(&locale_semaphore);
}