Lines Matching refs:pResData
40 #define RES_GET_KEY16(pResData, keyOffset) \ argument
41 ((keyOffset)<(pResData)->localKeyLimit ? \
42 (const char *)(pResData)->pRoot+(keyOffset) : \
43 (pResData)->poolBundleKeys+(keyOffset)-(pResData)->localKeyLimit)
45 #define RES_GET_KEY32(pResData, keyOffset) \ argument
47 (const char *)(pResData)->pRoot+(keyOffset) : \
48 (pResData)->poolBundleKeys+((keyOffset)&0x7fffffff))
72 _res_findTableItem(const ResourceData *pResData, const uint16_t *keyOffsets, int32_t length, in _res_findTableItem() argument
83 tableKey = RES_GET_KEY16(pResData, keyOffsets[mid]); in _res_findTableItem()
84 if (pResData->useNativeStrcmp) { in _res_findTableItem()
103 _res_findTable32Item(const ResourceData *pResData, const int32_t *keyOffsets, int32_t length, in _res_findTable32Item() argument
114 tableKey = RES_GET_KEY32(pResData, keyOffsets[mid]); in _res_findTable32Item()
115 if (pResData->useNativeStrcmp) { in _res_findTable32Item()
155 res_init(ResourceData *pResData, in res_init() argument
161 pResData->pRoot=(const int32_t *)inBytes; in res_init()
162 pResData->rootRes=(Resource)*pResData->pRoot; in res_init()
163 pResData->p16BitUnits=&gEmpty16; in res_init()
168 res_unload(pResData); in res_init()
173 rootType=(UResType)RES_GET_TYPE(pResData->rootRes); in res_init()
176 res_unload(pResData); in res_init()
181 pResData->localKeyLimit=0x10000; /* greater than any 16-bit key string offset */ in res_init()
184 const int32_t *indexes=pResData->pRoot+1; in res_init()
188 res_unload(pResData); in res_init()
196 res_unload(pResData); in res_init()
200 pResData->localKeyLimit=indexes[URES_INDEX_KEYS_TOP]<<2; in res_init()
207 pResData->poolStringIndexLimit=(int32_t)((uint32_t)indexes[URES_INDEX_LENGTH]>>8); in res_init()
211 pResData->noFallback=(UBool)(att&URES_ATT_NO_FALLBACK); in res_init()
212 pResData->isPoolBundle=(UBool)((att&URES_ATT_IS_POOL_BUNDLE)!=0); in res_init()
213 pResData->usesPoolBundle=(UBool)((att&URES_ATT_USES_POOL_BUNDLE)!=0); in res_init()
214 pResData->poolStringIndexLimit|=(att&0xf000)<<12; // bits 15..12 -> 27..24 in res_init()
215 pResData->poolStringIndex16Limit=(int32_t)((uint32_t)att>>16); in res_init()
217 …if((pResData->isPoolBundle || pResData->usesPoolBundle) && indexLength<=URES_INDEX_POOL_CHECKSUM) { in res_init()
219 res_unload(pResData); in res_init()
225 pResData->p16BitUnits=(const uint16_t *)(pResData->pRoot+indexes[URES_INDEX_KEYS_TOP]); in res_init()
234 pResData->useNativeStrcmp=TRUE; in res_init()
239 res_read(ResourceData *pResData, in res_read() argument
244 uprv_memset(pResData, 0, sizeof(ResourceData)); in res_read()
252 res_init(pResData, formatVersion, inBytes, length, errorCode); in res_read()
256 res_load(ResourceData *pResData, in res_load() argument
260 uprv_memset(pResData, 0, sizeof(ResourceData)); in res_load()
263 pResData->data=udata_openChoice(path, "res", name, isAcceptable, formatVersion, errorCode); in res_load()
269 res_init(pResData, formatVersion, udata_getMemory(pResData->data), -1, errorCode); in res_load()
273 res_unload(ResourceData *pResData) { in res_unload() argument
274 if(pResData->data!=NULL) { in res_unload()
275 udata_close(pResData->data); in res_unload()
276 pResData->data=NULL; in res_unload()
308 res_getString(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getString() argument
314 if((int32_t)offset<pResData->poolStringIndexLimit) { in res_getString()
315 p=(const UChar *)pResData->poolBundleStrings+offset; in res_getString()
317 p=(const UChar *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit); in res_getString()
333 const int32_t *p32= res==0 ? &gEmptyString.length : pResData->pRoot+res; in res_getString()
354 UBool isNoInheritanceMarker(const ResourceData *pResData, Resource res) { in isNoInheritanceMarker() argument
359 const int32_t *p32=pResData->pRoot+res; in isNoInheritanceMarker()
365 if((int32_t)offset<pResData->poolStringIndexLimit) { in isNoInheritanceMarker()
366 p=(const UChar *)pResData->poolBundleStrings+offset; in isNoInheritanceMarker()
368 p=(const UChar *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit); in isNoInheritanceMarker()
386 res_getAlias(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getAlias() argument
391 const int32_t *p32= offset==0 ? &gEmptyString.length : pResData->pRoot+offset; in res_getAlias()
405 res_getBinary(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getBinary() argument
410 const int32_t *p32= offset==0 ? (const int32_t*)&gEmpty32 : pResData->pRoot+offset; in res_getBinary()
425 res_getIntVector(const ResourceData *pResData, Resource res, int32_t *pLength) { in res_getIntVector() argument
430 p= offset==0 ? (const int32_t *)&gEmpty32 : pResData->pRoot+offset; in res_getIntVector()
443 res_countArrayItems(const ResourceData *pResData, Resource res) { in res_countArrayItems() argument
455 return offset==0 ? 0 : *(pResData->pRoot+offset); in res_countArrayItems()
457 return offset==0 ? 0 : *((const uint16_t *)(pResData->pRoot+offset)); in res_countArrayItems()
460 return pResData->p16BitUnits[offset]; in res_countArrayItems()
468 int32_t getArrayLength(const ResourceData *pResData, Resource res) { in getArrayLength() argument
475 return *(pResData->pRoot+offset); in getArrayLength()
477 return pResData->p16BitUnits[offset]; in getArrayLength()
483 int32_t getTableLength(const ResourceData *pResData, Resource res) { in getTableLength() argument
490 return *((const uint16_t *)(pResData->pRoot+offset)); in getTableLength()
492 return pResData->p16BitUnits[offset]; in getTableLength()
494 return *(pResData->pRoot+offset); in getTableLength()
514 const UChar *s = res_getString(pResData, res, &length); in getString()
525 const UChar *s = res_getAlias(pResData, res, &length); in getAliasString()
556 const int32_t *iv = res_getIntVector(pResData, res, &length); in getIntVector()
567 const uint8_t *b = res_getBinary(pResData, res, &length); in getBinary()
577 makeResourceFrom16(const ResourceData *pResData, int32_t res16) { in makeResourceFrom16() argument
578 if(res16<pResData->poolStringIndex16Limit) { in makeResourceFrom16()
583 res16=res16-pResData->poolStringIndex16Limit+pResData->poolStringIndexLimit; in makeResourceFrom16()
589 res_getTableItemByKey(const ResourceData *pResData, Resource table, in res_getTableItemByKey() argument
600 const uint16_t *p= (const uint16_t *)(pResData->pRoot+offset); in res_getTableItemByKey()
602 *indexR=idx=_res_findTableItem(pResData, p, length, *key, key); in res_getTableItemByKey()
611 const uint16_t *p=pResData->p16BitUnits+offset; in res_getTableItemByKey()
613 *indexR=idx=_res_findTableItem(pResData, p, length, *key, key); in res_getTableItemByKey()
615 return makeResourceFrom16(pResData, p[length+idx]); in res_getTableItemByKey()
621 const int32_t *p= pResData->pRoot+offset; in res_getTableItemByKey()
623 *indexR=idx=_res_findTable32Item(pResData, p, length, *key, key); in res_getTableItemByKey()
637 res_getTableItemByIndex(const ResourceData *pResData, Resource table, in res_getTableItemByIndex() argument
645 const uint16_t *p= (const uint16_t *)(pResData->pRoot+offset); in res_getTableItemByIndex()
650 *key=RES_GET_KEY16(pResData, p[indexR]); in res_getTableItemByIndex()
658 const uint16_t *p=pResData->p16BitUnits+offset; in res_getTableItemByIndex()
662 *key=RES_GET_KEY16(pResData, p[indexR]); in res_getTableItemByIndex()
664 return makeResourceFrom16(pResData, p[length+indexR]); in res_getTableItemByIndex()
670 const int32_t *p= pResData->pRoot+offset; in res_getTableItemByIndex()
674 *key=RES_GET_KEY32(pResData, p[indexR]); in res_getTableItemByIndex()
688 res_getResource(const ResourceData *pResData, const char *key) { in res_getResource() argument
691 return res_getTableItemByKey(pResData, pResData->rootRes, &idx, &realKey); in res_getResource()
701 ures_getAllTableItems(const ResourceData *pResData, Resource table, in ures_getAllTableItems() argument
714 keys16 = (const uint16_t *)(pResData->pRoot+offset); in ures_getAllTableItems()
721 keys16 = pResData->p16BitUnits+offset; in ures_getAllTableItems()
728 keys32 = pResData->pRoot+offset; in ures_getAllTableItems()
742 key=RES_GET_KEY16(pResData, keys16[i]); in ures_getAllTableItems()
744 key=RES_GET_KEY32(pResData, keys32[i]); in ures_getAllTableItems()
748 res = makeResourceFrom16(pResData, items16[i]); in ures_getAllTableItems()
754 int32_t numItems = getArrayLength(pResData, res); in ures_getAllTableItems()
757 ures_getAllArrayItems(pResData, res, value, *subSink, errorCode); in ures_getAllTableItems()
760 int32_t numItems = getTableLength(pResData, res); in ures_getAllTableItems()
763 ures_getAllTableItems(pResData, res, value, *subSink, errorCode); in ures_getAllTableItems()
770 } else if (isNoInheritanceMarker(pResData, res)) { in ures_getAllTableItems()
782 res_getArrayItem(const ResourceData *pResData, Resource array, int32_t indexR) { in res_getArrayItem() argument
788 const int32_t *p= pResData->pRoot+offset; in res_getArrayItem()
796 const uint16_t *p=pResData->p16BitUnits+offset; in res_getArrayItem()
798 return makeResourceFrom16(pResData, p[1+indexR]); in res_getArrayItem()
809 ures_getAllArrayItems(const ResourceData *pResData, Resource array, in ures_getAllArrayItems() argument
820 items32 = (const Resource *)pResData->pRoot+offset; in ures_getAllArrayItems()
826 items16 = pResData->p16BitUnits+offset; in ures_getAllArrayItems()
838 res = makeResourceFrom16(pResData, items16[i]); in ures_getAllArrayItems()
844 int32_t numItems = getArrayLength(pResData, res); in ures_getAllArrayItems()
847 ures_getAllArrayItems(pResData, res, value, *subSink, errorCode); in ures_getAllArrayItems()
850 int32_t numItems = getTableLength(pResData, res); in ures_getAllArrayItems()
853 ures_getAllTableItems(pResData, res, value, *subSink, errorCode); in ures_getAllArrayItems()
870 res_findResource(const ResourceData *pResData, Resource r, char** path, const char** key) { in res_findResource() argument
911 t2 = res_getTableItemByKey(pResData, t1, &indexR, key); in res_findResource()
917 t2 = res_getTableItemByIndex(pResData, t1, indexR, key); in res_findResource()
923 t2 = res_getArrayItem(pResData, t1, indexR); in res_findResource()