Lines Matching refs:resB

109     UResourceDataEntry *resB = resBundle->fData;  in getFallbackData()  local
113 if(resB != NULL) { in getFallbackData()
114 if(resB->fBogus == U_ZERO_ERROR) { /* if this resource is real, */ in getFallbackData()
115 …*res = res_getTableItemByKey(&(resB->fData), resB->fData.rootRes, &indexR, resTag); /* try to get … in getFallbackData()
119 … while(*res == RES_BOGUS && resB->fParent != NULL) { /* Otherwise, we'll look in parents */ in getFallbackData()
120 resB = resB->fParent; in getFallbackData()
121 if(resB->fBogus == U_ZERO_ERROR) { in getFallbackData()
123 … *res = res_getTableItemByKey(&(resB->fData), resB->fData.rootRes, &indexR, resTag); in getFallbackData()
130 …if(uprv_strcmp(resB->fName, uloc_getDefault())==0 || uprv_strcmp(resB->fName, kRootLocaleName)==0)… in getFallbackData()
136 *realData = resB; in getFallbackData()
137 return (&(resB->fData)); in getFallbackData()
174 UResourceDataEntry *resB; in ures_flushCache() local
195 resB = (UResourceDataEntry *) e->value.pointer; in ures_flushCache()
205 if (resB->fCountExisting == 0) { in ures_flushCache()
209 free_entry(resB); in ures_flushCache()
229 UResourceDataEntry *resB; in ures_dumpCacheContents() local
240 resB = (UResourceDataEntry *) e->value.pointer; in ures_dumpCacheContents()
243 (void*)resB, resB->fCountExisting, in ures_dumpCacheContents()
244 resB->fName?resB->fName:"NULL", in ures_dumpCacheContents()
245 resB->fPath?resB->fPath:"NULL", in ures_dumpCacheContents()
246 (void*)resB->fPool, in ures_dumpCacheContents()
247 (void*)resB->fAlias, in ures_dumpCacheContents()
248 (void*)resB->fParent); in ures_dumpCacheContents()
495 static void ures_setIsStackObject( UResourceBundle* resB, UBool state) { in ures_setIsStackObject() argument
497 resB->fMagic1 = 0; in ures_setIsStackObject()
498 resB->fMagic2 = 0; in ures_setIsStackObject()
500 resB->fMagic1 = MAGIC1; in ures_setIsStackObject()
501 resB->fMagic2 = MAGIC2; in ures_setIsStackObject()
505 static UBool ures_isStackObject(const UResourceBundle* resB) { in ures_isStackObject() argument
506 return((resB->fMagic1 == MAGIC1 && resB->fMagic2 == MAGIC2)?FALSE:TRUE); in ures_isStackObject()
510 U_CFUNC void ures_initStackObject(UResourceBundle* resB) { in ures_initStackObject() argument
511 uprv_memset(resB, 0, sizeof(UResourceBundle)); in ures_initStackObject()
512 ures_setIsStackObject(resB, TRUE); in ures_initStackObject()
821 static void entryCloseInt(UResourceDataEntry *resB) { in entryCloseInt() argument
822 UResourceDataEntry *p = resB; in entryCloseInt()
824 while(resB != NULL) { in entryCloseInt()
825 p = resB->fParent; in entryCloseInt()
826 resB->fCountExisting--; in entryCloseInt()
846 resB = p; in entryCloseInt()
854 static void entryClose(UResourceDataEntry *resB) { in entryClose() argument
856 entryCloseInt(resB); in entryClose()
877 static void ures_appendResPath(UResourceBundle *resB, const char* toAdd, int32_t lenToAdd, UErrorCo… in ures_appendResPath() argument
878 int32_t resPathLenOrig = resB->fResPathLen; in ures_appendResPath()
879 if(resB->fResPath == NULL) { in ures_appendResPath()
880 resB->fResPath = resB->fResBuf; in ures_appendResPath()
881 *(resB->fResPath) = 0; in ures_appendResPath()
882 resB->fResPathLen = 0; in ures_appendResPath()
884 resB->fResPathLen += lenToAdd; in ures_appendResPath()
885 if(RES_BUFSIZE <= resB->fResPathLen+1) { in ures_appendResPath()
886 if(resB->fResPath == resB->fResBuf) { in ures_appendResPath()
887 resB->fResPath = (char *)uprv_malloc((resB->fResPathLen+1)*sizeof(char)); in ures_appendResPath()
889 if (resB->fResPath == NULL) { in ures_appendResPath()
893 uprv_strcpy(resB->fResPath, resB->fResBuf); in ures_appendResPath()
895 char *temp = (char *)uprv_realloc(resB->fResPath, (resB->fResPathLen+1)*sizeof(char)); in ures_appendResPath()
901 resB->fResPath = temp; in ures_appendResPath()
904 uprv_strcpy(resB->fResPath + resPathLenOrig, toAdd); in ures_appendResPath()
907 static void ures_freeResPath(UResourceBundle *resB) { in ures_freeResPath() argument
908 if (resB->fResPath && resB->fResPath != resB->fResBuf) { in ures_freeResPath()
909 uprv_free(resB->fResPath); in ures_freeResPath()
911 resB->fResPath = NULL; in ures_freeResPath()
912 resB->fResPathLen = 0; in ures_freeResPath()
916 ures_closeBundle(UResourceBundle* resB, UBool freeBundleObj) in ures_closeBundle() argument
918 if(resB != NULL) { in ures_closeBundle()
919 if(resB->fData != NULL) { in ures_closeBundle()
920 entryClose(resB->fData); in ures_closeBundle()
922 if(resB->fVersion != NULL) { in ures_closeBundle()
923 uprv_free(resB->fVersion); in ures_closeBundle()
925 ures_freeResPath(resB); in ures_closeBundle()
927 if(ures_isStackObject(resB) == FALSE && freeBundleObj) { in ures_closeBundle()
928 uprv_free(resB); in ures_closeBundle()
933 uprv_memset(resB, -1, sizeof(UResourceBundle)); in ures_closeBundle()
940 ures_close(UResourceBundle* resB) in ures_close() argument
942 ures_closeBundle(resB, TRUE); in ures_close()
948 UResourceBundle *resB, UErrorCode *status) in init_resb_result() argument
951 return resB; in init_resb_result()
1044 UResourceBundle *result = resB; in init_resb_result()
1097 …t_resb_result(&(mainRes->fResData), r, temp, -1, mainRes->fData, mainRes, noAlias+1, resB, status); in init_resb_result()
1100 result = resB; in init_resb_result()
1130resB = init_resb_result(&(dataEntry->fData), r, temp, -1, dataEntry, result, noAlias+1, resB, stat… in init_resb_result()
1131 result = resB; in init_resb_result()
1146 result = resB; in init_resb_result()
1166 return resB; in init_resb_result()
1170 return resB; in init_resb_result()
1173 if(resB == NULL) { in init_resb_result()
1174 resB = (UResourceBundle *)uprv_malloc(sizeof(UResourceBundle)); in init_resb_result()
1176 if (resB == NULL) { in init_resb_result()
1180 ures_setIsStackObject(resB, FALSE); in init_resb_result()
1181 resB->fResPath = NULL; in init_resb_result()
1182 resB->fResPathLen = 0; in init_resb_result()
1184 if(resB->fData != NULL) { in init_resb_result()
1185 entryClose(resB->fData); in init_resb_result()
1187 if(resB->fVersion != NULL) { in init_resb_result()
1188 uprv_free(resB->fVersion); in init_resb_result()
1201 if(parent != resB) { in init_resb_result()
1202 ures_freeResPath(resB); in init_resb_result()
1205 resB->fData = realData; in init_resb_result()
1206 entryIncrease(resB->fData); in init_resb_result()
1207 resB->fHasFallback = FALSE; in init_resb_result()
1208 resB->fIsTopLevel = FALSE; in init_resb_result()
1209 resB->fIndex = -1; in init_resb_result()
1210 resB->fKey = key; in init_resb_result()
1212 resB->fTopLevelData = parent->fTopLevelData; in init_resb_result()
1213 if(parent->fResPath && parent != resB) { in init_resb_result()
1214 ures_appendResPath(resB, parent->fResPath, parent->fResPathLen, status); in init_resb_result()
1217 ures_appendResPath(resB, key, (int32_t)uprv_strlen(key), status); in init_resb_result()
1218 if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) { in init_resb_result()
1219 ures_appendResPath(resB, RES_PATH_SEPARATOR_S, 1, status); in init_resb_result()
1224 ures_appendResPath(resB, buf, len, status); in init_resb_result()
1225 if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) { in init_resb_result()
1226 ures_appendResPath(resB, RES_PATH_SEPARATOR_S, 1, status); in init_resb_result()
1231 int32_t usedLen = ((resB->fResBuf == resB->fResPath) ? resB->fResPathLen : 0); in init_resb_result()
1232 uprv_memset(resB->fResBuf + usedLen, 0, sizeof(resB->fResBuf) - usedLen); in init_resb_result()
1235 resB->fVersion = NULL; in init_resb_result()
1236 resB->fRes = r; in init_resb_result()
1238 uprv_memmove(&resB->fResData, rdata, sizeof(ResourceData)); in init_resb_result()
1239 resB->fSize = res_countArrayItems(&(resB->fResData), resB->fRes); in init_resb_result()
1240 return resB; in init_resb_result()
1279 U_CAPI const UChar* U_EXPORT2 ures_getString(const UResourceBundle* resB, int32_t* len, UErrorCode*… in ures_getString() argument
1284 if(resB == NULL) { in ures_getString()
1288 s = res_getString(&(resB->fResData), resB->fRes, len); in ures_getString()
1358 ures_getUTF8String(const UResourceBundle *resB, in ures_getUTF8String() argument
1363 const UChar *s16 = ures_getString(resB, &length16, status); in ures_getUTF8String()
1367 U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(const UResourceBundle* resB, int32_t* len, in ures_getBinary() argument
1373 if(resB == NULL) { in ures_getBinary()
1377 p = res_getBinary(&(resB->fResData), resB->fRes, len); in ures_getBinary()
1384 U_CAPI const int32_t* U_EXPORT2 ures_getIntVector(const UResourceBundle* resB, int32_t* len, in ures_getIntVector() argument
1390 if(resB == NULL) { in ures_getIntVector()
1394 p = res_getIntVector(&(resB->fResData), resB->fRes, len); in ures_getIntVector()
1403 U_CAPI int32_t U_EXPORT2 ures_getInt(const UResourceBundle* resB, UErrorCode *status) { in ures_getInt() argument
1407 if(resB == NULL) { in ures_getInt()
1411 if(RES_GET_TYPE(resB->fRes) != URES_INT) { in ures_getInt()
1415 return RES_GET_INT(resB->fRes); in ures_getInt()
1418 U_CAPI uint32_t U_EXPORT2 ures_getUInt(const UResourceBundle* resB, UErrorCode *status) { in ures_getUInt() argument
1422 if(resB == NULL) { in ures_getUInt()
1426 if(RES_GET_TYPE(resB->fRes) != URES_INT) { in ures_getUInt()
1430 return RES_GET_UINT(resB->fRes); in ures_getUInt()
1433 U_CAPI UResType U_EXPORT2 ures_getType(const UResourceBundle *resB) { in ures_getType() argument
1434 if(resB == NULL) { in ures_getType()
1437 return res_getPublicType(resB->fRes); in ures_getType()
1440 U_CAPI const char * U_EXPORT2 ures_getKey(const UResourceBundle *resB) { in ures_getKey() argument
1441 if(resB == NULL) { in ures_getKey()
1445 return(resB->fKey); in ures_getKey()
1448 U_CAPI int32_t U_EXPORT2 ures_getSize(const UResourceBundle *resB) { in ures_getSize() argument
1449 if(resB == NULL) { in ures_getSize()
1453 return resB->fSize; in ures_getSize()
1456 static const UChar* ures_getStringWithAlias(const UResourceBundle *resB, Resource r, int32_t sIndex… in ures_getStringWithAlias() argument
1459 UResourceBundle *tempRes = ures_getByIndex(resB, sIndex, NULL, status); in ures_getStringWithAlias()
1464 return res_getString(&(resB->fResData), r, len); in ures_getStringWithAlias()
1468 U_CAPI void U_EXPORT2 ures_resetIterator(UResourceBundle *resB){ in ures_resetIterator() argument
1469 if(resB == NULL) { in ures_resetIterator()
1472 resB->fIndex = -1; in ures_resetIterator()
1475 U_CAPI UBool U_EXPORT2 ures_hasNext(const UResourceBundle *resB) { in ures_hasNext() argument
1476 if(resB == NULL) { in ures_hasNext()
1479 return (UBool)(resB->fIndex < resB->fSize-1); in ures_hasNext()
1482 U_CAPI const UChar* U_EXPORT2 ures_getNextString(UResourceBundle *resB, int32_t* len, const char **… in ures_getNextString() argument
1488 if(resB == NULL) { in ures_getNextString()
1493 if(resB->fIndex == resB->fSize-1) { in ures_getNextString()
1496 resB->fIndex++; in ures_getNextString()
1497 switch(RES_GET_TYPE(resB->fRes)) { in ures_getNextString()
1500 return res_getString(&(resB->fResData), resB->fRes, len); in ures_getNextString()
1504 r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, resB->fIndex, key); in ures_getNextString()
1505 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getNextString()
1508 return ures_getStringWithAlias(resB, r, resB->fIndex, len, status); in ures_getNextString()
1511 r = res_getArrayItem(&(resB->fResData), resB->fRes, resB->fIndex); in ures_getNextString()
1512 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getNextString()
1515 return ures_getStringWithAlias(resB, r, resB->fIndex, len, status); in ures_getNextString()
1517 return ures_getStringWithAlias(resB, resB->fRes, resB->fIndex, len, status); in ures_getNextString()
1531 U_CAPI UResourceBundle* U_EXPORT2 ures_getNextResource(UResourceBundle *resB, UResourceBundle *fill… in ures_getNextResource() argument
1539 if(resB == NULL) { in ures_getNextResource()
1545 if(resB->fIndex == resB->fSize-1) { in ures_getNextResource()
1549 resB->fIndex++; in ures_getNextResource()
1550 switch(RES_GET_TYPE(resB->fRes)) { in ures_getNextResource()
1556 return ures_copyResb(fillIn, resB, status); in ures_getNextResource()
1560 r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, resB->fIndex, &key); in ures_getNextResource()
1561 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getNextResource()
1564 …return init_resb_result(&(resB->fResData), r, key, resB->fIndex, resB->fData, resB, 0, fillIn, sta… in ures_getNextResource()
1567 r = res_getArrayItem(&(resB->fResData), resB->fRes, resB->fIndex); in ures_getNextResource()
1568 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getNextResource()
1571 …return init_resb_result(&(resB->fResData), r, key, resB->fIndex, resB->fData, resB, 0, fillIn, sta… in ures_getNextResource()
1581 U_CAPI UResourceBundle* U_EXPORT2 ures_getByIndex(const UResourceBundle *resB, int32_t indexR, URes… in ures_getByIndex() argument
1589 if(resB == NULL) { in ures_getByIndex()
1595 if(indexR >= 0 && resB->fSize > indexR) { in ures_getByIndex()
1596 switch(RES_GET_TYPE(resB->fRes)) { in ures_getByIndex()
1602 return ures_copyResb(fillIn, resB, status); in ures_getByIndex()
1606 r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, indexR, &key); in ures_getByIndex()
1607 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getByIndex()
1610 … return init_resb_result(&(resB->fResData), r, key, indexR, resB->fData, resB, 0, fillIn, status); in ures_getByIndex()
1613 r = res_getArrayItem(&(resB->fResData), resB->fRes, indexR); in ures_getByIndex()
1614 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getByIndex()
1617 … return init_resb_result(&(resB->fResData), r, key, indexR, resB->fData, resB, 0, fillIn, status); in ures_getByIndex()
1629 U_CAPI const UChar* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resB, int32_t indexS, in… in ures_getStringByIndex() argument
1636 if(resB == NULL) { in ures_getStringByIndex()
1641 if(indexS >= 0 && resB->fSize > indexS) { in ures_getStringByIndex()
1642 switch(RES_GET_TYPE(resB->fRes)) { in ures_getStringByIndex()
1645 return res_getString(&(resB->fResData), resB->fRes, len); in ures_getStringByIndex()
1649 r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, indexS, &key); in ures_getStringByIndex()
1650 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getStringByIndex()
1653 return ures_getStringWithAlias(resB, r, indexS, len, status); in ures_getStringByIndex()
1656 r = res_getArrayItem(&(resB->fResData), resB->fRes, indexS); in ures_getStringByIndex()
1657 if(r == RES_BOGUS && resB->fHasFallback) { in ures_getStringByIndex()
1660 return ures_getStringWithAlias(resB, r, indexS, len, status); in ures_getStringByIndex()
1662 return ures_getStringWithAlias(resB, resB->fRes, indexS, len, status); in ures_getStringByIndex()
1680 ures_getUTF8StringByIndex(const UResourceBundle *resB, in ures_getUTF8StringByIndex() argument
1686 const UChar *s16 = ures_getStringByIndex(resB, idx, &length16, status); in ures_getUTF8StringByIndex()
1750 ures_findSubResource(const UResourceBundle *resB, char* path, UResourceBundle *fillIn, UErrorCode *… in ures_findSubResource() argument
1764 res = res_findResource(&(resB->fResData), resB->fRes, &path, &key); in ures_findSubResource()
1766 … result = init_resb_result(&(resB->fResData), res, key, -1, resB->fData, resB, 0, fillIn, status); in ures_findSubResource()
1767 resB = result; in ures_findSubResource()
1777 ures_getStringByKeyWithFallback(const UResourceBundle *resB, in ures_getStringByKeyWithFallback() argument
1785 ures_getByKeyWithFallback(resB, inKey, &stack, status); in ures_getStringByKeyWithFallback()
1835 ures_getByKeyWithFallback(const UResourceBundle *resB, in ures_getByKeyWithFallback() argument
1846 if(resB == NULL) { in ures_getByKeyWithFallback()
1851 int32_t type = RES_GET_TYPE(resB->fRes); in ures_getByKeyWithFallback()
1853 res = getTableItemByKeyPath(&(resB->fResData), resB->fRes, inKey); in ures_getByKeyWithFallback()
1856 UResourceDataEntry *dataEntry = resB->fData; in ures_getByKeyWithFallback()
1859 const char* resPath = resB->fResPath; in ures_getByKeyWithFallback()
1860 int32_t len = resB->fResPathLen; in ures_getByKeyWithFallback()
1881 …helper = init_resb_result(&(dataEntry->fData), res, NULL, -1, dataEntry, resB, 0, helper, status); in ures_getByKeyWithFallback()
1905 …fillIn = init_resb_result(&(dataEntry->fData), res, inKey, -1, dataEntry, resB, 0, fillIn, status); in ures_getByKeyWithFallback()
1910 … fillIn = init_resb_result(&(resB->fResData), res, key, -1, resB->fData, resB, 0, fillIn, status); in ures_getByKeyWithFallback()
2012 U_CAPI UResourceBundle* U_EXPORT2 ures_getByKey(const UResourceBundle *resB, const char* inKey, URe… in ures_getByKey() argument
2020 if(resB == NULL) { in ures_getByKey()
2025 int32_t type = RES_GET_TYPE(resB->fRes); in ures_getByKey()
2028 res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key); in ures_getByKey()
2031 if(resB->fHasFallback == TRUE) { in ures_getByKey()
2032 const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status); in ures_getByKey()
2035 return init_resb_result(rd, res, key, -1, realData, resB, 0, fillIn, status); in ures_getByKey()
2043 … return init_resb_result(&(resB->fResData), res, key, -1, resB->fData, resB, 0, fillIn, status); in ures_getByKey()
2049 else if(RES_GET_TYPE(resB->fRes) == URES_ARRAY && resB->fHasFallback == TRUE) { in ures_getByKey()
2051 const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status); in ures_getByKey()
2053 return init_resb_result(rd, res, key, realData, resB, fillIn, status); in ures_getByKey()
2065 U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, const char* inKey, i… in ures_getStringByKey() argument
2073 if(resB == NULL) { in ures_getStringByKey()
2078 int32_t type = RES_GET_TYPE(resB->fRes); in ures_getStringByKey()
2082 res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key); in ures_getStringByKey()
2086 if(resB->fHasFallback == TRUE) { in ures_getStringByKey()
2087 const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status); in ures_getStringByKey()
2096 UResourceBundle *tempRes = ures_getByKey(resB, inKey, NULL, status); in ures_getStringByKey()
2114 return res_getString(&(resB->fResData), res, len); in ures_getStringByKey()
2118 UResourceBundle *tempRes = ures_getByKey(resB, inKey, NULL, status); in ures_getStringByKey()
2131 else if(RES_GET_TYPE(resB->fRes) == URES_ARRAY && resB->fHasFallback == TRUE) { in ures_getStringByKey()
2133 const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status); in ures_getStringByKey()
2148 ures_getUTF8StringByKey(const UResourceBundle *resB, in ures_getUTF8StringByKey() argument
2154 const UChar *s16 = ures_getStringByKey(resB, key, &length16, status); in ures_getUTF8StringByKey()
2210 U_CFUNC const char* ures_getName(const UResourceBundle* resB) { in ures_getName() argument
2211 if(resB == NULL) { in ures_getName()
2215 return resB->fData->fName; in ures_getName()
2219 U_CFUNC const char* ures_getPath(const UResourceBundle* resB) { in ures_getPath() argument
2220 if(resB == NULL) { in ures_getPath()
2224 return resB->fData->fPath; in ures_getPath()
2408 U_CAPI void U_EXPORT2 ures_getVersion(const UResourceBundle* resB, UVersionInfo versionInfo) { in ures_getVersion() argument
2409 if (!resB) return; in ures_getVersion()
2411 u_versionFromString(versionInfo, ures_getVersionNumberInternal(resB)); in ures_getVersion()