ICU-1923 add isToken() helper function

X-SVN-Rev: 8745
This commit is contained in:
Markus Scherer 2002-05-31 01:14:52 +00:00
parent 003bdd3f26
commit e938c51dea
2 changed files with 27 additions and 3 deletions

View file

@ -177,6 +177,30 @@ writeUCDFilename(char *basename, const char *filename, const char *suffix) {
uprv_strcpy(basename+length, ".txt");
}
U_CFUNC UBool
isToken(const char *token, const char *s) {
const char *z;
int32_t j;
s=u_skipWhitespace(s);
for(j=0;; ++j) {
if(token[j]!=0) {
if(s[j]!=token[j]) {
break;
}
} else {
z=u_skipWhitespace(s+j);
if(*z==';' || *z==0) {
return TRUE;
} else {
break;
}
}
}
return FALSE;
}
U_CFUNC int32_t
getTokenIndex(const char *const tokens[], int32_t countTokens, const char *s) {
const char *t, *z;

View file

@ -62,6 +62,9 @@ genCategoryNames[];
U_CFUNC void
writeUCDFilename(char *basename, const char *filename, const char *suffix);
U_CFUNC UBool
isToken(const char *token, const char *s);
U_CFUNC int32_t
getTokenIndex(const char *const tokens[], int32_t countTokens, const char *s);
@ -90,9 +93,6 @@ generateData(const char *dataDir);
U_CFUNC void
initAdditionalProperties(void);
U_CFUNC void
setMainProperties(uint32_t start, uint32_t limit, uint32_t value);
U_CFUNC void
generateAdditionalProperties(char *filename, const char *suffix, UErrorCode *pErrorCode);