104 const size_t extent,
char *token)
115 assert(start != (
const char *) NULL);
116 assert(token != (
char *) NULL);
119 while ((isspace((
int) ((
unsigned char) *p)) != 0) && (*p !=
'\0'))
135 case '"': escape=
'"';
break;
136 case '\'': escape=
'\'';
break;
137 case '`': escape=
'\'';
break;
138 case '{': escape=
'}';
break;
139 default: escape=(*p);
break;
141 for (p++; *p !=
'\0'; p++)
143 if ((*p ==
'\\') && ((*(p+1) == escape) || (*(p+1) ==
'\\')))
151 if (i < (ssize_t) (extent-1))
158 if (i < (ssize_t) (extent-1))
160 if ((*p ==
'>') || (*p ==
'/'))
161 if (i < (ssize_t) (extent-1))
172 if ((p != q) && (*p !=
','))
174 for ( ; (p < q) && (*p !=
','); p++)
175 if (i < (ssize_t) (extent-1))
178 if (i < (ssize_t) (extent-1))
182 if ((*p !=
'\0') && (isalpha((
int) ((
unsigned char) *p)) == 0) &&
185 if (i < (ssize_t) (extent-1))
189 for ( ; *p !=
'\0'; p++)
191 if (((isspace((
int) ((
unsigned char) *p)) != 0) || (*p ==
'=') ||
192 (*p ==
',') || (*p ==
':') || (*p ==
';')) && (*(p-1) !=
'\\'))
194 if ((i > 0) && (*p ==
'<'))
196 if (i < (ssize_t) (extent-1))
201 for (p++; *p !=
'\0'; p++)
203 if (i < (ssize_t) (extent-1))
205 if ((*p ==
')') && (*(p-1) !=
'\\'))
219 if (token[offset] ==
'#')
221 i=(ssize_t) strlen(token);
223 token[i-offset-1]=
'\0';
225 while (isspace((
int) ((
unsigned char) *p)) != 0)
227 if (end != (
const char **) NULL)
228 *end=(
const char *) p;
269 if (pattern == (
char *) NULL)
271 if (*pattern ==
'\0')
279 while ((*pattern !=
'\0') && (done ==
WizardFalse))
281 if (*expression ==
'\0')
282 if ((*pattern !=
'{') && (*pattern !=
'*'))
291 while (*pattern ==
'*')
294 while ((*expression !=
'\0') && (status ==
WizardFalse))
298 while (*expression !=
'\0')
300 while (*pattern !=
'\0')
313 if ((*pattern ==
'\0') || (*pattern ==
']'))
318 if (*pattern ==
'\\')
321 if (*pattern ==
'\0')
327 if (*(pattern+1) ==
'-')
336 if (*pattern ==
'\\')
339 if (*pattern ==
'\0')
345 if ((*expression < c) || (*expression > *pattern))
352 if (*pattern != *expression)
358 while ((*pattern !=
']') && (*pattern !=
'\0'))
360 if ((*pattern ==
'\\') && (*(pattern+1) !=
'\0'))
364 if (*pattern !=
'\0')
385 while ((*pattern !=
'}') && (*pattern !=
'\0'))
389 while ((*p !=
'\0') && (*pattern !=
'\0') &&
390 (*pattern !=
',') && (*pattern !=
'}') &&
393 if (*pattern ==
'\\')
399 if (*pattern ==
'\0')
408 while ((*pattern !=
'}') && (*pattern !=
'\0'))
411 if (*pattern ==
'\\')
421 while ((*pattern !=
'}') && (*pattern !=
',') &&
425 if (*pattern ==
'\\')
428 if ((*pattern ==
'}') || (*pattern ==
','))
433 if (*pattern !=
'\0')
441 if (*pattern ==
'\0')
448 if (tolower((
int) ((
unsigned char) *expression)) !=
449 tolower((
int) ((
unsigned char) *pattern)))
456 if (*expression != *pattern)
466 while (*pattern ==
'*')
507 for (p=path; *p !=
'\0'; p++)
static double StringToDouble(const char *string, char **sentinal)
WizardExport int LocaleNCompare(const char *p, const char *q, const size_t length)
WizardExport int LocaleCompare(const char *p, const char *q)
WizardExport size_t CopyWizardString(char *destination, const char *source, const size_t length)
#define DirectorySeparator
WizardExport WizardBooleanType GlobExpression(const char *expression, const char *pattern, const WizardBooleanType case_insensitive)
WizardExport WizardBooleanType IsGlob(const char *path)
WizardExport void GetNextToken(const char *start, const char **end, const size_t extent, char *token)
WizardExport WizardBooleanType IsPathAcessible(const char *path)
unsigned int WizardStatusType