static char *GetNodeByURL(const char *primitive,const char *url)
{
char
- *token;
+ *node;
const char
*q,
*/
if (primitive == (const char *) NULL)
return((char *) NULL);
- token=AcquireString(primitive);
- extent=strlen(token)+MagickPathExtent;
+ node=AcquireString(primitive);
+ extent=strlen(node)+MagickPathExtent;
length=0;
n=0;
start=(const char *) NULL;
for (q=primitive; (*q != '\0') && (length == 0); )
{
p=q;
- GetNextToken(q,&q,extent,token);
- if (*token == '\0')
+ GetNextToken(q,&q,extent,node);
+ if (*node == '\0')
break;
- if (*token == '#')
+ if (*node == '#')
{
/*
Comment.
q++;
continue;
}
- if (LocaleCompare("pop",token) == 0)
+ if (LocaleCompare("pop",node) == 0)
{
- GetNextToken(q,&q,extent,token);
+ GetNextToken(q,&q,extent,node);
if ((n == 0) && (start != (const char *) NULL))
{
/*
}
n--;
}
- if (LocaleCompare("push",token) == 0)
+ if (LocaleCompare("push",node) == 0)
{
- GetNextToken(q,&q,extent,token);
+ GetNextToken(q,&q,extent,node);
n++;
if (*q == '"')
{
- GetNextToken(q,&q,extent,token);
- if (LocaleCompare(url,token) == 0)
+ GetNextToken(q,&q,extent,node);
+ if (LocaleCompare(url,node) == 0)
{
/*
Start of node by ID.
}
}
if (start == (const char *) NULL)
- return(DestroyString(token));
- (void) CopyMagickString(token,start,length);
- return(token);
+ return(DestroyString(node));
+ (void) CopyMagickString(node,start,length);
+ return(node);
}
static inline MagickBooleanType IsPoint(const char *point)
node=GetNodeByURL(primitive,token);
if (node != (char *) NULL)
{
+ char
+ *elements;
+
+ ssize_t
+ offset;
+
/*
- Insert class elements in stream.
+ Inject class elements in stream.
*/
+ offset=p-primitive;
+ elements=AcquireString(primitive);
+ elements[offset]='\0';
+ (void) ConcatenateString(&elements,node);
node=DestroyString(node);
+ (void) ConcatenateString(&elements,"\n");
+ (void) ConcatenateString(&elements,q);
+ primitive=DestroyString(primitive);
+ primitive=elements;
+ q=primitive+offset;
}
break;
}