Home | History | Annotate | Download | only in common

Lines Matching refs:pResData

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