Lines Matching refs:pResData
42 #define RES_GET_KEY16(pResData, keyOffset) \ argument
43 ((keyOffset)<(pResData)->localKeyLimit ? \
44 (const char *)(pResData)->pRoot+(keyOffset) : \
45 (pResData)->poolBundleKeys+(keyOffset)-(pResData)->localKeyLimit)
47 #define RES_GET_KEY32(pResData, keyOffset) \ argument
49 (const char *)(pResData)->pRoot+(keyOffset) : \
50 (pResData)->poolBundleKeys+((keyOffset)&0x7fffffff))
74 _res_findTableItem(const ResourceData *pResData, const uint16_t *keyOffsets, int32_t length, in _res_findTableItem() argument
85 tableKey = RES_GET_KEY16(pResData, keyOffsets[mid]); in _res_findTableItem()
86 if (pResData->useNativeStrcmp) { in _res_findTableItem()
105 _res_findTable32Item(const ResourceData *pResData, const int32_t *keyOffsets, int32_t length, in _res_findTable32Item() argument
116 tableKey = RES_GET_KEY32(pResData, keyOffsets[mid]); in _res_findTable32Item()
117 if (pResData->useNativeStrcmp) { in _res_findTable32Item()
157 res_init(ResourceData *pResData, in res_init() argument
163 pResData->pRoot=(const int32_t *)inBytes; in res_init()
164 pResData->rootRes=(Resource)*pResData->pRoot; in res_init()
165 pResData->p16BitUnits=&gEmpty16; in res_init()
170 res_unload(pResData); in res_init()
175 rootType=(UResType)RES_GET_TYPE(pResData->rootRes); in res_init()
178 res_unload(pResData); in res_init()
183 pResData->localKeyLimit=0x10000; /* greater than any 16-bit key string offset */ in res_init()
186 const int32_t *indexes=pResData->pRoot+1; in res_init()
190 res_unload(pResData); in res_init()
198 res_unload(pResData); in res_init()
202 pResData->localKeyLimit=indexes[URES_INDEX_KEYS_TOP]<<2; in res_init()
209 pResData->poolStringIndexLimit=(int32_t)((uint32_t)indexes[URES_INDEX_LENGTH]>>8); in res_init()
213 pResData->noFallback=(UBool)(att&URES_ATT_NO_FALLBACK); in res_init()
214 pResData->isPoolBundle=(UBool)((att&URES_ATT_IS_POOL_BUNDLE)!=0); in res_init()
215 pResData->usesPoolBundle=(UBool)((att&URES_ATT_USES_POOL_BUNDLE)!=0); in res_init()
216 pResData->poolStringIndexLimit|=(att&0xf000)<<12; // bits 15..12 -> 27..24 in res_init()
217 pResData->poolStringIndex16Limit=(int32_t)((uint32_t)att>>16); in res_init()
219 …if((pResData->isPoolBundle || pResData->usesPoolBundle) && indexLength<=URES_INDEX_POOL_CHECKSUM) { in res_init()
221 res_unload(pResData); in res_init()
227 pResData->p16BitUnits=(const uint16_t *)(pResData->pRoot+indexes[URES_INDEX_KEYS_TOP]); in res_init()
236 pResData->useNativeStrcmp=TRUE; in res_init()
241 res_read(ResourceData *pResData, in res_read() argument
246 uprv_memset(pResData, 0, sizeof(ResourceData)); in res_read()
254 res_init(pResData, formatVersion, inBytes, length, errorCode); in res_read()
258 res_load(ResourceData *pResData, in res_load() argument
262 uprv_memset(pResData, 0, sizeof(ResourceData)); in res_load()
265 pResData->data=udata_openChoice(path, "res", name, isAcceptable, formatVersion, errorCode); in res_load()
271 res_init(pResData, formatVersion, udata_getMemory(pResData->data), -1, errorCode); in res_load()
275 res_unload(ResourceData *pResData) { in res_unload() argument
276 if(pResData->data!=NULL) { in res_unload()
277 udata_close(pResData->data); in res_unload()
278 pResData->data=NULL; in res_unload()
310 res_getString(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getString() argument
316 if((int32_t)offset<pResData->poolStringIndexLimit) { in res_getString()
317 p=(const UChar *)pResData->poolBundleStrings+offset; in res_getString()
319 p=(const UChar *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit); in res_getString()
335 const int32_t *p32= res==0 ? &gEmptyString.length : pResData->pRoot+res; in res_getString()
356 UBool isNoInheritanceMarker(const ResourceData *pResData, Resource res) { in isNoInheritanceMarker() argument
361 const int32_t *p32=pResData->pRoot+res; in isNoInheritanceMarker()
367 if((int32_t)offset<pResData->poolStringIndexLimit) { in isNoInheritanceMarker()
368 p=(const UChar *)pResData->poolBundleStrings+offset; in isNoInheritanceMarker()
370 p=(const UChar *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit); in isNoInheritanceMarker()
385 int32_t getStringArray(const ResourceData *pResData, const icu::ResourceArray &array, in getStringArray() argument
405 const UChar *s = res_getString(pResData, array.internalGetResource(pResData, i), &sLength); in getStringArray()
418 res_getAlias(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getAlias() argument
423 const int32_t *p32= offset==0 ? &gEmptyString.length : pResData->pRoot+offset; in res_getAlias()
437 res_getBinary(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getBinary() argument
442 const int32_t *p32= offset==0 ? (const int32_t*)&gEmpty32 : pResData->pRoot+offset; in res_getBinary()
457 res_getIntVector(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getIntVector() argument
462 p= offset==0 ? (const int32_t *)&gEmpty32 : pResData->pRoot+offset; in res_getIntVector()
475 res_countArrayItems(const ResourceData *pResData, Resource res) { in res_countArrayItems() argument
487 return offset==0 ? 0 : *(pResData->pRoot+offset); in res_countArrayItems()
489 return offset==0 ? 0 : *((const uint16_t *)(pResData->pRoot+offset)); in res_countArrayItems()
492 return pResData->p16BitUnits[offset]; in res_countArrayItems()
510 const UChar *s = res_getString(pResData, res, &length); in getString()
521 const UChar *s = res_getAlias(pResData, res, &length); in getAliasString()
552 const int32_t *iv = res_getIntVector(pResData, res, &length); in getIntVector()
563 const uint8_t *b = res_getBinary(pResData, res, &length); in getBinary()
581 items32 = (const Resource *)pResData->pRoot+offset; in getArray()
586 items16 = pResData->p16BitUnits+offset; in getArray()
609 keys16 = (const uint16_t *)(pResData->pRoot+offset); in getTable()
615 keys16 = pResData->p16BitUnits+offset; in getTable()
621 keys32 = pResData->pRoot+offset; in getTable()
634 return ::isNoInheritanceMarker(pResData, res); in isNoInheritanceMarker()
639 return ::getStringArray(pResData, getArray(errorCode), dest, capacity, errorCode); in getStringArray()
645 return ::getStringArray(pResData, getArray(errorCode), dest, capacity, errorCode); in getStringArrayOrStringAsArray()
659 const UChar *s = res_getString(pResData, res, &sLength); in getStringArrayOrStringAsArray()
674 const UChar *s = res_getString(pResData, res, &sLength); in getStringOrFirstOfArray()
684 s = res_getString(pResData, array.internalGetResource(pResData, 0), &sLength); in getStringOrFirstOfArray()
697 makeResourceFrom16(const ResourceData *pResData, int32_t res16) { in makeResourceFrom16() argument
698 if(res16<pResData->poolStringIndex16Limit) { in makeResourceFrom16()
703 res16=res16-pResData->poolStringIndex16Limit+pResData->poolStringIndexLimit; in makeResourceFrom16()
709 res_getTableItemByKey(const ResourceData *pResData, Resource table, in res_getTableItemByKey() argument
720 const uint16_t *p= (const uint16_t *)(pResData->pRoot+offset); in res_getTableItemByKey()
722 *indexR=idx=_res_findTableItem(pResData, p, length, *key, key); in res_getTableItemByKey()
731 const uint16_t *p=pResData->p16BitUnits+offset; in res_getTableItemByKey()
733 *indexR=idx=_res_findTableItem(pResData, p, length, *key, key); in res_getTableItemByKey()
735 return makeResourceFrom16(pResData, p[length+idx]); in res_getTableItemByKey()
741 const int32_t *p= pResData->pRoot+offset; in res_getTableItemByKey()
743 *indexR=idx=_res_findTable32Item(pResData, p, length, *key, key); in res_getTableItemByKey()
757 res_getTableItemByIndex(const ResourceData *pResData, Resource table, in res_getTableItemByIndex() argument
767 const uint16_t *p= (const uint16_t *)(pResData->pRoot+offset); in res_getTableItemByIndex()
772 *key=RES_GET_KEY16(pResData, p[indexR]); in res_getTableItemByIndex()
780 const uint16_t *p=pResData->p16BitUnits+offset; in res_getTableItemByIndex()
784 *key=RES_GET_KEY16(pResData, p[indexR]); in res_getTableItemByIndex()
786 return makeResourceFrom16(pResData, p[length+indexR]); in res_getTableItemByIndex()
792 const int32_t *p= pResData->pRoot+offset; in res_getTableItemByIndex()
796 *key=RES_GET_KEY32(pResData, p[indexR]); in res_getTableItemByIndex()
810 res_getResource(const ResourceData *pResData, const char *key) { in res_getResource() argument
813 return res_getTableItemByKey(pResData, pResData->rootRes, &idx, &realKey); in res_getResource()
822 key = RES_GET_KEY16(rdValue.pResData, keys16[i]); in getKeyAndValue()
824 key = RES_GET_KEY32(rdValue.pResData, keys32[i]); in getKeyAndValue()
828 res = makeResourceFrom16(rdValue.pResData, items16[i]); in getKeyAndValue()
839 res_getArrayItem(const ResourceData *pResData, Resource array, int32_t indexR) { in res_getArrayItem() argument
847 const int32_t *p= pResData->pRoot+offset; in res_getArrayItem()
855 const uint16_t *p=pResData->p16BitUnits+offset; in res_getArrayItem()
857 return makeResourceFrom16(pResData, p[1+indexR]); in res_getArrayItem()
867 uint32_t icu::ResourceArray::internalGetResource(const ResourceData *pResData, int32_t i) const { in internalGetResource() argument
869 return makeResourceFrom16(pResData, items16[i]); in internalGetResource()
878 rdValue.setResource(internalGetResource(rdValue.pResData, i)); in getValue()
885 res_findResource(const ResourceData *pResData, Resource r, char** path, const char** key) { in res_findResource() argument
926 t2 = res_getTableItemByKey(pResData, t1, &indexR, key); in res_findResource()
932 t2 = res_getTableItemByIndex(pResData, t1, indexR, key); in res_findResource()
938 t2 = res_getArrayItem(pResData, t1, indexR); in res_findResource()