mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-1923 add isToken() helper function
X-SVN-Rev: 8745
This commit is contained in:
parent
003bdd3f26
commit
e938c51dea
2 changed files with 27 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue