% July 2003 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 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 %
#include "MagickCore/locale-private.h"
#include "MagickCore/log.h"
#include "MagickCore/memory_.h"
+#include "MagickCore/nt-base-private.h"
#include "MagickCore/semaphore.h"
#include "MagickCore/splay-tree.h"
#include "MagickCore/string_.h"
+#include "MagickCore/string-private.h"
#include "MagickCore/token.h"
#include "MagickCore/utility.h"
+#include "MagickCore/utility-private.h"
#include "MagickCore/xml-tree.h"
\f
/*
%
*/
-MagickExport ssize_t FormatLocaleFileList(FILE *file,
+MagickPrivate ssize_t FormatLocaleFileList(FILE *file,
const char *restrict format,va_list operands)
{
ssize_t
%
*/
-MagickExport ssize_t FormatLocaleStringList(char *restrict string,
+MagickPrivate ssize_t FormatLocaleStringList(char *restrict string,
const size_t length,const char *restrict format,va_list operands)
{
ssize_t
blob=(char *) NTResourceToBlob(filename);
if (blob != (char *) NULL)
{
- xml=StringToStringInfo(blob);
+ xml=AcquireStringInfo(0);
+ SetStringInfoLength(xml,strlen(blob)+1);
+ SetStringInfoDatum(xml,(unsigned char *) blob);
+ SetStringInfoPath(xml,filename);
(void) AppendValueToLinkedList(messages,xml);
- blob=DestroyString(blob);
}
}
#endif
MagickExport double InterpretLocaleValue(const char *restrict string,
char **restrict sentinal)
{
+ char
+ *q;
+
double
value;
+ if ((*string == '0') && ((string[1] | 0x20)=='x'))
+ value=(double) strtoul(string,&q,16);
+ else
+ {
#if defined(MAGICKCORE_HAVE_STRTOD_L)
- {
- locale_t
- locale;
-
- locale=AcquireCLocale();
- if (locale == (locale_t) NULL)
- value=strtod(string,sentinal);
- else
- value=strtod_l(string,sentinal,locale);
- }
+ locale_t
+ locale;
+
+ locale=AcquireCLocale();
+ if (locale == (locale_t) NULL)
+ value=strtod(string,&q);
+ else
+ value=strtod_l(string,&q,locale);
#else
- value=strtod(string,sentinal);
+ value=strtod(string,&q);
#endif
+ }
+ if (sentinal != (char **) NULL)
+ *sentinal=q;
return(value);
}
\f
{
if (depth > 200)
(void) ThrowMagickException(exception,GetMagickModule(),
- ConfigureError,"IncludeElementNestedTooDeeply","`%s'",token);
+ ConfigureError,"IncludeElementNestedTooDeeply","'%s'",token);
else
{
char
status=AddValueToSplayTree(locale_list,locale_info->tag,locale_info);
if (status == MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
- ResourceLimitError,"MemoryAllocationFailed","`%s'",
+ ResourceLimitError,"MemoryAllocationFailed","'%s'",
locale_info->tag);
(void) ConcatenateMagickString(tag,message,MaxTextExtent);
(void) ConcatenateMagickString(tag,"\n",MaxTextExtent);
static MagickBooleanType LoadLocaleLists(const char *filename,
const char *locale,ExceptionInfo *exception)
{
-#if defined(MAGICKCORE_EMBEDDABLE_SUPPORT)
+#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
return(LoadLocaleList(LocaleMap,"built-in",locale,0,exception));
#else
const StringInfo
if (locale_semaphore == (SemaphoreInfo *) NULL)
AcquireSemaphoreInfo(&locale_semaphore);
LockSemaphoreInfo(locale_semaphore);
+ if (locale_list != (SplayTreeInfo *) NULL)
+ locale_list=DestroySplayTree(locale_list);
#if defined(MAGICKCORE_HAVE_STRTOD_L)
DestroyCLocale();
#endif