diff --git a/magick/Makefile.am b/magick/Makefile.am
index ca09f4b..6abc3cc 100644
--- a/magick/Makefile.am
+++ b/magick/Makefile.am
@@ -150,7 +150,6 @@
magick/list.h \
magick/locale.c \
magick/locale_.h \
- magick/locale-private.h \
magick/log.c \
magick/log.h \
magick/mac.h \
@@ -387,7 +386,6 @@
magick/exception-private.h \
magick/fx-private.h \
magick/image-private.h \
- magick/locale-private.h \
magick/mac.h \
magick/mime-private.h \
magick/monitor-private.h \
diff --git a/magick/accelerate.c b/magick/accelerate.c
index 37e2361..e530e55 100644
--- a/magick/accelerate.c
+++ b/magick/accelerate.c
@@ -551,7 +551,7 @@
convolve_info=DestroyConvolveInfo(convolve_info);
return((ConvolveInfo *) NULL);
}
- (void) FormatMagickString(options,MaxTextExtent,CLOptions,(double)
+ (void) FormatLocaleString(options,MaxTextExtent,CLOptions,(double)
QuantumRange,MagickEpsilon);
status=clBuildProgram(convolve_info->program,1,convolve_info->devices,options,
NULL,NULL);
diff --git a/magick/animate.c b/magick/animate.c
index 8741fde..7459c58 100644
--- a/magick/animate.c
+++ b/magick/animate.c
@@ -483,7 +483,7 @@
*state|=PlayAnimationState;
*state&=(~AutoReverseAnimationState);
GetPathComponent((*image)->magick_filename,BasePath,basename);
- (void) FormatMagickString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s",MagickPackageName,basename);
if (resource_info->title != (char *) NULL)
{
@@ -607,7 +607,7 @@
Display documentation using Netscape remote control.
*/
url=GetMagickHomeURL();
- (void) FormatMagickString(command,MaxTextExtent,
+ (void) FormatLocaleString(command,MaxTextExtent,
"openurl(%s,new-tab)",url);
url=DestroyString(url);
mozilla_atom=XInternAtom(display,"_MOZILLA_COMMAND",MagickFalse);
@@ -817,7 +817,7 @@
status=XGetWindowAttributes(display,window_info.id,&window_attributes) != 0 ?
MagickTrue : MagickFalse;
if (status != MagickFalse)
- (void) FormatMagickString(visual_type,MaxTextExtent,"0x%lx",
+ (void) FormatLocaleString(visual_type,MaxTextExtent,"0x%lx",
XVisualIDFromVisual(window_attributes.visual));
if (visual_info == (XVisualInfo *) NULL)
{
@@ -943,7 +943,7 @@
(image_list[0]->rows != window_info.height))
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
image_list[0]->filename);
- (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>",
window_attributes.width,window_attributes.height);
geometry_info.width=window_info.width;
geometry_info.height=window_info.height;
@@ -1011,7 +1011,7 @@
ThrowXWindowFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",images->filename);
size_hints->flags=0L;
- (void) FormatMagickString(default_geometry,MaxTextExtent,"%ux%u",width,
+ (void) FormatLocaleString(default_geometry,MaxTextExtent,"%ux%u",width,
height);
flags=XWMGeometry(display,visual_info->screen,resources.image_geometry,
default_geometry,window_info.border_width,size_hints,&window_info.x,
@@ -1655,7 +1655,7 @@
Window name is the base of the filename.
*/
GetPathComponent(display_image->magick_filename,TailPath,filename);
- (void) FormatMagickString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s[scene: %.20g frames: %.20g]",MagickPackageName,filename,(double)
display_image->scene,(double) number_scenes);
(void) CopyMagickString(windows->image.icon_name,filename,MaxTextExtent);
@@ -1664,7 +1664,7 @@
windows->image.immutable=MagickTrue;
windows->image.shape=MagickTrue;
windows->image.geometry=resource_info->image_geometry;
- (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
XDisplayWidth(display,visual_info->screen),
XDisplayHeight(display,visual_info->screen));
geometry_info.width=display_image->columns;
@@ -1791,7 +1791,7 @@
resource_info,&windows->command);
windows->command.data=MagickMenus;
(void) XCommandWidget(display,windows,CommandMenu,(XEvent *) NULL);
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.command",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.command",
resource_info->client_name);
windows->command.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
@@ -1821,7 +1821,7 @@
*/
XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
resource_info,&windows->widget);
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.widget",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.widget",
resource_info->client_name);
windows->widget.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
@@ -1962,7 +1962,7 @@
strlen(image_list[scene]->magick_filename)-1;
while ((p > image_list[scene]->magick_filename) && (*(p-1) != '/'))
p--;
- (void) FormatMagickString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s[%.20g of %.20g]",MagickPackageName,p,(double) scene+1,
(double) number_scenes);
}
@@ -2081,7 +2081,7 @@
strlen(image_list[scene]->filename)-1;
while ((p > image_list[scene]->filename) && (*(p-1) != '/'))
p--;
- (void) FormatMagickString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s[%.20g of %.20g]",MagickPackageName,p,(double)
scene+1,(double) number_scenes);
if (resource_info->title != (char *) NULL)
@@ -2933,7 +2933,7 @@
/*
Request JPEG quality from user.
*/
- (void) FormatMagickString(quality,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(quality,MaxTextExtent,"%.20g",(double)
image_info->quality);
status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
quality);
diff --git a/magick/annotate.c b/magick/annotate.c
index 0d20d1c..bb69d19 100644
--- a/magick/annotate.c
+++ b/magick/annotate.c
@@ -450,7 +450,7 @@
undercolor_info->affine=draw_info->affine;
undercolor_info->affine.tx=offset.x-draw_info->affine.ry*metrics.ascent;
undercolor_info->affine.ty=offset.y-draw_info->affine.sy*metrics.ascent;
- (void) FormatMagickString(primitive,MaxTextExtent,
+ (void) FormatLocaleString(primitive,MaxTextExtent,
"rectangle 0,0 %g,%.20g",metrics.origin.x,(double) height);
(void) CloneString(&undercolor_info->primitive,primitive);
(void) DrawImage(image,undercolor_info);
@@ -458,7 +458,7 @@
}
annotate_info->affine.tx=offset.x;
annotate_info->affine.ty=offset.y;
- (void) FormatMagickString(primitive,MaxTextExtent,"stroke-width %g "
+ (void) FormatLocaleString(primitive,MaxTextExtent,"stroke-width %g "
"line 0,0 %g,0",metrics.underline_thickness,metrics.width);
if (annotate->decorate == OverlineDecoration)
{
@@ -950,7 +950,7 @@
path[MaxTextExtent];
affine=draw_info->affine;
- (void) FormatMagickString(path,MaxTextExtent,
+ (void) FormatLocaleString(path,MaxTextExtent,
"C%g,%g %g,%g %g,%g",affine.tx+p->x/64.0,affine.ty-
p->y/64.0,affine.tx+q->x/64.0,affine.ty-q->y/64.0,affine.tx+to->x/64.0,
affine.ty-to->y/64.0);
@@ -967,7 +967,7 @@
path[MaxTextExtent];
affine=draw_info->affine;
- (void) FormatMagickString(path,MaxTextExtent,"L%g,%g",affine.tx+
+ (void) FormatLocaleString(path,MaxTextExtent,"L%g,%g",affine.tx+
to->x/64.0,affine.ty-to->y/64.0);
(void) ConcatenateString(&draw_info->primitive,path);
return(0);
@@ -982,7 +982,7 @@
path[MaxTextExtent];
affine=draw_info->affine;
- (void) FormatMagickString(path,MaxTextExtent,"M%g,%g",affine.tx+
+ (void) FormatLocaleString(path,MaxTextExtent,"M%g,%g",affine.tx+
to->x/64.0,affine.ty-to->y/64.0);
(void) ConcatenateString(&draw_info->primitive,path);
return(0);
@@ -998,7 +998,7 @@
path[MaxTextExtent];
affine=draw_info->affine;
- (void) FormatMagickString(path,MaxTextExtent,"Q%g,%g %g,%g",
+ (void) FormatLocaleString(path,MaxTextExtent,"Q%g,%g %g,%g",
affine.tx+control->x/64.0,affine.ty-control->y/64.0,affine.tx+to->x/64.0,
affine.ty-to->y/64.0);
(void) ConcatenateString(&draw_info->primitive,path);
@@ -1631,15 +1631,15 @@
filename);
return(MagickFalse);
}
- (void) fprintf(file,"%%!PS-Adobe-3.0\n");
- (void) fprintf(file,"/ReencodeType\n");
- (void) fprintf(file,"{\n");
- (void) fprintf(file," findfont dup length\n");
- (void) fprintf(file,
+ (void) FormatLocaleFile(file,"%%!PS-Adobe-3.0\n");
+ (void) FormatLocaleFile(file,"/ReencodeType\n");
+ (void) FormatLocaleFile(file,"{\n");
+ (void) FormatLocaleFile(file," findfont dup length\n");
+ (void) FormatLocaleFile(file,
" dict begin { 1 index /FID ne {def} {pop pop} ifelse } forall\n");
- (void) fprintf(file,
+ (void) FormatLocaleFile(file,
" /Encoding ISOLatin1Encoding def currentdict end definefont pop\n");
- (void) fprintf(file,"} bind def\n");
+ (void) FormatLocaleFile(file,"} bind def\n");
/*
Sample to compute bounding box.
*/
@@ -1659,31 +1659,31 @@
if (point.y > extent.y)
extent.y=point.y;
}
- (void) fprintf(file,"%g %g moveto\n",identity != MagickFalse ? 0.0 :
+ (void) FormatLocaleFile(file,"%g %g moveto\n",identity != MagickFalse ? 0.0 :
extent.x/2.0,extent.y/2.0);
- (void) fprintf(file,"%g %g scale\n",draw_info->pointsize,
+ (void) FormatLocaleFile(file,"%g %g scale\n",draw_info->pointsize,
draw_info->pointsize);
if ((draw_info->font == (char *) NULL) || (*draw_info->font == '\0') ||
(strchr(draw_info->font,'/') != (char *) NULL))
- (void) fprintf(file,
+ (void) FormatLocaleFile(file,
"/Times-Roman-ISO dup /Times-Roman ReencodeType findfont setfont\n");
else
- (void) fprintf(file,"/%s-ISO dup /%s ReencodeType findfont setfont\n",
+ (void) FormatLocaleFile(file,"/%s-ISO dup /%s ReencodeType findfont setfont\n",
draw_info->font,draw_info->font);
- (void) fprintf(file,"[%g %g %g %g 0 0] concat\n",
+ (void) FormatLocaleFile(file,"[%g %g %g %g 0 0] concat\n",
draw_info->affine.sx,-draw_info->affine.rx,-draw_info->affine.ry,
draw_info->affine.sy);
text=EscapeParenthesis(draw_info->text);
if (identity == MagickFalse)
- (void) fprintf(file,"(%s) stringwidth pop -0.5 mul -0.5 rmoveto\n",text);
- (void) fprintf(file,"(%s) show\n",text);
+ (void) FormatLocaleFile(file,"(%s) stringwidth pop -0.5 mul -0.5 rmoveto\n",text);
+ (void) FormatLocaleFile(file,"(%s) show\n",text);
text=DestroyString(text);
- (void) fprintf(file,"showpage\n");
+ (void) FormatLocaleFile(file,"showpage\n");
(void) fclose(file);
- (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g+0+0!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g+0+0!",
floor(extent.x+0.5),floor(extent.y+0.5));
annotate_info=AcquireImageInfo();
- (void) FormatMagickString(annotate_info->filename,MaxTextExtent,"ps:%s",
+ (void) FormatLocaleString(annotate_info->filename,MaxTextExtent,"ps:%s",
filename);
(void) CloneString(&annotate_info->page,geometry);
if (draw_info->density != (char *) NULL)
@@ -1723,7 +1723,7 @@
ExpandAffine(&draw_info->affine)*draw_info->pointsize+0.5);
crop_info.y=(ssize_t) ceil((resolution.y/DefaultResolution)*extent.y/8.0-
0.5);
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
(void) TransformImage(&annotate_image,geometry,(char *) NULL);
@@ -2019,7 +2019,7 @@
annotate_info.degrees=(180.0/MagickPI)*
atan2(draw_info->affine.rx,draw_info->affine.sx);
}
- (void) FormatMagickString(annotate_info.geometry,MaxTextExtent,
+ (void) FormatLocaleString(annotate_info.geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) width,(double) height,
ceil(offset->x-0.5),ceil(offset->y-metrics->ascent-metrics->descent+
draw_info->interline_spacing-0.5));
diff --git a/magick/blob.c b/magick/blob.c
index 09f0370..0e30d90 100644
--- a/magick/blob.c
+++ b/magick/blob.c
@@ -51,6 +51,7 @@
#include "magick/exception-private.h"
#include "magick/image-private.h"
#include "magick/list.h"
+#include "magick/locale_.h"
#include "magick/log.h"
#include "magick/magick.h"
#include "magick/memory_.h"
@@ -377,7 +378,7 @@
return((Image *) NULL);
}
clone_info=CloneImageInfo(blob_info);
- (void) FormatMagickString(clone_info->filename,MaxTextExtent,"%s:%s",
+ (void) FormatLocaleString(clone_info->filename,MaxTextExtent,"%s:%s",
blob_info->magick,blob_info->filename);
image=ReadImage(clone_info,exception);
clone_info=DestroyImageInfo(clone_info);
@@ -1537,7 +1538,7 @@
blob_info->file=fdopen(file,"wb");
if (blob_info->file != (FILE *) NULL)
{
- (void) FormatMagickString(image->filename,MaxTextExtent,"%s:%s",
+ (void) FormatLocaleString(image->filename,MaxTextExtent,"%s:%s",
image->magick,unique);
status=WriteImage(blob_info,image);
(void) fclose(blob_info->file);
@@ -1796,7 +1797,7 @@
blob_info->file=fdopen(file,"wb");
if (blob_info->file != (FILE *) NULL)
{
- (void) FormatMagickString(filename,MaxTextExtent,"%s:%s",
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s:%s",
images->magick,unique);
status=WriteImages(blob_info,images,filename,exception);
(void) fclose(blob_info->file);
@@ -1910,7 +1911,7 @@
(void) RelinquishUniqueFileResource(filename);
return(MagickFalse);
}
- (void) FormatMagickString(byte_image->filename,MaxTextExtent,"%s:%s",format,
+ (void) FormatLocaleString(byte_image->filename,MaxTextExtent,"%s:%s",format,
filename);
DestroyBlob(byte_image);
byte_image->blob=CloneBlobInfo((BlobInfo *) NULL);
@@ -2440,10 +2441,10 @@
GetPathComponent(image->filename,RootPath,path);
if (*extension == '\0')
- (void) FormatMagickString(filename,MaxTextExtent,"%s-%.20g",
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s-%.20g",
path,(double) image->scene);
else
- (void) FormatMagickString(filename,MaxTextExtent,"%s-%.20g.%s",
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s-%.20g.%s",
path,(double) image->scene,extension);
}
(void) CopyMagickString(image->filename,filename,MaxTextExtent);
diff --git a/magick/cache.c b/magick/cache.c
index 9d228a8..f44526c 100644
--- a/magick/cache.c
+++ b/magick/cache.c
@@ -1499,7 +1499,7 @@
char
message[MaxTextExtent];
- (void) FormatMagickString(message,MaxTextExtent,"destroy %s",
+ (void) FormatLocaleString(message,MaxTextExtent,"destroy %s",
cache_info->filename);
(void) LogMagickEvent(CacheEvent,GetMagickModule(),"%s",message);
}
@@ -3991,7 +3991,7 @@
message[MaxTextExtent];
(void) FormatMagickSize(length,MagickFalse,format);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"extend %s (%s[%d], disk, %sB)",cache_info->filename,
cache_info->cache_filename,cache_info->file,format);
(void) LogMagickEvent(CacheEvent,GetMagickModule(),"%s",message);
@@ -4041,7 +4041,7 @@
assert(cache_info->signature == MagickSignature);
source_info=(*cache_info);
source_info.file=(-1);
- (void) FormatMagickString(cache_info->filename,MaxTextExtent,"%s[%.20g]",
+ (void) FormatLocaleString(cache_info->filename,MaxTextExtent,"%s[%.20g]",
image->filename,(double) GetImageIndexInList(image));
cache_info->mode=mode;
cache_info->rows=image->rows;
@@ -4089,7 +4089,7 @@
{
(void) FormatMagickSize(cache_info->length,MagickTrue,
format);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"open %s (%s memory, %.20gx%.20g %sB)",cache_info->filename,
cache_info->mapped != MagickFalse ? "anonymous" : "heap",
(double) cache_info->columns,(double) cache_info->rows,
@@ -4183,7 +4183,7 @@
{
(void) FormatMagickSize(cache_info->length,MagickTrue,
format);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"open %s (%s[%d], memory-mapped, %.20gx%.20g %sB)",
cache_info->filename,cache_info->cache_filename,
cache_info->file,(double) cache_info->columns,(double)
@@ -4204,7 +4204,7 @@
if (image->debug != MagickFalse)
{
(void) FormatMagickSize(cache_info->length,MagickFalse,format);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"open %s (%s[%d], disk, %.20gx%.20g %sB)",cache_info->filename,
cache_info->cache_filename,cache_info->file,(double)
cache_info->columns,(double) cache_info->rows,format);
diff --git a/magick/coder.c b/magick/coder.c
index 277251d..3d939a3 100644
--- a/magick/coder.c
+++ b/magick/coder.c
@@ -600,18 +600,18 @@
(LocaleCompare(path,coder_info[i]->path) != 0))
{
if (coder_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",coder_info[i]->path);
- (void) fprintf(file,"Magick Coder\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",coder_info[i]->path);
+ (void) FormatLocaleFile(file,"Magick Coder\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=coder_info[i]->path;
- (void) fprintf(file,"%s",coder_info[i]->magick);
+ (void) FormatLocaleFile(file,"%s",coder_info[i]->magick);
for (j=(ssize_t) strlen(coder_info[i]->magick); j <= 11; j++)
- (void) fprintf(file," ");
+ (void) FormatLocaleFile(file," ");
if (coder_info[i]->name != (char *) NULL)
- (void) fprintf(file,"%s",coder_info[i]->name);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"%s",coder_info[i]->name);
+ (void) FormatLocaleFile(file,"\n");
}
coder_info=(const CoderInfo **) RelinquishMagickMemory((void *) coder_info);
(void) fflush(file);
diff --git a/magick/color.c b/magick/color.c
index b3ab742..a558696 100644
--- a/magick/color.c
+++ b/magick/color.c
@@ -1060,26 +1060,26 @@
{
if (pixel->depth > 16)
{
- (void) FormatMagickString(component,MaxTextExtent,"%10lu",
+ (void) FormatLocaleString(component,MaxTextExtent,"%10lu",
(unsigned long) ScaleQuantumToLong(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
if (pixel->depth > 8)
{
- (void) FormatMagickString(component,MaxTextExtent,"%5d",
+ (void) FormatLocaleString(component,MaxTextExtent,"%5d",
ScaleQuantumToShort(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
- (void) FormatMagickString(component,MaxTextExtent,"%3d",
+ (void) FormatLocaleString(component,MaxTextExtent,"%3d",
ScaleQuantumToChar(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
if (channel == OpacityChannel)
{
- (void) FormatMagickString(component,MaxTextExtent,"%g",
+ (void) FormatLocaleString(component,MaxTextExtent,"%g",
(double) (QuantumScale*color));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
@@ -1087,19 +1087,19 @@
if ((pixel->colorspace == HSLColorspace) ||
(pixel->colorspace == HSBColorspace))
{
- (void) FormatMagickString(component,MaxTextExtent,"%g%%",
+ (void) FormatLocaleString(component,MaxTextExtent,"%g%%",
(double) (100.0*QuantumScale*color));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
if (pixel->depth > 8)
{
- (void) FormatMagickString(component,MaxTextExtent,"%g%%",
+ (void) FormatLocaleString(component,MaxTextExtent,"%g%%",
(double) (100.0*QuantumScale*color));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
- (void) FormatMagickString(component,MaxTextExtent,"%d",
+ (void) FormatLocaleString(component,MaxTextExtent,"%d",
ScaleQuantumToChar(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
}
@@ -1363,7 +1363,7 @@
}
if (pixel->depth > 32)
{
- (void) FormatMagickString(component,MaxTextExtent,"%08lX%08lX",
+ (void) FormatLocaleString(component,MaxTextExtent,"%08lX%08lX",
(unsigned long) ScaleQuantumToLong(ClampToQuantum(color)),
(unsigned long) ScaleQuantumToLong(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
@@ -1371,19 +1371,19 @@
}
if (pixel->depth > 16)
{
- (void) FormatMagickString(component,MaxTextExtent,"%08X",
+ (void) FormatLocaleString(component,MaxTextExtent,"%08X",
(unsigned int) ScaleQuantumToLong(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
if (pixel->depth > 8)
{
- (void) FormatMagickString(component,MaxTextExtent,"%04X",
+ (void) FormatLocaleString(component,MaxTextExtent,"%04X",
ScaleQuantumToShort(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
}
- (void) FormatMagickString(component,MaxTextExtent,"%02X",
+ (void) FormatLocaleString(component,MaxTextExtent,"%02X",
ScaleQuantumToChar(ClampToQuantum(color)));
(void) ConcatenateMagickString(tuple,component,MaxTextExtent);
return;
@@ -1983,23 +1983,23 @@
(LocaleCompare(path,color_info[i]->path) != 0))
{
if (color_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",color_info[i]->path);
- (void) fprintf(file,"Name Color "
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",color_info[i]->path);
+ (void) FormatLocaleFile(file,"Name Color "
" Compliance\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=color_info[i]->path;
- (void) fprintf(file,"%-21.21s ",color_info[i]->name);
+ (void) FormatLocaleFile(file,"%-21.21s ",color_info[i]->name);
GetColorTuple(&color_info[i]->color,MagickFalse,tuple);
- (void) fprintf(file,"%-45.45s ",tuple);
+ (void) FormatLocaleFile(file,"%-45.45s ",tuple);
if ((color_info[i]->compliance & SVGCompliance) != 0)
- (void) fprintf(file,"SVG ");
+ (void) FormatLocaleFile(file,"SVG ");
if ((color_info[i]->compliance & X11Compliance) != 0)
- (void) fprintf(file,"X11 ");
+ (void) FormatLocaleFile(file,"X11 ");
if ((color_info[i]->compliance & XPMCompliance) != 0)
- (void) fprintf(file,"XPM ");
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"XPM ");
+ (void) FormatLocaleFile(file,"\n");
}
color_info=(const ColorInfo **) RelinquishMagickMemory((void *) color_info);
(void) fflush(file);
diff --git a/magick/colorspace.c b/magick/colorspace.c
index 66c847f..891328c 100644
--- a/magick/colorspace.c
+++ b/magick/colorspace.c
@@ -622,20 +622,20 @@
gamma=DisplayGamma;
value=GetImageProperty(image,"gamma");
if (value != (const char *) NULL)
- gamma=1.0/StringToDouble(value,(char **) NULL) != 0.0 ?
- StringToDouble(value,(char **) NULL) : 1.0;
+ gamma=1.0/LocaleToDouble(value,(char **) NULL) != 0.0 ?
+ LocaleToDouble(value,(char **) NULL) : 1.0;
film_gamma=FilmGamma;
value=GetImageProperty(image,"film-gamma");
if (value != (const char *) NULL)
- film_gamma=StringToDouble(value,(char **) NULL);
+ film_gamma=LocaleToDouble(value,(char **) NULL);
reference_black=ReferenceBlack;
value=GetImageProperty(image,"reference-black");
if (value != (const char *) NULL)
- reference_black=StringToDouble(value,(char **) NULL);
+ reference_black=LocaleToDouble(value,(char **) NULL);
reference_white=ReferenceWhite;
value=GetImageProperty(image,"reference-white");
if (value != (const char *) NULL)
- reference_white=StringToDouble(value,(char **) NULL);
+ reference_white=LocaleToDouble(value,(char **) NULL);
logmap=(Quantum *) AcquireQuantumMemory((size_t) MaxMap+1UL,
sizeof(*logmap));
if (logmap == (Quantum *) NULL)
@@ -2076,20 +2076,20 @@
gamma=DisplayGamma;
value=GetImageProperty(image,"gamma");
if (value != (const char *) NULL)
- gamma=1.0/StringToDouble(value,(char **) NULL) != 0.0 ?
- StringToDouble(value,(char **) NULL) : 1.0;
+ gamma=1.0/LocaleToDouble(value,(char **) NULL) != 0.0 ?
+ LocaleToDouble(value,(char **) NULL) : 1.0;
film_gamma=FilmGamma;
value=GetImageProperty(image,"film-gamma");
if (value != (const char *) NULL)
- film_gamma=StringToDouble(value,(char **) NULL);
+ film_gamma=LocaleToDouble(value,(char **) NULL);
reference_black=ReferenceBlack;
value=GetImageProperty(image,"reference-black");
if (value != (const char *) NULL)
- reference_black=StringToDouble(value,(char **) NULL);
+ reference_black=LocaleToDouble(value,(char **) NULL);
reference_white=ReferenceWhite;
value=GetImageProperty(image,"reference-white");
if (value != (const char *) NULL)
- reference_white=StringToDouble(value,(char **) NULL);
+ reference_white=LocaleToDouble(value,(char **) NULL);
logmap=(Quantum *) AcquireQuantumMemory((size_t) MaxMap+1UL,
sizeof(*logmap));
if (logmap == (Quantum *) NULL)
diff --git a/magick/configure.c b/magick/configure.c
index cae5e08..460dce5 100644
--- a/magick/configure.c
+++ b/magick/configure.c
@@ -560,7 +560,7 @@
element=(const char *) GetNextValueInLinkedList(paths);
while (element != (const char *) NULL)
{
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",element,filename);
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",element,filename);
(void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
"Searching for configure file: \"%s\"",path);
xml=ConfigureFileToStringInfo(path);
@@ -690,7 +690,7 @@
key_value=NTRegistryKeyLookup(registry_key);
if (key_value != (unsigned char *) NULL)
{
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",(char *) key_value,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",(char *) key_value,
DirectorySeparator);
(void) AppendValueToLinkedList(paths,ConstantString(path));
key_value=(unsigned char *) RelinquishMagickMemory(key_value);
@@ -709,14 +709,14 @@
if (home != (char *) NULL)
{
#if !defined(MAGICKCORE_POSIX_SUPPORT)
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",home,
DirectorySeparator);
(void) AppendValueToLinkedList(paths,ConstantString(path));
#else
- (void) FormatMagickString(path,MaxTextExtent,"%s/etc/%s/",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/etc/%s/",home,
MAGICKCORE_CONFIGURE_RELATIVE_PATH);
(void) AppendValueToLinkedList(paths,ConstantString(path));
- (void) FormatMagickString(path,MaxTextExtent,"%s/share/%s/",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/share/%s/",home,
MAGICKCORE_SHARE_RELATIVE_PATH);
(void) AppendValueToLinkedList(paths,ConstantString(path));
#endif
@@ -726,7 +726,7 @@
if (*GetClientPath() != '\0')
{
#if !defined(MAGICKCORE_POSIX_SUPPORT)
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",GetClientPath(),
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",GetClientPath(),
DirectorySeparator);
(void) AppendValueToLinkedList(paths,ConstantString(path));
#else
@@ -738,10 +738,10 @@
*/
(void) CopyMagickString(prefix,GetClientPath(),MaxTextExtent);
ChopPathComponents(prefix,1);
- (void) FormatMagickString(path,MaxTextExtent,"%s/etc/%s/",prefix,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/etc/%s/",prefix,
MAGICKCORE_CONFIGURE_RELATIVE_PATH);
(void) AppendValueToLinkedList(paths,ConstantString(path));
- (void) FormatMagickString(path,MaxTextExtent,"%s/share/%s/",prefix,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/share/%s/",prefix,
MAGICKCORE_SHARE_RELATIVE_PATH);
(void) AppendValueToLinkedList(paths,ConstantString(path));
#endif
@@ -763,7 +763,7 @@
/*
Search $HOME/.magick.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s.magick%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s.magick%s",home,
DirectorySeparator,DirectorySeparator);
(void) AppendValueToLinkedList(paths,ConstantString(path));
home=DestroyString(home);
@@ -783,7 +783,7 @@
/*
Search module path.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",module_path,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",module_path,
DirectorySeparator);
element=(char *) RemoveElementByValueFromLinkedList(paths,path);
if (element != (char *) NULL)
@@ -795,10 +795,10 @@
/*
Search PerlMagick module path.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",module_path,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",module_path,
DirectorySeparator);
(void) AppendValueToLinkedList(paths,ConstantString(path));
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",module_path,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",module_path,
"\\inc\\lib\\auto\\Image\\Magick\\");
(void) AppendValueToLinkedList(paths,ConstantString(path));
}
@@ -936,24 +936,24 @@
(LocaleCompare(path,configure_info[i]->path) != 0))
{
if (configure_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",configure_info[i]->path);
- (void) fprintf(file,"Name Value\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",configure_info[i]->path);
+ (void) FormatLocaleFile(file,"Name Value\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=configure_info[i]->path;
name="unknown";
if (configure_info[i]->name != (char *) NULL)
name=configure_info[i]->name;
- (void) fprintf(file,"%s",name);
+ (void) FormatLocaleFile(file,"%s",name);
for (j=(ssize_t) strlen(name); j <= 12; j++)
- (void) fprintf(file," ");
- (void) fprintf(file," ");
+ (void) FormatLocaleFile(file," ");
+ (void) FormatLocaleFile(file," ");
value="unknown";
if (configure_info[i]->value != (char *) NULL)
value=configure_info[i]->value;
- (void) fprintf(file,"%s",value);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"%s",value);
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
configure_info=(const ConfigureInfo **)
diff --git a/magick/delegate.c b/magick/delegate.c
index 27cfb3c..6f8f606 100644
--- a/magick/delegate.c
+++ b/magick/delegate.c
@@ -953,7 +953,7 @@
if (LocaleCompare(magick,"NULL") != 0)
(void) CopyMagickString(image->magick,magick,MaxTextExtent);
magick=DestroyString(magick);
- (void) FormatMagickString(clone_info->filename,MaxTextExtent,"%s:",
+ (void) FormatLocaleString(clone_info->filename,MaxTextExtent,"%s:",
delegate_info->decode);
(void) SetImageInfo(clone_info,(unsigned int) GetImageListLength(image),
exception);
@@ -963,7 +963,7 @@
MaxTextExtent);
for (p=image; p != (Image *) NULL; p=GetNextImageInList(p))
{
- (void) FormatMagickString(p->filename,MaxTextExtent,"%s:%s",
+ (void) FormatLocaleString(p->filename,MaxTextExtent,"%s:%s",
delegate_info->decode,clone_info->filename);
status=WriteImage(clone_info,p);
if (status == MagickFalse)
@@ -1134,9 +1134,9 @@
(LocaleCompare(path,delegate_info[i]->path) != 0))
{
if (delegate_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",delegate_info[i]->path);
- (void) fprintf(file,"Delegate Command\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",delegate_info[i]->path);
+ (void) FormatLocaleFile(file,"Delegate Command\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=delegate_info[i]->path;
@@ -1148,15 +1148,15 @@
commands=StringToList(delegate_info[i]->commands);
if (commands == (char **) NULL)
continue;
- (void) fprintf(file,"%11s%c=%c%s ",delegate_info[i]->decode ?
+ (void) FormatLocaleFile(file,"%11s%c=%c%s ",delegate_info[i]->decode ?
delegate_info[i]->decode : "",delegate_info[i]->mode <= 0 ? '<' : ' ',
delegate_info[i]->mode >= 0 ? '>' : ' ',delegate);
StripString(commands[0]);
- (void) fprintf(file,"\"%s\"\n",commands[0]);
+ (void) FormatLocaleFile(file,"\"%s\"\n",commands[0]);
for (j=1; commands[j] != (char *) NULL; j++)
{
StripString(commands[j]);
- (void) fprintf(file," \"%s\"\n",commands[j]);
+ (void) FormatLocaleFile(file," \"%s\"\n",commands[j]);
}
for (j=0; commands[j] != (char *) NULL; j++)
commands[j]=DestroyString(commands[j]);
diff --git a/magick/deprecate.c b/magick/deprecate.c
index 7fe6c19..8db76df 100644
--- a/magick/deprecate.c
+++ b/magick/deprecate.c
@@ -1472,7 +1472,7 @@
% Deprecated, replace with:
%
% char key[MaxTextExtent];
-% FormatMagickString(key,MaxTextExtent,"%ld\n",id);
+% FormatLocaleString(key,MaxTextExtent,"%ld\n",id);
% DeleteImageRegistry(key);
%
% The format of the DeleteMagickRegistry method is:
@@ -1489,7 +1489,7 @@
char
key[MaxTextExtent];
- (void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
+ (void) FormatLocaleString(key,MaxTextExtent,"%.20g\n",(double) id);
return(DeleteImageRegistry(key));
}
@@ -2020,6 +2020,67 @@
% %
% %
% %
+% F o r m a t M a g i c k S t r i n g %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% FormatMagickString() prints formatted output of a variable argument list.
+%
+% The format of the FormatMagickString method is:
+%
+% ssize_t FormatMagickString(char *string,const size_t length,
+% const char *format,...)
+%
+% A description of each parameter follows.
+%
+% o string: FormatMagickString() returns the formatted string in this
+% character buffer.
+%
+% o length: the maximum length of the string.
+%
+% o format: A string describing the format to use to write the remaining
+% arguments.
+%
+*/
+
+MagickExport ssize_t FormatMagickStringList(char *string,const size_t length,
+ const char *format,va_list operands)
+{
+ int
+ n;
+
+#if defined(MAGICKCORE_HAVE_VSNPRINTF)
+ n=vsnprintf(string,length,format,operands);
+#else
+ n=vsprintf(string,format,operands);
+#endif
+ if (n < 0)
+ string[length-1]='\0';
+ return((ssize_t) n);
+}
+
+MagickExport ssize_t FormatMagickString(char *string,const size_t length,
+ const char *format,...)
+{
+ ssize_t
+ n;
+
+ va_list
+ operands;
+
+ va_start(operands,format);
+ n=(ssize_t) FormatMagickStringList(string,length,format,operands);
+ va_end(operands);
+ return(n);
+}
+
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% F o r m a t S t r i n g %
% %
% %
@@ -2064,7 +2125,7 @@
operands;
va_start(operands,format);
- (void) FormatMagickStringList(string,MaxTextExtent,format,operands);
+ (void) FormatLocaleStringList(string,MaxTextExtent,format,operands);
va_end(operands);
return;
}
@@ -2254,7 +2315,7 @@
/*
Search hard coded paths.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",
MAGICKCORE_LIBRARY_PATH,filename);
if (IsPathAccessible(path) != MagickFalse)
blob=FileToBlob(path,~0,length,exception);
@@ -2272,7 +2333,7 @@
key_value=NTRegistryKeyLookup("ConfigurePath");
if (key_value != (char *) NULL)
{
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",key_value,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",key_value,
DirectorySeparator,filename);
if (IsPathAccessible(path) != MagickFalse)
blob=FileToBlob(path,~0,length,exception);
@@ -2292,10 +2353,10 @@
Search MAGICK_HOME.
*/
#if !defined(MAGICKCORE_POSIX_SUPPORT)
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",home,
DirectorySeparator,filename);
#else
- (void) FormatMagickString(path,MaxTextExtent,"%s/lib/%s/%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/lib/%s/%s",home,
MAGICKCORE_LIBRARY_RELATIVE_PATH,filename);
#endif
if (IsPathAccessible(path) != MagickFalse)
@@ -2310,7 +2371,7 @@
/*
Search $HOME/.magick.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s.magick%s%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s.magick%s%s",home,
DirectorySeparator,DirectorySeparator,filename);
if ((IsPathAccessible(path) != MagickFalse) && (blob == (void *) NULL))
blob=FileToBlob(path,~0,length,exception);
@@ -2320,7 +2381,7 @@
if ((blob == (void *) NULL) && (*GetClientPath() != '\0'))
{
#if !defined(MAGICKCORE_POSIX_SUPPORT)
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",GetClientPath(),
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",GetClientPath(),
DirectorySeparator,filename);
#else
char
@@ -2332,7 +2393,7 @@
(void) CopyMagickString(prefix,GetClientPath(),
MaxTextExtent);
ChopPathComponents(prefix,1);
- (void) FormatMagickString(path,MaxTextExtent,"%s/lib/%s/%s",prefix,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/lib/%s/%s",prefix,
MAGICKCORE_LIBRARY_RELATIVE_PATH,filename);
#endif
if (IsPathAccessible(path) != MagickFalse)
@@ -2668,7 +2729,7 @@
*type=UndefinedRegistryType;
*length=0;
- (void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
+ (void) FormatLocaleString(key,MaxTextExtent,"%.20g\n",(double) id);
blob=(void *) GetImageRegistry(ImageRegistryType,key,exception);
if (blob != (void *) NULL)
return(blob);
@@ -6142,7 +6203,7 @@
static ssize_t
id = 0;
- (void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
+ (void) FormatLocaleString(key,MaxTextExtent,"%.20g\n",(double) id);
status=SetImageRegistry(type,key,blob,exception);
if (status == MagickFalse)
return(-1);
diff --git a/magick/deprecate.h b/magick/deprecate.h
index d8441eb..59a5339 100644
--- a/magick/deprecate.h
+++ b/magick/deprecate.h
@@ -154,6 +154,10 @@
magick_attribute((deprecated));
extern MagickExport ssize_t
+ FormatMagickString(char *,const size_t,const char *,...)
+ magick_attribute((format (printf,3,4))),
+ FormatMagickStringList(char *,const size_t,const char *,va_list)
+ magick_attribute((format (printf,3,0))),
GetImageListIndex(const Image *) magick_attribute((deprecated)),
SetMagickRegistry(const RegistryType,const void *,const size_t,
ExceptionInfo *) magick_attribute((deprecated));
diff --git a/magick/display.c b/magick/display.c
index ad31ba6..76fdb6c 100644
--- a/magick/display.c
+++ b/magick/display.c
@@ -1914,7 +1914,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
@@ -2105,14 +2105,14 @@
break;
if (entry != 8)
{
- degrees=StringToDouble(RotateMenu[entry],(char **) NULL);
+ degrees=LocaleToDouble(RotateMenu[entry],(char **) NULL);
break;
}
(void) XDialogWidget(display,windows,"OK","Enter rotation angle:",
angle);
if (*angle == '\0')
break;
- degrees=StringToDouble(angle,(char **) NULL);
+ degrees=LocaleToDouble(angle,(char **) NULL);
break;
}
case AnnotateHelpCommand:
@@ -2702,7 +2702,7 @@
width*(annotate_info->x+windows->image.x)/windows->image.ximage->width;
annotate_info->y=(int) height*(annotate_info->y-font_info->ascent+
windows->image.y)/windows->image.ximage->height;
- (void) FormatMagickString(annotate_info->geometry,MaxTextExtent,
+ (void) FormatLocaleString(annotate_info->geometry,MaxTextExtent,
"%ux%u%+d%+d",width*annotate_info->width/windows->image.ximage->width,
height*annotate_info->height/windows->image.ximage->height,
annotate_info->x+x,annotate_info->y+y);
@@ -2914,7 +2914,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
@@ -3086,7 +3086,7 @@
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) chop_info.width,(double)
chop_info.height,(double) chop_info.x,(double) chop_info.y);
XInfoWidget(display,windows,text);
@@ -3356,7 +3356,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
@@ -3981,7 +3981,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
(long) composite_info.x,(long) composite_info.y);
XInfoWidget(display,windows,text);
}
@@ -4042,7 +4042,7 @@
GXinvert);
if (*factor == '\0')
break;
- blend=StringToDouble(factor,(char **) NULL);
+ blend=LocaleToDouble(factor,(char **) NULL);
compose=DissolveCompositeOp;
break;
}
@@ -4420,10 +4420,10 @@
Notify window manager of the new configuration.
*/
if (resource_info->image_geometry != (char *) NULL)
- (void) FormatMagickString(geometry,MaxTextExtent,"%s>!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%s>!",
resource_info->image_geometry);
else
- (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
XDisplayWidth(display,windows->image.screen),
XDisplayHeight(display,windows->image.screen));
(void) ParseMetaGeometry(geometry,&x,&y,&width,&height);
@@ -4653,7 +4653,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
(long) crop_info.x,(long) crop_info.y);
XInfoWidget(display,windows,text);
}
@@ -4848,7 +4848,7 @@
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
XInfoWidget(display,windows,text);
@@ -4941,7 +4941,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
XInfoWidget(display,windows,text);
@@ -5227,7 +5227,7 @@
/*
Set primary selection.
*/
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
request=(&(event.xselectionrequest));
@@ -5498,7 +5498,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
@@ -5709,7 +5709,7 @@
if (stipple_image == (Image *) NULL)
break;
(void) AcquireUniqueFileResource(filename);
- (void) FormatMagickString(stipple_image->filename,MaxTextExtent,
+ (void) FormatLocaleString(stipple_image->filename,MaxTextExtent,
"xbm:%s",filename);
(void) WriteImage(image_info,stipple_image);
stipple_image=DestroyImage(stipple_image);
@@ -5903,7 +5903,7 @@
(void) XDrawLines(display,windows->image.id,
windows->image.highlight_context,coordinate_info,
number_coordinates,CoordModeOrigin);
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d",
coordinate_info[number_coordinates-1].x,
coordinate_info[number_coordinates-1].y);
XInfoWidget(display,windows,text);
@@ -5919,7 +5919,7 @@
*/
degrees=RadiansToDegrees(-atan2((double) (line_info.y2-
line_info.y1),(double) (line_info.x2-line_info.x1)));
- (void) FormatMagickString(text,MaxTextExtent," %g",
+ (void) FormatLocaleString(text,MaxTextExtent," %g",
(double) degrees);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
@@ -5939,7 +5939,7 @@
/*
Display info and draw drawing rectangle.
*/
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
(double) rectangle_info.height,(double) rectangle_info.x,
(double) rectangle_info.y);
@@ -5963,7 +5963,7 @@
/*
Display info and draw drawing rectangle.
*/
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
(double) rectangle_info.height,(double) rectangle_info.x,
(double) rectangle_info.y);
@@ -5991,7 +5991,7 @@
*/
degrees=RadiansToDegrees(-atan2((double) (line_info.y2-
line_info.y1),(double) (line_info.x2-line_info.x1)));
- (void) FormatMagickString(text,MaxTextExtent," %g",
+ (void) FormatLocaleString(text,MaxTextExtent," %g",
(double) degrees);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
@@ -6235,7 +6235,7 @@
draw_info.height=(unsigned int) rectangle_info.height+(line_width << 1);
if (draw_info.height > (unsigned int) (*image)->rows)
draw_info.height=(unsigned int) (*image)->rows;
- (void) FormatMagickString(draw_info.geometry,MaxTextExtent,"%ux%u%+d%+d",
+ (void) FormatLocaleString(draw_info.geometry,MaxTextExtent,"%ux%u%+d%+d",
width*draw_info.width/windows->image.ximage->width,
height*draw_info.height/windows->image.ximage->height,
draw_info.x+x,draw_info.y+y);
@@ -6428,7 +6428,7 @@
undo_image=GetPreviousImageInList(undo_image);
windows->image.window_changes.width=(int) cache_image->columns;
windows->image.window_changes.height=(int) cache_image->rows;
- (void) FormatMagickString(image_geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(image,windows->image.crop_geometry,image_geometry);
if (windows->image.crop_geometry != (char *) NULL)
@@ -7222,7 +7222,7 @@
/*
Create canvas.
*/
- (void) FormatMagickString(image_info->filename,MaxTextExtent,
+ (void) FormatLocaleString(image_info->filename,MaxTextExtent,
"%s:%s",format,color);
(void) CloneString(&image_info->size,geometry);
nexus=ReadImage(image_info,&(*image)->exception);
@@ -7343,7 +7343,7 @@
height=(size_t) windows->image.ximage->height;
x=0;
y=0;
- (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g+0+0",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g+0+0",
(double) width,(double) height);
status=XDialogWidget(display,windows,"Resize",
"Enter resize geometry (e.g. 640x480, 200%):",geometry);
@@ -7374,7 +7374,7 @@
/*
Crop and/or scale displayed image.
*/
- (void) FormatMagickString(image_geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(image,windows->image.crop_geometry,image_geometry);
if (windows->image.crop_geometry != (char *) NULL)
@@ -7466,7 +7466,7 @@
height=(unsigned int) (*image)->rows;
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,
&width,&height);
- (void) FormatMagickString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",width,height,(int) (*image)->columns-(int) width-x,y);
}
if (windows->image.orphan != MagickFalse)
@@ -7501,7 +7501,7 @@
height=(unsigned int) (*image)->rows;
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,
&width,&height);
- (void) FormatMagickString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",width,height,x,(int) (*image)->rows-(int) height-y);
}
if (windows->image.orphan != MagickFalse)
@@ -7645,7 +7645,7 @@
/*
Query user for the fuzz factor.
*/
- (void) FormatMagickString(fuzz,MaxTextExtent,"%g%%",100.0*
+ (void) FormatLocaleString(fuzz,MaxTextExtent,"%g%%",100.0*
(*image)->fuzz/(QuantumRange+1.0));
(void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz);
if (*fuzz == '\0')
@@ -8926,7 +8926,7 @@
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) AcquireUniqueFilename(filename);
- (void) FormatMagickString((*image)->filename,MaxTextExtent,"launch:%s",
+ (void) FormatLocaleString((*image)->filename,MaxTextExtent,"launch:%s",
filename);
status=WriteImage(image_info,*image);
if (status == MagickFalse)
@@ -9005,7 +9005,7 @@
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Preview");
(void) AcquireUniqueFilename(filename);
- (void) FormatMagickString((*image)->filename,MaxTextExtent,"preview:%s",
+ (void) FormatLocaleString((*image)->filename,MaxTextExtent,"preview:%s",
filename);
status=WriteImage(image_info,*image);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
@@ -9013,7 +9013,7 @@
(void) RelinquishUniqueFileResource(filename);
if (preview_image == (Image *) NULL)
break;
- (void) FormatMagickString(preview_image->filename,MaxTextExtent,"show:%s",
+ (void) FormatLocaleString(preview_image->filename,MaxTextExtent,"show:%s",
filename);
status=WriteImage(image_info,preview_image);
preview_image=DestroyImage(preview_image);
@@ -9038,7 +9038,7 @@
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Histogram");
(void) AcquireUniqueFilename(filename);
- (void) FormatMagickString((*image)->filename,MaxTextExtent,"histogram:%s",
+ (void) FormatLocaleString((*image)->filename,MaxTextExtent,"histogram:%s",
filename);
status=WriteImage(image_info,*image);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
@@ -9046,7 +9046,7 @@
(void) RelinquishUniqueFileResource(filename);
if (histogram_image == (Image *) NULL)
break;
- (void) FormatMagickString(histogram_image->filename,MaxTextExtent,
+ (void) FormatLocaleString(histogram_image->filename,MaxTextExtent,
"show:%s",filename);
status=WriteImage(image_info,histogram_image);
histogram_image=DestroyImage(histogram_image);
@@ -9077,7 +9077,7 @@
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Matte");
(void) AcquireUniqueFilename(filename);
- (void) FormatMagickString((*image)->filename,MaxTextExtent,"matte:%s",
+ (void) FormatLocaleString((*image)->filename,MaxTextExtent,"matte:%s",
filename);
status=WriteImage(image_info,*image);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
@@ -9085,7 +9085,7 @@
(void) RelinquishUniqueFileResource(filename);
if (matte_image == (Image *) NULL)
break;
- (void) FormatMagickString(matte_image->filename,MaxTextExtent,"show:%s",
+ (void) FormatLocaleString(matte_image->filename,MaxTextExtent,"show:%s",
filename);
status=WriteImage(image_info,matte_image);
matte_image=DestroyImage(matte_image);
@@ -9175,7 +9175,7 @@
Display documentation using Netscape remote control.
*/
url=GetMagickHomeURL();
- (void) FormatMagickString(command,MaxTextExtent,
+ (void) FormatLocaleString(command,MaxTextExtent,
"openurl(%s,new-tab)",url);
url=DestroyString(url);
mozilla_atom=XInternAtom(display,"_MOZILLA_COMMAND",MagickFalse);
@@ -9283,7 +9283,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
windows->magnify.x,windows->magnify.y);
XInfoWidget(display,windows,text);
}
@@ -9642,7 +9642,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
@@ -9786,14 +9786,14 @@
break;
if (entry != 2)
{
- (void) FormatMagickString(matte,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(matte,MaxTextExtent,QuantumFormat,
OpaqueOpacity);
if (LocaleCompare(MatteMenu[entry],"Transparent") == 0)
- (void) FormatMagickString(matte,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(matte,MaxTextExtent,QuantumFormat,
(Quantum) TransparentOpacity);
break;
}
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"Enter matte value (0 - " QuantumFormat "):",(Quantum)
QuantumRange);
(void) XDialogWidget(display,windows,"Matte",message,matte);
@@ -10055,7 +10055,7 @@
}
draw_info=CloneDrawInfo(resource_info->image_info,
(DrawInfo *) NULL);
- draw_info->fill.opacity=ClampToQuantum(StringToDouble(matte,
+ draw_info->fill.opacity=ClampToQuantum(LocaleToDouble(matte,
(char **) NULL));
(void) FloodfillPaintImage(*image,OpacityChannel,draw_info,&target,
(ssize_t) x_offset,(ssize_t) y_offset,
@@ -10268,7 +10268,7 @@
register int
i;
- (void) FormatMagickString(title,MaxTextExtent,
+ (void) FormatLocaleString(title,MaxTextExtent,
"Unknown format: %s",filename);
XTextViewWidget(display,resource_info,windows,MagickTrue,title,
(const char **) textlist);
@@ -10424,7 +10424,7 @@
*/
windows->image.x=(int) pan_info.x;
windows->image.y=(int) pan_info.y;
- (void) FormatMagickString(text,MaxTextExtent," %ux%u%+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %ux%u%+d%+d ",
windows->image.width,windows->image.height,windows->image.x,
windows->image.y);
XInfoWidget(display,windows,text);
@@ -10573,7 +10573,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
(long) paste_info.x,(long) paste_info.y);
XInfoWidget(display,windows,text);
}
@@ -10867,7 +10867,7 @@
Request Postscript page geometry from user.
*/
image_info=CloneImageInfo(resource_info->image_info);
- (void) FormatMagickString(geometry,MaxTextExtent,"Letter");
+ (void) FormatLocaleString(geometry,MaxTextExtent,"Letter");
if (image_info->page != (char *) NULL)
(void) CopyMagickString(geometry,image_info->page,MaxTextExtent);
XListBrowserWidget(display,windows,&windows->widget,PageSizes,"Select",
@@ -10883,14 +10883,14 @@
print_image=CloneImage(image,0,0,MagickTrue,&image->exception);
if (print_image == (Image *) NULL)
return(MagickFalse);
- (void) FormatMagickString(geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(&print_image,windows->image.crop_geometry,geometry);
/*
Print image.
*/
(void) AcquireUniqueFilename(filename);
- (void) FormatMagickString(print_image->filename,MaxTextExtent,"print:%s",
+ (void) FormatLocaleString(print_image->filename,MaxTextExtent,"print:%s",
filename);
status=WriteImage(image_info,print_image);
(void) RelinquishUniqueFileResource(filename);
@@ -11209,7 +11209,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
(long) roi_info.x,(long) roi_info.y);
XInfoWidget(display,windows,text);
}
@@ -11367,7 +11367,7 @@
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
roi_info.height,(double) roi_info.x,(double) roi_info.y);
XInfoWidget(display,windows,text);
@@ -11463,7 +11463,7 @@
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
roi_info.height,(double) roi_info.x,(double) roi_info.y);
XInfoWidget(display,windows,text);
@@ -11804,7 +11804,7 @@
/*
Set primary selection.
*/
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
roi_info.height,(double) roi_info.x,(double) roi_info.y);
request=(&(event.xselectionrequest));
@@ -12177,7 +12177,7 @@
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent," %g",
+ (void) FormatLocaleString(text,MaxTextExtent," %g",
direction == VerticalRotateCommand ? degrees-90.0 : degrees);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
@@ -12293,7 +12293,7 @@
/*
Rotate 90 degrees.
*/
- (void) FormatMagickString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",height,width,(int) (*image)->columns-
(int) height-y,x);
break;
@@ -12303,7 +12303,7 @@
/*
Rotate 180 degrees.
*/
- (void) FormatMagickString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",width,height,(int) width-x,(int) height-y);
break;
}
@@ -12312,7 +12312,7 @@
/*
Rotate 270 degrees.
*/
- (void) FormatMagickString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",height,width,y,(int) (*image)->rows-(int) width-x);
break;
}
@@ -12449,7 +12449,7 @@
/*
Request JPEG quality from user.
*/
- (void) FormatMagickString(quality,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(quality,MaxTextExtent,"%.20g",(double)
image->quality);
status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
quality);
@@ -12487,7 +12487,7 @@
save_image=CloneImage(image,0,0,MagickTrue,&image->exception);
if (save_image == (Image *) NULL)
return(MagickFalse);
- (void) FormatMagickString(geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(&save_image,windows->image.crop_geometry,geometry);
/*
@@ -12826,7 +12826,7 @@
/*
Display info on cropping rectangle.
*/
- (void) FormatMagickString(text,MaxTextExtent," %.20gx%.20g%+.20g%+.20g",
+ (void) FormatLocaleString(text,MaxTextExtent," %.20gx%.20g%+.20g%+.20g",
(double) crop_info->width,(double) crop_info->height,(double)
crop_info->x,(double) crop_info->y);
XInfoWidget(display,windows,text);
@@ -12857,7 +12857,7 @@
height=(unsigned int) (scale_factor*crop_info->height+0.5);
if (height == 0)
height=1;
- (void) FormatMagickString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",width,height,x,y);
}
@@ -13255,7 +13255,7 @@
/*
Refresh Image window.
*/
- (void) FormatMagickString(text,MaxTextExtent," %ux%u%+d%+d ",
+ (void) FormatLocaleString(text,MaxTextExtent," %ux%u%+d%+d ",
windows->image.width,windows->image.height,windows->image.x,
windows->image.y);
XInfoWidget(display,windows,text);
@@ -13511,7 +13511,7 @@
*/
background_resources=(*resource_info);
background_resources.window_id=AcquireString("");
- (void) FormatMagickString(background_resources.window_id,MaxTextExtent,
+ (void) FormatLocaleString(background_resources.window_id,MaxTextExtent,
"0x%lx",windows->image.id);
background_resources.backdrop=MagickTrue;
/*
@@ -13702,7 +13702,7 @@
(void) CopyMagickString(visual_type,"default",MaxTextExtent);
status=XGetWindowAttributes(display,window_info.id,&window_attributes);
if (status != 0)
- (void) FormatMagickString(visual_type,MaxTextExtent,"0x%lx",
+ (void) FormatLocaleString(visual_type,MaxTextExtent,"0x%lx",
XVisualIDFromVisual(window_attributes.visual));
if (visual_info == (XVisualInfo *) NULL)
{
@@ -13768,7 +13768,7 @@
(image->rows != window_info.height))
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
image->filename);
- (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>",
window_attributes.width,window_attributes.height);
geometry_info.width=window_info.width;
geometry_info.height=window_info.height;
@@ -13835,7 +13835,7 @@
ThrowXWindowFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",image->filename);
size_hints->flags=0L;
- (void) FormatMagickString(default_geometry,MaxTextExtent,"%dx%d",
+ (void) FormatLocaleString(default_geometry,MaxTextExtent,"%dx%d",
width,height);
flags=XWMGeometry(display,visual_info->screen,resources.image_geometry,
default_geometry,window_info.border_width,size_hints,&window_info.x,
@@ -14560,10 +14560,10 @@
*/
GetPathComponent(display_image->magick_filename,TailPath,filename);
if (GetImageListLength(display_image) == 1)
- (void) FormatMagickString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s",MagickPackageName,filename);
else
- (void) FormatMagickString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s[scene: %.20g frames: %.20g]",MagickPackageName,filename,
(double) display_image->scene,(double) GetImageListLength(
display_image));
@@ -14573,7 +14573,7 @@
windows->image.immutable=MagickTrue;
windows->image.use_pixmap=resource_info->use_pixmap;
windows->image.geometry=resource_info->image_geometry;
- (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
XDisplayWidth(display,visual_info->screen),
XDisplayHeight(display,visual_info->screen));
geometry_info.width=display_image->columns;
@@ -14700,7 +14700,7 @@
resource_info,&windows->command);
windows->command.data=MagickMenus;
(void) XCommandWidget(display,windows,CommandMenu,(XEvent *) NULL);
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.command",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.command",
resource_info->client_name);
windows->command.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
@@ -14732,7 +14732,7 @@
*/
XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
resource_info,&windows->widget);
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.widget",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.widget",
resource_info->client_name);
windows->widget.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
@@ -14787,11 +14787,11 @@
resource_info,&windows->magnify);
if (resource_info->use_shared_memory == MagickFalse)
windows->magnify.shared_memory=MagickFalse;
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.magnify",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.magnify",
resource_info->client_name);
windows->magnify.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
- (void) FormatMagickString(windows->magnify.name,MaxTextExtent,"Magnify %uX",
+ (void) FormatLocaleString(windows->magnify.name,MaxTextExtent,"Magnify %uX",
resource_info->magnify);
if (windows->magnify.cursor != (Cursor) NULL)
(void) XFreeCursor(display,windows->magnify.cursor);
@@ -14831,7 +14831,7 @@
(void) CloneString(&windows->pan.name,"Pan Icon");
windows->pan.width=windows->icon.width;
windows->pan.height=windows->icon.height;
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.pan",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.pan",
resource_info->client_name);
windows->pan.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
@@ -14945,7 +14945,7 @@
/*
Redisplay image.
*/
- (void) FormatMagickString(
+ (void) FormatLocaleString(
resource_info->image_info->filename,MaxTextExtent,
"%s:%s",display_image->magick,
display_image->filename);
diff --git a/magick/distort.c b/magick/distort.c
index 6cbb353..bd59287 100644
--- a/magick/distort.c
+++ b/magick/distort.c
@@ -1826,7 +1826,7 @@
/* Set destination image size and virtual offset */
if ( bestfit || viewport_given ) {
- (void) FormatMagickString(image_gen, MaxTextExtent," -size %.20gx%.20g "
+ (void) FormatLocaleString(image_gen, MaxTextExtent," -size %.20gx%.20g "
"-page %+.20g%+.20g xc: +insert \\\n",(double) geometry.width,
(double) geometry.height,(double) geometry.x,(double) geometry.y);
lookup="v.p{ xx-v.page.x-.5, yy-v.page.x-.5 }";
@@ -1851,21 +1851,21 @@
}
InvertAffineCoefficients(coeff, inverse);
CoefficientsToAffineArgs(inverse);
- fprintf(stderr, "Affine Projection:\n");
- fprintf(stderr, " -distort AffineProjection \\\n '");
+ FormatLocaleFile(stderr, "Affine Projection:\n");
+ FormatLocaleFile(stderr, " -distort AffineProjection \\\n '");
for (i=0; i<5; i++)
- fprintf(stderr, "%lf,", inverse[i]);
- fprintf(stderr, "%lf'\n", inverse[5]);
+ FormatLocaleFile(stderr, "%lf,", inverse[i]);
+ FormatLocaleFile(stderr, "%lf'\n", inverse[5]);
inverse = (double *) RelinquishMagickMemory(inverse);
- fprintf(stderr, "Affine Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
- fprintf(stderr, " xx=%+lf*ii %+lf*jj %+lf;\n",
+ FormatLocaleFile(stderr, "Affine Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
+ FormatLocaleFile(stderr, " xx=%+lf*ii %+lf*jj %+lf;\n",
coeff[0], coeff[1], coeff[2]);
- fprintf(stderr, " yy=%+lf*ii %+lf*jj %+lf;\n",
+ FormatLocaleFile(stderr, " yy=%+lf*ii %+lf*jj %+lf;\n",
coeff[3], coeff[4], coeff[5]);
- fprintf(stderr, " %s'\n", lookup);
+ FormatLocaleFile(stderr, " %s'\n", lookup);
break;
}
@@ -1883,155 +1883,155 @@
return((Image *) NULL);
}
InvertPerspectiveCoefficients(coeff, inverse);
- fprintf(stderr, "Perspective Projection:\n");
- fprintf(stderr, " -distort PerspectiveProjection \\\n '");
+ FormatLocaleFile(stderr, "Perspective Projection:\n");
+ FormatLocaleFile(stderr, " -distort PerspectiveProjection \\\n '");
for (i=0; i<4; i++)
- fprintf(stderr, "%lf, ", inverse[i]);
- fprintf(stderr, "\n ");
+ FormatLocaleFile(stderr, "%lf, ", inverse[i]);
+ FormatLocaleFile(stderr, "\n ");
for (; i<7; i++)
- fprintf(stderr, "%lf, ", inverse[i]);
- fprintf(stderr, "%lf'\n", inverse[7]);
+ FormatLocaleFile(stderr, "%lf, ", inverse[i]);
+ FormatLocaleFile(stderr, "%lf'\n", inverse[7]);
inverse = (double *) RelinquishMagickMemory(inverse);
- fprintf(stderr, "Perspective Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
- fprintf(stderr, " rr=%+lf*ii %+lf*jj + 1;\n",
+ FormatLocaleFile(stderr, "Perspective Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
+ FormatLocaleFile(stderr, " rr=%+lf*ii %+lf*jj + 1;\n",
coeff[6], coeff[7]);
- fprintf(stderr, " xx=(%+lf*ii %+lf*jj %+lf)/rr;\n",
+ FormatLocaleFile(stderr, " xx=(%+lf*ii %+lf*jj %+lf)/rr;\n",
coeff[0], coeff[1], coeff[2]);
- fprintf(stderr, " yy=(%+lf*ii %+lf*jj %+lf)/rr;\n",
+ FormatLocaleFile(stderr, " yy=(%+lf*ii %+lf*jj %+lf)/rr;\n",
coeff[3], coeff[4], coeff[5]);
- fprintf(stderr, " rr%s0 ? %s : blue'\n",
+ FormatLocaleFile(stderr, " rr%s0 ? %s : blue'\n",
coeff[8] < 0 ? "<" : ">", lookup);
break;
}
case BilinearForwardDistortion:
- fprintf(stderr, "BilinearForward Mapping Equations:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " i = %+lf*x %+lf*y %+lf*x*y %+lf;\n",
+ FormatLocaleFile(stderr, "BilinearForward Mapping Equations:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " i = %+lf*x %+lf*y %+lf*x*y %+lf;\n",
coeff[0], coeff[1], coeff[2], coeff[3]);
- fprintf(stderr, " j = %+lf*x %+lf*y %+lf*x*y %+lf;\n",
+ FormatLocaleFile(stderr, " j = %+lf*x %+lf*y %+lf*x*y %+lf;\n",
coeff[4], coeff[5], coeff[6], coeff[7]);
#if 0
/* for debugging */
- fprintf(stderr, " c8 = %+lf c9 = 2*a = %+lf;\n",
+ FormatLocaleFile(stderr, " c8 = %+lf c9 = 2*a = %+lf;\n",
coeff[8], coeff[9]);
#endif
- fprintf(stderr, "BilinearForward Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x%+lf; jj=j+page.y%+lf;\n",
+ FormatLocaleFile(stderr, "BilinearForward Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x%+lf; jj=j+page.y%+lf;\n",
0.5-coeff[3], 0.5-coeff[7]);
- fprintf(stderr, " bb=%lf*ii %+lf*jj %+lf;\n",
+ FormatLocaleFile(stderr, " bb=%lf*ii %+lf*jj %+lf;\n",
coeff[6], -coeff[2], coeff[8]);
/* Handle Special degenerate (non-quadratic) or trapezoidal case */
if ( coeff[9] != 0 ) {
- fprintf(stderr, " rt=bb*bb %+lf*(%lf*ii%+lf*jj);\n",
+ FormatLocaleFile(stderr, " rt=bb*bb %+lf*(%lf*ii%+lf*jj);\n",
-2*coeff[9], coeff[4], -coeff[0]);
- fprintf(stderr, " yy=( -bb + sqrt(rt) ) / %lf;\n",
+ FormatLocaleFile(stderr, " yy=( -bb + sqrt(rt) ) / %lf;\n",
coeff[9]);
} else
- fprintf(stderr, " yy=(%lf*ii%+lf*jj)/bb;\n",
+ FormatLocaleFile(stderr, " yy=(%lf*ii%+lf*jj)/bb;\n",
-coeff[4], coeff[0]);
- fprintf(stderr, " xx=(ii %+lf*yy)/(%lf %+lf*yy);\n",
+ FormatLocaleFile(stderr, " xx=(ii %+lf*yy)/(%lf %+lf*yy);\n",
-coeff[1], coeff[0], coeff[2]);
if ( coeff[9] != 0 )
- fprintf(stderr, " (rt < 0 ) ? red : %s'\n", lookup);
+ FormatLocaleFile(stderr, " (rt < 0 ) ? red : %s'\n", lookup);
else
- fprintf(stderr, " %s'\n", lookup);
+ FormatLocaleFile(stderr, " %s'\n", lookup);
break;
case BilinearReverseDistortion:
#if 0
- fprintf(stderr, "Polynomial Projection Distort:\n");
- fprintf(stderr, " -distort PolynomialProjection \\\n");
- fprintf(stderr, " '1.5, %lf, %lf, %lf, %lf,\n",
+ FormatLocaleFile(stderr, "Polynomial Projection Distort:\n");
+ FormatLocaleFile(stderr, " -distort PolynomialProjection \\\n");
+ FormatLocaleFile(stderr, " '1.5, %lf, %lf, %lf, %lf,\n",
coeff[3], coeff[0], coeff[1], coeff[2]);
- fprintf(stderr, " %lf, %lf, %lf, %lf'\n",
+ FormatLocaleFile(stderr, " %lf, %lf, %lf, %lf'\n",
coeff[7], coeff[4], coeff[5], coeff[6]);
#endif
- fprintf(stderr, "BilinearReverse Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
- fprintf(stderr, " xx=%+lf*ii %+lf*jj %+lf*ii*jj %+lf;\n",
+ FormatLocaleFile(stderr, "BilinearReverse Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
+ FormatLocaleFile(stderr, " xx=%+lf*ii %+lf*jj %+lf*ii*jj %+lf;\n",
coeff[0], coeff[1], coeff[2], coeff[3]);
- fprintf(stderr, " yy=%+lf*ii %+lf*jj %+lf*ii*jj %+lf;\n",
+ FormatLocaleFile(stderr, " yy=%+lf*ii %+lf*jj %+lf*ii*jj %+lf;\n",
coeff[4], coeff[5], coeff[6], coeff[7]);
- fprintf(stderr, " %s'\n", lookup);
+ FormatLocaleFile(stderr, " %s'\n", lookup);
break;
case PolynomialDistortion:
{
size_t nterms = (size_t) coeff[1];
- fprintf(stderr, "Polynomial (order %lg, terms %lu), FX Equivelent\n",
+ FormatLocaleFile(stderr, "Polynomial (order %lg, terms %lu), FX Equivelent\n",
coeff[0],(unsigned long) nterms);
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
- fprintf(stderr, " xx =");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;\n");
+ FormatLocaleFile(stderr, " xx =");
for (i=0; i<(ssize_t) nterms; i++) {
- if ( i != 0 && i%4 == 0 ) fprintf(stderr, "\n ");
- fprintf(stderr, " %+lf%s", coeff[2+i],
+ if ( i != 0 && i%4 == 0 ) FormatLocaleFile(stderr, "\n ");
+ FormatLocaleFile(stderr, " %+lf%s", coeff[2+i],
poly_basis_str(i));
}
- fprintf(stderr, ";\n yy =");
+ FormatLocaleFile(stderr, ";\n yy =");
for (i=0; i<(ssize_t) nterms; i++) {
- if ( i != 0 && i%4 == 0 ) fprintf(stderr, "\n ");
- fprintf(stderr, " %+lf%s", coeff[2+i+nterms],
+ if ( i != 0 && i%4 == 0 ) FormatLocaleFile(stderr, "\n ");
+ FormatLocaleFile(stderr, " %+lf%s", coeff[2+i+nterms],
poly_basis_str(i));
}
- fprintf(stderr, ";\n %s'\n", lookup);
+ FormatLocaleFile(stderr, ";\n %s'\n", lookup);
break;
}
case ArcDistortion:
{
- fprintf(stderr, "Arc Distort, Internal Coefficients:\n");
+ FormatLocaleFile(stderr, "Arc Distort, Internal Coefficients:\n");
for ( i=0; i<5; i++ )
- fprintf(stderr, " c%.20g = %+lf\n", (double) i, coeff[i]);
- fprintf(stderr, "Arc Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x; jj=j+page.y;\n");
- fprintf(stderr, " xx=(atan2(jj,ii)%+lf)/(2*pi);\n",
+ FormatLocaleFile(stderr, " c%.20g = %+lf\n", (double) i, coeff[i]);
+ FormatLocaleFile(stderr, "Arc Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x; jj=j+page.y;\n");
+ FormatLocaleFile(stderr, " xx=(atan2(jj,ii)%+lf)/(2*pi);\n",
-coeff[0]);
- fprintf(stderr, " xx=xx-round(xx);\n");
- fprintf(stderr, " xx=xx*%lf %+lf;\n",
+ FormatLocaleFile(stderr, " xx=xx-round(xx);\n");
+ FormatLocaleFile(stderr, " xx=xx*%lf %+lf;\n",
coeff[1], coeff[4]);
- fprintf(stderr, " yy=(%lf - hypot(ii,jj)) * %lf;\n",
+ FormatLocaleFile(stderr, " yy=(%lf - hypot(ii,jj)) * %lf;\n",
coeff[2], coeff[3]);
- fprintf(stderr, " v.p{xx-.5,yy-.5}'\n");
+ FormatLocaleFile(stderr, " v.p{xx-.5,yy-.5}'\n");
break;
}
case PolarDistortion:
{
- fprintf(stderr, "Polar Distort, Internal Coefficents\n");
+ FormatLocaleFile(stderr, "Polar Distort, Internal Coefficents\n");
for ( i=0; i<8; i++ )
- fprintf(stderr, " c%.20g = %+lf\n", (double) i, coeff[i]);
- fprintf(stderr, "Polar Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'ii=i+page.x%+lf; jj=j+page.y%+lf;\n",
+ FormatLocaleFile(stderr, " c%.20g = %+lf\n", (double) i, coeff[i]);
+ FormatLocaleFile(stderr, "Polar Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'ii=i+page.x%+lf; jj=j+page.y%+lf;\n",
-coeff[2], -coeff[3]);
- fprintf(stderr, " xx=(atan2(ii,jj)%+lf)/(2*pi);\n",
+ FormatLocaleFile(stderr, " xx=(atan2(ii,jj)%+lf)/(2*pi);\n",
-(coeff[4]+coeff[5])/2 );
- fprintf(stderr, " xx=xx-round(xx);\n");
- fprintf(stderr, " xx=xx*2*pi*%lf + v.w/2;\n",
+ FormatLocaleFile(stderr, " xx=xx-round(xx);\n");
+ FormatLocaleFile(stderr, " xx=xx*2*pi*%lf + v.w/2;\n",
coeff[6] );
- fprintf(stderr, " yy=(hypot(ii,jj)%+lf)*%lf;\n",
+ FormatLocaleFile(stderr, " yy=(hypot(ii,jj)%+lf)*%lf;\n",
-coeff[1], coeff[7] );
- fprintf(stderr, " v.p{xx-.5,yy-.5}'\n");
+ FormatLocaleFile(stderr, " v.p{xx-.5,yy-.5}'\n");
break;
}
case DePolarDistortion:
{
- fprintf(stderr, "DePolar Distort, Internal Coefficents\n");
+ FormatLocaleFile(stderr, "DePolar Distort, Internal Coefficents\n");
for ( i=0; i<8; i++ )
- fprintf(stderr, " c%.20g = %+lf\n", (double) i, coeff[i]);
- fprintf(stderr, "DePolar Distort, FX Equivelent:\n");
- fprintf(stderr, "%s", image_gen);
- fprintf(stderr, " -fx 'aa=(i+.5)*%lf %+lf;\n", coeff[6], -coeff[4] );
- fprintf(stderr, " rr=(j+.5)*%lf %+lf;\n", coeff[7], +coeff[1] );
- fprintf(stderr, " xx=rr*sin(aa) %+lf;\n", coeff[2] );
- fprintf(stderr, " yy=rr*cos(aa) %+lf;\n", coeff[3] );
- fprintf(stderr, " v.p{xx-.5,yy-.5}'\n");
+ FormatLocaleFile(stderr, " c%.20g = %+lf\n", (double) i, coeff[i]);
+ FormatLocaleFile(stderr, "DePolar Distort, FX Equivelent:\n");
+ FormatLocaleFile(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, " -fx 'aa=(i+.5)*%lf %+lf;\n", coeff[6], -coeff[4] );
+ FormatLocaleFile(stderr, " rr=(j+.5)*%lf %+lf;\n", coeff[7], +coeff[1] );
+ FormatLocaleFile(stderr, " xx=rr*sin(aa) %+lf;\n", coeff[2] );
+ FormatLocaleFile(stderr, " yy=rr*cos(aa) %+lf;\n", coeff[3] );
+ FormatLocaleFile(stderr, " v.p{xx-.5,yy-.5}'\n");
break;
}
case BarrelDistortion:
@@ -2043,23 +2043,23 @@
*/
xc = ((double)image->columns-1.0)/2.0 + image->page.x;
yc = ((double)image->rows-1.0)/2.0 + image->page.y;
- fprintf(stderr, "Barrel%s Distort, FX Equivelent:\n",
+ FormatLocaleFile(stderr, "Barrel%s Distort, FX Equivelent:\n",
method == BarrelDistortion ? "" : "Inv");
- fprintf(stderr, "%s", image_gen);
+ FormatLocaleFile(stderr, "%s", image_gen);
if ( fabs(coeff[8]-xc-0.5) < 0.1 && fabs(coeff[9]-yc-0.5) < 0.1 )
- fprintf(stderr, " -fx 'xc=(w-1)/2; yc=(h-1)/2;\n");
+ FormatLocaleFile(stderr, " -fx 'xc=(w-1)/2; yc=(h-1)/2;\n");
else
- fprintf(stderr, " -fx 'xc=%lf; yc=%lf;\n",
+ FormatLocaleFile(stderr, " -fx 'xc=%lf; yc=%lf;\n",
coeff[8]-0.5, coeff[9]-0.5);
- fprintf(stderr,
+ FormatLocaleFile(stderr,
" ii=i-xc; jj=j-yc; rr=hypot(ii,jj);\n");
- fprintf(stderr, " ii=ii%s(%lf*rr*rr*rr %+lf*rr*rr %+lf*rr %+lf);\n",
+ FormatLocaleFile(stderr, " ii=ii%s(%lf*rr*rr*rr %+lf*rr*rr %+lf*rr %+lf);\n",
method == BarrelDistortion ? "*" : "/",
coeff[0],coeff[1],coeff[2],coeff[3]);
- fprintf(stderr, " jj=jj%s(%lf*rr*rr*rr %+lf*rr*rr %+lf*rr %+lf);\n",
+ FormatLocaleFile(stderr, " jj=jj%s(%lf*rr*rr*rr %+lf*rr*rr %+lf*rr %+lf);\n",
method == BarrelDistortion ? "*" : "/",
coeff[4],coeff[5],coeff[6],coeff[7]);
- fprintf(stderr, " v.p{fx*ii+xc,fy*jj+yc}'\n");
+ FormatLocaleFile(stderr, " v.p{fx*ii+xc,fy*jj+yc}'\n");
}
default:
break;
@@ -2075,7 +2075,7 @@
artifact=GetImageArtifact(image,"distort:scale");
output_scaling = 1.0;
if (artifact != (const char *) NULL) {
- output_scaling = fabs(StringToDouble(artifact,(char **) NULL));
+ output_scaling = fabs(LocaleToDouble(artifact,(char **) NULL));
geometry.width *= output_scaling;
geometry.height *= output_scaling;
geometry.x *= output_scaling;
@@ -2642,46 +2642,46 @@
case BarycentricColorInterpolate:
{
register ssize_t x=0;
- fprintf(stderr, "Barycentric Sparse Color:\n");
+ FormatLocaleFile(stderr, "Barycentric Sparse Color:\n");
if ( channel & RedChannel )
- fprintf(stderr, " -channel R -fx '%+lf*i %+lf*j %+lf' \\\n",
+ FormatLocaleFile(stderr, " -channel R -fx '%+lf*i %+lf*j %+lf' \\\n",
coeff[x], coeff[x+1], coeff[x+2]),x+=3;
if ( channel & GreenChannel )
- fprintf(stderr, " -channel G -fx '%+lf*i %+lf*j %+lf' \\\n",
+ FormatLocaleFile(stderr, " -channel G -fx '%+lf*i %+lf*j %+lf' \\\n",
coeff[x], coeff[x+1], coeff[x+2]),x+=3;
if ( channel & BlueChannel )
- fprintf(stderr, " -channel B -fx '%+lf*i %+lf*j %+lf' \\\n",
+ FormatLocaleFile(stderr, " -channel B -fx '%+lf*i %+lf*j %+lf' \\\n",
coeff[x], coeff[x+1], coeff[x+2]),x+=3;
if ( channel & IndexChannel )
- fprintf(stderr, " -channel K -fx '%+lf*i %+lf*j %+lf' \\\n",
+ FormatLocaleFile(stderr, " -channel K -fx '%+lf*i %+lf*j %+lf' \\\n",
coeff[x], coeff[x+1], coeff[x+2]),x+=3;
if ( channel & OpacityChannel )
- fprintf(stderr, " -channel A -fx '%+lf*i %+lf*j %+lf' \\\n",
+ FormatLocaleFile(stderr, " -channel A -fx '%+lf*i %+lf*j %+lf' \\\n",
coeff[x], coeff[x+1], coeff[x+2]),x+=3;
break;
}
case BilinearColorInterpolate:
{
register ssize_t x=0;
- fprintf(stderr, "Bilinear Sparse Color\n");
+ FormatLocaleFile(stderr, "Bilinear Sparse Color\n");
if ( channel & RedChannel )
- fprintf(stderr, " -channel R -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
+ FormatLocaleFile(stderr, " -channel R -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
coeff[ x ], coeff[x+1],
coeff[x+2], coeff[x+3]),x+=4;
if ( channel & GreenChannel )
- fprintf(stderr, " -channel G -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
+ FormatLocaleFile(stderr, " -channel G -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
coeff[ x ], coeff[x+1],
coeff[x+2], coeff[x+3]),x+=4;
if ( channel & BlueChannel )
- fprintf(stderr, " -channel B -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
+ FormatLocaleFile(stderr, " -channel B -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
coeff[ x ], coeff[x+1],
coeff[x+2], coeff[x+3]),x+=4;
if ( channel & IndexChannel )
- fprintf(stderr, " -channel K -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
+ FormatLocaleFile(stderr, " -channel K -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
coeff[ x ], coeff[x+1],
coeff[x+2], coeff[x+3]),x+=4;
if ( channel & OpacityChannel )
- fprintf(stderr, " -channel A -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
+ FormatLocaleFile(stderr, " -channel A -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
coeff[ x ], coeff[x+1],
coeff[x+2], coeff[x+3]),x+=4;
break;
diff --git a/magick/draw.c b/magick/draw.c
index 63c30bb..db4cef8 100644
--- a/magick/draw.c
+++ b/magick/draw.c
@@ -1414,7 +1414,7 @@
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(draw_info != (const DrawInfo *) NULL);
- (void) FormatMagickString(clip_mask,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(clip_mask,MaxTextExtent,"%s",name);
value=GetImageArtifact(image,clip_mask);
if (value == (const char *) NULL)
return(MagickFalse);
@@ -1657,7 +1657,7 @@
double
value;
- value=StringToDouble(point,&p);
+ value=LocaleToDouble(point,&p);
return((value == 0.0) && (p == point) ? MagickFalse : MagickTrue);
}
@@ -1822,27 +1822,27 @@
if (LocaleCompare("affine",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=StringToDouble(token,(char **) NULL);
+ affine.sx=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.rx=StringToDouble(token,(char **) NULL);
+ affine.rx=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ry=StringToDouble(token,(char **) NULL);
+ affine.ry=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=StringToDouble(token,(char **) NULL);
+ affine.sy=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.tx=StringToDouble(token,(char **) NULL);
+ affine.tx=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=StringToDouble(token,(char **) NULL);
+ affine.ty=LocaleToDouble(token,(char **) NULL);
break;
}
if (LocaleCompare("arc",keyword) == 0)
@@ -1984,7 +1984,7 @@
if (LocaleCompare("fill",keyword) == 0)
{
GetMagickToken(q,&q,token);
- (void) FormatMagickString(pattern,MaxTextExtent,"%s",token);
+ (void) FormatLocaleString(pattern,MaxTextExtent,"%s",token);
if (GetImageArtifact(image,pattern) != (const char *) NULL)
(void) DrawPatternPath(image,draw_info,token,
&graphic_context[n]->fill_pattern);
@@ -2013,7 +2013,7 @@
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->fill.opacity=ClampToQuantum((MagickRealType)
- QuantumRange*(1.0-factor*StringToDouble(token,(char **) NULL)));
+ QuantumRange*(1.0-factor*LocaleToDouble(token,(char **) NULL)));
break;
}
if (LocaleCompare("fill-rule",keyword) == 0)
@@ -2050,7 +2050,7 @@
if (LocaleCompare("font-size",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->pointsize=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->pointsize=LocaleToDouble(token,(char **) NULL);
break;
}
if (LocaleCompare("font-stretch",keyword) == 0)
@@ -2152,13 +2152,13 @@
if (LocaleCompare("interline-spacing",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->interline_spacing=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->interline_spacing=LocaleToDouble(token,(char **) NULL);
break;
}
if (LocaleCompare("interword-spacing",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->interword_spacing=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->interword_spacing=LocaleToDouble(token,(char **) NULL);
break;
}
status=MagickFalse;
@@ -2170,7 +2170,7 @@
if (LocaleCompare("kerning",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->kerning=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->kerning=LocaleToDouble(token,(char **) NULL);
break;
}
status=MagickFalse;
@@ -2212,7 +2212,7 @@
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->opacity=ClampToQuantum((MagickRealType)
QuantumRange*(1.0-((1.0-QuantumScale*graphic_context[n]->opacity)*
- factor*StringToDouble(token,(char **) NULL))));
+ factor*LocaleToDouble(token,(char **) NULL))));
graphic_context[n]->fill.opacity=graphic_context[n]->opacity;
graphic_context[n]->stroke.opacity=graphic_context[n]->opacity;
break;
@@ -2284,7 +2284,7 @@
name[MaxTextExtent];
GetMagickToken(q,&q,token);
- (void) FormatMagickString(name,MaxTextExtent,"%s",token);
+ (void) FormatLocaleString(name,MaxTextExtent,"%s",token);
for (p=q; *q != '\0'; )
{
GetMagickToken(q,&q,token);
@@ -2315,19 +2315,19 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(type,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- segment.x1=StringToDouble(token,(char **) NULL);
+ segment.x1=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.y1=StringToDouble(token,(char **) NULL);
+ segment.y1=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.x2=StringToDouble(token,(char **) NULL);
+ segment.x2=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.y2=StringToDouble(token,(char **) NULL);
+ segment.y2=LocaleToDouble(token,(char **) NULL);
if (LocaleCompare(type,"radial") == 0)
{
GetMagickToken(q,&q,token);
@@ -2357,10 +2357,10 @@
bounds.y2=graphic_context[n]->affine.rx*segment.x2+
graphic_context[n]->affine.sy*segment.y2+
graphic_context[n]->affine.ty;
- (void) FormatMagickString(key,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(key,MaxTextExtent,"%s",name);
(void) SetImageArtifact(image,key,token);
- (void) FormatMagickString(key,MaxTextExtent,"%s-geometry",name);
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(key,MaxTextExtent,"%s-geometry",name);
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%gx%g%+.15g%+.15g",
MagickMax(fabs(bounds.x2-bounds.x1+1.0),1.0),
MagickMax(fabs(bounds.y2-bounds.y1+1.0),1.0),
@@ -2377,19 +2377,19 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(name,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- bounds.x=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-0.5);
+ bounds.x=(ssize_t) ceil(LocaleToDouble(token,(char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.y=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-0.5);
+ bounds.y=(ssize_t) ceil(LocaleToDouble(token,(char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.width=(size_t) floor(StringToDouble(token,(char **) NULL)+0.5);
+ bounds.width=(size_t) floor(LocaleToDouble(token,(char **) NULL)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.height=(size_t) floor(StringToDouble(token,(char **) NULL)+0.5);
+ bounds.height=(size_t) floor(LocaleToDouble(token,(char **) NULL)+0.5);
for (p=q; *q != '\0'; )
{
GetMagickToken(q,&q,token);
@@ -2401,10 +2401,10 @@
break;
}
(void) CopyMagickString(token,p,(size_t) (q-p-4+1));
- (void) FormatMagickString(key,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(key,MaxTextExtent,"%s",name);
(void) SetImageArtifact(image,key,token);
- (void) FormatMagickString(key,MaxTextExtent,"%s-geometry",name);
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(key,MaxTextExtent,"%s-geometry",name);
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) bounds.width,(double)
bounds.height,(double) bounds.x,(double) bounds.y);
(void) SetImageArtifact(image,key,geometry);
@@ -2446,7 +2446,7 @@
if (LocaleCompare("rotate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=StringToDouble(token,(char **) NULL);
+ angle=LocaleToDouble(token,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod((double) angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod((double) angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod((double) angle,360.0))));
@@ -2467,24 +2467,24 @@
if (LocaleCompare("scale",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=StringToDouble(token,(char **) NULL);
+ affine.sx=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=StringToDouble(token,(char **) NULL);
+ affine.sy=LocaleToDouble(token,(char **) NULL);
break;
}
if (LocaleCompare("skewX",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=StringToDouble(token,(char **) NULL);
+ angle=LocaleToDouble(token,(char **) NULL);
affine.ry=sin(DegreesToRadians(angle));
break;
}
if (LocaleCompare("skewY",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=StringToDouble(token,(char **) NULL);
+ angle=LocaleToDouble(token,(char **) NULL);
affine.rx=(-tan(DegreesToRadians(angle)/2.0));
break;
}
@@ -2504,7 +2504,7 @@
if (LocaleCompare("stroke",keyword) == 0)
{
GetMagickToken(q,&q,token);
- (void) FormatMagickString(pattern,MaxTextExtent,"%s",token);
+ (void) FormatLocaleString(pattern,MaxTextExtent,"%s",token);
if (GetImageArtifact(image,pattern) != (const char *) NULL)
(void) DrawPatternPath(image,draw_info,token,
&graphic_context[n]->stroke_pattern);
@@ -2570,7 +2570,7 @@
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_pattern[j]=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->dash_pattern[j]=LocaleToDouble(token,(char **) NULL);
}
if ((x & 0x01) != 0)
for ( ; j < (2*x); j++)
@@ -2585,7 +2585,7 @@
if (LocaleCompare("stroke-dashoffset",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_offset=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->dash_offset=LocaleToDouble(token,(char **) NULL);
break;
}
if (LocaleCompare("stroke-linecap",keyword) == 0)
@@ -2629,13 +2629,13 @@
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->stroke.opacity=ClampToQuantum((MagickRealType)
- QuantumRange*(1.0-factor*StringToDouble(token,(char **) NULL)));
+ QuantumRange*(1.0-factor*LocaleToDouble(token,(char **) NULL)));
break;
}
if (LocaleCompare("stroke-width",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->stroke_width=StringToDouble(token,(char **) NULL);
+ graphic_context[n]->stroke_width=LocaleToDouble(token,(char **) NULL);
break;
}
status=MagickFalse;
@@ -2696,11 +2696,11 @@
if (LocaleCompare("translate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.tx=StringToDouble(token,(char **) NULL);
+ affine.tx=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=StringToDouble(token,(char **) NULL);
+ affine.ty=LocaleToDouble(token,(char **) NULL);
break;
}
status=MagickFalse;
@@ -2712,23 +2712,23 @@
if (LocaleCompare("viewbox",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-
+ graphic_context[n]->viewbox.x=(ssize_t) ceil(LocaleToDouble(token,(char **) NULL)-
0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-
+ graphic_context[n]->viewbox.y=(ssize_t) ceil(LocaleToDouble(token,(char **) NULL)-
0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
graphic_context[n]->viewbox.width=(size_t) floor(
- StringToDouble(token,(char **) NULL)+0.5);
+ LocaleToDouble(token,(char **) NULL)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
graphic_context[n]->viewbox.height=(size_t) floor(
- StringToDouble(token,(char **) NULL)+0.5);
+ LocaleToDouble(token,(char **) NULL)+0.5);
break;
}
status=MagickFalse;
@@ -2776,11 +2776,11 @@
if (IsPoint(q) == MagickFalse)
break;
GetMagickToken(q,&q,token);
- point.x=StringToDouble(token,(char **) NULL);
+ point.x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- point.y=StringToDouble(token,(char **) NULL);
+ point.y=LocaleToDouble(token,(char **) NULL);
GetMagickToken(q,(const char **) NULL,token);
if (*token == ',')
GetMagickToken(q,&q,token);
@@ -2862,7 +2862,7 @@
double
value;
- value=StringToDouble(s,&t);
+ value=LocaleToDouble(s,&t);
(void) value;
if (s == t)
{
@@ -3504,11 +3504,11 @@
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(draw_info != (const DrawInfo *) NULL);
assert(name != (const char *) NULL);
- (void) FormatMagickString(property,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(property,MaxTextExtent,"%s",name);
path=GetImageArtifact(image,property);
if (path == (const char *) NULL)
return(MagickFalse);
- (void) FormatMagickString(property,MaxTextExtent,"%s-geometry",name);
+ (void) FormatLocaleString(property,MaxTextExtent,"%s-geometry",name);
geometry=GetImageArtifact(image,property);
if (geometry == (const char *) NULL)
return(MagickFalse);
@@ -4397,7 +4397,7 @@
break;
clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info);
(void) CloneString(&clone_info->text,primitive_info->text);
- (void) FormatMagickString(geometry,MaxTextExtent,"%+f%+f",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%+f%+f",
primitive_info->point.x,primitive_info->point.y);
(void) CloneString(&clone_info->geometry,geometry);
status=AnnotateImage(image,clone_info);
@@ -4453,7 +4453,7 @@
/*
Resize image.
*/
- (void) FormatMagickString(geometry,MaxTextExtent,"%gx%g!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%gx%g!",
primitive_info[1].point.x,primitive_info[1].point.y);
composite_image->filter=image->filter;
(void) TransformImage(&composite_image,(char *) NULL,geometry);
@@ -4466,7 +4466,7 @@
image->gravity=draw_info->gravity;
geometry.x=x;
geometry.y=y;
- (void) FormatMagickString(composite_geometry,MaxTextExtent,
+ (void) FormatLocaleString(composite_geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,(double)
composite_image->rows,(double) geometry.x,(double) geometry.y);
(void) ParseGravityGeometry(image,composite_geometry,&geometry,
@@ -4759,14 +4759,14 @@
(void) CloneString(&draw_info->encoding,option);
option=GetImageOption(clone_info,"kerning");
if (option != (const char *) NULL)
- draw_info->kerning=StringToDouble(option,(char **) NULL);
+ draw_info->kerning=LocaleToDouble(option,(char **) NULL);
option=GetImageOption(clone_info,"interline-spacing");
if (option != (const char *) NULL)
- draw_info->interline_spacing=StringToDouble(option,(char **) NULL);
+ draw_info->interline_spacing=LocaleToDouble(option,(char **) NULL);
draw_info->direction=UndefinedDirection;
option=GetImageOption(clone_info,"interword-spacing");
if (option != (const char *) NULL)
- draw_info->interword_spacing=StringToDouble(option,(char **) NULL);
+ draw_info->interword_spacing=LocaleToDouble(option,(char **) NULL);
option=GetImageOption(clone_info,"direction");
if (option != (const char *) NULL)
draw_info->direction=(DirectionType) ParseCommandOption(
@@ -4779,7 +4779,7 @@
(void) QueryColorDatabase(option,&draw_info->stroke,exception);
option=GetImageOption(clone_info,"strokewidth");
if (option != (const char *) NULL)
- draw_info->stroke_width=StringToDouble(option,(char **) NULL);
+ draw_info->stroke_width=LocaleToDouble(option,(char **) NULL);
option=GetImageOption(clone_info,"undercolor");
if (option != (const char *) NULL)
(void) QueryColorDatabase(option,&draw_info->undercolor,exception);
@@ -5256,15 +5256,15 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arc.x=StringToDouble(token,(char **) NULL);
+ arc.x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arc.y=StringToDouble(token,(char **) NULL);
+ arc.y=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- angle=StringToDouble(token,(char **) NULL);
+ angle=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
@@ -5276,11 +5276,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
end.x=(double) (attribute == (int) 'A' ? x : point.x+x);
end.y=(double) (attribute == (int) 'A' ? y : point.y+y);
TraceArcPath(q,point,end,arc,angle,large_arc,sweep);
@@ -5303,11 +5303,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
end.x=(double) (attribute == (int) 'C' ? x : point.x+x);
end.y=(double) (attribute == (int) 'C' ? y : point.y+y);
points[i]=end;
@@ -5328,7 +5328,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
point.x=(double) (attribute == (int) 'H' ? x: point.x+x);
TracePoint(q,point);
q+=q->coordinates;
@@ -5343,11 +5343,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
point.x=(double) (attribute == (int) 'L' ? x : point.x+x);
point.y=(double) (attribute == (int) 'L' ? y : point.y+y);
TracePoint(q,point);
@@ -5370,11 +5370,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
point.x=(double) (attribute == (int) 'M' ? x : point.x+x);
point.y=(double) (attribute == (int) 'M' ? y : point.y+y);
if (i == 0)
@@ -5404,11 +5404,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
if (*p == ',')
p++;
end.x=(double) (attribute == (int) 'Q' ? x : point.x+x);
@@ -5439,11 +5439,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
if (*p == ',')
p++;
end.x=(double) (attribute == (int) 'S' ? x : point.x+x);
@@ -5479,11 +5479,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token,(char **) NULL);
+ x=LocaleToDouble(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
end.x=(double) (attribute == (int) 'T' ? x : point.x+x);
end.y=(double) (attribute == (int) 'T' ? y : point.y+y);
points[i]=end;
@@ -5509,7 +5509,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token,(char **) NULL);
+ y=LocaleToDouble(token,(char **) NULL);
point.y=(double) (attribute == (int) 'V' ? y : point.y+y);
TracePoint(q,point);
q+=q->coordinates;
@@ -5531,7 +5531,7 @@
default:
{
if (isalpha((int) ((unsigned char) attribute)) != 0)
- (void) fprintf(stderr,"attribute not recognized: %c\n",attribute);
+ (void) FormatLocaleFile(stderr,"attribute not recognized: %c\n",attribute);
break;
}
}
diff --git a/magick/effect.c b/magick/effect.c
index a028c9e..36dc410 100644
--- a/magick/effect.c
+++ b/magick/effect.c
@@ -888,9 +888,9 @@
for (i=0; i < (ssize_t) width; i++)
{
*message='\0';
- (void) FormatMagickString(format,MaxTextExtent,"%.20g: ",(double) i);
+ (void) FormatLocaleString(format,MaxTextExtent,"%.20g: ",(double) i);
(void) ConcatenateString(&message,format);
- (void) FormatMagickString(format,MaxTextExtent,"%g ",*k++);
+ (void) FormatLocaleString(format,MaxTextExtent,"%g ",*k++);
(void) ConcatenateString(&message,format);
(void) LogMagickEvent(TransformEvent,GetMagickModule(),"%s",message);
}
@@ -1394,11 +1394,11 @@
for (v=0; v < (ssize_t) width; v++)
{
*message='\0';
- (void) FormatMagickString(format,MaxTextExtent,"%.20g: ",(double) v);
+ (void) FormatLocaleString(format,MaxTextExtent,"%.20g: ",(double) v);
(void) ConcatenateString(&message,format);
for (u=0; u < (ssize_t) width; u++)
{
- (void) FormatMagickString(format,MaxTextExtent,"%g ",*k++);
+ (void) FormatLocaleString(format,MaxTextExtent,"%g ",*k++);
(void) ConcatenateString(&message,format);
}
(void) LogMagickEvent(TransformEvent,GetMagickModule(),"%s",message);
@@ -2209,11 +2209,11 @@
for (v=0; v < (ssize_t) kernel->height; v++)
{
*message='\0';
- (void) FormatMagickString(format,MaxTextExtent,"%.20g: ",(double) v);
+ (void) FormatLocaleString(format,MaxTextExtent,"%.20g: ",(double) v);
(void) ConcatenateString(&message,format);
for (u=0; u < (ssize_t) kernel->width; u++)
{
- (void) FormatMagickString(format,MaxTextExtent,"%g ",*k++);
+ (void) FormatLocaleString(format,MaxTextExtent,"%g ",*k++);
(void) ConcatenateString(&message,format);
}
(void) LogMagickEvent(TransformEvent,GetMagickModule(),"%s",message);
@@ -2962,14 +2962,14 @@
{
degrees+=45.0;
preview_image=RotateImage(thumbnail,degrees,exception);
- (void) FormatMagickString(label,MaxTextExtent,"rotate %g",degrees);
+ (void) FormatLocaleString(label,MaxTextExtent,"rotate %g",degrees);
break;
}
case ShearPreview:
{
degrees+=5.0;
preview_image=ShearImage(thumbnail,degrees,degrees,exception);
- (void) FormatMagickString(label,MaxTextExtent,"shear %gx%g",
+ (void) FormatLocaleString(label,MaxTextExtent,"shear %gx%g",
degrees,2.0*degrees);
break;
}
@@ -2978,7 +2978,7 @@
x=(ssize_t) ((i+1)*thumbnail->columns)/NumberTiles;
y=(ssize_t) ((i+1)*thumbnail->rows)/NumberTiles;
preview_image=RollImage(thumbnail,x,y,exception);
- (void) FormatMagickString(label,MaxTextExtent,"roll %+.20gx%+.20g",
+ (void) FormatLocaleString(label,MaxTextExtent,"roll %+.20gx%+.20g",
(double) x,(double) y);
break;
}
@@ -2987,10 +2987,10 @@
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) FormatMagickString(factor,MaxTextExtent,"100,100,%g",
+ (void) FormatLocaleString(factor,MaxTextExtent,"100,100,%g",
2.0*percentage);
(void) ModulateImage(preview_image,factor);
- (void) FormatMagickString(label,MaxTextExtent,"modulate %s",factor);
+ (void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
}
case SaturationPreview:
@@ -2998,10 +2998,10 @@
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) FormatMagickString(factor,MaxTextExtent,"100,%g",
+ (void) FormatLocaleString(factor,MaxTextExtent,"100,%g",
2.0*percentage);
(void) ModulateImage(preview_image,factor);
- (void) FormatMagickString(label,MaxTextExtent,"modulate %s",factor);
+ (void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
}
case BrightnessPreview:
@@ -3009,9 +3009,9 @@
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) FormatMagickString(factor,MaxTextExtent,"%g",2.0*percentage);
+ (void) FormatLocaleString(factor,MaxTextExtent,"%g",2.0*percentage);
(void) ModulateImage(preview_image,factor);
- (void) FormatMagickString(label,MaxTextExtent,"modulate %s",factor);
+ (void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
}
case GammaPreview:
@@ -3022,7 +3022,7 @@
break;
gamma+=0.4f;
(void) GammaImageChannel(preview_image,DefaultChannels,gamma);
- (void) FormatMagickString(label,MaxTextExtent,"gamma %g",gamma);
+ (void) FormatLocaleString(label,MaxTextExtent,"gamma %g",gamma);
break;
}
case SpiffPreview:
@@ -3031,7 +3031,7 @@
if (preview_image != (Image *) NULL)
for (x=0; x < i; x++)
(void) ContrastImage(preview_image,MagickTrue);
- (void) FormatMagickString(label,MaxTextExtent,"contrast (%.20g)",
+ (void) FormatLocaleString(label,MaxTextExtent,"contrast (%.20g)",
(double) i+1);
break;
}
@@ -3042,7 +3042,7 @@
break;
for (x=0; x < i; x++)
(void) ContrastImage(preview_image,MagickFalse);
- (void) FormatMagickString(label,MaxTextExtent,"+contrast (%.20g)",
+ (void) FormatLocaleString(label,MaxTextExtent,"+contrast (%.20g)",
(double) i+1);
break;
}
@@ -3055,7 +3055,7 @@
quantize_info.number_colors=colors;
quantize_info.colorspace=GRAYColorspace;
(void) QuantizeImage(&quantize_info,preview_image);
- (void) FormatMagickString(label,MaxTextExtent,
+ (void) FormatLocaleString(label,MaxTextExtent,
"-colorspace gray -colors %.20g",(double) colors);
break;
}
@@ -3067,7 +3067,7 @@
colors<<=1;
quantize_info.number_colors=colors;
(void) QuantizeImage(&quantize_info,preview_image);
- (void) FormatMagickString(label,MaxTextExtent,"colors %.20g",(double)
+ (void) FormatLocaleString(label,MaxTextExtent,"colors %.20g",(double)
colors);
break;
}
@@ -3084,7 +3084,7 @@
preview_image=DespeckleImage(thumbnail,exception);
if (preview_image == (Image *) NULL)
break;
- (void) FormatMagickString(label,MaxTextExtent,"despeckle (%.20g)",
+ (void) FormatLocaleString(label,MaxTextExtent,"despeckle (%.20g)",
(double) i+1);
break;
}
@@ -3092,7 +3092,7 @@
{
preview_image=StatisticImage(thumbnail,NonpeakStatistic,(size_t) radius,
(size_t) radius,exception);
- (void) FormatMagickString(label,MaxTextExtent,"noise %g",radius);
+ (void) FormatLocaleString(label,MaxTextExtent,"noise %g",radius);
break;
}
case AddNoisePreview:
@@ -3137,20 +3137,20 @@
}
preview_image=StatisticImage(thumbnail,NonpeakStatistic,(size_t) i,
(size_t) i,exception);
- (void) FormatMagickString(label,MaxTextExtent,"+noise %s",factor);
+ (void) FormatLocaleString(label,MaxTextExtent,"+noise %s",factor);
break;
}
case SharpenPreview:
{
preview_image=SharpenImage(thumbnail,radius,sigma,exception);
- (void) FormatMagickString(label,MaxTextExtent,"sharpen %gx%g",
+ (void) FormatLocaleString(label,MaxTextExtent,"sharpen %gx%g",
radius,sigma);
break;
}
case BlurPreview:
{
preview_image=BlurImage(thumbnail,radius,sigma,exception);
- (void) FormatMagickString(label,MaxTextExtent,"blur %gx%g",radius,
+ (void) FormatLocaleString(label,MaxTextExtent,"blur %gx%g",radius,
sigma);
break;
}
@@ -3161,20 +3161,20 @@
break;
(void) BilevelImage(thumbnail,
(double) (percentage*((MagickRealType) QuantumRange+1.0))/100.0);
- (void) FormatMagickString(label,MaxTextExtent,"threshold %g",
+ (void) FormatLocaleString(label,MaxTextExtent,"threshold %g",
(double) (percentage*((MagickRealType) QuantumRange+1.0))/100.0);
break;
}
case EdgeDetectPreview:
{
preview_image=EdgeImage(thumbnail,radius,exception);
- (void) FormatMagickString(label,MaxTextExtent,"edge %g",radius);
+ (void) FormatLocaleString(label,MaxTextExtent,"edge %g",radius);
break;
}
case SpreadPreview:
{
preview_image=SpreadImage(thumbnail,radius,exception);
- (void) FormatMagickString(label,MaxTextExtent,"spread %g",
+ (void) FormatLocaleString(label,MaxTextExtent,"spread %g",
radius+0.5);
break;
}
@@ -3185,7 +3185,7 @@
break;
(void) SolarizeImage(preview_image,(double) QuantumRange*
percentage/100.0);
- (void) FormatMagickString(label,MaxTextExtent,"solarize %g",
+ (void) FormatLocaleString(label,MaxTextExtent,"solarize %g",
(QuantumRange*percentage)/100.0);
break;
}
@@ -3194,7 +3194,7 @@
degrees+=10.0;
preview_image=ShadeImage(thumbnail,MagickTrue,degrees,degrees,
exception);
- (void) FormatMagickString(label,MaxTextExtent,"shade %gx%g",
+ (void) FormatLocaleString(label,MaxTextExtent,"shade %gx%g",
degrees,degrees);
break;
}
@@ -3208,7 +3208,7 @@
geometry.x=i/2;
geometry.y=i/2;
(void) RaiseImage(preview_image,&geometry,MagickTrue);
- (void) FormatMagickString(label,MaxTextExtent,
+ (void) FormatLocaleString(label,MaxTextExtent,
"raise %.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
break;
@@ -3221,14 +3221,14 @@
threshold+=0.4f;
(void) SegmentImage(preview_image,RGBColorspace,MagickFalse,threshold,
threshold);
- (void) FormatMagickString(label,MaxTextExtent,"segment %gx%g",
+ (void) FormatLocaleString(label,MaxTextExtent,"segment %gx%g",
threshold,threshold);
break;
}
case SwirlPreview:
{
preview_image=SwirlImage(thumbnail,degrees,exception);
- (void) FormatMagickString(label,MaxTextExtent,"swirl %g",degrees);
+ (void) FormatLocaleString(label,MaxTextExtent,"swirl %g",degrees);
degrees+=45.0;
break;
}
@@ -3236,28 +3236,28 @@
{
degrees+=0.1f;
preview_image=ImplodeImage(thumbnail,degrees,exception);
- (void) FormatMagickString(label,MaxTextExtent,"implode %g",degrees);
+ (void) FormatLocaleString(label,MaxTextExtent,"implode %g",degrees);
break;
}
case WavePreview:
{
degrees+=5.0f;
preview_image=WaveImage(thumbnail,0.5*degrees,2.0*degrees,exception);
- (void) FormatMagickString(label,MaxTextExtent,"wave %gx%g",
+ (void) FormatLocaleString(label,MaxTextExtent,"wave %gx%g",
0.5*degrees,2.0*degrees);
break;
}
case OilPaintPreview:
{
preview_image=OilPaintImage(thumbnail,(double) radius,exception);
- (void) FormatMagickString(label,MaxTextExtent,"paint %g",radius);
+ (void) FormatLocaleString(label,MaxTextExtent,"paint %g",radius);
break;
}
case CharcoalDrawingPreview:
{
preview_image=CharcoalImage(thumbnail,(double) radius,(double) sigma,
exception);
- (void) FormatMagickString(label,MaxTextExtent,"charcoal %gx%g",
+ (void) FormatLocaleString(label,MaxTextExtent,"charcoal %gx%g",
radius,sigma);
break;
}
@@ -3276,12 +3276,12 @@
if (preview_image == (Image *) NULL)
break;
preview_info->quality=(size_t) percentage;
- (void) FormatMagickString(factor,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(factor,MaxTextExtent,"%.20g",(double)
preview_info->quality);
file=AcquireUniqueFileResource(filename);
if (file != -1)
file=close(file)-1;
- (void) FormatMagickString(preview_image->filename,MaxTextExtent,
+ (void) FormatLocaleString(preview_image->filename,MaxTextExtent,
"jpeg:%s",filename);
status=WriteImage(preview_info,preview_image);
if (status != MagickFalse)
@@ -3300,16 +3300,16 @@
}
(void) RelinquishUniqueFileResource(preview_image->filename);
if ((GetBlobSize(preview_image)/1024) >= 1024)
- (void) FormatMagickString(label,MaxTextExtent,"quality %s\n%gmb ",
+ (void) FormatLocaleString(label,MaxTextExtent,"quality %s\n%gmb ",
factor,(double) ((MagickOffsetType) GetBlobSize(preview_image))/
1024.0/1024.0);
else
if (GetBlobSize(preview_image) >= 1024)
- (void) FormatMagickString(label,MaxTextExtent,
+ (void) FormatLocaleString(label,MaxTextExtent,
"quality %s\n%gkb ",factor,(double) ((MagickOffsetType)
GetBlobSize(preview_image))/1024.0);
else
- (void) FormatMagickString(label,MaxTextExtent,"quality %s\n%.20gb ",
+ (void) FormatLocaleString(label,MaxTextExtent,"quality %s\n%.20gb ",
factor,(double) GetBlobSize(thumbnail));
break;
}
@@ -3798,11 +3798,11 @@
for (v=0; v < (ssize_t) width; v++)
{
*message='\0';
- (void) FormatMagickString(format,MaxTextExtent,"%.20g: ",(double) v);
+ (void) FormatLocaleString(format,MaxTextExtent,"%.20g: ",(double) v);
(void) ConcatenateString(&message,format);
for (u=0; u < (ssize_t) width; u++)
{
- (void) FormatMagickString(format,MaxTextExtent,"%+f ",*k++);
+ (void) FormatLocaleString(format,MaxTextExtent,"%+f ",*k++);
(void) ConcatenateString(&message,format);
}
(void) LogMagickEvent(TransformEvent,GetMagickModule(),"%s",message);
diff --git a/magick/enhance.c b/magick/enhance.c
index 81732ad..b375a93 100644
--- a/magick/enhance.c
+++ b/magick/enhance.c
@@ -454,9 +454,9 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: color_correction.red.slope=StringToDouble(token,(char **) NULL); break;
- case 1: color_correction.green.slope=StringToDouble(token,(char **) NULL); break;
- case 2: color_correction.blue.slope=StringToDouble(token,(char **) NULL); break;
+ case 0: color_correction.red.slope=LocaleToDouble(token,(char **) NULL); break;
+ case 1: color_correction.green.slope=LocaleToDouble(token,(char **) NULL); break;
+ case 2: color_correction.blue.slope=LocaleToDouble(token,(char **) NULL); break;
}
}
}
@@ -472,9 +472,9 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: color_correction.red.offset=StringToDouble(token,(char **) NULL); break;
- case 1: color_correction.green.offset=StringToDouble(token,(char **) NULL); break;
- case 2: color_correction.blue.offset=StringToDouble(token,(char **) NULL); break;
+ case 0: color_correction.red.offset=LocaleToDouble(token,(char **) NULL); break;
+ case 1: color_correction.green.offset=LocaleToDouble(token,(char **) NULL); break;
+ case 2: color_correction.blue.offset=LocaleToDouble(token,(char **) NULL); break;
}
}
}
@@ -490,9 +490,9 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: color_correction.red.power=StringToDouble(token,(char **) NULL); break;
- case 1: color_correction.green.power=StringToDouble(token,(char **) NULL); break;
- case 2: color_correction.blue.power=StringToDouble(token,(char **) NULL); break;
+ case 0: color_correction.red.power=LocaleToDouble(token,(char **) NULL); break;
+ case 1: color_correction.green.power=LocaleToDouble(token,(char **) NULL); break;
+ case 2: color_correction.blue.power=LocaleToDouble(token,(char **) NULL); break;
}
}
}
@@ -509,7 +509,7 @@
content=GetXMLTreeContent(saturation);
p=(const char *) content;
GetMagickToken(p,&p,token);
- color_correction.saturation=StringToDouble(token,(char **) NULL);
+ color_correction.saturation=LocaleToDouble(token,(char **) NULL);
}
}
ccc=DestroyXMLTree(ccc);
diff --git a/magick/exception.c b/magick/exception.c
index 09ad1cf..57dc25e 100644
--- a/magick/exception.c
+++ b/magick/exception.c
@@ -258,10 +258,10 @@
{
if (reason == (char *) NULL)
return;
- (void) fprintf(stderr,"%s: %s",GetClientName(),reason);
+ (void) FormatLocaleFile(stderr,"%s: %s",GetClientName(),reason);
if (description != (char *) NULL)
- (void) fprintf(stderr," (%s)",description);
- (void) fprintf(stderr,".\n");
+ (void) FormatLocaleFile(stderr," (%s)",description);
+ (void) FormatLocaleFile(stderr,".\n");
(void) fflush(stderr);
}
@@ -300,10 +300,10 @@
{
if (reason == (char *) NULL)
return;
- (void) fprintf(stderr,"%s: %s",GetClientName(),reason);
+ (void) FormatLocaleFile(stderr,"%s: %s",GetClientName(),reason);
if (description != (char *) NULL)
- (void) fprintf(stderr," (%s)",description);
- (void) fprintf(stderr,".\n");
+ (void) FormatLocaleFile(stderr," (%s)",description);
+ (void) FormatLocaleFile(stderr,".\n");
(void) fflush(stderr);
MagickCoreTerminus();
exit(1);
@@ -342,10 +342,10 @@
{
if (reason == (char *) NULL)
return;
- (void) fprintf(stderr,"%s: %s",GetClientName(),reason);
+ (void) FormatLocaleFile(stderr,"%s: %s",GetClientName(),reason);
if (description != (char *) NULL)
- (void) fprintf(stderr," (%s)",description);
- (void) fprintf(stderr,".\n");
+ (void) FormatLocaleFile(stderr," (%s)",description);
+ (void) FormatLocaleFile(stderr,".\n");
(void) fflush(stderr);
}
@@ -573,7 +573,7 @@
*locale_message;
assert(tag != (const char *) NULL);
- (void) FormatMagickString(message,MaxTextExtent,"Exception/%s%s",
+ (void) FormatLocaleString(message,MaxTextExtent,"Exception/%s%s",
ExceptionSeverityToTag(severity),tag);
locale_message=GetLocaleMessage(message);
if (locale_message == (const char *) NULL)
@@ -981,7 +981,7 @@
type="error";
if (severity >= FatalErrorException)
type="fatal";
- (void) FormatMagickString(message,MaxTextExtent,"%s @ %s/%s/%s/%.20g",reason,
+ (void) FormatLocaleString(message,MaxTextExtent,"%s @ %s/%s/%s/%.20g",reason,
type,path,function,(double) line);
(void) ThrowException(exception,severity,message,(char *) NULL);
return(status);
diff --git a/magick/fx.c b/magick/fx.c
index 1dc1e18..f186d35 100644
--- a/magick/fx.c
+++ b/magick/fx.c
@@ -340,7 +340,7 @@
attenuate=1.0;
option=GetImageArtifact(image,"attenuate");
if (option != (char *) NULL)
- attenuate=StringToDouble(option,(char **) NULL);
+ attenuate=LocaleToDouble(option,(char **) NULL);
status=MagickTrue;
progress=0;
random_info=AcquireRandomInfoThreadSet();
@@ -929,11 +929,11 @@
for (v=0; v < 6; v++)
{
*message='\0';
- (void) FormatMagickString(format,MaxTextExtent,"%.20g: ",(double) v);
+ (void) FormatLocaleString(format,MaxTextExtent,"%.20g: ",(double) v);
(void) ConcatenateString(&message,format);
for (u=0; u < 6; u++)
{
- (void) FormatMagickString(format,MaxTextExtent,"%+f ",
+ (void) FormatLocaleString(format,MaxTextExtent,"%+f ",
ColorMatrix[v][u]);
(void) ConcatenateString(&message,format);
}
@@ -1161,11 +1161,11 @@
case 'k': channel=BlackChannel; break;
default: break;
}
- (void) FormatMagickString(key,MaxTextExtent,"%p.%.20g.%s",(void *) image,
+ (void) FormatLocaleString(key,MaxTextExtent,"%p.%.20g.%s",(void *) image,
(double) channel,symbol);
value=(const char *) GetValueFromSplayTree(fx_info->symbols,key);
if (value != (const char *) NULL)
- return(QuantumScale*StringToDouble(value,(char **) NULL));
+ return(QuantumScale*LocaleToDouble(value,(char **) NULL));
(void) DeleteNodeFromSplayTree(fx_info->symbols,key);
if (LocaleNCompare(symbol,"depth",5) == 0)
{
@@ -1173,7 +1173,7 @@
depth;
depth=GetImageChannelDepth(image,channel,exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%.20g",(double)
depth);
}
if (LocaleNCompare(symbol,"kurtosis",8) == 0)
@@ -1184,7 +1184,7 @@
(void) GetImageChannelKurtosis(image,channel,&kurtosis,&skewness,
exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%g",kurtosis);
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%g",kurtosis);
}
if (LocaleNCompare(symbol,"maxima",6) == 0)
{
@@ -1193,7 +1193,7 @@
minima;
(void) GetImageChannelRange(image,channel,&minima,&maxima,exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%g",maxima);
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%g",maxima);
}
if (LocaleNCompare(symbol,"mean",4) == 0)
{
@@ -1203,7 +1203,7 @@
(void) GetImageChannelMean(image,channel,&mean,&standard_deviation,
exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%g",mean);
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%g",mean);
}
if (LocaleNCompare(symbol,"minima",6) == 0)
{
@@ -1212,7 +1212,7 @@
minima;
(void) GetImageChannelRange(image,channel,&minima,&maxima,exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%g",minima);
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%g",minima);
}
if (LocaleNCompare(symbol,"skewness",8) == 0)
{
@@ -1222,7 +1222,7 @@
(void) GetImageChannelKurtosis(image,channel,&kurtosis,&skewness,
exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%g",skewness);
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%g",skewness);
}
if (LocaleNCompare(symbol,"standard_deviation",18) == 0)
{
@@ -1232,12 +1232,12 @@
(void) GetImageChannelMean(image,channel,&mean,&standard_deviation,
exception);
- (void) FormatMagickString(statistic,MaxTextExtent,"%g",
+ (void) FormatLocaleString(statistic,MaxTextExtent,"%g",
standard_deviation);
}
(void) AddValueToSplayTree(fx_info->symbols,ConstantString(key),
ConstantString(statistic));
- return(QuantumScale*StringToDouble(statistic,(char **) NULL));
+ return(QuantumScale*LocaleToDouble(statistic,(char **) NULL));
}
static MagickRealType
@@ -1849,7 +1849,7 @@
}
value=(const char *) GetValueFromSplayTree(fx_info->symbols,symbol);
if (value != (const char *) NULL)
- return((MagickRealType) StringToDouble(value,(char **) NULL));
+ return((MagickRealType) LocaleToDouble(value,(char **) NULL));
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"UnableToParseExpression","`%s'",symbol);
return(0.0);
@@ -2279,7 +2279,7 @@
}
ClearMagickException(exception);
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- (void) FormatMagickString(numeric,MaxTextExtent,"%g",(double)
+ (void) FormatLocaleString(numeric,MaxTextExtent,"%g",(double)
*beta);
(void) DeleteNodeFromSplayTree(fx_info->symbols,subexpression);
(void) AddValueToSplayTree(fx_info->symbols,ConstantString(
@@ -2451,7 +2451,7 @@
if (strlen(subexpression) > 1)
subexpression[strlen(subexpression)-1]='\0';
if (fx_info->file != (FILE *) NULL)
- (void) fprintf(fx_info->file,"%s[%.20g,%.20g].%s: %s=%.*g\n",
+ (void) FormatLocaleFile(fx_info->file,"%s[%.20g,%.20g].%s: %s=%.*g\n",
fx_info->images->filename,(double) x,(double) y,type,
subexpression,GetMagickPrecision(),(double) alpha);
return(0.0);
@@ -2777,7 +2777,7 @@
break;
}
q=(char *) expression;
- alpha=StringToDouble(expression,&q);
+ alpha=LocaleToDouble(expression,&q);
if (q == expression)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
return(alpha);
@@ -3852,7 +3852,7 @@
caption_image->background_color=image->border_color;
(void) SetImageBackgroundColor(caption_image);
(void) CloneString(&annotate_info->text,caption);
- (void) FormatMagickString(geometry,MaxTextExtent,"+0+%g",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"+0+%g",
metrics.ascent);
if (annotate_info->gravity == UndefinedGravity)
(void) CloneString(&annotate_info->geometry,AcquireString(
@@ -5273,7 +5273,7 @@
draw_info=CloneDrawInfo((const ImageInfo *) NULL,(const DrawInfo *) NULL);
(void) QueryColorDatabase("#ffffff",&draw_info->fill,exception);
(void) QueryColorDatabase("#ffffff",&draw_info->stroke,exception);
- (void) FormatMagickString(ellipse,MaxTextExtent,
+ (void) FormatLocaleString(ellipse,MaxTextExtent,
"ellipse %g,%g,%g,%g,0.0,360.0",image->columns/2.0,
image->rows/2.0,image->columns/2.0-x,image->rows/2.0-y);
draw_info->primitive=AcquireString(ellipse);
diff --git a/magick/geometry.c b/magick/geometry.c
index e75303a..30ed8ad 100644
--- a/magick/geometry.c
+++ b/magick/geometry.c
@@ -188,7 +188,7 @@
if (*p == '\0')
return(flags);
q=p;
- value=StringToDouble(p,&q);
+ value=LocaleToDouble(p,&q);
(void) value;
if (LocaleNCompare(p,"0x",2) == 0)
value=(double) strtol(p,&q,10);
@@ -201,7 +201,7 @@
if (LocaleNCompare(p,"0x",2) == 0)
*width=(size_t) strtol(p,&p,10);
else
- *width=(size_t) floor(StringToDouble(p,&p)+0.5);
+ *width=(size_t) floor(LocaleToDouble(p,&p)+0.5);
if (p != q)
flags|=WidthValue;
}
@@ -214,7 +214,7 @@
Parse height.
*/
q=p;
- *height=(size_t) floor(StringToDouble(p,&p)+0.5);
+ *height=(size_t) floor(LocaleToDouble(p,&p)+0.5);
if (p != q)
flags|=HeightValue;
}
@@ -227,7 +227,7 @@
if (*p == '-')
flags|=XNegative;
q=p;
- *x=(ssize_t) ceil(StringToDouble(p,&p)-0.5);
+ *x=(ssize_t) ceil(LocaleToDouble(p,&p)-0.5);
if (p != q)
flags|=XValue;
if ((*p == '+') || (*p == '-'))
@@ -238,7 +238,7 @@
if (*p == '-')
flags|=YNegative;
q=p;
- *y=(ssize_t) ceil(StringToDouble(p,&p)-0.5);
+ *y=(ssize_t) ceil(LocaleToDouble(p,&p)-0.5);
if (p != q)
flags|=YValue;
}
@@ -553,7 +553,7 @@
if (geometry == (const char *) NULL)
return(MagickFalse);
p=(char *) geometry;
- value=StringToDouble(geometry,&p);
+ value=LocaleToDouble(geometry,&p);
(void) value;
if (p == geometry)
return(MagickFalse);
@@ -662,12 +662,12 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: affine_matrix->sx=StringToDouble(token,(char **) NULL); break;
- case 1: affine_matrix->rx=StringToDouble(token,(char **) NULL); break;
- case 2: affine_matrix->ry=StringToDouble(token,(char **) NULL); break;
- case 3: affine_matrix->sy=StringToDouble(token,(char **) NULL); break;
- case 4: affine_matrix->tx=StringToDouble(token,(char **) NULL); flags|=XValue; break;
- case 5: affine_matrix->ty=StringToDouble(token,(char **) NULL); flags|=YValue; break;
+ case 0: affine_matrix->sx=LocaleToDouble(token,(char **) NULL); break;
+ case 1: affine_matrix->rx=LocaleToDouble(token,(char **) NULL); break;
+ case 2: affine_matrix->ry=LocaleToDouble(token,(char **) NULL); break;
+ case 3: affine_matrix->sy=LocaleToDouble(token,(char **) NULL); break;
+ case 4: affine_matrix->tx=LocaleToDouble(token,(char **) NULL); flags|=XValue; break;
+ case 5: affine_matrix->ty=LocaleToDouble(token,(char **) NULL); flags|=YValue; break;
}
}
determinant=(affine_matrix->sx*affine_matrix->sy-affine_matrix->rx*
@@ -824,7 +824,7 @@
if (*p == '\0')
return(flags);
q=p;
- value=StringToDouble(p,&q);
+ value=LocaleToDouble(p,&q);
if (LocaleNCompare(p,"0x",2) == 0)
value=(double) strtol(p,&q,10);
if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') ||
@@ -837,7 +837,7 @@
if (LocaleNCompare(p,"0x",2) == 0)
value=(double) strtol(p,&p,10);
else
- value=StringToDouble(p,&p);
+ value=LocaleToDouble(p,&p);
if (p != q)
{
flags|=RhoValue;
@@ -858,7 +858,7 @@
((*p != '+') && (*p != '-')))
{
q=p;
- value=StringToDouble(p,&p);
+ value=LocaleToDouble(p,&p);
if (p != q)
{
flags|=SigmaValue;
@@ -876,7 +876,7 @@
if ((*p == ',') || (*p == '/') || (*p == ':'))
p++;
q=p;
- value=StringToDouble(p,&p);
+ value=LocaleToDouble(p,&p);
if (p != q)
{
flags|=XiValue;
@@ -895,7 +895,7 @@
if ((*p == ',') || (*p == '/') || (*p == ':'))
p++;
q=p;
- value=StringToDouble(p,&p);
+ value=LocaleToDouble(p,&p);
if (p != q)
{
flags|=PsiValue;
@@ -915,7 +915,7 @@
if ((*p == ',') || (*p == '/') || (*p == ':'))
p++;
q=p;
- value=StringToDouble(p,&p);
+ value=LocaleToDouble(p,&p);
if (p != q)
{
flags|=ChiValue;
diff --git a/magick/histogram.c b/magick/histogram.c
index 4586bcf..5027c53 100644
--- a/magick/histogram.c
+++ b/magick/histogram.c
@@ -1184,8 +1184,8 @@
(void) ConcatenateMagickString(tuple,")",MaxTextExtent);
(void) QueryMagickColorname(image,&pixel,SVGCompliance,color,exception);
GetColorTuple(&pixel,MagickTrue,hex);
- (void) fprintf(file,"%10" MagickSizeFormat,p->count);
- (void) fprintf(file,": %s %s %s\n",tuple,hex,color);
+ (void) FormatLocaleFile(file,"%10" MagickSizeFormat,p->count);
+ (void) FormatLocaleFile(file,": %s %s %s\n",tuple,hex,color);
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
MagickBooleanType
diff --git a/magick/identify.c b/magick/identify.c
index 853541d..7ac595e 100644
--- a/magick/identify.c
+++ b/magick/identify.c
@@ -187,7 +187,7 @@
int
status;
- status=fprintf(file,FeaturesFormat,name,
+ status=FormatLocaleFile(file,FeaturesFormat,name,
PrintFeature(channel_features[channel].angular_second_moment),
PrintFeature(channel_features[channel].contrast),
PrintFeature(channel_features[channel].correlation),
@@ -219,7 +219,7 @@
if (channel == AlphaChannel)
{
- status=fprintf(file,StatisticsFormat,name,ClampToQuantum(scale*
+ status=FormatLocaleFile(file,StatisticsFormat,name,ClampToQuantum(scale*
(QuantumRange-channel_statistics[channel].maxima)),
(QuantumRange-channel_statistics[channel].maxima)/(double) QuantumRange,
ClampToQuantum(scale*(QuantumRange-channel_statistics[channel].minima)),
@@ -232,7 +232,7 @@
channel_statistics[channel].skewness);
return(status);
}
- status=fprintf(file,StatisticsFormat,name,ClampToQuantum(scale*
+ status=FormatLocaleFile(file,StatisticsFormat,name,ClampToQuantum(scale*
channel_statistics[channel].minima),channel_statistics[channel].minima/
(double) QuantumRange,ClampToQuantum(scale*
channel_statistics[channel].maxima),channel_statistics[channel].maxima/
@@ -315,59 +315,59 @@
*/
if (*image->magick_filename != '\0')
if (LocaleCompare(image->magick_filename,image->filename) != 0)
- (void) fprintf(file,"%s=>",image->magick_filename);
+ (void) FormatLocaleFile(file,"%s=>",image->magick_filename);
if ((GetPreviousImageInList(image) == (Image *) NULL) &&
(GetNextImageInList(image) == (Image *) NULL) &&
(image->scene == 0))
- (void) fprintf(file,"%s ",image->filename);
+ (void) FormatLocaleFile(file,"%s ",image->filename);
else
- (void) fprintf(file,"%s[%.20g] ",image->filename,(double) image->scene);
- (void) fprintf(file,"%s ",image->magick);
+ (void) FormatLocaleFile(file,"%s[%.20g] ",image->filename,(double) image->scene);
+ (void) FormatLocaleFile(file,"%s ",image->magick);
if ((image->magick_columns != 0) || (image->magick_rows != 0))
if ((image->magick_columns != image->columns) ||
(image->magick_rows != image->rows))
- (void) fprintf(file,"%.20gx%.20g=>",(double) image->magick_columns,
+ (void) FormatLocaleFile(file,"%.20gx%.20g=>",(double) image->magick_columns,
(double) image->magick_rows);
- (void) fprintf(file,"%.20gx%.20g ",(double) image->columns,(double)
+ (void) FormatLocaleFile(file,"%.20gx%.20g ",(double) image->columns,(double)
image->rows);
if ((image->page.width != 0) || (image->page.height != 0) ||
(image->page.x != 0) || (image->page.y != 0))
- (void) fprintf(file,"%.20gx%.20g%+.20g%+.20g ",(double)
+ (void) FormatLocaleFile(file,"%.20gx%.20g%+.20g%+.20g ",(double)
image->page.width,(double) image->page.height,(double) image->page.x,
(double) image->page.y);
- (void) fprintf(file,"%.20g-bit ",(double) image->depth);
+ (void) FormatLocaleFile(file,"%.20g-bit ",(double) image->depth);
if (image->type != UndefinedType)
- (void) fprintf(file,"%s ",CommandOptionToMnemonic(MagickTypeOptions,
+ (void) FormatLocaleFile(file,"%s ",CommandOptionToMnemonic(MagickTypeOptions,
(ssize_t) image->type));
if (image->storage_class == DirectClass)
{
- (void) fprintf(file,"DirectClass ");
+ (void) FormatLocaleFile(file,"DirectClass ");
if (image->total_colors != 0)
{
(void) FormatMagickSize(image->total_colors,MagickFalse,format);
- (void) fprintf(file,"%s ",format);
+ (void) FormatLocaleFile(file,"%s ",format);
}
}
else
if (image->total_colors <= image->colors)
- (void) fprintf(file,"PseudoClass %.20gc ",(double) image->colors);
+ (void) FormatLocaleFile(file,"PseudoClass %.20gc ",(double) image->colors);
else
- (void) fprintf(file,"PseudoClass %.20g=>%.20gc ",(double)
+ (void) FormatLocaleFile(file,"PseudoClass %.20g=>%.20gc ",(double)
image->total_colors,(double) image->colors);
if (image->error.mean_error_per_pixel != 0.0)
- (void) fprintf(file,"%.20g/%f/%fdb ",(double)
+ (void) FormatLocaleFile(file,"%.20g/%f/%fdb ",(double)
(image->error.mean_error_per_pixel+0.5),
image->error.normalized_mean_error,
image->error.normalized_maximum_error);
if (GetBlobSize(image) != 0)
{
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
- (void) fprintf(file,"%s ",format);
+ (void) FormatLocaleFile(file,"%s ",format);
}
- (void) fprintf(file,"%0.3fu %lu:%02lu.%03lu",user_time,(unsigned long)
+ (void) FormatLocaleFile(file,"%0.3fu %lu:%02lu.%03lu",user_time,(unsigned long)
(elapsed_time/60.0),(unsigned long) floor(fmod(elapsed_time,60.0)),
(unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))));
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"\n");
(void) fflush(file);
return(ferror(file) != 0 ? MagickFalse : MagickTrue);
}
@@ -380,7 +380,7 @@
ping=pixels == (const PixelPacket *) NULL ? MagickTrue : MagickFalse;
type=GetImageType(image,&image->exception);
(void) SignatureImage(image);
- (void) fprintf(file,"Image: %s\n",image->filename);
+ (void) FormatLocaleFile(file,"Image: %s\n",image->filename);
if (*image->magick_filename != '\0')
if (LocaleCompare(image->magick_filename,image->filename) != 0)
{
@@ -388,45 +388,45 @@
filename[MaxTextExtent];
GetPathComponent(image->magick_filename,TailPath,filename);
- (void) fprintf(file," Base filename: %s\n",filename);
+ (void) FormatLocaleFile(file," Base filename: %s\n",filename);
}
magick_info=GetMagickInfo(image->magick,&image->exception);
if ((magick_info == (const MagickInfo *) NULL) ||
(*GetMagickDescription(magick_info) == '\0'))
- (void) fprintf(file," Format: %s\n",image->magick);
+ (void) FormatLocaleFile(file," Format: %s\n",image->magick);
else
- (void) fprintf(file," Format: %s (%s)\n",image->magick,
+ (void) FormatLocaleFile(file," Format: %s (%s)\n",image->magick,
GetMagickDescription(magick_info));
- (void) fprintf(file," Class: %s\n",CommandOptionToMnemonic(MagickClassOptions,
+ (void) FormatLocaleFile(file," Class: %s\n",CommandOptionToMnemonic(MagickClassOptions,
(ssize_t) image->storage_class));
- (void) fprintf(file," Geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+ (void) FormatLocaleFile(file," Geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
image->columns,(double) image->rows,(double) image->tile_offset.x,(double)
image->tile_offset.y);
if ((image->magick_columns != 0) || (image->magick_rows != 0))
if ((image->magick_columns != image->columns) ||
(image->magick_rows != image->rows))
- (void) fprintf(file," Base geometry: %.20gx%.20g\n",(double)
+ (void) FormatLocaleFile(file," Base geometry: %.20gx%.20g\n",(double)
image->magick_columns,(double) image->magick_rows);
if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
{
- (void) fprintf(file," Resolution: %gx%g\n",image->x_resolution,
+ (void) FormatLocaleFile(file," Resolution: %gx%g\n",image->x_resolution,
image->y_resolution);
- (void) fprintf(file," Print size: %gx%g\n",(double) image->columns/
+ (void) FormatLocaleFile(file," Print size: %gx%g\n",(double) image->columns/
image->x_resolution,(double) image->rows/image->y_resolution);
}
- (void) fprintf(file," Units: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Units: %s\n",CommandOptionToMnemonic(
MagickResolutionOptions,(ssize_t) image->units));
- (void) fprintf(file," Type: %s\n",CommandOptionToMnemonic(MagickTypeOptions,
+ (void) FormatLocaleFile(file," Type: %s\n",CommandOptionToMnemonic(MagickTypeOptions,
(ssize_t) type));
if (image->type != UndefinedType)
- (void) fprintf(file," Base type: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Base type: %s\n",CommandOptionToMnemonic(
MagickTypeOptions,(ssize_t) image->type));
- (void) fprintf(file," Endianess: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Endianess: %s\n",CommandOptionToMnemonic(
MagickEndianOptions,(ssize_t) image->endian));
/*
Detail channel depth and extrema.
*/
- (void) fprintf(file," Colorspace: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Colorspace: %s\n",CommandOptionToMnemonic(
MagickColorspaceOptions,(ssize_t) image->colorspace));
channel_statistics=(ChannelStatistics *) NULL;
channel_features=(ChannelFeatures *) NULL;
@@ -446,11 +446,11 @@
}
depth=GetImageDepth(image,&image->exception);
if (image->depth == depth)
- (void) fprintf(file," Depth: %.20g-bit\n",(double) image->depth);
+ (void) FormatLocaleFile(file," Depth: %.20g-bit\n",(double) image->depth);
else
- (void) fprintf(file," Depth: %.20g/%.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," Depth: %.20g/%.20g-bit\n",(double)
image->depth,(double) depth);
- (void) fprintf(file," Channel depth:\n");
+ (void) FormatLocaleFile(file," Channel depth:\n");
if (IsGrayImage(image,&image->exception) != MagickFalse)
colorspace=GRAYColorspace;
switch (colorspace)
@@ -458,35 +458,35 @@
case RGBColorspace:
default:
{
- (void) fprintf(file," red: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," red: %.20g-bit\n",(double)
channel_statistics[RedChannel].depth);
- (void) fprintf(file," green: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," green: %.20g-bit\n",(double)
channel_statistics[GreenChannel].depth);
- (void) fprintf(file," blue: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," blue: %.20g-bit\n",(double)
channel_statistics[BlueChannel].depth);
break;
}
case CMYKColorspace:
{
- (void) fprintf(file," cyan: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," cyan: %.20g-bit\n",(double)
channel_statistics[CyanChannel].depth);
- (void) fprintf(file," magenta: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," magenta: %.20g-bit\n",(double)
channel_statistics[MagentaChannel].depth);
- (void) fprintf(file," yellow: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," yellow: %.20g-bit\n",(double)
channel_statistics[YellowChannel].depth);
- (void) fprintf(file," black: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," black: %.20g-bit\n",(double)
channel_statistics[BlackChannel].depth);
break;
}
case GRAYColorspace:
{
- (void) fprintf(file," gray: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," gray: %.20g-bit\n",(double)
channel_statistics[GrayChannel].depth);
break;
}
}
if (image->matte != MagickFalse)
- (void) fprintf(file," alpha: %.20g-bit\n",(double)
+ (void) FormatLocaleFile(file," alpha: %.20g-bit\n",(double)
channel_statistics[OpacityChannel].depth);
scale=1;
if (image->depth <= MAGICKCORE_QUANTUM_DEPTH)
@@ -495,7 +495,7 @@
}
if (channel_statistics != (ChannelStatistics *) NULL)
{
- (void) fprintf(file," Channel statistics:\n");
+ (void) FormatLocaleFile(file," Channel statistics:\n");
switch (colorspace)
{
case RGBColorspace:
@@ -533,7 +533,7 @@
channel_statistics);
if (colorspace != GRAYColorspace)
{
- (void) fprintf(file," Image statistics:\n");
+ (void) FormatLocaleFile(file," Image statistics:\n");
(void) PrintChannelStatistics(file,CompositeChannels,"Overall",1.0/scale,
channel_statistics);
}
@@ -542,7 +542,7 @@
}
if (channel_features != (ChannelFeatures *) NULL)
{
- (void) fprintf(file," Channel features (horizontal, vertical, left and right diagonals, average):\n");
+ (void) FormatLocaleFile(file," Channel features (horizontal, vertical, left and right diagonals, average):\n");
switch (colorspace)
{
case RGBColorspace:
@@ -579,7 +579,7 @@
if (ping == MagickFalse)
{
if (image->colorspace == CMYKColorspace)
- (void) fprintf(file," Total ink density: %.0f%%\n",100.0*
+ (void) FormatLocaleFile(file," Total ink density: %.0f%%\n",100.0*
GetImageTotalInkDensity(image)/(double) QuantumRange);
x=0;
if (image->matte != MagickFalse)
@@ -619,25 +619,25 @@
SetMagickPixelPacket(image,p,indexes+x,&pixel);
(void) QueryMagickColorname(image,&pixel,SVGCompliance,tuple,
&image->exception);
- (void) fprintf(file," Alpha: %s ",tuple);
+ (void) FormatLocaleFile(file," Alpha: %s ",tuple);
GetColorTuple(&pixel,MagickTrue,tuple);
- (void) fprintf(file," %s\n",tuple);
+ (void) FormatLocaleFile(file," %s\n",tuple);
}
}
artifact=GetImageArtifact(image,"identify:unique-colors");
if ((artifact != (const char *) NULL) &&
(IsMagickTrue(artifact) != MagickFalse))
- (void) fprintf(file," Colors: %.20g\n",(double)
+ (void) FormatLocaleFile(file," Colors: %.20g\n",(double)
GetNumberColors(image,(FILE *) NULL,&image->exception));
if (IsHistogramImage(image,&image->exception) != MagickFalse)
{
- (void) fprintf(file," Histogram:\n");
+ (void) FormatLocaleFile(file," Histogram:\n");
(void) GetNumberColors(image,file,&image->exception);
}
}
if (image->storage_class == PseudoClass)
{
- (void) fprintf(file," Colormap: %.20g\n",(double) image->colors);
+ (void) FormatLocaleFile(file," Colormap: %.20g\n",(double) image->colors);
if (image->colors <= 1024)
{
char
@@ -678,24 +678,24 @@
(void) QueryMagickColorname(image,&pixel,SVGCompliance,color,
&image->exception);
GetColorTuple(&pixel,MagickTrue,hex);
- (void) fprintf(file," %8ld: %s %s %s\n",(long) i,tuple,hex,color);
+ (void) FormatLocaleFile(file," %8ld: %s %s %s\n",(long) i,tuple,hex,color);
p++;
}
}
}
if (image->error.mean_error_per_pixel != 0.0)
- (void) fprintf(file," Mean error per pixel: %g\n",
+ (void) FormatLocaleFile(file," Mean error per pixel: %g\n",
image->error.mean_error_per_pixel);
if (image->error.normalized_mean_error != 0.0)
- (void) fprintf(file," Normalized mean error: %g\n",
+ (void) FormatLocaleFile(file," Normalized mean error: %g\n",
image->error.normalized_mean_error);
if (image->error.normalized_maximum_error != 0.0)
- (void) fprintf(file," Normalized maximum error: %g\n",
+ (void) FormatLocaleFile(file," Normalized maximum error: %g\n",
image->error.normalized_maximum_error);
- (void) fprintf(file," Rendering intent: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Rendering intent: %s\n",CommandOptionToMnemonic(
MagickIntentOptions,(ssize_t) image->rendering_intent));
if (image->gamma != 0.0)
- (void) fprintf(file," Gamma: %g\n",image->gamma);
+ (void) FormatLocaleFile(file," Gamma: %g\n",image->gamma);
if ((image->chromaticity.red_primary.x != 0.0) ||
(image->chromaticity.green_primary.x != 0.0) ||
(image->chromaticity.blue_primary.x != 0.0) ||
@@ -704,66 +704,66 @@
/*
Display image chromaticity.
*/
- (void) fprintf(file," Chromaticity:\n");
- (void) fprintf(file," red primary: (%g,%g)\n",
+ (void) FormatLocaleFile(file," Chromaticity:\n");
+ (void) FormatLocaleFile(file," red primary: (%g,%g)\n",
image->chromaticity.red_primary.x,image->chromaticity.red_primary.y);
- (void) fprintf(file," green primary: (%g,%g)\n",
+ (void) FormatLocaleFile(file," green primary: (%g,%g)\n",
image->chromaticity.green_primary.x,
image->chromaticity.green_primary.y);
- (void) fprintf(file," blue primary: (%g,%g)\n",
+ (void) FormatLocaleFile(file," blue primary: (%g,%g)\n",
image->chromaticity.blue_primary.x,image->chromaticity.blue_primary.y);
- (void) fprintf(file," white point: (%g,%g)\n",
+ (void) FormatLocaleFile(file," white point: (%g,%g)\n",
image->chromaticity.white_point.x,image->chromaticity.white_point.y);
}
if ((image->extract_info.width*image->extract_info.height) != 0)
- (void) fprintf(file," Tile geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+ (void) FormatLocaleFile(file," Tile geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
image->extract_info.width,(double) image->extract_info.height,(double)
image->extract_info.x,(double) image->extract_info.y);
- (void) fprintf(file," Interlace: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Interlace: %s\n",CommandOptionToMnemonic(
MagickInterlaceOptions,(ssize_t) image->interlace));
(void) QueryColorname(image,&image->background_color,SVGCompliance,color,
&image->exception);
- (void) fprintf(file," Background color: %s\n",color);
+ (void) FormatLocaleFile(file," Background color: %s\n",color);
(void) QueryColorname(image,&image->border_color,SVGCompliance,color,
&image->exception);
- (void) fprintf(file," Border color: %s\n",color);
+ (void) FormatLocaleFile(file," Border color: %s\n",color);
(void) QueryColorname(image,&image->matte_color,SVGCompliance,color,
&image->exception);
- (void) fprintf(file," Matte color: %s\n",color);
+ (void) FormatLocaleFile(file," Matte color: %s\n",color);
(void) QueryColorname(image,&image->transparent_color,SVGCompliance,color,
&image->exception);
- (void) fprintf(file," Transparent color: %s\n",color);
- (void) fprintf(file," Compose: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Transparent color: %s\n",color);
+ (void) FormatLocaleFile(file," Compose: %s\n",CommandOptionToMnemonic(
MagickComposeOptions,(ssize_t) image->compose));
if ((image->page.width != 0) || (image->page.height != 0) ||
(image->page.x != 0) || (image->page.y != 0))
- (void) fprintf(file," Page geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+ (void) FormatLocaleFile(file," Page geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
image->page.width,(double) image->page.height,(double)
image->page.x,(double) image->page.y);
if ((image->page.x != 0) || (image->page.y != 0))
- (void) fprintf(file," Origin geometry: %+.20g%+.20g\n",(double)
+ (void) FormatLocaleFile(file," Origin geometry: %+.20g%+.20g\n",(double)
image->page.x,(double) image->page.y);
- (void) fprintf(file," Dispose: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Dispose: %s\n",CommandOptionToMnemonic(
MagickDisposeOptions,(ssize_t) image->dispose));
if (image->delay != 0)
- (void) fprintf(file," Delay: %.20gx%.20g\n",(double) image->delay,
+ (void) FormatLocaleFile(file," Delay: %.20gx%.20g\n",(double) image->delay,
(double) image->ticks_per_second);
if (image->iterations != 1)
- (void) fprintf(file," Iterations: %.20g\n",(double) image->iterations);
+ (void) FormatLocaleFile(file," Iterations: %.20g\n",(double) image->iterations);
if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
- (void) fprintf(file," Scene: %.20g of %.20g\n",(double) image->scene,
+ (void) FormatLocaleFile(file," Scene: %.20g of %.20g\n",(double) image->scene,
(double) GetImageListLength(image));
else
if (image->scene != 0)
- (void) fprintf(file," Scene: %.20g\n",(double) image->scene);
- (void) fprintf(file," Compression: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Scene: %.20g\n",(double) image->scene);
+ (void) FormatLocaleFile(file," Compression: %s\n",CommandOptionToMnemonic(
MagickCompressOptions,(ssize_t) image->compression));
if (image->quality != UndefinedCompressionQuality)
- (void) fprintf(file," Quality: %.20g\n",(double) image->quality);
- (void) fprintf(file," Orientation: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Quality: %.20g\n",(double) image->quality);
+ (void) FormatLocaleFile(file," Orientation: %s\n",CommandOptionToMnemonic(
MagickOrientationOptions,(ssize_t) image->orientation));
if (image->montage != (char *) NULL)
- (void) fprintf(file," Montage: %s\n",image->montage);
+ (void) FormatLocaleFile(file," Montage: %s\n",image->montage);
if (image->directory != (char *) NULL)
{
Image
@@ -784,7 +784,7 @@
*/
image_info=AcquireImageInfo();
(void) CloneString(&image_info->size,"64x64");
- (void) fprintf(file," Directory:\n");
+ (void) FormatLocaleFile(file," Directory:\n");
for (p=image->directory; *p != '\0'; p++)
{
q=p;
@@ -792,26 +792,26 @@
q++;
(void) CopyMagickString(image_info->filename,p,(size_t) (q-p+1));
p=q;
- (void) fprintf(file," %s",image_info->filename);
+ (void) FormatLocaleFile(file," %s",image_info->filename);
handler=SetWarningHandler((WarningHandler) NULL);
tile=ReadImage(image_info,&image->exception);
(void) SetWarningHandler(handler);
if (tile == (Image *) NULL)
{
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"\n");
continue;
}
- (void) fprintf(file," %.20gx%.20g %s\n",(double) tile->magick_columns,
+ (void) FormatLocaleFile(file," %.20gx%.20g %s\n",(double) tile->magick_columns,
(double) tile->magick_rows,tile->magick);
(void) SignatureImage(tile);
ResetImagePropertyIterator(tile);
property=GetNextImageProperty(tile);
while (property != (const char *) NULL)
{
- (void) fprintf(file," %s:\n",property);
+ (void) FormatLocaleFile(file," %s:\n",property);
value=GetImageProperty(tile,property);
if (value != (const char *) NULL)
- (void) fprintf(file,"%s\n",value);
+ (void) FormatLocaleFile(file,"%s\n",value);
property=GetNextImageProperty(tile);
}
tile=DestroyImage(tile);
@@ -826,27 +826,27 @@
/*
Display image properties.
*/
- (void) fprintf(file," Properties:\n");
+ (void) FormatLocaleFile(file," Properties:\n");
while (property != (const char *) NULL)
{
- (void) fprintf(file," %s: ",property);
+ (void) FormatLocaleFile(file," %s: ",property);
value=GetImageProperty(image,property);
if (value != (const char *) NULL)
- (void) fprintf(file,"%s\n",value);
+ (void) FormatLocaleFile(file,"%s\n",value);
property=GetNextImageProperty(image);
}
}
- (void) FormatMagickString(key,MaxTextExtent,"8BIM:1999,2998:#1");
+ (void) FormatLocaleString(key,MaxTextExtent,"8BIM:1999,2998:#1");
value=GetImageProperty(image,key);
if (value != (const char *) NULL)
{
/*
Display clipping path.
*/
- (void) fprintf(file," Clipping path: ");
+ (void) FormatLocaleFile(file," Clipping path: ");
if (strlen(value) > 80)
(void) fputc('\n',file);
- (void) fprintf(file,"%s\n",value);
+ (void) FormatLocaleFile(file,"%s\n",value);
}
ResetImageProfileIterator(image);
name=GetNextImageProfile(image);
@@ -858,13 +858,13 @@
/*
Identify image profiles.
*/
- (void) fprintf(file," Profiles:\n");
+ (void) FormatLocaleFile(file," Profiles:\n");
while (name != (char *) NULL)
{
profile=GetImageProfile(image,name);
if (profile == (StringInfo *) NULL)
continue;
- (void) fprintf(file," Profile-%s: %.20g bytes\n",name,(double)
+ (void) FormatLocaleFile(file," Profile-%s: %.20g bytes\n",name,(double)
GetStringInfoLength(profile));
#if defined(MAGICKCORE_LCMS_DELEGATE)
if ((LocaleCompare(name,"icc") == 0) ||
@@ -883,23 +883,23 @@
name=cmsTakeProductName(icc_profile);
if (name != (const char *) NULL)
- (void) fprintf(file," %s\n",name);
+ (void) FormatLocaleFile(file," %s\n",name);
#else
char
info[MaxTextExtent];
(void) cmsGetProfileInfoASCII(icc_profile,cmsInfoDescription,
"en","US",info,MaxTextExtent);
- (void) fprintf(file," Description: %s\n",info);
+ (void) FormatLocaleFile(file," Description: %s\n",info);
(void) cmsGetProfileInfoASCII(icc_profile,cmsInfoManufacturer,
"en","US",info,MaxTextExtent);
- (void) fprintf(file," Manufacturer: %s\n",info);
+ (void) FormatLocaleFile(file," Manufacturer: %s\n",info);
(void) cmsGetProfileInfoASCII(icc_profile,cmsInfoModel,"en",
"US",info,MaxTextExtent);
- (void) fprintf(file," Model: %s\n",info);
+ (void) FormatLocaleFile(file," Model: %s\n",info);
(void) cmsGetProfileInfoASCII(icc_profile,cmsInfoCopyright,
"en","US",info,MaxTextExtent);
- (void) fprintf(file," Copyright: %s\n",info);
+ (void) FormatLocaleFile(file," Copyright: %s\n",info);
#endif
(void) cmsCloseProfile(icc_profile);
}
@@ -991,7 +991,7 @@
case 219: tag="Custom Field 20"; break;
default: tag="unknown"; break;
}
- (void) fprintf(file," %s[%.20g,%.20g]: ",tag,(double)
+ (void) FormatLocaleFile(file," %s[%.20g,%.20g]: ",tag,(double)
dataset,(double) record);
length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
length|=GetStringInfoDatum(profile)[i++];
@@ -1032,13 +1032,13 @@
/*
Display image artifacts.
*/
- (void) fprintf(file," Artifacts:\n");
+ (void) FormatLocaleFile(file," Artifacts:\n");
while (artifact != (const char *) NULL)
{
- (void) fprintf(file," %s: ",artifact);
+ (void) FormatLocaleFile(file," %s: ",artifact);
value=GetImageArtifact(image,artifact);
if (value != (const char *) NULL)
- (void) fprintf(file,"%s\n",value);
+ (void) FormatLocaleFile(file,"%s\n",value);
artifact=GetNextImageArtifact(image);
}
}
@@ -1049,32 +1049,32 @@
/*
Display image registry.
*/
- (void) fprintf(file," Registry:\n");
+ (void) FormatLocaleFile(file," Registry:\n");
while (registry != (const char *) NULL)
{
- (void) fprintf(file," %s: ",registry);
+ (void) FormatLocaleFile(file," %s: ",registry);
value=(const char *) GetImageRegistry(StringRegistryType,registry,
&image->exception);
if (value != (const char *) NULL)
- (void) fprintf(file,"%s\n",value);
+ (void) FormatLocaleFile(file,"%s\n",value);
registry=GetNextImageRegistry();
}
}
- (void) fprintf(file," Tainted: %s\n",CommandOptionToMnemonic(
+ (void) FormatLocaleFile(file," Tainted: %s\n",CommandOptionToMnemonic(
MagickBooleanOptions,(ssize_t) image->taint));
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
- (void) fprintf(file," Filesize: %sB\n",format);
+ (void) FormatLocaleFile(file," Filesize: %sB\n",format);
(void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
MagickFalse,format);
- (void) fprintf(file," Number pixels: %s\n",format);
+ (void) FormatLocaleFile(file," Number pixels: %s\n",format);
(void) FormatMagickSize((MagickSizeType) ((double) image->columns*image->rows/
elapsed_time+0.5),MagickFalse,format);
- (void) fprintf(file," Pixels per second: %s\n",format);
- (void) fprintf(file," User time: %0.3fu\n",user_time);
- (void) fprintf(file," Elapsed time: %lu:%02lu.%03lu\n",(unsigned long)
+ (void) FormatLocaleFile(file," Pixels per second: %s\n",format);
+ (void) FormatLocaleFile(file," User time: %0.3fu\n",user_time);
+ (void) FormatLocaleFile(file," Elapsed time: %lu:%02lu.%03lu\n",(unsigned long)
(elapsed_time/60.0),(unsigned long) ceil(fmod(elapsed_time,60.0)),
(unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))));
- (void) fprintf(file," Version: %s\n",GetMagickVersion((size_t *)
+ (void) FormatLocaleFile(file," Version: %s\n",GetMagickVersion((size_t *)
NULL));
(void) fflush(file);
return(ferror(file) != 0 ? MagickFalse : MagickTrue);
diff --git a/magick/image.c b/magick/image.c
index 3a2aa0f..377599b 100644
--- a/magick/image.c
+++ b/magick/image.c
@@ -683,7 +683,7 @@
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(pathname != NULL);
property=AcquireString(pathname);
- (void) FormatMagickString(property,MaxTextExtent,"8BIM:1999,2998:%s",
+ (void) FormatLocaleString(property,MaxTextExtent,"8BIM:1999,2998:%s",
pathname);
value=GetImageProperty(image,property);
property=DestroyString(property);
@@ -708,7 +708,7 @@
}
if (inside == MagickFalse)
(void) NegateImage(clip_mask,MagickFalse);
- (void) FormatMagickString(clip_mask->magick_filename,MaxTextExtent,
+ (void) FormatLocaleString(clip_mask->magick_filename,MaxTextExtent,
"8BIM:1999,2998:%s\nPS",pathname);
(void) SetImageClipMask(image,clip_mask);
clip_mask=DestroyImage(clip_mask);
@@ -1772,7 +1772,7 @@
q++;
c=(*q);
*q='\0';
- (void) FormatMagickString(filename+(p-format),(size_t) (MaxTextExtent-
+ (void) FormatLocaleString(filename+(p-format),(size_t) (MaxTextExtent-
(p-format)),p,value);
*q=c;
(void) ConcatenateMagickString(filename,q,MaxTextExtent);
@@ -4596,7 +4596,7 @@
value=GetImageOption(image_info,option);
if (value != (const char *) NULL)
{
- (void) FormatMagickString(property,MaxTextExtent,"%s",option);
+ (void) FormatLocaleString(property,MaxTextExtent,"%s",option);
(void) SetImageArtifact(image,property,value);
}
option=GetNextImageOption(image_info);
diff --git a/magick/image.h b/magick/image.h
index 136e1b0..9638c45 100644
--- a/magick/image.h
+++ b/magick/image.h
@@ -134,6 +134,7 @@
#include "magick/effect.h"
#include "magick/geometry.h"
#include "magick/layer.h"
+#include "magick/locale_.h"
#include "magick/monitor.h"
#include "magick/pixel.h"
#include "magick/profile.h"
diff --git a/magick/layer.c b/magick/layer.c
index a7f3d08..81afc08 100644
--- a/magick/layer.c
+++ b/magick/layer.c
@@ -1064,12 +1064,12 @@
*/
#if DEBUG_OPT_FRAME
i=0;
- fprintf(stderr, "frame %.20g :-\n", (double) i);
+ FormatLocaleFile(stderr, "frame %.20g :-\n", (double) i);
#endif
disposals[0]=NoneDispose;
bounds[0]=CompareImageBounds(prev_image,curr,CompareAnyLayer,exception);
#if DEBUG_OPT_FRAME
- fprintf(stderr, "overlay: %.20gx%.20g%+.20g%+.20g\n\n",
+ FormatLocaleFile(stderr, "overlay: %.20gx%.20g%+.20g%+.20g\n\n",
(double) bounds[i].width,(double) bounds[i].height,
(double) bounds[i].x,(double) bounds[i].y );
#endif
@@ -1087,7 +1087,7 @@
for ( ; curr != (const Image *) NULL; curr=GetNextImageInList(curr))
{
#if DEBUG_OPT_FRAME
- fprintf(stderr, "frame %.20g :-\n", (double) i);
+ FormatLocaleFile(stderr, "frame %.20g :-\n", (double) i);
#endif
/*
Assume none disposal is the best
@@ -1096,7 +1096,7 @@
cleared=IsBoundsCleared(curr->previous,curr,&bounds[i],exception);
disposals[i-1]=NoneDispose;
#if DEBUG_OPT_FRAME
- fprintf(stderr, "overlay: %.20gx%.20g%+.20g%+.20g%s%s\n",
+ FormatLocaleFile(stderr, "overlay: %.20gx%.20g%+.20g%+.20g%s%s\n",
(double) bounds[i].width,(double) bounds[i].height,
(double) bounds[i].x,(double) bounds[i].y,
bounds[i].x < 0?" (unchanged)":"",
@@ -1125,7 +1125,7 @@
try_bounds=CompareImageBounds(prev_image,curr,CompareAnyLayer,exception);
try_cleared=IsBoundsCleared(prev_image,curr,&try_bounds,exception);
#if DEBUG_OPT_FRAME
- fprintf(stderr, "test_prev: %.20gx%.20g%+.20g%+.20g%s\n",
+ FormatLocaleFile(stderr, "test_prev: %.20gx%.20g%+.20g%+.20g%s\n",
(double) try_bounds.width,(double) try_bounds.height,
(double) try_bounds.x,(double) try_bounds.y,
try_cleared?" (pixels were cleared)":"");
@@ -1138,9 +1138,9 @@
bounds[i]=try_bounds;
disposals[i-1]=PreviousDispose;
#if DEBUG_OPT_FRAME
- fprintf(stderr, "previous: accepted\n");
+ FormatLocaleFile(stderr, "previous: accepted\n");
} else {
- fprintf(stderr, "previous: rejected\n");
+ FormatLocaleFile(stderr, "previous: rejected\n");
#endif
}
@@ -1196,7 +1196,7 @@
try_bounds=CompareImageBounds(bgnd_image,curr,CompareAnyLayer,exception);
try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
#if DEBUG_OPT_FRAME
- fprintf(stderr, "background: %s\n",
+ FormatLocaleFile(stderr, "background: %s\n",
try_cleared?"(pixels cleared)":"");
#endif
if ( try_cleared )
@@ -1209,7 +1209,7 @@
*/
try_bounds=CompareImageBounds(curr->previous,curr,CompareClearLayer,exception);
#if DEBUG_OPT_FRAME
- fprintf(stderr, "expand_clear: %.20gx%.20g%+.20g%+.20g%s\n",
+ FormatLocaleFile(stderr, "expand_clear: %.20gx%.20g%+.20g%+.20g%s\n",
(double) try_bounds.width,(double) try_bounds.height,
(double) try_bounds.x,(double) try_bounds.y,
try_bounds.x<0?" (no expand nessary)":"");
@@ -1219,7 +1219,7 @@
else
{
#if DEBUG_OPT_FRAME
- fprintf(stderr, "expand_bgnd: %.20gx%.20g%+.20g%+.20g\n",
+ FormatLocaleFile(stderr, "expand_bgnd: %.20gx%.20g%+.20g%+.20g\n",
(double) bgnd_bounds.width,(double) bgnd_bounds.height,
(double) bgnd_bounds.x,(double) bgnd_bounds.y );
#endif
@@ -1250,7 +1250,7 @@
bgnd_bounds.height = try_bounds.height;
}
#if DEBUG_OPT_FRAME
- fprintf(stderr, " to : %.20gx%.20g%+.20g%+.20g\n",
+ FormatLocaleFile(stderr, " to : %.20gx%.20g%+.20g%+.20g\n",
(double) bgnd_bounds.width,(double) bgnd_bounds.height,
(double) bgnd_bounds.x,(double) bgnd_bounds.y );
#endif
@@ -1265,12 +1265,12 @@
* Only CompareOverlay seemed to return something sensible.
*/
try_bounds=CompareImageBounds(bgnd_image,curr,CompareClearLayer,exception);
- fprintf(stderr, "expand_ctst: %.20gx%.20g%+.20g%+.20g\n",
+ FormatLocaleFile(stderr, "expand_ctst: %.20gx%.20g%+.20g%+.20g\n",
(double) try_bounds.width,(double) try_bounds.height,
(double) try_bounds.x,(double) try_bounds.y );
try_bounds=CompareImageBounds(bgnd_image,curr,CompareAnyLayer,exception);
try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
- fprintf(stderr, "expand_any : %.20gx%.20g%+.20g%+.20g%s\n",
+ FormatLocaleFile(stderr, "expand_any : %.20gx%.20g%+.20g%+.20g%s\n",
(double) try_bounds.width,(double) try_bounds.height,
(double) try_bounds.x,(double) try_bounds.y,
try_cleared?" (pixels cleared)":"");
@@ -1278,7 +1278,7 @@
try_bounds=CompareImageBounds(bgnd_image,curr,CompareOverlayLayer,exception);
#if DEBUG_OPT_FRAME
try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
- fprintf(stderr, "expand_test: %.20gx%.20g%+.20g%+.20g%s\n",
+ FormatLocaleFile(stderr, "expand_test: %.20gx%.20g%+.20g%+.20g%s\n",
(double) try_bounds.width,(double) try_bounds.height,
(double) try_bounds.x,(double) try_bounds.y,
try_cleared?" (pixels cleared)":"");
@@ -1302,9 +1302,9 @@
dup_image=DestroyImage(dup_image);
disposals[i-1]=BackgroundDispose;
#if DEBUG_OPT_FRAME
- fprintf(stderr, "expand_bgnd: accepted\n");
+ FormatLocaleFile(stderr, "expand_bgnd: accepted\n");
} else {
- fprintf(stderr, "expand_bgnd: reject\n");
+ FormatLocaleFile(stderr, "expand_bgnd: reject\n");
#endif
}
}
@@ -1350,19 +1350,19 @@
assert(prev_image != (Image *) NULL);
disposals[i]=disposals[i-1];
#if DEBUG_OPT_FRAME
- fprintf(stderr, "final %.20g : %s %.20gx%.20g%+.20g%+.20g\n",
+ FormatLocaleFile(stderr, "final %.20g : %s %.20gx%.20g%+.20g%+.20g\n",
(double) i-1,
CommandOptionToMnemonic(MagickDisposeOptions, disposals[i-1]),
(double) bounds[i-1].width, (double) bounds[i-1].height,
(double) bounds[i-1].x, (double) bounds[i-1].y );
#endif
#if DEBUG_OPT_FRAME
- fprintf(stderr, "interum %.20g : %s %.20gx%.20g%+.20g%+.20g\n",
+ FormatLocaleFile(stderr, "interum %.20g : %s %.20gx%.20g%+.20g%+.20g\n",
(double) i,
CommandOptionToMnemonic(MagickDisposeOptions, disposals[i]),
(double) bounds[i].width, (double) bounds[i].height,
(double) bounds[i].x, (double) bounds[i].y );
- fprintf(stderr, "\n");
+ FormatLocaleFile(stderr, "\n");
#endif
i++;
}
diff --git a/magick/locale-private.h b/magick/locale-private.h
deleted file mode 100644
index edd9721..0000000
--- a/magick/locale-private.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- 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.
- obtain a copy of the License at
-
- http://www.imagemagick.org/script/license.php
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- MagickCore locale private methods.
-*/
-#ifndef _MAGICKCORE_LOCALE_PRIVATE_H
-#define _MAGICKCORE_LOCALE_PRIVATE_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-extern MagickExport locale_t
- AcquireMagickLocale(void);
-
-extern MagickExport void
- DestroyMagickLocale(void);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif
diff --git a/magick/locale.c b/magick/locale.c
index d86f3e4..e66b266 100644
--- a/magick/locale.c
+++ b/magick/locale.c
@@ -87,7 +87,7 @@
instantiate_locale = MagickFalse;
static volatile locale_t
- locale_cache = (locale_t) NULL;
+ c_locale = (locale_t) NULL;
/*
Forward declarations.
@@ -101,30 +101,61 @@
% %
% %
% %
-+ A c q u i r e M a g i c k L o c a l e %
++ A c q u i r e C L o c a l e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% AcquireMagickLocale() allocates the C locale object, or (locale_t) 0 with
+% AcquireCLocale() allocates the C locale object, or (locale_t) 0 with
% errno set if it cannot be acquired.
%
-% The format of the AcquireMagickLocale method is:
+% The format of the AcquireCLocale method is:
%
-% locale_t AcquireMagickLocale(void)
+% locale_t AcquireCLocale(void)
%
*/
-MagickExport locale_t AcquireMagickLocale(void)
+static locale_t AcquireCLocale(void)
{
#if defined(MAGICKCORE_HAVE_NEWLOCALE)
- if (locale_cache == (locale_t) NULL)
- locale_cache=newlocale(LC_ALL_MASK,"C",(locale_t) 0);
+ if (c_locale == (locale_t) NULL)
+ c_locale=newlocale(LC_ALL_MASK,"C",(locale_t) 0);
#elif defined(MAGICKCORE_WINDOWS_SUPPORT)
- if (locale_cache == (locale_t) NULL)
- locale_cache=_create_locale(LC_ALL,"C");
+ if (c_locale == (locale_t) NULL)
+ c_locale=_create_locale(LC_ALL,"C");
#endif
- return(locale_cache);
+ return(c_locale);
+}
+
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
++ D e s t r o y C L o c a l e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DestroyCLocale() releases the resources allocated for a locale object
+% returned by a call to the AcquireCLocale() method.
+%
+% The format of the DestroyCLocale method is:
+%
+% void DestroyCLocale(void)
+%
+*/
+static void DestroyCLocale(void)
+{
+#if defined(MAGICKCORE_HAVE_NEWLOCALE)
+ if (c_locale != (locale_t) NULL)
+ freelocale(c_locale);
+#elif defined(MAGICKCORE_WINDOWS_SUPPORT)
+ if (c_locale != (locale_t) NULL)
+ _free_locale(c_locale);
+#endif
+ c_locale=(locale_t) NULL;
}
/*
@@ -168,30 +199,163 @@
% %
% %
% %
-+ D e s t r o y M a g i c k L o c a l e %
++ F o r m a t L o c a l e F i l e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% DestroyMagickLocale() releases the resources allocated for a locale object
-% returned by a call to the AcquireMagickLocale() method.
+% FormatLocaleFile() prints formatted output of a variable argument list to a
+% file in the "C" locale.
%
-% The format of the DestroyMagickLocale method is:
+% The format of the FormatLocaleFile method is:
%
-% void DestroyMagickLocale(void)
+% ssize_t FormatLocaleFile(FILE *file,const char *format,...)
+%
+% A description of each parameter follows.
+%
+% o file: the file.
+%
+% o format: A file describing the format to use to write the remaining
+% arguments.
%
*/
-MagickExport void DestroyMagickLocale(void)
+
+MagickExport ssize_t FormatLocaleFileList(FILE *file,const char *format,
+ va_list operands)
{
-#if defined(MAGICKCORE_HAVE_NEWLOCALE)
- if (locale_cache != (locale_t) NULL)
- freelocale(locale_cache);
-#elif defined(MAGICKCORE_WINDOWS_SUPPORT)
- if (locale_cache != (locale_t) NULL)
- _free_locale(locale_cache);
+ int
+ n;
+
+#if defined(MAGICKCORE_HAVE_FPRINTF_L)
+ {
+ locale_t
+ locale;
+
+ locale=AcquireCLocale();
+ if (locale == (locale_t) NULL)
+ n=fprintf(file,format,operands);
+ else
+ n=fprintf_l(file,format,locale,operands);
+ }
+#else
+#if defined(MAGICKCORE_HAVE_USELOCALE)
+ {
+ locale_t
+ locale,
+ previous_locale;
+
+ locale=AcquireCLocale();
+ if (locale == (locale_t) NULL)
+ n=fprintf(file,format,operands);
+ else
+ {
+ previous_locale=uselocale(locale);
+ n=fprintf(file,format,operands);
+ uselocale(previous_locale);
+ }
+ }
+#else
+ n=fprintf(file,format,operands);
#endif
- locale_cache=(locale_t) NULL;
+#endif
+ return((ssize_t) n);
+}
+
+MagickExport ssize_t FormatLocaleFile(FILE *file,const char *format,...)
+{
+ ssize_t
+ n;
+
+ va_list
+ operands;
+
+ va_start(operands,format);
+ n=(ssize_t) FormatLocaleFileList(file,format,operands);
+ va_end(operands);
+ return(n);
+}
+
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
++ F o r m a t L o c a l e S t r i n g %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% FormatLocaleString() prints formatted output of a variable argument list to
+% a string buffer in the "C" locale.
+%
+% The format of the FormatLocaleString method is:
+%
+% ssize_t FormatLocaleString(char *string,const size_t length,
+% const char *format,...)
+%
+% A description of each parameter follows.
+%
+% o string: FormatLocaleString() returns the formatted string in this
+% character buffer.
+%
+% o length: the maximum length of the string.
+%
+% o format: A string describing the format to use to write the remaining
+% arguments.
+%
+*/
+
+MagickExport ssize_t FormatLocaleStringList(char *string,const size_t length,
+ const char *format,va_list operands)
+{
+ int
+ n;
+
+#if defined(MAGICKCORE_HAVE_VSNPRINTF_L)
+ n=vsnprintf_l(string,length,format,(locale_t) NULL,operands);
+#elif defined(MAGICKCORE_HAVE_VSNPRINTF)
+#if defined(MAGICKCORE_HAVE_USELOCALE)
+ {
+ locale_t
+ locale,
+ previous_locale;
+
+ locale=AcquireCLocale();
+ if (locale == (locale_t) NULL)
+ n=vsnprintf(string,length,format,operands);
+ else
+ {
+ previous_locale=uselocale(locale);
+ n=vsnprintf(string,length,format,operands);
+ uselocale(previous_locale);
+ }
+ }
+#else
+ n=vsnprintf(string,length,format,operands);
+#endif
+#else
+ n=vsprintf(string,format,operands);
+#endif
+ if (n < 0)
+ string[length-1]='\0';
+ return((ssize_t) n);
+}
+
+MagickExport ssize_t FormatLocaleString(char *string,const size_t length,
+ const char *format,...)
+{
+ ssize_t
+ n;
+
+ va_list
+ operands;
+
+ va_start(operands,format);
+ n=(ssize_t) FormatLocaleStringList(string,length,format,operands);
+ va_end(operands);
+ return(n);
}
/*
@@ -464,7 +628,7 @@
if ((tag == (const char *) NULL) || (*tag == '\0'))
return(tag);
exception=AcquireExceptionInfo();
- (void) FormatMagickString(name,MaxTextExtent,"%s/",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"%s/",tag);
locale_info=GetLocaleInfo_(name,exception);
exception=DestroyExceptionInfo(exception);
if (locale_info != (const LocaleInfo *) NULL)
@@ -529,7 +693,7 @@
element=(const char *) GetNextValueInLinkedList(paths);
while (element != (const char *) NULL)
{
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",element,filename);
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",element,filename);
(void) LogMagickEvent(LocaleEvent,GetMagickModule(),
"Searching for locale file: \"%s\"",path);
xml=ConfigureFileToStringInfo(path);
@@ -703,16 +867,16 @@
(LocaleCompare(path,locale_info[i]->path) != 0))
{
if (locale_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",locale_info[i]->path);
- (void) fprintf(file,"Tag/Message\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",locale_info[i]->path);
+ (void) FormatLocaleFile(file,"Tag/Message\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=locale_info[i]->path;
- (void) fprintf(file,"%s\n",locale_info[i]->tag);
+ (void) FormatLocaleFile(file,"%s\n",locale_info[i]->tag);
if (locale_info[i]->message != (char *) NULL)
- (void) fprintf(file," %s",locale_info[i]->message);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file," %s",locale_info[i]->message);
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
locale_info=(const LocaleInfo **)
@@ -795,10 +959,10 @@
{
if (reason == (char *) NULL)
return;
- (void) fprintf(stderr,"%s: %s",GetClientName(),reason);
+ (void) FormatLocaleFile(stderr,"%s: %s",GetClientName(),reason);
if (description != (char *) NULL)
- (void) fprintf(stderr," (%s)",description);
- (void) fprintf(stderr,".\n");
+ (void) FormatLocaleFile(stderr," (%s)",description);
+ (void) FormatLocaleFile(stderr,".\n");
(void) fflush(stderr);
exit(1);
}
@@ -1156,8 +1320,59 @@
if (locale_semaphore == (SemaphoreInfo *) NULL)
AcquireSemaphoreInfo(&locale_semaphore);
LockSemaphoreInfo(locale_semaphore);
- DestroyMagickLocale();
+ DestroyCLocale();
instantiate_locale=MagickFalse;
UnlockSemaphoreInfo(locale_semaphore);
DestroySemaphoreInfo(&locale_semaphore);
}
+
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
++ L o c a l e T o D o u b l e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% LocaleToDouble() interprets the string as a floating point number in the
+% "C" locale and returns its value as a double. If sentinal is not a null
+% pointer, the method also sets the value pointed by sentinal to point to the
+% first character after the number.
+%
+% The format of the LocaleToDouble method is:
+%
+% double LocaleToDouble(const char *value,char **sentinal)
+%
+% A description of each parameter follows:
+%
+% o value: the string value.
+%
+% o sentinal: if sentinal is not NULL, a pointer to the character after the
+% last character used in the conversion is stored in the location
+% referenced by sentinal.
+%
+*/
+MagickExport double LocaleToDouble(const char *string,char **sentinal)
+{
+ double
+ value;
+
+#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);
+ }
+#else
+ value=strtod(string,sentinal);
+#endif
+ return(value);
+}
diff --git a/magick/locale_.h b/magick/locale_.h
index 88819b5..59e7fbd 100644
--- a/magick/locale_.h
+++ b/magick/locale_.h
@@ -52,6 +52,9 @@
*GetLocaleInfo_(const char *,ExceptionInfo *),
**GetLocaleInfoList(const char *,size_t *,ExceptionInfo *);
+extern MagickExport double
+ LocaleToDouble(const char *,char **);
+
extern MagickExport LinkedListInfo
*DestroyLocaleOptions(LinkedListInfo *),
*GetLocaleOptions(const char *,ExceptionInfo *);
@@ -60,6 +63,16 @@
ListLocaleInfo(FILE *,ExceptionInfo *),
LocaleComponentGenesis(void);
+extern MagickExport ssize_t
+ FormatLocaleFile(FILE *,const char *,...)
+ magick_attribute((format (printf,2,3))),
+ FormatLocaleFileList(FILE *,const char *,va_list)
+ magick_attribute((format (printf,2,0))),
+ FormatLocaleString(char *,const size_t,const char *,...)
+ magick_attribute((format (printf,3,4))),
+ FormatLocaleStringList(char *,const size_t,const char *,va_list)
+ magick_attribute((format (printf,3,0)));
+
extern MagickExport void
LocaleComponentTerminus(void);
diff --git a/magick/log.c b/magick/log.c
index 97168cd..fce62b3 100644
--- a/magick/log.c
+++ b/magick/log.c
@@ -230,7 +230,7 @@
if (log_info->file != (FILE *) NULL)
{
if (log_info->append == MagickFalse)
- (void) fprintf(log_info->file,"</log>\n");
+ (void) FormatLocaleFile(log_info->file,"</log>\n");
(void) fclose(log_info->file);
log_info->file=(FILE *) NULL;
}
@@ -641,25 +641,25 @@
(LocaleCompare(path,log_info[i]->path) != 0))
{
if (log_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",log_info[i]->path);
- (void) fprintf(file,"Filename Generations Limit Format\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",log_info[i]->path);
+ (void) FormatLocaleFile(file,"Filename Generations Limit Format\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=log_info[i]->path;
if (log_info[i]->filename != (char *) NULL)
{
- (void) fprintf(file,"%s",log_info[i]->filename);
+ (void) FormatLocaleFile(file,"%s",log_info[i]->filename);
for (j=(ssize_t) strlen(log_info[i]->filename); j <= 16; j++)
- (void) fprintf(file," ");
+ (void) FormatLocaleFile(file," ");
}
- (void) fprintf(file,"%9g ",(double) log_info[i]->generations);
+ (void) FormatLocaleFile(file,"%9g ",(double) log_info[i]->generations);
(void) FormatMagickSize(MegabytesToBytes(log_info[i]->limit),MagickFalse,
limit);
- (void) fprintf(file,"%8sB ",limit);
+ (void) FormatLocaleFile(file,"%8sB ",limit);
if (log_info[i]->format != (char *) NULL)
- (void) fprintf(file,"%s",log_info[i]->format);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"%s",log_info[i]->format);
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
log_info=(const LogInfo **) RelinquishMagickMemory((void *) log_info);
@@ -718,7 +718,7 @@
if (p->file != (FILE *) NULL)
{
if (p->append == MagickFalse)
- (void) fprintf(p->file,"</log>\n");
+ (void) FormatLocaleFile(p->file,"</log>\n");
(void) fclose(p->file);
p->file=(FILE *) NULL;
}
@@ -828,7 +828,7 @@
Translate event in "XML" format.
*/
(void) FormatMagickTime(seconds,extent,timestamp);
- (void) FormatMagickString(text,extent,
+ (void) FormatLocaleString(text,extent,
"<entry>\n"
" <timestamp>%s</timestamp>\n"
" <elapsed-time>%lu:%02lu.%03lu</elapsed-time>\n"
@@ -931,13 +931,13 @@
q++;
break;
}
- q+=FormatMagickString(q,extent,"%.20g",(double) (log_info->generation %
+ q+=FormatLocaleString(q,extent,"%.20g",(double) (log_info->generation %
log_info->generations));
break;
}
case 'l':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) line);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) line);
break;
}
case 'm':
@@ -961,12 +961,12 @@
}
case 'p':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) getpid());
+ q+=FormatLocaleString(q,extent,"%.20g",(double) getpid());
break;
}
case 'r':
{
- q+=FormatMagickString(q,extent,"%lu:%02lu.%03lu",(unsigned long)
+ q+=FormatLocaleString(q,extent,"%lu:%02lu.%03lu",(unsigned long)
(elapsed_time/60.0),(unsigned long) floor(fmod(elapsed_time,60.0)),
(unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))+0.5));
break;
@@ -978,7 +978,7 @@
}
case 'u':
{
- q+=FormatMagickString(q,extent,"%0.3fu",user_time);
+ q+=FormatLocaleString(q,extent,"%0.3fu",user_time);
break;
}
case 'v':
@@ -1068,7 +1068,7 @@
q++;
break;
}
- q+=FormatMagickString(q,extent,"%.20g",(double) (log_info->generation %
+ q+=FormatLocaleString(q,extent,"%.20g",(double) (log_info->generation %
log_info->generations));
break;
}
@@ -1079,7 +1079,7 @@
}
case 'p':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) getpid());
+ q+=FormatLocaleString(q,extent,"%.20g",(double) getpid());
break;
}
case 'v':
@@ -1152,7 +1152,7 @@
}
if ((log_info->handler_mask & ConsoleHandler) != 0)
{
- (void) fprintf(stderr,"%s\n",text);
+ (void) FormatLocaleFile(stderr,"%s\n",text);
(void) fflush(stderr);
}
if ((log_info->handler_mask & DebugHandler) != 0)
@@ -1177,7 +1177,7 @@
(void) fstat(fileno(log_info->file),&file_info);
if (file_info.st_size > (1024*1024*log_info->limit))
{
- (void) fprintf(log_info->file,"</log>\n");
+ (void) FormatLocaleFile(log_info->file,"</log>\n");
(void) fclose(log_info->file);
log_info->file=(FILE *) NULL;
}
@@ -1204,22 +1204,22 @@
log_info->generation++;
if (log_info->append == MagickFalse)
{
- (void) fprintf(log_info->file,"<?xml version=\"1.0\" "
+ (void) FormatLocaleFile(log_info->file,"<?xml version=\"1.0\" "
"encoding=\"UTF-8\" standalone=\"yes\"?>\n");
- (void) fprintf(log_info->file,"<log>\n");
+ (void) FormatLocaleFile(log_info->file,"<log>\n");
}
}
- (void) fprintf(log_info->file,"%s\n",text);
+ (void) FormatLocaleFile(log_info->file,"%s\n",text);
(void) fflush(log_info->file);
}
if ((log_info->handler_mask & StdoutHandler) != 0)
{
- (void) fprintf(stdout,"%s\n",text);
+ (void) FormatLocaleFile(stdout,"%s\n",text);
(void) fflush(stdout);
}
if ((log_info->handler_mask & StderrHandler) != 0)
{
- (void) fprintf(stderr,"%s\n",text);
+ (void) FormatLocaleFile(stderr,"%s\n",text);
(void) fflush(stderr);
}
text=(char *) RelinquishMagickMemory(text);
diff --git a/magick/mac.c b/magick/mac.c
index 756c6f9..3183d1f 100644
--- a/magick/mac.c
+++ b/magick/mac.c
@@ -339,7 +339,7 @@
MagickExport int Exit(int status)
{
#if !defined(DISABLE_SIOUX)
- (void) fprintf(stdout,"Select File->Quit to exit.\n");
+ (void) FormatLocaleFile(stdout,"Select File->Quit to exit.\n");
#endif
exit(status);
return(0);
@@ -505,10 +505,10 @@
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s (%s).\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
#if defined(DISABLE_SIOUX)
if(exception.hook != (MACErrorHookPtr) NULL)
@@ -564,10 +564,10 @@
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s (%s).\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
if(exception.hook != (MACErrorHookPtr) NULL)
exception.hook(severity, buffer);
@@ -958,10 +958,10 @@
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s (%s).\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
#if defined(DISABLE_SIOUX)
if(exception.hook != (MACErrorHookPtr) NULL)
diff --git a/magick/magic.c b/magick/magic.c
index fbe8d66..9a3db43 100644
--- a/magick/magic.c
+++ b/magick/magic.c
@@ -597,16 +597,16 @@
(LocaleCompare(path,magic_info[i]->path) != 0))
{
if (magic_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",magic_info[i]->path);
- (void) fprintf(file,"Name Offset Target\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",magic_info[i]->path);
+ (void) FormatLocaleFile(file,"Name Offset Target\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=magic_info[i]->path;
- (void) fprintf(file,"%s",magic_info[i]->name);
+ (void) FormatLocaleFile(file,"%s",magic_info[i]->name);
for (j=(ssize_t) strlen(magic_info[i]->name); j <= 9; j++)
- (void) fprintf(file," ");
- (void) fprintf(file,"%6ld ",(long) magic_info[i]->offset);
+ (void) FormatLocaleFile(file," ");
+ (void) FormatLocaleFile(file,"%6ld ",(long) magic_info[i]->offset);
if (magic_info[i]->target != (char *) NULL)
{
register ssize_t
@@ -614,12 +614,12 @@
for (j=0; magic_info[i]->target[j] != '\0'; j++)
if (isprint((int) ((unsigned char) magic_info[i]->target[j])) != 0)
- (void) fprintf(file,"%c",magic_info[i]->target[j]);
+ (void) FormatLocaleFile(file,"%c",magic_info[i]->target[j]);
else
- (void) fprintf(file,"\\%03o",(unsigned int)
+ (void) FormatLocaleFile(file,"\\%03o",(unsigned int)
((unsigned char) magic_info[i]->target[j]));
}
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
magic_info=(const MagicInfo **) RelinquishMagickMemory((void *) magic_info);
diff --git a/magick/magick-config.h b/magick/magick-config.h
index af13311..db6c5c3 100644
--- a/magick/magick-config.h
+++ b/magick/magick-config.h
@@ -321,6 +321,9 @@
#define MAGICKCORE_HAVE_FORK 1
#endif
+/* Define to 1 if you have the `fprintf_l' function. */
+/* #undef HAVE_FPRINTF_L */
+
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#ifndef MAGICKCORE_HAVE_FSEEKO
#define MAGICKCORE_HAVE_FSEEKO 1
@@ -1015,6 +1018,9 @@
#define MAGICKCORE_HAVE_VSNPRINTF 1
#endif
+/* Define to 1 if you have the `vsnprintf_l' function. */
+/* #undef HAVE_VSNPRINTF_L */
+
/* Define to 1 if you have the `vsprintf' function. */
#ifndef MAGICKCORE_HAVE_VSPRINTF
#define MAGICKCORE_HAVE_VSPRINTF 1
diff --git a/magick/magick.c b/magick/magick.c
index cb73c6e..676a086 100644
--- a/magick/magick.c
+++ b/magick/magick.c
@@ -954,17 +954,17 @@
return(MagickFalse);
ClearMagickException(exception);
#if !defined(MAGICKCORE_MODULES_SUPPORT)
- (void) fprintf(file," Format Mode Description\n");
+ (void) FormatLocaleFile(file," Format Mode Description\n");
#else
- (void) fprintf(file," Format Module Mode Description\n");
+ (void) FormatLocaleFile(file," Format Module Mode Description\n");
#endif
- (void) fprintf(file,"--------------------------------------------------------"
+ (void) FormatLocaleFile(file,"--------------------------------------------------------"
"-----------------------\n");
for (i=0; i < (ssize_t) number_formats; i++)
{
if (magick_info[i]->stealth != MagickFalse)
continue;
- (void) fprintf(file,"%9s%c ",magick_info[i]->name != (char *) NULL ?
+ (void) FormatLocaleFile(file,"%9s%c ",magick_info[i]->name != (char *) NULL ?
magick_info[i]->name : "",
magick_info[i]->blob_support != MagickFalse ? '*' : ' ');
#if defined(MAGICKCORE_MODULES_SUPPORT)
@@ -977,17 +977,17 @@
(void) CopyMagickString(module,magick_info[i]->module,MaxTextExtent);
(void) ConcatenateMagickString(module," ",MaxTextExtent);
module[9]='\0';
- (void) fprintf(file,"%9s ",module);
+ (void) FormatLocaleFile(file,"%9s ",module);
}
#endif
- (void) fprintf(file,"%c%c%c ",magick_info[i]->decoder ? 'r' : '-',
+ (void) FormatLocaleFile(file,"%c%c%c ",magick_info[i]->decoder ? 'r' : '-',
magick_info[i]->encoder ? 'w' : '-',magick_info[i]->encoder != NULL &&
magick_info[i]->adjoin != MagickFalse ? '+' : '-');
if (magick_info[i]->description != (char *) NULL)
- (void) fprintf(file," %s",magick_info[i]->description);
+ (void) FormatLocaleFile(file," %s",magick_info[i]->description);
if (magick_info[i]->version != (char *) NULL)
- (void) fprintf(file," (%s)",magick_info[i]->version);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file," (%s)",magick_info[i]->version);
+ (void) FormatLocaleFile(file,"\n");
if (magick_info[i]->note != (char *) NULL)
{
char
@@ -998,17 +998,17 @@
{
for (j=0; text[j] != (char *) NULL; j++)
{
- (void) fprintf(file," %s\n",text[j]);
+ (void) FormatLocaleFile(file," %s\n",text[j]);
text[j]=DestroyString(text[j]);
}
text=(char **) RelinquishMagickMemory(text);
}
}
}
- (void) fprintf(file,"\n* native blob support\n");
- (void) fprintf(file,"r read support\n");
- (void) fprintf(file,"w write support\n");
- (void) fprintf(file,"+ support for multiple images\n");
+ (void) FormatLocaleFile(file,"\n* native blob support\n");
+ (void) FormatLocaleFile(file,"r read support\n");
+ (void) FormatLocaleFile(file,"w write support\n");
+ (void) FormatLocaleFile(file,"+ support for multiple images\n");
(void) fflush(file);
magick_info=(const MagickInfo **) RelinquishMagickMemory((void *)
magick_info);
diff --git a/magick/methods.h b/magick/methods.h
index 65a2b71..9d5b675 100644
--- a/magick/methods.h
+++ b/magick/methods.h
@@ -336,8 +336,8 @@
#define FormatImageProperty PrependMagickMethod(FormatImageProperty)
#define FormatMagickCaption PrependMagickMethod(FormatMagickCaption)
#define FormatMagickSize PrependMagickMethod(FormatMagickSize)
-#define FormatMagickStringList PrependMagickMethod(FormatMagickStringList)
-#define FormatMagickString PrependMagickMethod(FormatMagickString)
+#define FormatLocaleStringList PrependMagickMethod(FormatLocaleStringList)
+#define FormatLocaleString PrependMagickMethod(FormatLocaleString)
#define FormatMagickTime PrependMagickMethod(FormatMagickTime)
#define FormatStringList PrependMagickMethod(FormatStringList)
#define FormatString PrependMagickMethod(FormatString)
diff --git a/magick/mime.c b/magick/mime.c
index b5d6dae..f8397bb 100644
--- a/magick/mime.c
+++ b/magick/mime.c
@@ -674,27 +674,27 @@
(strcasecmp(path,mime_info[i]->path) != 0))
{
if (mime_info[i]->path != (char *) NULL)
- (void) fprintf(file,"\nPath: %s\n\n",mime_info[i]->path);
- (void) fprintf(file,"Type Description\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",mime_info[i]->path);
+ (void) FormatLocaleFile(file,"Type Description\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
}
path=mime_info[i]->path;
- (void) fprintf(file,"%s",mime_info[i]->type);
+ (void) FormatLocaleFile(file,"%s",mime_info[i]->type);
if (strlen(mime_info[i]->type) <= 25)
{
for (j=(ssize_t) strlen(mime_info[i]->type); j <= 27; j++)
- (void) fprintf(file," ");
+ (void) FormatLocaleFile(file," ");
}
else
{
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"\n");
for (j=0; j <= 27; j++)
- (void) fprintf(file," ");
+ (void) FormatLocaleFile(file," ");
}
if (mime_info[i]->description != (char *) NULL)
- (void) fprintf(file,"%s",mime_info[i]->description);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"%s",mime_info[i]->description);
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
mime_info=(const MimeInfo **) RelinquishMagickMemory((void *) mime_info);
@@ -1021,14 +1021,14 @@
ExceptionInfo
*exception;
- (void) FormatMagickString(filename,MaxTextExtent,"file.%s",magick);
+ (void) FormatLocaleString(filename,MaxTextExtent,"file.%s",magick);
LocaleLower(filename);
exception=AcquireExceptionInfo();
mime_info=GetMimeInfo(filename,(unsigned char *) " ",1,exception);
exception=DestroyExceptionInfo(exception);
if (mime_info != (const MimeInfo *) NULL)
return(ConstantString(GetMimeType(mime_info)));
- (void) FormatMagickString(media,MaxTextExtent,"image/x-%s",magick);
+ (void) FormatLocaleString(media,MaxTextExtent,"image/x-%s",magick);
LocaleLower(media+8);
return(ConstantString(media));
}
diff --git a/magick/module.c b/magick/module.c
index 60a979d..a3cd583 100644
--- a/magick/module.c
+++ b/magick/module.c
@@ -632,7 +632,7 @@
break;
}
}
- (void) FormatMagickString(path,MaxTextExtent,"%s%s",directory,filename);
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s",directory,filename);
if (IsPathAccessible(path) == MagickFalse)
{
ThrowFileException(exception,ConfigureWarning,
@@ -674,7 +674,7 @@
"RegistryKeyLookupFailed","`%s'",registery_key);
return(MagickFalse);
}
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",(char *) key_value,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",(char *) key_value,
DirectorySeparator,filename);
key_value=(unsigned char *) RelinquishMagickMemory(key_value);
if (IsPathAccessible(path) == MagickFalse)
@@ -702,7 +702,7 @@
Search MAGICK_HOME.
*/
#if !defined(MAGICKCORE_POSIX_SUPPORT)
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",home,
DirectorySeparator,filename);
#else
const char
@@ -722,7 +722,7 @@
break;
}
}
- (void) FormatMagickString(path,MaxTextExtent,"%s/lib/%s/%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s/lib/%s/%s",home,
directory,filename);
#endif
home=DestroyString(home);
@@ -736,7 +736,7 @@
Search based on executable directory.
*/
#if !defined(MAGICKCORE_POSIX_SUPPORT)
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",GetClientPath(),
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",GetClientPath(),
DirectorySeparator,filename);
#else
char
@@ -761,7 +761,7 @@
}
(void) CopyMagickString(prefix,GetClientPath(),MaxTextExtent);
ChopPathComponents(prefix,1);
- (void) FormatMagickString(path,MaxTextExtent,
+ (void) FormatLocaleString(path,MaxTextExtent,
"%s/lib/%s/modules-Q%d/%s/%s",prefix,MAGICKCORE_LIBRARY_RELATIVE_PATH,
MAGICKCORE_QUANTUM_DEPTH,directory,filename);
#endif
@@ -796,7 +796,7 @@
/*
Search $HOME/.magick.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s.magick%s%s",home,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s.magick%s%s",home,
DirectorySeparator,DirectorySeparator,filename);
home=DestroyString(home);
if (IsPathAccessible(path) != MagickFalse)
@@ -998,9 +998,9 @@
Locate the module.
*/
#if !defined(MAGICKCORE_NAMESPACE_PREFIX)
- (void) FormatMagickString(name,MaxTextExtent,"%sImage",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"%sImage",tag);
#else
- (void) FormatMagickString(name,MaxTextExtent,"%s%sImage",
+ (void) FormatLocaleString(name,MaxTextExtent,"%s%sImage",
MAGICKCORE_NAMESPACE_PREFIX,tag);
#endif
/*
@@ -1088,14 +1088,14 @@
(void) GetMagickModulePath(filename,MagickImageCoderModule,module_path,
exception);
GetPathComponent(module_path,HeadPath,path);
- (void) fprintf(file,"\nPath: %s\n\n",path);
- (void) fprintf(file,"Image Coder\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",path);
+ (void) FormatLocaleFile(file,"Image Coder\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
for (i=0; i < (ssize_t) number_modules; i++)
{
- (void) fprintf(file,"%s",modules[i]);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"%s",modules[i]);
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
/*
@@ -1114,14 +1114,14 @@
(void) GetMagickModulePath(filename,MagickImageFilterModule,module_path,
exception);
GetPathComponent(module_path,HeadPath,path);
- (void) fprintf(file,"\nPath: %s\n\n",path);
- (void) fprintf(file,"Image Filter\n");
- (void) fprintf(file,"-------------------------------------------------"
+ (void) FormatLocaleFile(file,"\nPath: %s\n\n",path);
+ (void) FormatLocaleFile(file,"Image Filter\n");
+ (void) FormatLocaleFile(file,"-------------------------------------------------"
"------------------------------\n");
for (i=0; i < (ssize_t) number_modules; i++)
{
- (void) fprintf(file,"%s",modules[i]);
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"%s",modules[i]);
+ (void) FormatLocaleFile(file,"\n");
}
(void) fflush(file);
/*
@@ -1452,7 +1452,7 @@
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",tag);
assert(name != (char *) NULL);
#if defined(MAGICKCORE_LTDL_DELEGATE)
- (void) FormatMagickString(name,MaxTextExtent,"%s.la",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"%s.la",tag);
(void) LocaleLower(name);
#else
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
@@ -1461,9 +1461,9 @@
else
{
#if defined(_DEBUG)
- (void) FormatMagickString(name,MaxTextExtent,"IM_MOD_DB_%s_.dll",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"IM_MOD_DB_%s_.dll",tag);
#else
- (void) FormatMagickString(name,MaxTextExtent,"IM_MOD_RL_%s_.dll",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"IM_MOD_RL_%s_.dll",tag);
#endif
}
#endif
@@ -1501,9 +1501,9 @@
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",tag);
assert(name != (char *) NULL);
#if !defined(MAGICKCORE_LTDL_DELEGATE)
- (void) FormatMagickString(name,MaxTextExtent,"%s.dll",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"%s.dll",tag);
#else
- (void) FormatMagickString(name,MaxTextExtent,"%s.la",tag);
+ (void) FormatLocaleString(name,MaxTextExtent,"%s.la",tag);
#endif
}
@@ -1547,15 +1547,15 @@
(void) CopyMagickString(name,tag,MaxTextExtent);
LocaleUpper(name);
#if !defined(MAGICKCORE_NAMESPACE_PREFIX)
- (void) FormatMagickString(module,MaxTextExtent,format,name);
+ (void) FormatLocaleString(module,MaxTextExtent,format,name);
#else
{
char
prefix_format[MaxTextExtent];
- (void) FormatMagickString(prefix_format,MaxTextExtent,"%s%s",
+ (void) FormatLocaleString(prefix_format,MaxTextExtent,"%s%s",
MAGICKCORE_NAMESPACE_PREFIX,format);
- (void) FormatMagickString(module,MaxTextExtent,prefix_format,name);
+ (void) FormatLocaleString(module,MaxTextExtent,prefix_format,name);
}
#endif
}
diff --git a/magick/monitor-private.h b/magick/monitor-private.h
index 63f9450..48a661a 100644
--- a/magick/monitor-private.h
+++ b/magick/monitor-private.h
@@ -32,7 +32,7 @@
if (image->progress_monitor == (MagickProgressMonitor) NULL)
return(MagickTrue);
- (void) FormatMagickString(message,MaxTextExtent,"%s/%s",tag,image->filename);
+ (void) FormatLocaleString(message,MaxTextExtent,"%s/%s",tag,image->filename);
return(image->progress_monitor(message,offset,extent,image->client_data));
}
diff --git a/magick/montage.c b/magick/montage.c
index 01a4ef8..7b63763 100644
--- a/magick/montage.c
+++ b/magick/montage.c
@@ -509,7 +509,7 @@
(void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
frame_info.width=extract_info.width;
frame_info.height=extract_info.height;
- (void) FormatMagickString(absolute_geometry,MaxTextExtent,"%s!",
+ (void) FormatLocaleString(absolute_geometry,MaxTextExtent,"%s!",
montage_info->frame);
flags=ParseMetaGeometry(absolute_geometry,&frame_info.outer_bevel,
&frame_info.inner_bevel,&frame_info.width,&frame_info.height);
@@ -660,7 +660,7 @@
GetMontageGeometry(montage_info->tile,number_images,&x_offset,&y_offset,
&sans,&sans);
y_offset+=(ssize_t) title_offset;
- (void) FormatMagickString(montage->montage,MaxTextExtent,
+ (void) FormatLocaleString(montage->montage,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) (extract_info.width+
(extract_info.x+border_width)*2),(double) (extract_info.height+
(extract_info.y+border_width)*2+(double) ((metrics.ascent-
@@ -697,7 +697,7 @@
clone_info->gravity=CenterGravity;
clone_info->pointsize*=2.0;
(void) GetTypeMetrics(image_list[0],clone_info,&metrics);
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) montage->columns,(double)
(metrics.ascent-metrics.descent),0.0,(double) extract_info.y+4);
(void) CloneString(&clone_info->geometry,geometry);
@@ -767,7 +767,7 @@
tile_image->gravity=montage_info->gravity;
if (image->gravity != UndefinedGravity)
tile_image->gravity=image->gravity;
- (void) FormatMagickString(tile_geometry,MaxTextExtent,"%.20gx%.20g+0+0",
+ (void) FormatLocaleString(tile_geometry,MaxTextExtent,"%.20gx%.20g+0+0",
(double) image->columns,(double) image->rows);
flags=ParseGravityGeometry(tile_image,tile_geometry,&geometry,exception);
x=(ssize_t) (geometry.x+border_width);
@@ -834,7 +834,7 @@
/*
Annotate composite tile with label.
*/
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) ((montage_info->frame ?
image->columns : width)-2*border_width),(double)
(metrics.ascent-metrics.descent+4)*MultilineCensus(value),
diff --git a/magick/morphology.c b/magick/morphology.c
index db3175c..fff530e 100644
--- a/magick/morphology.c
+++ b/magick/morphology.c
@@ -329,7 +329,7 @@
kernel->values[i] = nan; /* do not include this value in kernel */
}
else {
- kernel->values[i] = StringToDouble(token,(char **) NULL);
+ kernel->values[i] = LocaleToDouble(token,(char **) NULL);
( kernel->values[i] < 0)
? ( kernel->negative_range += kernel->values[i] )
: ( kernel->positive_range += kernel->values[i] );
@@ -414,7 +414,7 @@
#if 0
/* For Debugging Geometry Input */
- fprintf(stderr, "Geometry = 0x%04X : %lg x %lg %+lg %+lg\n",
+ FormatLocaleFile(stderr, "Geometry = 0x%04X : %lg x %lg %+lg %+lg\n",
flags, args.rho, args.sigma, args.xi, args.psi );
#endif
@@ -516,7 +516,7 @@
/* Error handling -- this is not proper error handling! */
if ( new_kernel == (KernelInfo *) NULL ) {
- fprintf(stderr, "Failed to parse kernel number #%.20g\n",(double)
+ FormatLocaleFile(stderr, "Failed to parse kernel number #%.20g\n",(double)
kernel_number);
if ( kernel != (KernelInfo *) NULL )
kernel=DestroyKernelInfo(kernel);
@@ -3852,7 +3852,7 @@
channel, kernel, exception);
if ( verbose == MagickTrue )
- (void) fprintf(stderr, "%s:%.20g.%.20g #%.20g => Changed %.20g\n",
+ (void) FormatLocaleFile(stderr, "%s:%.20g.%.20g #%.20g => Changed %.20g\n",
CommandOptionToMnemonic(MagickMorphologyOptions, method),
1.0,0.0,1.0, (double) changed);
@@ -3998,11 +3998,11 @@
/* Extra information for debugging compound operations */
if ( verbose == MagickTrue ) {
if ( stage_limit > 1 )
- (void) FormatMagickString(v_info,MaxTextExtent,"%s:%.20g.%.20g -> ",
+ (void) FormatLocaleString(v_info,MaxTextExtent,"%s:%.20g.%.20g -> ",
CommandOptionToMnemonic(MagickMorphologyOptions,method),(double)
method_loop,(double) stage_loop);
else if ( primitive != method )
- (void) FormatMagickString(v_info, MaxTextExtent, "%s:%.20g -> ",
+ (void) FormatLocaleString(v_info, MaxTextExtent, "%s:%.20g -> ",
CommandOptionToMnemonic(MagickMorphologyOptions, method),(double)
method_loop);
else
@@ -4037,8 +4037,8 @@
if ( verbose == MagickTrue ) {
if ( kernel_loop > 1 )
- fprintf(stderr, "\n"); /* add end-of-line from previous */
- (void) fprintf(stderr, "%s%s%s:%.20g.%.20g #%.20g => Changed %.20g",
+ FormatLocaleFile(stderr, "\n"); /* add end-of-line from previous */
+ (void) FormatLocaleFile(stderr, "%s%s%s:%.20g.%.20g #%.20g => Changed %.20g",
v_info,CommandOptionToMnemonic(MagickMorphologyOptions,
primitive),(this_kernel == rflt_kernel ) ? "*" : "",
(double) (method_loop+kernel_loop-1),(double) kernel_number,
@@ -4060,16 +4060,16 @@
} /* End Loop 4: Iterate the kernel with primitive */
if ( verbose == MagickTrue && kernel_changed != (size_t)changed )
- fprintf(stderr, " Total %.20g",(double) kernel_changed);
+ FormatLocaleFile(stderr, " Total %.20g",(double) kernel_changed);
if ( verbose == MagickTrue && stage_loop < stage_limit )
- fprintf(stderr, "\n"); /* add end-of-line before looping */
+ FormatLocaleFile(stderr, "\n"); /* add end-of-line before looping */
#if 0
- fprintf(stderr, "--E-- image=0x%lx\n", (unsigned long)image);
- fprintf(stderr, " curr =0x%lx\n", (unsigned long)curr_image);
- fprintf(stderr, " work =0x%lx\n", (unsigned long)work_image);
- fprintf(stderr, " save =0x%lx\n", (unsigned long)save_image);
- fprintf(stderr, " union=0x%lx\n", (unsigned long)rslt_image);
+ FormatLocaleFile(stderr, "--E-- image=0x%lx\n", (unsigned long)image);
+ FormatLocaleFile(stderr, " curr =0x%lx\n", (unsigned long)curr_image);
+ FormatLocaleFile(stderr, " work =0x%lx\n", (unsigned long)work_image);
+ FormatLocaleFile(stderr, " save =0x%lx\n", (unsigned long)save_image);
+ FormatLocaleFile(stderr, " union=0x%lx\n", (unsigned long)rslt_image);
#endif
} /* End Loop 3: Primative (staging) Loop for Coumpound Methods */
@@ -4087,7 +4087,7 @@
case TopHatMorphology:
case BottomHatMorphology:
if ( verbose == MagickTrue )
- fprintf(stderr, "\n%s: Difference with original image",
+ FormatLocaleFile(stderr, "\n%s: Difference with original image",
CommandOptionToMnemonic(MagickMorphologyOptions, method) );
(void) CompositeImageChannel(curr_image,
(ChannelType) (channel & ~SyncChannels),
@@ -4095,7 +4095,7 @@
break;
case EdgeMorphology:
if ( verbose == MagickTrue )
- fprintf(stderr, "\n%s: Difference of Dilate and Erode",
+ FormatLocaleFile(stderr, "\n%s: Difference of Dilate and Erode",
CommandOptionToMnemonic(MagickMorphologyOptions, method) );
(void) CompositeImageChannel(curr_image,
(ChannelType) (channel & ~SyncChannels),
@@ -4112,15 +4112,15 @@
else if ( rslt_compose == NoCompositeOp )
{ if ( verbose == MagickTrue ) {
if ( this_kernel->next != (KernelInfo *) NULL )
- fprintf(stderr, " (re-iterate)");
+ FormatLocaleFile(stderr, " (re-iterate)");
else
- fprintf(stderr, " (done)");
+ FormatLocaleFile(stderr, " (done)");
}
rslt_image = curr_image; /* return result, and re-iterate */
}
else if ( rslt_image == (Image *) NULL)
{ if ( verbose == MagickTrue )
- fprintf(stderr, " (save for compose)");
+ FormatLocaleFile(stderr, " (save for compose)");
rslt_image = curr_image;
curr_image = (Image *) image; /* continue with original image */
}
@@ -4133,7 +4133,7 @@
** IE: Turn off SVG composition 'alpha blending'.
*/
if ( verbose == MagickTrue )
- fprintf(stderr, " (compose \"%s\")",
+ FormatLocaleFile(stderr, " (compose \"%s\")",
CommandOptionToMnemonic(MagickComposeOptions, rslt_compose) );
(void) CompositeImageChannel(rslt_image,
(ChannelType) (channel & ~SyncChannels), rslt_compose,
@@ -4142,7 +4142,7 @@
curr_image = (Image *) image; /* continue with original image */
}
if ( verbose == MagickTrue )
- fprintf(stderr, "\n");
+ FormatLocaleFile(stderr, "\n");
/* loop to the next kernel in a multi-kernel list */
norm_kernel = norm_kernel->next;
@@ -4548,7 +4548,7 @@
#if 0
/* For Debugging Geometry Input */
- fprintf(stderr, "Geometry = 0x%04X : %lg x %lg %+lg %+lg\n",
+ FormatLocaleFile(stderr, "Geometry = 0x%04X : %lg x %lg %+lg %+lg\n",
flags, args.rho, args.sigma, args.xi, args.psi );
#endif
@@ -4736,38 +4736,38 @@
for (c=0, k=kernel; k != (KernelInfo *) NULL; c++, k=k->next ) {
- fprintf(stderr, "Kernel");
+ FormatLocaleFile(stderr, "Kernel");
if ( kernel->next != (KernelInfo *) NULL )
- fprintf(stderr, " #%lu", (unsigned long) c );
- fprintf(stderr, " \"%s",
+ FormatLocaleFile(stderr, " #%lu", (unsigned long) c );
+ FormatLocaleFile(stderr, " \"%s",
CommandOptionToMnemonic(MagickKernelOptions, k->type) );
if ( fabs(k->angle) > MagickEpsilon )
- fprintf(stderr, "@%lg", k->angle);
- fprintf(stderr, "\" of size %lux%lu%+ld%+ld",(unsigned long) k->width,
+ FormatLocaleFile(stderr, "@%lg", k->angle);
+ FormatLocaleFile(stderr, "\" of size %lux%lu%+ld%+ld",(unsigned long) k->width,
(unsigned long) k->height,(long) k->x,(long) k->y);
- fprintf(stderr,
+ FormatLocaleFile(stderr,
" with values from %.*lg to %.*lg\n",
GetMagickPrecision(), k->minimum,
GetMagickPrecision(), k->maximum);
- fprintf(stderr, "Forming a output range from %.*lg to %.*lg",
+ FormatLocaleFile(stderr, "Forming a output range from %.*lg to %.*lg",
GetMagickPrecision(), k->negative_range,
GetMagickPrecision(), k->positive_range);
if ( fabs(k->positive_range+k->negative_range) < MagickEpsilon )
- fprintf(stderr, " (Zero-Summing)\n");
+ FormatLocaleFile(stderr, " (Zero-Summing)\n");
else if ( fabs(k->positive_range+k->negative_range-1.0) < MagickEpsilon )
- fprintf(stderr, " (Normalized)\n");
+ FormatLocaleFile(stderr, " (Normalized)\n");
else
- fprintf(stderr, " (Sum %.*lg)\n",
+ FormatLocaleFile(stderr, " (Sum %.*lg)\n",
GetMagickPrecision(), k->positive_range+k->negative_range);
for (i=v=0; v < k->height; v++) {
- fprintf(stderr, "%2lu:", (unsigned long) v );
+ FormatLocaleFile(stderr, "%2lu:", (unsigned long) v );
for (u=0; u < k->width; u++, i++)
if ( IsNan(k->values[i]) )
- fprintf(stderr," %*s", GetMagickPrecision()+3, "nan");
+ FormatLocaleFile(stderr," %*s", GetMagickPrecision()+3, "nan");
else
- fprintf(stderr," %*.*lg", GetMagickPrecision()+3,
+ FormatLocaleFile(stderr," %*.*lg", GetMagickPrecision()+3,
GetMagickPrecision(), k->values[i]);
- fprintf(stderr,"\n");
+ FormatLocaleFile(stderr,"\n");
}
}
}
diff --git a/magick/nt-base.c b/magick/nt-base.c
index 166fc6f..8ebee1f 100644
--- a/magick/nt-base.c
+++ b/magick/nt-base.c
@@ -182,7 +182,7 @@
module_path=DestroyString(module_path);
return(FALSE);
}
- (void) FormatMagickString(variable,16*MaxTextExtent,
+ (void) FormatLocaleString(variable,16*MaxTextExtent,
"%s;%s",module_path,path);
SetEnvironmentVariable("PATH",variable);
variable=DestroyString(variable);
@@ -507,18 +507,18 @@
}
message=GetExceptionMessage(errno);
if ((description != (char *) NULL) && errno)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s (%s) [%s].\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s) [%s].\n",
GetClientName(),reason,description,message);
else
if (description != (char *) NULL)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s (%s).\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
else
if (errno != 0)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s [%s].\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s [%s].\n",
GetClientName(),reason,message);
else
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s.\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",
GetClientName(),reason);
message=DestroyString(message);
(void) MessageBox(NULL,buffer,"ImageMagick Exception",MB_OK | MB_TASKMODAL |
@@ -904,7 +904,7 @@
REGSAM
mode;
- (void) FormatMagickString(key,MaxTextExtent,"SOFTWARE\\%s",products[i]);
+ (void) FormatLocaleString(key,MaxTextExtent,"SOFTWARE\\%s",products[i]);
root=HKEY_LOCAL_MACHINE;
mode=KEY_READ;
#if defined(KEY_WOW64_32KEY)
@@ -993,7 +993,7 @@
(void) NTLocateGhostscript(&product_family,&major_version,&minor_version);
if (product_family == NULL)
return(FALSE);
- (void) FormatMagickString(key,MaxTextExtent,"SOFTWARE\\%s\\%d.%02d",
+ (void) FormatLocaleString(key,MaxTextExtent,"SOFTWARE\\%s\\%d.%02d",
product_family,major_version,minor_version);
for (i=0; i < (ssize_t) (sizeof(hkeys)/sizeof(hkeys[0])); i++)
{
@@ -1144,7 +1144,7 @@
q=strchr(path,DirectoryListSeparator);
if (q != (char *) NULL)
*q='\0';
- (void) FormatMagickString(filename,MaxTextExtent,"%s%sfonts.dir",path,
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s%sfonts.dir",path,
DirectorySeparator);
if (IsPathAccessible(filename) != MagickFalse)
return(TRUE);
@@ -1595,7 +1595,7 @@
/*
Look-up base key.
*/
- (void) FormatMagickString(package_key,MaxTextExtent,"SOFTWARE\\%s\\%s\\Q:%d",
+ (void) FormatLocaleString(package_key,MaxTextExtent,"SOFTWARE\\%s\\%s\\Q:%d",
MagickPackageName,MagickLibVersionText,MAGICKCORE_QUANTUM_DEPTH);
(void) LogMagickEvent(ConfigureEvent,GetMagickModule(),"%s",package_key);
registry_key=(HKEY) INVALID_HANDLE_VALUE;
@@ -1728,7 +1728,7 @@
assert(id != (const char *) NULL);
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",id);
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",GetClientPath(),
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",GetClientPath(),
DirectorySeparator,GetClientName());
if (IsPathAccessible(path) != MagickFalse)
handle=GetModuleHandle(path);
@@ -2222,10 +2222,10 @@
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
- (void) FormatMagickString(buffer,MaxTextExtent,"%s: %s (%s).\n",
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
(void) MessageBox(NULL,buffer,"ImageMagick Warning",MB_OK | MB_TASKMODAL |
MB_SETFOREGROUND | MB_ICONINFORMATION);
diff --git a/magick/nt-base.h b/magick/nt-base.h
index 875b7e4..cd2d902 100644
--- a/magick/nt-base.h
+++ b/magick/nt-base.h
@@ -191,6 +191,16 @@
#if !defined(popen)
# define popen _popen
#endif
+#if !defined(fprintf)
+#if !defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500))
+#define fprintf _fprintf_s
+#endif
+#endif
+#if !defined(fprintf_l)
+#if !defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500))
+#define fprintf_l _fprintf_s_l
+#endif
+#endif
#if !defined(read)
# define read _read
#endif
diff --git a/magick/option.c b/magick/option.c
index da584c4..7460c36 100644
--- a/magick/option.c
+++ b/magick/option.c
@@ -2134,7 +2134,7 @@
{
if (option_info[i].stealth != MagickFalse)
continue;
- (void) fprintf(file,"%s\n",option_info[i].mnemonic);
+ (void) FormatLocaleFile(file,"%s\n",option_info[i].mnemonic);
}
return(MagickTrue);
}
diff --git a/magick/policy.c b/magick/policy.c
index 9629ba4..933dc9b 100644
--- a/magick/policy.c
+++ b/magick/policy.c
@@ -572,33 +572,33 @@
if (((path == (const char *) NULL) ||
(LocaleCompare(path,policy_info[i]->path) != 0)) &&
(policy_info[i]->path != (char *) NULL))
- (void) fprintf(file,"\nPath: %s\n",policy_info[i]->path);
+ (void) FormatLocaleFile(file,"\nPath: %s\n",policy_info[i]->path);
path=policy_info[i]->path;
domain=CommandOptionToMnemonic(MagickPolicyDomainOptions,
policy_info[i]->domain);
- (void) fprintf(file," Policy: %s\n",domain);
+ (void) FormatLocaleFile(file," Policy: %s\n",domain);
if ((policy_info[i]->domain == ResourcePolicyDomain) ||
(policy_info[i]->domain == SystemPolicyDomain))
{
if (policy_info[i]->name != (char *) NULL)
- (void) fprintf(file," name: %s\n",policy_info[i]->name);
+ (void) FormatLocaleFile(file," name: %s\n",policy_info[i]->name);
if (policy_info[i]->value != (char *) NULL)
- (void) fprintf(file," value: %s\n",policy_info[i]->value);
+ (void) FormatLocaleFile(file," value: %s\n",policy_info[i]->value);
}
else
{
- (void) fprintf(file," rights: ");
+ (void) FormatLocaleFile(file," rights: ");
if (policy_info[i]->rights == NoPolicyRights)
- (void) fprintf(file,"None ");
+ (void) FormatLocaleFile(file,"None ");
if ((policy_info[i]->rights & ReadPolicyRights) != 0)
- (void) fprintf(file,"Read ");
+ (void) FormatLocaleFile(file,"Read ");
if ((policy_info[i]->rights & WritePolicyRights) != 0)
- (void) fprintf(file,"Write ");
+ (void) FormatLocaleFile(file,"Write ");
if ((policy_info[i]->rights & ExecutePolicyRights) != 0)
- (void) fprintf(file,"Execute ");
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file,"Execute ");
+ (void) FormatLocaleFile(file,"\n");
if (policy_info[i]->pattern != (char *) NULL)
- (void) fprintf(file," pattern: %s\n",policy_info[i]->pattern);
+ (void) FormatLocaleFile(file," pattern: %s\n",policy_info[i]->pattern);
}
}
policy_info=(const PolicyInfo **) RelinquishMagickMemory((void *)
diff --git a/magick/profile.c b/magick/profile.c
index 0189457..669942a 100644
--- a/magick/profile.c
+++ b/magick/profile.c
@@ -1688,7 +1688,7 @@
/*
Inject profile into image properties.
*/
- (void) FormatMagickString(property,MaxTextExtent,"%s:sans",name);
+ (void) FormatLocaleString(property,MaxTextExtent,"%s:sans",name);
(void) GetImageProperty(image,property);
return(status);
}
diff --git a/magick/property.c b/magick/property.c
index 49dc1cd..51aa4f2 100644
--- a/magick/property.c
+++ b/magick/property.c
@@ -746,7 +746,7 @@
p1=p; \
for (component=0; component < components; component++) \
{ \
- length+=FormatMagickString(buffer+length,MaxTextExtent-length, \
+ length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
format", ",arg); \
if (length >= MaxTextExtent - 1) \
length=MaxTextExtent-1; \
@@ -772,7 +772,7 @@
p1=p; \
for (component=0; component < components; component++) \
{ \
- length+=FormatMagickString(buffer+length,MaxTextExtent-length, \
+ length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
format", ",arg1, arg2); \
if (length >= MaxTextExtent - 1) \
length=MaxTextExtent-1; \
@@ -1419,21 +1419,21 @@
break;
}
}
- (void) FormatMagickString(key,MaxTextExtent,"%s",
+ (void) FormatLocaleString(key,MaxTextExtent,"%s",
description);
break;
}
case 2:
{
if (tag_value < 0x10000)
- (void) FormatMagickString(key,MaxTextExtent,"#%04lx",
+ (void) FormatLocaleString(key,MaxTextExtent,"#%04lx",
(unsigned long) tag_value);
else
if (tag_value < 0x20000)
- (void) FormatMagickString(key,MaxTextExtent,"@%04lx",
+ (void) FormatLocaleString(key,MaxTextExtent,"@%04lx",
(unsigned long) (tag_value & 0xffff));
else
- (void) FormatMagickString(key,MaxTextExtent,"unknown");
+ (void) FormatLocaleString(key,MaxTextExtent,"unknown");
break;
}
}
@@ -1596,26 +1596,26 @@
if (path == (char *) NULL)
return((char *) NULL);
message=AcquireString((char *) NULL);
- (void) FormatMagickString(message,MaxTextExtent,"/ClipImage\n");
+ (void) FormatLocaleString(message,MaxTextExtent,"/ClipImage\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,"{\n");
+ (void) FormatLocaleString(message,MaxTextExtent,"{\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent," /c {curveto} bind def\n");
+ (void) FormatLocaleString(message,MaxTextExtent," /c {curveto} bind def\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent," /l {lineto} bind def\n");
+ (void) FormatLocaleString(message,MaxTextExtent," /l {lineto} bind def\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent," /m {moveto} bind def\n");
+ (void) FormatLocaleString(message,MaxTextExtent," /m {moveto} bind def\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" /v {currentpoint 6 2 roll curveto} bind def\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" /y {2 copy curveto} bind def\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" /z {closepath} bind def\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent," newpath\n");
+ (void) FormatLocaleString(message,MaxTextExtent," newpath\n");
(void) ConcatenateString(&path,message);
/*
The clipping path format is defined in "Adobe Photoshop File
@@ -1684,7 +1684,7 @@
}
if (in_subpath == MagickFalse)
{
- (void) FormatMagickString(message,MaxTextExtent," %g %g m\n",
+ (void) FormatLocaleString(message,MaxTextExtent," %g %g m\n",
point[1].x,point[1].y);
for (i=0; i < 3; i++)
{
@@ -1700,20 +1700,20 @@
*/
if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
(point[0].x == point[1].x) && (point[0].y == point[1].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g l\n",point[1].x,point[1].y);
else
if ((last[1].x == last[2].x) && (last[1].y == last[2].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g %g %g v\n",point[0].x,point[0].y,
point[1].x,point[1].y);
else
if ((point[0].x == point[1].x) && (point[0].y == point[1].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g %g %g y\n",last[2].x,last[2].y,
point[1].x,point[1].y);
else
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g %g %g %g %g c\n",last[2].x,
last[2].y,point[0].x,point[0].y,point[1].x,point[1].y);
for (i=0; i < 3; i++)
@@ -1733,20 +1733,20 @@
*/
if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
(first[0].x == first[1].x) && (first[0].y == first[1].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g l z\n",first[1].x,first[1].y);
else
if ((last[1].x == last[2].x) && (last[1].y == last[2].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g %g %g v z\n",first[0].x,first[0].y,
first[1].x,first[1].y);
else
if ((first[0].x == first[1].x) && (first[0].y == first[1].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g %g %g y z\n",last[2].x,last[2].y,
first[1].x,first[1].y);
else
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
" %g %g %g %g %g %g c z\n",last[2].x,
last[2].y,first[0].x,first[0].y,first[1].x,first[1].y);
(void) ConcatenateString(&path,message);
@@ -1768,9 +1768,9 @@
/*
Returns an empty PS path if the path has no knots.
*/
- (void) FormatMagickString(message,MaxTextExtent," eoclip\n");
+ (void) FormatLocaleString(message,MaxTextExtent," eoclip\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,"} bind def");
+ (void) FormatLocaleString(message,MaxTextExtent,"} bind def");
(void) ConcatenateString(&path,message);
message=DestroyString(message);
return(path);
@@ -1804,18 +1804,18 @@
if (path == (char *) NULL)
return((char *) NULL);
message=AcquireString((char *) NULL);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"<svg width=\"%.20g\" height=\"%.20g\">\n",(double) columns,(double) rows);
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,"<g>\n");
+ (void) FormatLocaleString(message,MaxTextExtent,"<g>\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"<path style=\"fill:#00000000;stroke:#00000000;");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"stroke-width:0;stroke-antialiasing:false\" d=\"\n");
(void) ConcatenateString(&path,message);
(void) ResetMagickMemory(point,0,sizeof(point));
@@ -1881,7 +1881,7 @@
}
if (in_subpath == MagickFalse)
{
- (void) FormatMagickString(message,MaxTextExtent,"M %g,%g\n",
+ (void) FormatLocaleString(message,MaxTextExtent,"M %g,%g\n",
point[1].x,point[1].y);
for (i=0; i < 3; i++)
{
@@ -1893,10 +1893,10 @@
{
if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
(point[0].x == point[1].x) && (point[0].y == point[1].y))
- (void) FormatMagickString(message,MaxTextExtent,"L %g,%g\n",
+ (void) FormatLocaleString(message,MaxTextExtent,"L %g,%g\n",
point[1].x,point[1].y);
else
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"C %g,%g %g,%g %g,%g\n",last[2].x,last[2].y,
point[0].x,point[0].y,point[1].x,point[1].y);
for (i=0; i < 3; i++)
@@ -1912,11 +1912,11 @@
{
if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
(first[0].x == first[1].x) && (first[0].y == first[1].y))
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"L %g,%g Z\n",first[1].x,first[1].y);
else
{
- (void) FormatMagickString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MaxTextExtent,
"C %g,%g %g,%g %g,%g Z\n",last[2].x,
last[2].y,first[0].x,first[0].y,first[1].x,first[1].y);
(void) ConcatenateString(&path,message);
@@ -1939,11 +1939,11 @@
/*
Return an empty SVG image if the path does not have knots.
*/
- (void) FormatMagickString(message,MaxTextExtent,"\"/>\n");
+ (void) FormatLocaleString(message,MaxTextExtent,"\"/>\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,"</g>\n");
+ (void) FormatLocaleString(message,MaxTextExtent,"</g>\n");
(void) ConcatenateString(&path,message);
- (void) FormatMagickString(message,MaxTextExtent,"</svg>\n");
+ (void) FormatLocaleString(message,MaxTextExtent,"</svg>\n");
(void) ConcatenateString(&path,message);
message=DestroyString(message);
return(path);
@@ -2038,7 +2038,7 @@
char
value[MaxTextExtent];
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),(double) alpha);
(void) SetImageProperty((Image *) image,property,value);
}
@@ -2183,7 +2183,7 @@
/*
Image channels.
*/
- (void) FormatMagickString(value,MaxTextExtent,"%s",
+ (void) FormatLocaleString(value,MaxTextExtent,"%s",
CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
image->colorspace));
LocaleLower(value);
@@ -2202,7 +2202,7 @@
colorspace=image->colorspace;
if (IsGrayImage(image,&image->exception) != MagickFalse)
colorspace=GRAYColorspace;
- (void) FormatMagickString(value,MaxTextExtent,"%s",
+ (void) FormatLocaleString(value,MaxTextExtent,"%s",
CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
colorspace));
break;
@@ -2218,7 +2218,7 @@
{
if (LocaleNCompare("depth",property,5) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
image->depth);
break;
}
@@ -2244,7 +2244,7 @@
{
if (LocaleNCompare("group",property,5) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"0x%lx",
+ (void) FormatLocaleString(value,MaxTextExtent,"0x%lx",
(unsigned long) image_info->group);
break;
}
@@ -2254,7 +2254,7 @@
{
if (LocaleNCompare("height",property,6) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
image->magick_rows != 0 ? (double) image->magick_rows : 256.0);
break;
}
@@ -2279,7 +2279,7 @@
(void) GetImageChannelKurtosis(image,image_info->channel,&kurtosis,
&skewness,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),kurtosis);
break;
}
@@ -2300,7 +2300,7 @@
(void) GetImageChannelRange(image,image_info->channel,&minimum,
&maximum,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),maximum);
break;
}
@@ -2312,7 +2312,7 @@
(void) GetImageChannelMean(image,image_info->channel,&mean,
&standard_deviation,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),mean);
break;
}
@@ -2324,7 +2324,7 @@
(void) GetImageChannelRange(image,image_info->channel,&minimum,
&maximum,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),minimum);
break;
}
@@ -2362,7 +2362,7 @@
{
if (LocaleNCompare("page",property,4) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
GetImageIndexInList(image)+1);
break;
}
@@ -2376,21 +2376,21 @@
format[MaxTextExtent];
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
- (void) FormatMagickString(value,MaxTextExtent,"%sB",format);
+ (void) FormatLocaleString(value,MaxTextExtent,"%sB",format);
break;
}
if (LocaleNCompare("scenes",property,6) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
GetImageListLength(image));
break;
}
if (LocaleNCompare("scene",property,5) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
image->scene);
if (image_info->number_scenes != 0)
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
image_info->scene);
break;
}
@@ -2402,7 +2402,7 @@
(void) GetImageChannelKurtosis(image,image_info->channel,&kurtosis,
&skewness,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),skewness);
break;
}
@@ -2415,7 +2415,7 @@
(void) GetImageChannelMean(image,image_info->channel,&mean,
&standard_deviation,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
GetMagickPrecision(),standard_deviation);
break;
}
@@ -2445,7 +2445,7 @@
{
if (LocaleNCompare("width",property,5) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
(image->magick_columns != 0 ? image->magick_columns : 256));
break;
}
@@ -2455,7 +2455,7 @@
{
if (LocaleNCompare("xresolution",property,11) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%g",
image->x_resolution);
break;
}
@@ -2465,7 +2465,7 @@
{
if (LocaleNCompare("yresolution",property,11) == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%g",
image->y_resolution);
break;
}
@@ -2645,7 +2645,7 @@
/*
File size.
*/
- (void) FormatMagickString(format,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(format,MaxTextExtent,"%.20g",(double)
image->extent);
if (image->extent != (MagickSizeType) ((size_t) image->extent))
(void) FormatMagickSize(image->extent,MagickFalse,format);
@@ -2731,7 +2731,7 @@
/*
Image geometry.
*/
- q+=FormatMagickString(q,extent,"%.20gx%.20g%+.20g%+.20g",(double)
+ q+=FormatLocaleString(q,extent,"%.20gx%.20g%+.20g%+.20g",(double)
image->page.width,(double) image->page.height,(double) image->page.x,
(double) image->page.y);
break;
@@ -2741,7 +2741,7 @@
/*
Image height.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double) (image->rows != 0 ?
+ q+=FormatLocaleString(q,extent,"%.20g",(double) (image->rows != 0 ?
image->rows : image->magick_rows));
break;
}
@@ -2758,7 +2758,7 @@
/*
Number of unique colors.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double) GetNumberColors(image,
+ q+=FormatLocaleString(q,extent,"%.20g",(double) GetNumberColors(image,
(FILE *) NULL,&image->exception));
break;
}
@@ -2804,7 +2804,7 @@
/*
Number of images in the list.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double)
+ q+=FormatLocaleString(q,extent,"%.20g",(double)
GetImageListLength(image));
break;
}
@@ -2821,7 +2821,7 @@
/*
Image index in list.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double)
+ q+=FormatLocaleString(q,extent,"%.20g",(double)
GetImageIndexInList(image));
break;
}
@@ -2830,7 +2830,7 @@
/*
Image depth.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double)
+ q+=FormatLocaleString(q,extent,"%.20g",(double)
MAGICKCORE_QUANTUM_DEPTH);
break;
}
@@ -2845,7 +2845,7 @@
colorspace=image->colorspace;
if (IsGrayImage(image,&image->exception) != MagickFalse)
colorspace=GRAYColorspace;
- q+=FormatMagickString(q,extent,"%s%s%s",CommandOptionToMnemonic(
+ q+=FormatLocaleString(q,extent,"%s%s%s",CommandOptionToMnemonic(
MagickClassOptions,(ssize_t) image->storage_class),
CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace),
image->matte != MagickFalse ? "Matte" : "");
@@ -2857,9 +2857,9 @@
Image scene number.
*/
if (image_info->number_scenes == 0)
- q+=FormatMagickString(q,extent,"%.20g",(double) image->scene);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image->scene);
else
- q+=FormatMagickString(q,extent,"%.20g",(double) image_info->scene);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image_info->scene);
break;
}
case 'u':
@@ -2876,7 +2876,7 @@
/*
Image width.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double) (image->columns != 0 ?
+ q+=FormatLocaleString(q,extent,"%.20g",(double) (image->columns != 0 ?
image->columns : image->magick_columns));
break;
}
@@ -2885,7 +2885,7 @@
/*
Image horizontal resolution.
*/
- q+=FormatMagickString(q,extent,"%g %s",image->x_resolution,
+ q+=FormatLocaleString(q,extent,"%g %s",image->x_resolution,
CommandOptionToMnemonic(MagickResolutionOptions,(ssize_t)
image->units));
break;
@@ -2895,7 +2895,7 @@
/*
Image vertical resolution.
*/
- q+=FormatMagickString(q,extent,"%g %s",image->y_resolution,
+ q+=FormatLocaleString(q,extent,"%g %s",image->y_resolution,
CommandOptionToMnemonic(MagickResolutionOptions,(ssize_t)
image->units));
break;
@@ -2905,7 +2905,7 @@
/*
Image depth.
*/
- q+=FormatMagickString(q,extent,"%.20g",(double) image->depth);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image->depth);
break;
}
case 'A':
@@ -2913,7 +2913,7 @@
/*
Image alpha channel.
*/
- q+=FormatMagickString(q,extent,"%s",CommandOptionToMnemonic(
+ q+=FormatLocaleString(q,extent,"%s",CommandOptionToMnemonic(
MagickBooleanOptions,(ssize_t) image->matte));
break;
}
@@ -2922,7 +2922,7 @@
/*
Image compression method.
*/
- q+=FormatMagickString(q,extent,"%s",CommandOptionToMnemonic(
+ q+=FormatLocaleString(q,extent,"%s",CommandOptionToMnemonic(
MagickCompressOptions,(ssize_t) image->compression));
break;
}
@@ -2931,36 +2931,36 @@
/*
Image dispose method.
*/
- q+=FormatMagickString(q,extent,"%s",CommandOptionToMnemonic(
+ q+=FormatLocaleString(q,extent,"%s",CommandOptionToMnemonic(
MagickDisposeOptions,(ssize_t) image->dispose));
break;
}
case 'G':
{
- q+=FormatMagickString(q,extent,"%.20gx%.20g",(double)
+ q+=FormatLocaleString(q,extent,"%.20gx%.20g",(double)
image->magick_columns,(double) image->magick_rows);
break;
}
case 'H':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) image->page.height);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image->page.height);
break;
}
case 'O':
{
- q+=FormatMagickString(q,extent,"%+ld%+ld",(long) image->page.x,(long)
+ q+=FormatLocaleString(q,extent,"%+ld%+ld",(long) image->page.x,(long)
image->page.y);
break;
}
case 'P':
{
- q+=FormatMagickString(q,extent,"%.20gx%.20g",(double) image->page.width,
+ q+=FormatLocaleString(q,extent,"%.20gx%.20g",(double) image->page.width,
(double) image->page.height);
break;
}
case 'Q':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) image->quality);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image->quality);
break;
}
case 'S':
@@ -2971,28 +2971,28 @@
if (image_info->number_scenes == 0)
q+=CopyMagickString(q,"2147483647",extent);
else
- q+=FormatMagickString(q,extent,"%.20g",(double) (image_info->scene+
+ q+=FormatLocaleString(q,extent,"%.20g",(double) (image_info->scene+
image_info->number_scenes));
break;
}
case 'T':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) image->delay);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image->delay);
break;
}
case 'W':
{
- q+=FormatMagickString(q,extent,"%.20g",(double) image->page.width);
+ q+=FormatLocaleString(q,extent,"%.20g",(double) image->page.width);
break;
}
case 'X':
{
- q+=FormatMagickString(q,extent,"%+.20g",(double) image->page.x);
+ q+=FormatLocaleString(q,extent,"%+.20g",(double) image->page.x);
break;
}
case 'Y':
{
- q+=FormatMagickString(q,extent,"%+.20g",(double) image->page.y);
+ q+=FormatLocaleString(q,extent,"%+.20g",(double) image->page.y);
break;
}
case 'Z':
@@ -3077,7 +3077,7 @@
break;
q=interpret_text+strlen(interpret_text);
}
- q+=FormatMagickString(q,extent,"%s=%s\n",key,value);
+ q+=FormatLocaleString(q,extent,"%s=%s\n",key,value);
}
}
key=GetNextImageProperty(image);
@@ -3130,7 +3130,7 @@
Image bounding box.
*/
page=GetImageBoundingBox(image,&image->exception);
- q+=FormatMagickString(q,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
+ q+=FormatLocaleString(q,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
(double) page.width,(double) page.height,(double) page.x,(double)
page.y);
break;
diff --git a/magick/quantum.c b/magick/quantum.c
index cf84a42..aee3951 100644
--- a/magick/quantum.c
+++ b/magick/quantum.c
@@ -372,10 +372,10 @@
MagickQuantumFormatOptions,MagickFalse,option);
option=GetImageOption(image_info,"quantum:minimum");
if (option != (char *) NULL)
- quantum_info->minimum=StringToDouble(option,(char **) NULL);
+ quantum_info->minimum=LocaleToDouble(option,(char **) NULL);
option=GetImageOption(image_info,"quantum:maximum");
if (option != (char *) NULL)
- quantum_info->maximum=StringToDouble(option,(char **) NULL);
+ quantum_info->maximum=LocaleToDouble(option,(char **) NULL);
if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
quantum_info->scale=0.0;
else
@@ -389,7 +389,7 @@
quantum_info->minimum);
option=GetImageOption(image_info,"quantum:scale");
if (option != (char *) NULL)
- quantum_info->scale=StringToDouble(option,(char **) NULL);
+ quantum_info->scale=LocaleToDouble(option,(char **) NULL);
option=GetImageOption(image_info,"quantum:polarity");
if (option != (char *) NULL)
quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
diff --git a/magick/resample.c b/magick/resample.c
index 53935ba..7257957 100644
--- a/magick/resample.c
+++ b/magick/resample.c
@@ -340,7 +340,7 @@
}
#if DEBUG_ELLIPSE
- fprintf(stderr, "u0=%lf; v0=%lf;\n", u0, v0);
+ FormatLocaleFile(stderr, "u0=%lf; v0=%lf;\n", u0, v0);
#endif
/*
@@ -551,8 +551,8 @@
uw = (ssize_t)(2.0*resample_filter->Uwidth)+1;
#if DEBUG_ELLIPSE
- fprintf(stderr, "v1=%ld; v2=%ld\n", (long)v1, (long)v2);
- fprintf(stderr, "u1=%ld; uw=%ld\n", (long)u1, (long)uw);
+ FormatLocaleFile(stderr, "v1=%ld; v2=%ld\n", (long)v1, (long)v2);
+ FormatLocaleFile(stderr, "u1=%ld; uw=%ld\n", (long)u1, (long)uw);
#else
# define DEBUG_HIT_MISS 0 /* only valid if DEBUG_ELLIPSE is enabled */
#endif
@@ -565,7 +565,7 @@
for( v=v1; v<=v2; v++ ) {
#if DEBUG_HIT_MISS
long uu = ceil(u1); /* actual pixel location (for debug only) */
- fprintf(stderr, "# scan line from pixel %ld, %ld\n", (long)uu, (long)v);
+ FormatLocaleFile(stderr, "# scan line from pixel %ld, %ld\n", (long)uu, (long)v);
#endif
u = (ssize_t)ceil(u1); /* first pixel in scanline */
u1 += resample_filter->slope; /* start of next scan line */
@@ -614,14 +614,14 @@
hit++;
#if DEBUG_HIT_MISS
/* mark the pixel according to hit/miss of the ellipse */
- fprintf(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 3\n",
+ FormatLocaleFile(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 3\n",
(long)uu-.1,(double)v-.1,(long)uu+.1,(long)v+.1);
- fprintf(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 3\n",
+ FormatLocaleFile(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 3\n",
(long)uu+.1,(double)v-.1,(long)uu-.1,(long)v+.1);
} else {
- fprintf(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 1\n",
+ FormatLocaleFile(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 1\n",
(long)uu-.1,(double)v-.1,(long)uu+.1,(long)v+.1);
- fprintf(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 1\n",
+ FormatLocaleFile(stderr, "set arrow from %lf,%lf to %lf,%lf nohead ls 1\n",
(long)uu+.1,(double)v-.1,(long)uu-.1,(long)v+.1);
}
uu++;
@@ -635,7 +635,7 @@
}
}
#if DEBUG_ELLIPSE
- fprintf(stderr, "Hit=%ld; Total=%ld;\n", (long)hit, (long)uw*(v2-v1) );
+ FormatLocaleFile(stderr, "Hit=%ld; Total=%ld;\n", (long)hit, (long)uw*(v2-v1) );
#endif
/*
@@ -1036,8 +1036,8 @@
return; /* EWA turned off - nothing to do */
#if DEBUG_ELLIPSE
- fprintf(stderr, "# -----\n" );
- fprintf(stderr, "dux=%lf; dvx=%lf; duy=%lf; dvy=%lf;\n",
+ FormatLocaleFile(stderr, "# -----\n" );
+ FormatLocaleFile(stderr, "dux=%lf; dvx=%lf; duy=%lf; dvy=%lf;\n",
dux, dvx, duy, dvy);
#endif
@@ -1067,7 +1067,7 @@
major_x *= major_mag; major_y *= major_mag;
minor_x *= minor_mag; minor_y *= minor_mag;
#if DEBUG_ELLIPSE
- fprintf(stderr, "major_x=%lf; major_y=%lf; minor_x=%lf; minor_y=%lf;\n",
+ FormatLocaleFile(stderr, "major_x=%lf; major_y=%lf; minor_x=%lf; minor_y=%lf;\n",
major_x, major_y, minor_x, minor_y);
#endif
A = major_y*major_y+minor_y*minor_y;
@@ -1106,7 +1106,7 @@
#endif
#if DEBUG_ELLIPSE
- fprintf(stderr, "A=%lf; B=%lf; C=%lf; F=%lf\n", A,B,C,F);
+ FormatLocaleFile(stderr, "A=%lf; B=%lf; C=%lf; F=%lf\n", A,B,C,F);
/* Figure out the various information directly about the ellipse.
This information currently not needed at this time, but may be
@@ -1127,14 +1127,14 @@
Major = sqrt(2*F/(alpha - gamma));
Minor = sqrt(2*F/(alpha + gamma));
- fprintf(stderr, "# Major=%lf; Minor=%lf\n", Major, Minor );
+ FormatLocaleFile(stderr, "# Major=%lf; Minor=%lf\n", Major, Minor );
/* other information about ellipse include... */
Eccentricity = Major/Minor;
Ellipse_Area = MagickPI*Major*Minor;
Ellipse_Angle = atan2(B, A-C);
- fprintf(stderr, "# Angle=%lf Area=%lf\n",
+ FormatLocaleFile(stderr, "# Angle=%lf Area=%lf\n",
RadiansToDegrees(Ellipse_Angle), Ellipse_Area);
}
#endif
@@ -1166,7 +1166,7 @@
resample_filter->slope = -B/(2.0*A); /* Reciprocal slope of the parallelogram */
#if DEBUG_ELLIPSE
- fprintf(stderr, "Ulimit=%lf; Vlimit=%lf; UWidth=%lf; Slope=%lf;\n",
+ FormatLocaleFile(stderr, "Ulimit=%lf; Vlimit=%lf; UWidth=%lf; Slope=%lf;\n",
resample_filter->Ulimit, resample_filter->Vlimit,
resample_filter->Uwidth, resample_filter->slope );
#endif
diff --git a/magick/resize.c b/magick/resize.c
index 84ecaa6..559547a 100644
--- a/magick/resize.c
+++ b/magick/resize.c
@@ -922,7 +922,7 @@
/* User Sigma Override - no support change */
artifact=GetImageArtifact(image,"filter:sigma");
if (artifact != (const char *) NULL)
- sigma=StringToDouble(artifact,(char **) NULL);
+ sigma=LocaleToDouble(artifact,(char **) NULL);
/* Define coefficents for Gaussian */
if ( GaussianFilter ) {
resize_filter->coefficient[0]=1.0/(2.0*sigma*sigma);
@@ -933,7 +933,7 @@
/* Blur Override */
artifact=GetImageArtifact(image,"filter:blur");
if (artifact != (const char *) NULL)
- resize_filter->blur *= StringToDouble(artifact,(char **) NULL);
+ resize_filter->blur *= LocaleToDouble(artifact,(char **) NULL);
if (resize_filter->blur < MagickEpsilon)
resize_filter->blur=(MagickRealType) MagickEpsilon;
@@ -960,7 +960,7 @@
/* expert override of the support setting */
artifact=GetImageArtifact(image,"filter:support");
if (artifact != (const char *) NULL)
- resize_filter->support=fabs(StringToDouble(artifact,(char **) NULL));
+ resize_filter->support=fabs(LocaleToDouble(artifact,(char **) NULL));
/*
Scale windowing function separatally to the support 'clipping'
window that calling operator is planning to actually use. (Expert
@@ -969,7 +969,7 @@
resize_filter->window_support=resize_filter->support; /* default */
artifact=GetImageArtifact(image,"filter:win-support");
if (artifact != (const char *) NULL)
- resize_filter->window_support=fabs(StringToDouble(artifact,(char **) NULL));
+ resize_filter->window_support=fabs(LocaleToDouble(artifact,(char **) NULL));
/*
Adjust window function scaling to match windowing support for
weighting function. This avoids a division on every filter call.
@@ -994,18 +994,18 @@
artifact=GetImageArtifact(image,"filter:b");
if (artifact != (const char *) NULL)
{
- B=StringToDouble(artifact,(char **) NULL);
+ B=LocaleToDouble(artifact,(char **) NULL);
C=(1.0-B)/2.0; /* Calculate C to get a Keys cubic filter. */
artifact=GetImageArtifact(image,"filter:c"); /* user C override */
if (artifact != (const char *) NULL)
- C=StringToDouble(artifact,(char **) NULL);
+ C=LocaleToDouble(artifact,(char **) NULL);
}
else
{
artifact=GetImageArtifact(image,"filter:c");
if (artifact != (const char *) NULL)
{
- C=StringToDouble(artifact,(char **) NULL);
+ C=LocaleToDouble(artifact,(char **) NULL);
B=1.0-2.0*C; /* Calculate B to get a Keys cubic filter. */
}
}
@@ -1056,35 +1056,35 @@
Report Filter Details.
*/
support=GetResizeFilterSupport(resize_filter); /* practical_support */
- (void) fprintf(stdout,"# Resize Filter (for graphing)\n#\n");
- (void) fprintf(stdout,"# filter = %s\n",
+ (void) FormatLocaleFile(stdout,"# Resize Filter (for graphing)\n#\n");
+ (void) FormatLocaleFile(stdout,"# filter = %s\n",
CommandOptionToMnemonic(MagickFilterOptions,filter_type));
- (void) fprintf(stdout,"# window = %s\n",
+ (void) FormatLocaleFile(stdout,"# window = %s\n",
CommandOptionToMnemonic(MagickFilterOptions, window_type));
- (void) fprintf(stdout,"# support = %.*g\n",
+ (void) FormatLocaleFile(stdout,"# support = %.*g\n",
GetMagickPrecision(),(double) resize_filter->support);
- (void) fprintf(stdout,"# win-support = %.*g\n",
+ (void) FormatLocaleFile(stdout,"# win-support = %.*g\n",
GetMagickPrecision(),(double) resize_filter->window_support);
- (void) fprintf(stdout,"# scale_blur = %.*g\n",
+ (void) FormatLocaleFile(stdout,"# scale_blur = %.*g\n",
GetMagickPrecision(), (double)resize_filter->blur);
if ( filter_type == GaussianFilter )
- (void) fprintf(stdout,"# gaussian_sigma = %.*g\n",
+ (void) FormatLocaleFile(stdout,"# gaussian_sigma = %.*g\n",
GetMagickPrecision(), (double)sigma);
- (void) fprintf(stdout,"# practical_support = %.*g\n",
+ (void) FormatLocaleFile(stdout,"# practical_support = %.*g\n",
GetMagickPrecision(), (double)support);
if ( filter_type == CubicFilter || window_type == CubicFilter )
- (void) fprintf(stdout,"# B,C = %.*g,%.*g\n",
+ (void) FormatLocaleFile(stdout,"# B,C = %.*g,%.*g\n",
GetMagickPrecision(),(double)B, GetMagickPrecision(),(double)C);
- (void) fprintf(stdout,"\n");
+ (void) FormatLocaleFile(stdout,"\n");
/*
Output values of resulting filter graph -- for graphing
filter result.
*/
for (x=0.0; x <= support; x+=0.01f)
- (void) fprintf(stdout,"%5.2lf\t%.*g\n",x,GetMagickPrecision(),
+ (void) FormatLocaleFile(stdout,"%5.2lf\t%.*g\n",x,GetMagickPrecision(),
(double) GetResizeFilterWeight(resize_filter,x));
/* A final value so gnuplot can graph the 'stop' properly. */
- (void) fprintf(stdout,"%5.2lf\t%.*g\n",support,GetMagickPrecision(),
+ (void) FormatLocaleFile(stdout,"%5.2lf\t%.*g\n",support,GetMagickPrecision(),
0.0);
}
/* Output the above once only for each image - remove setting */
@@ -3317,33 +3317,33 @@
(void) DeleteImageProperty(thumbnail_image,"comment");
(void) CopyMagickString(value,image->magick_filename,MaxTextExtent);
if (strstr(image->magick_filename,"//") == (char *) NULL)
- (void) FormatMagickString(value,MaxTextExtent,"file://%s",
+ (void) FormatLocaleString(value,MaxTextExtent,"file://%s",
image->magick_filename);
(void) SetImageProperty(thumbnail_image,"Thumb::URI",value);
(void) CopyMagickString(value,image->magick_filename,MaxTextExtent);
if (GetPathAttributes(image->filename,&attributes) != MagickFalse)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
attributes.st_mtime);
(void) SetImageProperty(thumbnail_image,"Thumb::MTime",value);
}
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
attributes.st_mtime);
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,value);
(void) ConcatenateMagickString(value,"B",MaxTextExtent);
(void) SetImageProperty(thumbnail_image,"Thumb::Size",value);
- (void) FormatMagickString(value,MaxTextExtent,"image/%s",image->magick);
+ (void) FormatLocaleString(value,MaxTextExtent,"image/%s",image->magick);
LocaleLower(value);
(void) SetImageProperty(thumbnail_image,"Thumb::Mimetype",value);
(void) SetImageProperty(thumbnail_image,"software",
GetMagickVersion(&version));
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
image->magick_columns);
(void) SetImageProperty(thumbnail_image,"Thumb::Image::Width",value);
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
image->magick_rows);
(void) SetImageProperty(thumbnail_image,"Thumb::Image::height",value);
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
GetImageListLength(image));
(void) SetImageProperty(thumbnail_image,"Thumb::Document::Pages",value);
return(thumbnail_image);
diff --git a/magick/resource.c b/magick/resource.c
index 0287739..de1c7a0 100644
--- a/magick/resource.c
+++ b/magick/resource.c
@@ -394,9 +394,9 @@
return(MagickTrue);
}
if (directory[strlen(directory)-1] == *DirectorySeparator)
- (void) FormatMagickString(path,MaxTextExtent,"%smagick-XXXXXXXX",directory);
+ (void) FormatLocaleString(path,MaxTextExtent,"%smagick-XXXXXXXX",directory);
else
- (void) FormatMagickString(path,MaxTextExtent,"%s%smagick-XXXXXXXX",
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%smagick-XXXXXXXX",
directory,DirectorySeparator);
directory=DestroyString(directory);
if (*DirectorySeparator != '/')
@@ -687,13 +687,13 @@
(void) FormatMagickSize(resource_info.disk_limit,MagickTrue,disk_limit);
(void) CopyMagickString(time_limit,"unlimited",MaxTextExtent);
if (resource_info.time_limit != MagickResourceInfinity)
- (void) FormatMagickString(time_limit,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(time_limit,MaxTextExtent,"%.20g",(double)
resource_info.time_limit);
- (void) fprintf(file,"File Area Memory Map"
+ (void) FormatLocaleFile(file,"File Area Memory Map"
" Disk Thread Time\n");
- (void) fprintf(file,"--------------------------------------------------------"
+ (void) FormatLocaleFile(file,"--------------------------------------------------------"
"-----------------------\n");
- (void) fprintf(file,"%4g %10s %10s %10s %10s %6g %11s\n",(double)
+ (void) FormatLocaleFile(file,"%4g %10s %10s %10s %10s %6g %11s\n",(double)
resource_info.file_limit,area_limit,memory_limit,map_limit,disk_limit,
(double) resource_info.thread_limit,time_limit);
(void) fflush(file);
diff --git a/magick/segment.c b/magick/segment.c
index 0f7d99f..30486fc 100644
--- a/magick/segment.c
+++ b/magick/segment.c
@@ -445,32 +445,32 @@
/*
Print cluster statistics.
*/
- (void) fprintf(stdout,"Fuzzy C-means Statistics\n");
- (void) fprintf(stdout,"===================\n\n");
- (void) fprintf(stdout,"\tCluster Threshold = %g\n",(double)
+ (void) FormatLocaleFile(stdout,"Fuzzy C-means Statistics\n");
+ (void) FormatLocaleFile(stdout,"===================\n\n");
+ (void) FormatLocaleFile(stdout,"\tCluster Threshold = %g\n",(double)
cluster_threshold);
- (void) fprintf(stdout,"\tWeighting Exponent = %g\n",(double)
+ (void) FormatLocaleFile(stdout,"\tWeighting Exponent = %g\n",(double)
weighting_exponent);
- (void) fprintf(stdout,"\tTotal Number of Clusters = %.20g\n\n",(double)
+ (void) FormatLocaleFile(stdout,"\tTotal Number of Clusters = %.20g\n\n",(double)
number_clusters);
/*
Print the total number of points per cluster.
*/
- (void) fprintf(stdout,"\n\nNumber of Vectors Per Cluster\n");
- (void) fprintf(stdout,"=============================\n\n");
+ (void) FormatLocaleFile(stdout,"\n\nNumber of Vectors Per Cluster\n");
+ (void) FormatLocaleFile(stdout,"=============================\n\n");
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
- (void) fprintf(stdout,"Cluster #%.20g = %.20g\n",(double) cluster->id,
+ (void) FormatLocaleFile(stdout,"Cluster #%.20g = %.20g\n",(double) cluster->id,
(double) cluster->count);
/*
Print the cluster extents.
*/
- (void) fprintf(stdout,
+ (void) FormatLocaleFile(stdout,
"\n\n\nCluster Extents: (Vector Size: %d)\n",MaxDimension);
- (void) fprintf(stdout,"================");
+ (void) FormatLocaleFile(stdout,"================");
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
{
- (void) fprintf(stdout,"\n\nCluster #%.20g\n\n",(double) cluster->id);
- (void) fprintf(stdout,"%.20g-%.20g %.20g-%.20g %.20g-%.20g\n",(double)
+ (void) FormatLocaleFile(stdout,"\n\nCluster #%.20g\n\n",(double) cluster->id);
+ (void) FormatLocaleFile(stdout,"%.20g-%.20g %.20g-%.20g %.20g-%.20g\n",(double)
cluster->red.left,(double) cluster->red.right,(double)
cluster->green.left,(double) cluster->green.right,(double)
cluster->blue.left,(double) cluster->blue.right);
@@ -478,17 +478,17 @@
/*
Print the cluster center values.
*/
- (void) fprintf(stdout,
+ (void) FormatLocaleFile(stdout,
"\n\n\nCluster Center Values: (Vector Size: %d)\n",MaxDimension);
- (void) fprintf(stdout,"=====================");
+ (void) FormatLocaleFile(stdout,"=====================");
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
{
- (void) fprintf(stdout,"\n\nCluster #%.20g\n\n",(double) cluster->id);
- (void) fprintf(stdout,"%g %g %g\n",(double)
+ (void) FormatLocaleFile(stdout,"\n\nCluster #%.20g\n\n",(double) cluster->id);
+ (void) FormatLocaleFile(stdout,"%g %g %g\n",(double)
cluster->red.center,(double) cluster->green.center,(double)
cluster->blue.center);
}
- (void) fprintf(stdout,"\n");
+ (void) FormatLocaleFile(stdout,"\n");
}
if (number_clusters > 256)
ThrowBinaryException(ImageError,"TooManyClusters",image->filename);
diff --git a/magick/semaphore.c b/magick/semaphore.c
index 331bb9e..ee9be1c 100644
--- a/magick/semaphore.c
+++ b/magick/semaphore.c
@@ -280,7 +280,7 @@
if ((semaphore_info->reference_count > 0) &&
(IsMagickThreadEqual(semaphore_info->id) != MagickFalse))
{
- (void) fprintf(stderr,"Warning: unexpected recursive lock!\n");
+ (void) FormatLocaleFile(stderr,"Warning: unexpected recursive lock!\n");
(void) fflush(stderr);
}
#endif
@@ -394,7 +394,7 @@
assert(IsMagickThreadEqual(semaphore_info->id) != MagickFalse);
if (semaphore_info->reference_count == 0)
{
- (void) fprintf(stderr,"Warning: semaphore lock already unlocked!\n");
+ (void) FormatLocaleFile(stderr,"Warning: semaphore lock already unlocked!\n");
(void) fflush(stderr);
return;
}
diff --git a/magick/string-private.h b/magick/string-private.h
index 6b92dd0..da1696b 100644
--- a/magick/string-private.h
+++ b/magick/string-private.h
@@ -31,7 +31,7 @@
scale,
value;
- value=StringToDouble(string,&q);
+ value=LocaleToDouble(string,&q);
scale=1000.0;
if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))
scale=1024.0;
diff --git a/magick/string.c b/magick/string.c
index 0f93600..ef6a228 100644
--- a/magick/string.c
+++ b/magick/string.c
@@ -45,7 +45,7 @@
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/list.h"
-#include "magick/locale-private.h"
+#include "magick/locale_.h"
#include "magick/log.h"
#include "magick/memory_.h"
#include "magick/property.h"
@@ -1050,7 +1050,7 @@
length/=bytes;
for (j=2; j < 12; j++)
{
- count=FormatMagickString(format,MaxTextExtent,"%.*g%sB",(int) (i+j),length,
+ count=FormatLocaleString(format,MaxTextExtent,"%.*g%sB",(int) (i+j),length,
units[i]);
if (strchr(format,'+') == (char *) NULL)
break;
@@ -1063,87 +1063,6 @@
% %
% %
% %
-% F o r m a t M a g i c k S t r i n g %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FormatMagickString() prints formatted output of a variable argument list.
-%
-% The format of the FormatMagickString method is:
-%
-% ssize_t FormatMagickString(char *string,const size_t length,
-% const char *format,...)
-%
-% A description of each parameter follows.
-%
-% o string: FormatMagickString() returns the formatted string in this
-% character buffer.
-%
-% o length: the maximum length of the string.
-%
-% o format: A string describing the format to use to write the remaining
-% arguments.
-%
-*/
-
-MagickExport ssize_t FormatMagickStringList(char *string,const size_t length,
- const char *format,va_list operands)
-{
- int
- n;
-
-#if defined(MAGICKCORE_HAVE_VSNPRINTF_L)
- n=vsnprintf_l(string,length,(locale_t) NULL,format,operands);
-#elif defined(MAGICKCORE_HAVE_VSNPRINTF)
-#if defined(MAGICKCORE_HAVE_USELOCALE)
- {
- locale_t
- locale,
- previous_locale;
-
- locale=AcquireMagickLocale();
- if (locale == (locale_t) NULL)
- n=vsnprintf(string,length,format,operands);
- else
- {
- previous_locale=uselocale(locale);
- n=vsnprintf(string,length,format,operands);
- uselocale(previous_locale);
- }
- }
-#else
- n=vsnprintf(string,length,format,operands);
-#endif
-#else
- n=vsprintf(string,format,operands);
-#endif
- if (n < 0)
- string[length-1]='\0';
- return((ssize_t) n);
-}
-
-MagickExport ssize_t FormatMagickString(char *string,const size_t length,
- const char *format,...)
-{
- ssize_t
- n;
-
- va_list
- operands;
-
- va_start(operands,format);
- n=(ssize_t) FormatMagickStringList(string,length,format,operands);
- va_end(operands);
- return(n);
-}
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% F o r m a t M a g i c k T i m e %
% %
% %
@@ -1212,7 +1131,7 @@
local_time.tm_hour-gm_time.tm_hour+24*((local_time.tm_year-
gm_time.tm_year) != 0 ? (local_time.tm_year-gm_time.tm_year) :
(local_time.tm_yday-gm_time.tm_yday)));
- count=FormatMagickString(timestamp,length,
+ count=FormatLocaleString(timestamp,length,
"%04d-%02d-%02dT%02d:%02d:%02d%+03ld:00",local_time.tm_year+1900,
local_time.tm_mon+1,local_time.tm_mday,local_time.tm_hour,
local_time.tm_min,local_time.tm_sec,(long) timezone);
@@ -1595,10 +1514,10 @@
p=(char *) string_info->datum;
for (i=0; i < string_info->length; i+=0x14)
{
- (void) fprintf(file,"0x%08lx: ",(unsigned long) (0x14*i));
+ (void) FormatLocaleFile(file,"0x%08lx: ",(unsigned long) (0x14*i));
for (j=1; j <= MagickMin(string_info->length-i,0x14); j++)
{
- (void) fprintf(file,"%02lx",(unsigned long) (*(p+j)) & 0xff);
+ (void) FormatLocaleFile(file,"%02lx",(unsigned long) (*(p+j)) & 0xff);
if ((j % 0x04) == 0)
(void) fputc(' ',file);
}
@@ -1998,43 +1917,6 @@
% %
% %
% %
-% S t r i n g T o D o u b l e %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% StringToDouble() interprets the string as a floating point number and
-% returns its value as a double. If sentinal is not a null pointer, the
-% method also sets the value pointed by sentinal to point to the first
-% character after the number.
-%
-% The format of the StringToDouble method is:
-%
-% double StringToDouble(const char *value,char **sentinal)
-%
-% A description of each parameter follows:
-%
-% o value: the string value.
-%
-% o sentinal: if sentinal is not NULL, a pointer to the character after the
-% last character used in the conversion is stored in the location
-% referenced by sentinal.
-%
-*/
-MagickExport double StringToDouble(const char *value,char **sentinal)
-{
-#if defined(MAGICKCORE_HAVE_STRTOD_L)
- return(strtod_l(value,sentinal,(locale_t) NULL));
-#endif
- return(strtod(value,sentinal));
-}
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% S t r i n g I n f o T o H e x S t r i n g %
% %
% %
@@ -2272,12 +2154,12 @@
sizeof(**textlist));
if (textlist[i] == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"UnableToConvertText");
- (void) FormatMagickString(textlist[i],MaxTextExtent,"0x%08lx: ",
+ (void) FormatLocaleString(textlist[i],MaxTextExtent,"0x%08lx: ",
(long) (0x14*i));
q=textlist[i]+strlen(textlist[i]);
for (j=1; j <= (ssize_t) MagickMin(strlen(p),0x14); j++)
{
- (void) FormatMagickString(hex_string,MaxTextExtent,"%02x",*(p+j));
+ (void) FormatLocaleString(hex_string,MaxTextExtent,"%02x",*(p+j));
(void) CopyMagickString(q,hex_string,MaxTextExtent);
q+=2;
if ((j % 0x04) == 0)
diff --git a/magick/string_.h b/magick/string_.h
index 3787e47..b1fd5b5 100644
--- a/magick/string_.h
+++ b/magick/string_.h
@@ -57,9 +57,6 @@
extern MagickExport const char
*GetStringInfoPath(const StringInfo *);
-extern MagickExport double
- StringToDouble(const char *,char **);
-
extern MagickExport int
CompareStringInfo(const StringInfo *,const StringInfo *),
LocaleCompare(const char *,const char *),
@@ -78,10 +75,6 @@
extern MagickExport ssize_t
FormatMagickSize(const MagickSizeType,const MagickBooleanType,char *),
- FormatMagickString(char *,const size_t,const char *,...)
- magick_attribute((format (printf,3,4))),
- FormatMagickStringList(char *,const size_t,const char *,va_list)
- magick_attribute((format (printf,3,0))),
FormatMagickTime(const time_t,const size_t,char *);
extern MagickExport StringInfo
diff --git a/magick/threshold.c b/magick/threshold.c
index a1da573..c65ef9b 100644
--- a/magick/threshold.c
+++ b/magick/threshold.c
@@ -1156,8 +1156,8 @@
if ( thresholds == (XMLTreeInfo *)NULL )
return(MagickFalse);
- (void) fprintf(file,"%-16s %-12s %s\n", "Map", "Alias", "Description");
- (void) fprintf(file,"----------------------------------------------------\n");
+ (void) FormatLocaleFile(file,"%-16s %-12s %s\n", "Map", "Alias", "Description");
+ (void) FormatLocaleFile(file,"----------------------------------------------------\n");
for( threshold = GetXMLTreeChild(thresholds,"threshold");
threshold != (XMLTreeInfo *)NULL;
@@ -1186,7 +1186,7 @@
thresholds=DestroyXMLTree(thresholds);
return(MagickFalse);
}
- (void) fprintf(file,"%-16s %-12s %s\n",map,alias ? alias : "", content);
+ (void) FormatLocaleFile(file,"%-16s %-12s %s\n",map,alias ? alias : "", content);
}
thresholds=DestroyXMLTree(thresholds);
return(MagickTrue);
@@ -1234,12 +1234,12 @@
file = stdout;
options=GetConfigureOptions(ThresholdsFilename,exception);
- (void) fprintf(file, "\n Threshold Maps for Ordered Dither Operations\n");
+ (void) FormatLocaleFile(file, "\n Threshold Maps for Ordered Dither Operations\n");
while ( ( option=(const StringInfo *) GetNextValueInLinkedList(options) )
!= (const StringInfo *) NULL)
{
- (void) fprintf(file,"\nPATH: %s\n\n",GetStringInfoPath(option));
+ (void) FormatLocaleFile(file,"\nPATH: %s\n\n",GetStringInfoPath(option));
status|=ListThresholdMapFile(file,(const char *) GetStringInfoDatum(option),
GetStringInfoPath(option),exception);
}
diff --git a/magick/token.c b/magick/token.c
index 5cb89da..12ee024 100644
--- a/magick/token.c
+++ b/magick/token.c
@@ -229,7 +229,7 @@
char
*q;
- value=StringToDouble(p,&q);
+ value=LocaleToDouble(p,&q);
(void) value;
if ((p != q) && (*p != ','))
{
diff --git a/magick/type.c b/magick/type.c
index 5a08ae3..234219a 100644
--- a/magick/type.c
+++ b/magick/type.c
@@ -853,7 +853,7 @@
if (((path == (const char *) NULL) ||
(LocaleCompare(path,type_info[i]->path) != 0)) &&
(type_info[i]->path != (char *) NULL))
- (void) fprintf(file,"\nPath: %s\n",type_info[i]->path);
+ (void) FormatLocaleFile(file,"\nPath: %s\n",type_info[i]->path);
path=type_info[i]->path;
name="unknown";
if (type_info[i]->name != (char *) NULL)
@@ -866,14 +866,14 @@
glyphs="unknown";
if (type_info[i]->glyphs != (char *) NULL)
glyphs=type_info[i]->glyphs;
- (void) FormatMagickString(weight,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(weight,MaxTextExtent,"%.20g",(double)
type_info[i]->weight);
- (void) fprintf(file," Font: %s\n",name);
- (void) fprintf(file," family: %s\n",family);
- (void) fprintf(file," style: %s\n",style);
- (void) fprintf(file," stretch: %s\n",stretch);
- (void) fprintf(file," weight: %s\n",weight);
- (void) fprintf(file," glyphs: %s\n",glyphs);
+ (void) FormatLocaleFile(file," Font: %s\n",name);
+ (void) FormatLocaleFile(file," family: %s\n",family);
+ (void) FormatLocaleFile(file," style: %s\n",style);
+ (void) FormatLocaleFile(file," stretch: %s\n",stretch);
+ (void) FormatLocaleFile(file," weight: %s\n",weight);
+ (void) FormatLocaleFile(file," glyphs: %s\n",glyphs);
}
(void) fflush(file);
type_info=(const TypeInfo **) RelinquishMagickMemory((void *) type_info);
@@ -1314,7 +1314,7 @@
/*
Search MAGICK_FONT_PATH.
*/
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",font_path,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
DirectorySeparator,filename);
option=FileToString(path,~0,exception);
if (option != (void *) NULL)
diff --git a/magick/utility.c b/magick/utility.c
index d28c6f7..5e8a969 100644
--- a/magick/utility.c
+++ b/magick/utility.c
@@ -279,7 +279,7 @@
char
message[MaxTextExtent];
- (void) FormatMagickString(message,MaxTextExtent,"%s:%s",format,filename);
+ (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",format,filename);
(void) CopyMagickString(filename,message,MaxTextExtent);
return;
}
@@ -293,12 +293,12 @@
GetPathComponent(filename,RootPath,root);
(void) CopyMagickString(filename,root,MaxTextExtent);
GetPathComponent(filename,RootPath,root);
- (void) FormatMagickString(filename,MaxTextExtent,"%s.%s.%s",root,format,
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s.%s.%s",root,format,
extension);
return;
}
GetPathComponent(filename,RootPath,root);
- (void) FormatMagickString(filename,MaxTextExtent,"%s.%s",root,format);
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s.%s",root,format);
}
/*
@@ -954,12 +954,12 @@
ssize_t
count;
- (void) FormatMagickString(link_path,MaxTextExtent,"/proc/%.20g/exe",
+ (void) FormatLocaleString(link_path,MaxTextExtent,"/proc/%.20g/exe",
(double) getpid());
count=readlink(link_path,execution_path,PATH_MAX);
if (count == -1)
{
- (void) FormatMagickString(link_path,MaxTextExtent,"/proc/%.20g/file",
+ (void) FormatLocaleString(link_path,MaxTextExtent,"/proc/%.20g/file",
(double) getpid());
count=readlink(link_path,execution_path,PATH_MAX);
}
@@ -1024,7 +1024,7 @@
if (program_name == (char *) NULL)
program_name=program_invocation_name;
else
- count=FormatMagickString(program_name,extent,"%s/%s",cwd,
+ count=FormatLocaleString(program_name,extent,"%s/%s",cwd,
program_invocation_name);
}
if (count != -1)
@@ -2018,7 +2018,7 @@
}
if (verbose != MagickFalse)
{
- (void) fprintf(stderr,"%s\n",command);
+ (void) FormatLocaleFile(stderr,"%s\n",command);
(void) fflush(stderr);
}
shell_command=(char *) command;
diff --git a/magick/version.c b/magick/version.c
index b079287..a858305 100644
--- a/magick/version.c
+++ b/magick/version.c
@@ -41,6 +41,7 @@
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/hashmap.h"
+#include "magick/locale_.h"
#include "magick/option.h"
#include "magick/string_.h"
#include "magick/utility.h"
@@ -139,7 +140,7 @@
element=(const char *) GetNextValueInLinkedList(paths);
while (element != (const char *) NULL)
{
- (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",element,
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
DirectorySeparator,MagickURLFilename);
if (IsPathAccessible(path) != MagickFalse)
return(ConstantString(path));
diff --git a/magick/version.h b/magick/version.h
index d4fdf15..9828bc6 100644
--- a/magick/version.h
+++ b/magick/version.h
@@ -27,7 +27,7 @@
*/
#define MagickPackageName "ImageMagick"
#define MagickCopyright "Copyright (C) 1999-2011 ImageMagick Studio LLC"
-#define MagickSVNRevision "4455"
+#define MagickSVNRevision "4458"
#define MagickLibVersion 0x669
#define MagickLibVersionText "6.6.9"
#define MagickLibVersionNumber 4,0,1
diff --git a/magick/vms.c b/magick/vms.c
index d304b4c..89a7794 100644
--- a/magick/vms.c
+++ b/magick/vms.c
@@ -130,7 +130,7 @@
/*
Initialize descriptor.
*/
- (void) FormatMagickString(directory->pattern,MaxTextExtent,"%s*.*",name);
+ (void) FormatLocaleString(directory->pattern,MaxTextExtent,"%s*.*",name);
directory->context=0;
directory->pat.dsc$a_pointer=directory->pattern;
directory->pat.dsc$w_length=strlen(directory->pattern);
diff --git a/magick/widget.c b/magick/widget.c
index c824b39..8b647ac 100644
--- a/magick/widget.c
+++ b/magick/widget.c
@@ -2103,7 +2103,7 @@
(unsigned int) windows->widget.visual_info->colormap_size,
&windows->widget.pixel_info->matte_color);
mode_info.text=colorname;
- (void) FormatMagickString(mode_info.text,MaxTextExtent,"#%02x%02x%02x",
+ (void) FormatLocaleString(mode_info.text,MaxTextExtent,"#%02x%02x%02x",
windows->widget.pixel_info->matte_color.red,
windows->widget.pixel_info->matte_color.green,
windows->widget.pixel_info->matte_color.blue);
@@ -8585,7 +8585,7 @@
SharedColormap ? MagickTrue : MagickFalse;
preferences_info[7].raised=resource_info->use_pixmap ==
MagickFalse ? MagickTrue : MagickFalse;
- (void) FormatMagickString(cache,MaxTextExtent,CacheButtonText,
+ (void) FormatLocaleString(cache,MaxTextExtent,CacheButtonText,
(unsigned long) resource_info->undo_cache);
XGetWidgetInfo(cache,&cache_info);
cache_info.bevel_width--;
@@ -8659,7 +8659,7 @@
resource_info->undo_cache<<=1;
if (resource_info->undo_cache > 256)
resource_info->undo_cache=1;
- (void) FormatMagickString(cache,MaxTextExtent,CacheButtonText,
+ (void) FormatLocaleString(cache,MaxTextExtent,CacheButtonText,
(unsigned long) resource_info->undo_cache);
cache_info.raised=MagickFalse;
XDrawTriangleEast(display,&windows->widget,&cache_info);
diff --git a/magick/xml-tree.c b/magick/xml-tree.c
index d6fd097..3e02023 100644
--- a/magick/xml-tree.c
+++ b/magick/xml-tree.c
@@ -352,22 +352,22 @@
{
case '&':
{
- i+=FormatMagickString(canonical_content+i,extent,"&");
+ i+=FormatLocaleString(canonical_content+i,extent,"&");
break;
}
case '<':
{
- i+=FormatMagickString(canonical_content+i,extent,"<");
+ i+=FormatLocaleString(canonical_content+i,extent,"<");
break;
}
case '>':
{
- i+=FormatMagickString(canonical_content+i,extent,">");
+ i+=FormatLocaleString(canonical_content+i,extent,">");
break;
}
case '"':
{
- i+=FormatMagickString(canonical_content+i,extent,""");
+ i+=FormatLocaleString(canonical_content+i,extent,""");
break;
}
case '\n':
@@ -377,7 +377,7 @@
canonical_content[i++]=(char) (*p);
break;
}
- i+=FormatMagickString(canonical_content+i,extent,"
");
+ i+=FormatLocaleString(canonical_content+i,extent,"
");
break;
}
case '\t':
@@ -387,12 +387,12 @@
canonical_content[i++]=(char) (*p);
break;
}
- i+=FormatMagickString(canonical_content+i,extent,"	");
+ i+=FormatLocaleString(canonical_content+i,extent,"	");
break;
}
case '\r':
{
- i+=FormatMagickString(canonical_content+i,extent,"
");
+ i+=FormatLocaleString(canonical_content+i,extent,"
");
break;
}
default:
@@ -2361,7 +2361,7 @@
if (*destination == (char *) NULL)
return(*destination);
}
- *length+=FormatMagickString(*destination+(*length),*extent,"%s",
+ *length+=FormatLocaleString(*destination+(*length),*extent,"%s",
canonical_content);
canonical_content=DestroyString(canonical_content);
return(*destination);
@@ -2398,7 +2398,7 @@
if (*source == (char *) NULL)
return(*source);
}
- *length+=FormatMagickString(*source+(*length),*extent,"<%s",xml_info->tag);
+ *length+=FormatLocaleString(*source+(*length),*extent,"<%s",xml_info->tag);
for (i=0; xml_info->attributes[i]; i+=2)
{
attribute=GetXMLTreeAttribute(xml_info,xml_info->attributes[i]);
@@ -2411,11 +2411,11 @@
if (*source == (char *) NULL)
return((char *) NULL);
}
- *length+=FormatMagickString(*source+(*length),*extent," %s=\"",
+ *length+=FormatLocaleString(*source+(*length),*extent," %s=\"",
xml_info->attributes[i]);
(void) EncodePredefinedEntities(xml_info->attributes[i+1],-1,source,length,
extent,MagickTrue);
- *length+=FormatMagickString(*source+(*length),*extent,"\"");
+ *length+=FormatLocaleString(*source+(*length),*extent,"\"");
}
i=0;
while ((attributes[i] != (char **) NULL) &&
@@ -2438,14 +2438,14 @@
if (*source == (char *) NULL)
return((char *) NULL);
}
- *length+=FormatMagickString(*source+(*length),*extent," %s=\"",
+ *length+=FormatLocaleString(*source+(*length),*extent," %s=\"",
attributes[i][j]);
(void) EncodePredefinedEntities(attributes[i][j+1],-1,source,length,extent,
MagickTrue);
- *length+=FormatMagickString(*source+(*length),*extent,"\"");
+ *length+=FormatLocaleString(*source+(*length),*extent,"\"");
j+=3;
}
- *length+=FormatMagickString(*source+(*length),*extent,*xml_info->content ?
+ *length+=FormatLocaleString(*source+(*length),*extent,*xml_info->content ?
">" : "/>");
if (xml_info->child != (XMLTreeInfo *) NULL)
*source=XMLTreeTagToXML(xml_info->child,source,length,extent,0,attributes);
@@ -2460,7 +2460,7 @@
return((char *) NULL);
}
if (*xml_info->content != '\0')
- *length+=FormatMagickString(*source+(*length),*extent,"</%s>",
+ *length+=FormatLocaleString(*source+(*length),*extent,"</%s>",
xml_info->tag);
while ((content[offset] != '\0') && (offset < xml_info->offset))
offset++;
@@ -2538,7 +2538,7 @@
if (xml == (char *) NULL)
return(xml);
}
- length+=FormatMagickString(xml+length,extent,"<?%s%s%s?>\n",q,
+ length+=FormatLocaleString(xml+length,extent,"<?%s%s%s?>\n",q,
*p != '\0' ? " " : "",p);
p=root->processing_instructions[i][j];
}
@@ -2574,7 +2574,7 @@
if (xml == (char *) NULL)
return(xml);
}
- length+=FormatMagickString(xml+length,extent,"\n<?%s%s%s?>",q,
+ length+=FormatLocaleString(xml+length,extent,"\n<?%s%s%s?>",q,
*p != '\0' ? " " : "",p);
p=root->processing_instructions[i][j];
}
diff --git a/magick/xwindow.c b/magick/xwindow.c
index c1e6081..9ef30b5 100644
--- a/magick/xwindow.c
+++ b/magick/xwindow.c
@@ -605,7 +605,7 @@
/*
Scale image.
*/
- (void) FormatMagickString(image_geometry,MaxTextExtent,"%ux%u",
+ (void) FormatLocaleString(image_geometry,MaxTextExtent,"%ux%u",
width,height);
(void) TransformImage(&annotate_image,(char *) NULL,image_geometry);
}
@@ -1301,7 +1301,7 @@
/*
User specified Standard Colormap.
*/
- (void) FormatMagickString((char *) map_name,MaxTextExtent,
+ (void) FormatLocaleString((char *) map_name,MaxTextExtent,
"RGB_%s_MAP",map_type);
LocaleUpper(map_name);
map_property=XInternAtom(display,(char *) map_name,MagickTrue);
@@ -1977,42 +1977,42 @@
}
if (resource_info->gamma_correct != MagickFalse)
if (resource_info->display_gamma != (char *) NULL)
- (void) fprintf(file,"Display\n gamma: %s\n\n",
+ (void) FormatLocaleFile(file,"Display\n gamma: %s\n\n",
resource_info->display_gamma);
/*
Write info about the X image to a file.
*/
- (void) fprintf(file,"X\n visual: %s\n",
+ (void) FormatLocaleFile(file,"X\n visual: %s\n",
XVisualClassName((int) windows->image.storage_class));
- (void) fprintf(file," depth: %d\n",windows->image.ximage->depth);
+ (void) FormatLocaleFile(file," depth: %d\n",windows->image.ximage->depth);
if (windows->visual_info->colormap_size != 0)
- (void) fprintf(file," colormap size: %d\n",
+ (void) FormatLocaleFile(file," colormap size: %d\n",
windows->visual_info->colormap_size);
if (resource_info->colormap== SharedColormap)
- (void) fprintf(file," colormap type: Shared\n");
+ (void) FormatLocaleFile(file," colormap type: Shared\n");
else
- (void) fprintf(file," colormap type: Private\n");
- (void) fprintf(file," geometry: %dx%d\n",windows->image.ximage->width,
+ (void) FormatLocaleFile(file," colormap type: Private\n");
+ (void) FormatLocaleFile(file," geometry: %dx%d\n",windows->image.ximage->width,
windows->image.ximage->height);
if (windows->image.crop_geometry != (char *) NULL)
- (void) fprintf(file," crop geometry: %s\n",windows->image.crop_geometry);
+ (void) FormatLocaleFile(file," crop geometry: %s\n",windows->image.crop_geometry);
if (windows->image.pixmap == (Pixmap) NULL)
- (void) fprintf(file," type: X Image\n");
+ (void) FormatLocaleFile(file," type: X Image\n");
else
- (void) fprintf(file," type: Pixmap\n");
+ (void) FormatLocaleFile(file," type: Pixmap\n");
if (windows->image.shape != MagickFalse)
- (void) fprintf(file," non-rectangular shape: True\n");
+ (void) FormatLocaleFile(file," non-rectangular shape: True\n");
else
- (void) fprintf(file," non-rectangular shape: False\n");
+ (void) FormatLocaleFile(file," non-rectangular shape: False\n");
if (windows->image.shared_memory != MagickFalse)
- (void) fprintf(file," shared memory: True\n");
+ (void) FormatLocaleFile(file," shared memory: True\n");
else
- (void) fprintf(file," shared memory: False\n");
- (void) fprintf(file,"\n");
+ (void) FormatLocaleFile(file," shared memory: False\n");
+ (void) FormatLocaleFile(file,"\n");
if (resource_info->font != (char *) NULL)
- (void) fprintf(file,"Font: %s\n\n",resource_info->font);
+ (void) FormatLocaleFile(file,"Font: %s\n\n",resource_info->font);
if (resource_info->text_font != (char *) NULL)
- (void) fprintf(file,"Text font: %s\n\n",resource_info->text_font);
+ (void) FormatLocaleFile(file,"Text font: %s\n\n",resource_info->text_font);
/*
Write info about the undo cache to a file.
*/
@@ -2023,9 +2023,9 @@
bytes+=number_pixels*sizeof(PixelPacket);
undo_image=GetPreviousImageInList(undo_image);
}
- (void) fprintf(file,"Undo Edit Cache\n levels: %u\n",levels);
- (void) fprintf(file," bytes: %.20gmb\n",(double) ((bytes+(1 << 19)) >> 20));
- (void) fprintf(file," limit: %.20gmb\n\n",(double)
+ (void) FormatLocaleFile(file,"Undo Edit Cache\n levels: %u\n",levels);
+ (void) FormatLocaleFile(file," bytes: %.20gmb\n",(double) ((bytes+(1 << 19)) >> 20));
+ (void) FormatLocaleFile(file," limit: %.20gmb\n\n",(double)
resource_info->undo_cache);
/*
Write info about the image to a file.
@@ -2050,7 +2050,7 @@
Display information about the image in the Text View widget.
*/
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
- (void) FormatMagickString(title,MaxTextExtent,"Image Info: %s",
+ (void) FormatLocaleString(title,MaxTextExtent,"Image Info: %s",
image->filename);
XTextViewWidget(display,resource_info,windows,MagickTrue,title,
(char const **) textlist);
@@ -2507,7 +2507,7 @@
/*
Scale image.
*/
- (void) FormatMagickString(image_geometry,MaxTextExtent,"%ux%u",
+ (void) FormatLocaleString(image_geometry,MaxTextExtent,"%ux%u",
width,height);
(void) TransformImage(&draw_image,(char *) NULL,image_geometry);
}
@@ -3271,7 +3271,7 @@
/*
Initialize resource keyword and class.
*/
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.%s",
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.%s",
client_name,keyword);
c=(int) (*client_name);
if ((c >= XK_a) && (c <= XK_z))
@@ -3291,7 +3291,7 @@
else
if ((k >= XK_oslash) && (k <= XK_thorn))
k-=(XK_oslash-XK_Ooblique);
- (void) FormatMagickString(resource_class,MaxTextExtent,"%c%s.%c%s",c,
+ (void) FormatLocaleString(resource_class,MaxTextExtent,"%c%s.%c%s",c,
client_name+1,k,keyword+1);
}
status=XrmGetResource(database,resource_name,resource_class,&resource_type,
@@ -3380,7 +3380,7 @@
if ((c >= XK_oslash) && (c <= XK_thorn))
c-=(XK_oslash-XK_Ooblique);
#if defined(X11_APPLICATION_PATH)
- (void) FormatMagickString(filename,MaxTextExtent,"%s%c%s",
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s%c%s",
X11_APPLICATION_PATH,c,client_name+1);
(void) XrmCombineFileDatabase(filename,&resource_database,MagickFalse);
#endif
@@ -3396,7 +3396,7 @@
Merge user preferences database.
*/
#if defined(X11_PREFERENCES_PATH)
- (void) FormatMagickString(filename,MaxTextExtent,"%s%src",
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s%src",
X11_PREFERENCES_PATH,client_name);
ExpandFilename(filename);
(void) XrmCombineFileDatabase(filename,&resource_database,MagickFalse);
@@ -3654,7 +3654,7 @@
return((char *) resource_default);
*resource_name='\0';
if (keyword != (char *) NULL)
- (void) FormatMagickString(resource_name,MaxTextExtent,"%s.%s",client_name,
+ (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.%s",client_name,
keyword);
status=XrmGetResource(database,resource_name,"ImageMagick",&resource_type,
&resource_value);
@@ -3706,7 +3706,7 @@
((double) DisplayWidthMM(display,XDefaultScreen(display))));
y_density=((((double) DisplayHeight(display,XDefaultScreen(display)))*25.4)/
((double) DisplayHeightMM(display,XDefaultScreen(display))));
- (void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_density,
+ (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_density,
y_density);
return(GetPageGeometry(density));
}
@@ -5881,7 +5881,7 @@
resource_info->image_info->texture != (char *) NULL ?
resource_info->image_info->texture : "pattern:checkerboard",
MaxTextExtent);
- (void) FormatMagickString(size,MaxTextExtent,"%.20gx%.20g",(double)
+ (void) FormatLocaleString(size,MaxTextExtent,"%.20gx%.20g",(double)
image->columns,(double) image->rows);
image_info->size=ConstantString(size);
pattern=ReadImage(image_info,&image->exception);
@@ -6508,7 +6508,7 @@
resource_info->image_info->texture != (char *) NULL ?
resource_info->image_info->texture : "pattern:checkerboard",
MaxTextExtent);
- (void) FormatMagickString(size,MaxTextExtent,"%.20gx%.20g",(double)
+ (void) FormatLocaleString(size,MaxTextExtent,"%.20gx%.20g",(double)
image->columns,(double) image->rows);
image_info->size=ConstantString(size);
pattern=ReadImage(image_info,&image->exception);
@@ -7136,7 +7136,7 @@
i=0;
while ((1 << i) <= (int) magnify)
i++;
- (void) FormatMagickString(windows->magnify.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->magnify.name,MaxTextExtent,
"Magnify %.20gX",(double) i);
status=XStringListToTextProperty(&windows->magnify.name,1,&window_name);
if (status != False)
@@ -7457,7 +7457,7 @@
(void) GetOneVirtualMagickPixel(windows->image.image,(ssize_t)
windows->magnify.x,(ssize_t) windows->magnify.y,&pixel,
&windows->image.image->exception);
- (void) FormatMagickString(tuple,MaxTextExtent,"%d,%d: ",
+ (void) FormatLocaleString(tuple,MaxTextExtent,"%d,%d: ",
windows->magnify.x,windows->magnify.y);
(void) ConcatenateMagickString(tuple,"(",MaxTextExtent);
ConcatenateColorComponent(&pixel,RedChannel,X11Compliance,tuple);
@@ -8377,7 +8377,7 @@
/*
User specified geometry.
*/
- (void) FormatMagickString(default_geometry,MaxTextExtent,"%dx%d",
+ (void) FormatLocaleString(default_geometry,MaxTextExtent,"%dx%d",
size_hints->width,size_hints->height);
(void) CopyMagickString(geometry,window_info->geometry,MaxTextExtent);
p=geometry;
@@ -8567,7 +8567,7 @@
p=strrchr(tag,'/');
if (p != (char *) NULL)
*p='\0';
- (void) FormatMagickString(message,MaxTextExtent,"Monitor/%s",tag);
+ (void) FormatLocaleString(message,MaxTextExtent,"Monitor/%s",tag);
locale_message=GetLocaleMessage(message);
if (locale_message == message)
return(text);
@@ -9289,39 +9289,39 @@
assert(resource_info != (XResourceInfo *) NULL);
client_name=GetClientName();
preferences_database=XrmGetStringDatabase("");
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.backdrop",client_name);
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.backdrop",client_name);
value=resource_info->backdrop ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.colormap",client_name);
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.colormap",client_name);
value=resource_info->colormap == SharedColormap ? "Shared" : "Private";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.confirmExit",
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.confirmExit",
client_name);
value=resource_info->confirm_exit ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.confirmEdit",
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.confirmEdit",
client_name);
value=resource_info->confirm_edit ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.displayWarnings",
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.displayWarnings",
client_name);
value=resource_info->display_warnings ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.dither",client_name);
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.dither",client_name);
value=resource_info->quantize_info->dither ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.gammaCorrect",
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.gammaCorrect",
client_name);
value=resource_info->gamma_correct ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.undoCache",client_name);
- (void) FormatMagickString(cache,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.undoCache",client_name);
+ (void) FormatLocaleString(cache,MaxTextExtent,"%.20g",(double)
resource_info->undo_cache);
XrmPutStringResource(&preferences_database,specifier,cache);
- (void) FormatMagickString(specifier,MaxTextExtent,"%s.usePixmap",client_name);
+ (void) FormatLocaleString(specifier,MaxTextExtent,"%s.usePixmap",client_name);
value=resource_info->use_pixmap ? "True" : "False";
XrmPutStringResource(&preferences_database,specifier,(char *) value);
- (void) FormatMagickString(filename,MaxTextExtent,"%s%src",
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s%src",
X11_PREFERENCES_PATH,client_name);
ExpandFilename(filename);
XrmPutFileDatabase(preferences_database,filename);