Lines Matching defs:csp
67 UCaseProps *csp=(UCaseProps *)context;
68 uprv_memcpy(csp->formatVersion, pInfo->formatVersion, 4);
78 UCaseProps *csp;
125 csp=(UCaseProps *)uprv_malloc(sizeof(UCaseProps));
126 if(csp==NULL) {
130 uprv_memcpy(csp, cspProto, sizeof(UCaseProps));
131 return csp;
137 UCaseProps cspProto={ NULL }, *csp;
144 csp=ucase_openData(
153 return csp;
195 ucase_close(UCaseProps *csp) {
196 if(csp!=NULL) {
198 udata_close(csp->mem);
200 uprv_free(csp);
250 UCaseProps *csp=ucase_open(pErrorCode);
260 gCsp=csp;
261 csp=NULL;
267 ucase_close(csp);
276 UCaseProps *csp;
282 UMTX_CHECK(NULL, gCspDummy, csp);
284 if(csp!=NULL) {
286 return csp;
287 } else /* csp==NULL */ {
291 csp=(UCaseProps *)uprv_malloc(sizeof(UCaseProps)+UCASE_IX_TOP*4+UTRIE_DUMMY_SIZE);
292 if(csp==NULL) {
296 uprv_memset(csp, 0, sizeof(UCaseProps)+UCASE_IX_TOP*4);
298 csp->indexes=indexes=(int32_t *)(csp+1);
302 utrie_unserializeDummy(&csp->trie, indexes+UCASE_IX_TOP, UTRIE_DUMMY_SIZE, 0, 0, TRUE, pErrorCode);
304 uprv_free(csp);
308 csp->formatVersion[0]=1;
309 csp->formatVersion[2]=UTRIE_SHIFT;
310 csp->formatVersion[3]=UTRIE_INDEX_SHIFT;
315 gCspDummy=csp;
316 csp=NULL;
321 uprv_free(csp);
338 ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *pErrorCode) {
344 utrie2_enum(&csp->trie, NULL, _enumPropertyStartsRange, sa);
358 #define GET_EXCEPTIONS(csp, props) ((csp)->exceptions+((props)>>UCASE_EXC_SHIFT))
407 ucase_tolower(const UCaseProps *csp, UChar32 c) {
408 uint16_t props=UTRIE2_GET16(&csp->trie, c);
414 const uint16_t *pe=GET_EXCEPTIONS(csp, props);
424 ucase_toupper(const UCaseProps *csp, UChar32 c) {
425 uint16_t props=UTRIE2_GET16(&csp->trie, c);
431 const uint16_t *pe=GET_EXCEPTIONS(csp, props);
441 ucase_totitle(const UCaseProps *csp, UChar32 c) {
442 uint16_t props=UTRIE2_GET16(&csp->trie, c);
448 const uint16_t *pe=GET_EXCEPTIONS(csp, props);
472 ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa) {
503 props=UTRIE2_GET16(&csp->trie, c);
517 const uint16_t *pe0, *pe=GET_EXCEPTIONS(csp, props);
612 ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa) {
616 if(csp->unfold==NULL || s==NULL) {
630 unfold=csp->unfold;
656 ucase_addCaseClosure(csp, c, sa);
671 ucase_getType(const UCaseProps *csp, UChar32 c) {
672 uint16_t props=UTRIE2_GET16(&csp->trie, c);
678 ucase_getTypeOrIgnorable(const UCaseProps *csp, UChar32 c) {
679 uint16_t props=UTRIE2_GET16(&csp->trie, c);
682 const uint16_t *pe=GET_EXCEPTIONS(csp, props);
694 getDotType(const UCaseProps *csp, UChar32 c) {
695 uint16_t props=UTRIE2_GET16(&csp->trie, c);
699 const uint16_t *pe=GET_EXCEPTIONS(csp, props);
705 ucase_isSoftDotted(const UCaseProps *csp, UChar32 c) {
706 return (UBool)(getDotType(csp, c)==UCASE_SOFT_DOTTED);
710 ucase_isCaseSensitive(const UCaseProps *csp, UChar32 c) {
711 uint16_t props=UTRIE2_GET16(&csp->trie, c);
900 isFollowedByCasedLetter(const UCaseProps *csp, UCaseContextIterator *iter, void *context, int8_t dir) {
908 int32_t type=ucase_getTypeOrIgnorable(csp, c);
923 isPrecededBySoftDotted(const UCaseProps *csp, UCaseContextIterator *iter, void *context) {
933 dotType=getDotType(csp, c);
980 isPrecededBy_I(const UCaseProps *csp, UCaseContextIterator *iter, void *context) {
993 dotType=getDotType(csp, c);
1004 isFollowedByMoreAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *context) {
1014 dotType=getDotType(csp, c);
1027 isFollowedByDotAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *context) {
1040 dotType=getDotType(csp, c);
1050 ucase_toFullLower(const UCaseProps *csp, UChar32 c,
1056 uint16_t props=UTRIE2_GET16(&csp->trie, c);
1062 const uint16_t *pe=GET_EXCEPTIONS(csp, props), *pe2;
1081 isFollowedByMoreAbove(csp, iter, context)) ||
1133 } else if(loc==UCASE_LOC_TURKISH && c==0x307 && isPrecededBy_I(csp, iter, context)) {
1142 } else if(loc==UCASE_LOC_TURKISH && c==0x49 && !isFollowedByDotAbove(csp, iter, context)) {
1159 !isFollowedByCasedLetter(csp, iter, context, 1) &&
1160 isFollowedByCasedLetter(csp, iter, context, -1) /* -1=preceded */
1194 toUpperOrTitle(const UCaseProps *csp, UChar32 c,
1200 uint16_t props=UTRIE2_GET16(&csp->trie, c);
1206 const uint16_t *pe=GET_EXCEPTIONS(csp, props), *pe2;
1229 } else if(loc==UCASE_LOC_LITHUANIAN && c==0x307 && isPrecededBySoftDotted(csp, iter, context)) {
1287 ucase_toFullUpper(const UCaseProps *csp, UChar32 c,
1291 return toUpperOrTitle(csp, c, iter, context, pString, locale, locCache, TRUE);
1295 ucase_toFullTitle(const UCaseProps *csp, UChar32 c,
1299 return toUpperOrTitle(csp, c, iter, context, pString, locale, locCache, FALSE);
1345 ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options) {
1346 uint16_t props=UTRIE2_GET16(&csp->trie, c);
1352 const uint16_t *pe=GET_EXCEPTIONS(csp, props);
1405 ucase_toFullFolding(const UCaseProps *csp, UChar32 c,
1410 uint16_t props=UTRIE2_GET16(&csp->trie, c);
1416 const uint16_t *pe=GET_EXCEPTIONS(csp, props), *pe2;
1489 const UCaseProps *csp;
1492 csp
1495 csp=ucase_getDummy(&errorCode);
1501 return csp;
1583 const UCaseProps *csp=GET_CASE_PROPS();
1584 if(csp==NULL) {
1589 return (UBool)(UCASE_LOWER==ucase_getType(csp, c));
1591 return (UBool)(UCASE_UPPER==ucase_getType(csp, c));
1593 return ucase_isSoftDotted(csp, c);
1595 return ucase_isCaseSensitive(csp, c);
1597 return (UBool)(UCASE_NONE!=ucase_getType(csp, c));
1599 return (UBool)(ucase_getTypeOrIgnorable(csp, c)>>2);
1614 return (UBool)(ucase_toFullLower(csp, c, NULL, NULL, &resultString, "", &locCache)>=0);
1617 return (UBool)(ucase_toFullUpper(csp, c, NULL, NULL, &resultString, "", &locCache)>=0);
1620 return (UBool)(ucase_toFullTitle(csp, c, NULL, NULL, &resultString, "", &locCache)>=0);
1625 ucase_toFullLower(csp, c, NULL, NULL, &resultString, "", &locCache)>=0 ||
1626 ucase_toFullUpper(csp, c, NULL, NULL, &resultString, "", &locCache)>=0 ||
1627 ucase_toFullTitle(csp, c, NULL, NULL, &resultString, "", &locCache)>=0);