% January 1993 %
% %
% %
-% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
MagickStatusType
flag;
- long
+ ssize_t
offset;
char
quote;
- unsigned long
+ size_t
signature;
};
\f
TokenInfo
*token_info;
- token_info=(TokenInfo *) AcquireMagickMemory(sizeof(*token_info));
+ token_info=(TokenInfo *) AcquireAlignedMemory(1,sizeof(*token_info));
if (token_info == (TokenInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
token_info->signature=MagickSignature;
% GetMagickToken() gets a token from the token stream. A token is defined as a
% sequence of characters delimited by whitespace (e.g. clip-path), a sequence
% delimited with quotes (.e.g "Quote me"), or a sequence enclosed in
-% parenthesis (e.g. rgb(0,0,0)).
+% parenthesis (e.g. rgb(0,0,0)). GetMagickToken() also recognizes these
+% separator characters: ':', '=', ',', and ';'.
%
% The format of the GetMagickToken method is:
%
register const char
*p;
- register long
+ register ssize_t
i;
i=0;
for ( ; *p != '\0'; p++)
{
if (((isspace((int) ((unsigned char) *p)) != 0) || (*p == '=') ||
- (*p == ',') || (*p == ':')) && (*(p-1) != '\\'))
+ (*p == ',') || (*p == ':') || (*p == ';')) && (*(p-1) != '\\'))
break;
if ((i > 0) && (*p == '<'))
break;
offset=4;
if (token[offset] == '#')
offset++;
- i=(long) strlen(token);
+ i=(ssize_t) strlen(token);
(void) CopyMagickString(token,token+offset,MaxTextExtent);
token[i-offset-1]='\0';
}
image_info=AcquireImageInfo();
(void) CopyMagickString(image_info->filename,pattern,MaxTextExtent);
exception=AcquireExceptionInfo();
- (void) SetImageInfo(image_info,MagickTrue,exception);
+ (void) SetImageInfo(image_info,0,exception);
exception=DestroyExceptionInfo(exception);
if (LocaleCompare(image_info->filename,pattern) != 0)
{
break;
switch (GetUTFCode(pattern))
{
- case '\\':
- {
- pattern+=GetUTFOctets(pattern);
- if (GetUTFCode(pattern) != 0)
- pattern+=GetUTFOctets(pattern);
- break;
- }
case '*':
{
MagickBooleanType
}
case '[':
{
- unsigned long
+ ssize_t
c;
pattern+=GetUTFOctets(pattern);
}
break;
}
+ case '\\':
+ {
+ pattern+=GetUTFOctets(pattern);
+ if (GetUTFCode(pattern) == 0)
+ break;
+ }
default:
{
if (case_insensitive != MagickFalse)
#define IN_QUOTE 2
#define IN_OZONE 3
-static long sindex(int c,const char *string)
+static ssize_t sindex(int c,const char *string)
{
register const char
*p;
for (p=string; *p != '\0'; p++)
if (c == (int) (*p))
- return(p-string);
+ return((ssize_t) (p-string));
return(-1);
}
static void StoreToken(TokenInfo *token_info,char *string,
size_t max_token_length,int c)
{
- register long
+ register ssize_t
i;
if ((token_info->offset < 0) ||
int
c;
- register long
+ register ssize_t
i;
*breaker='\0';