OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * | 3 * |
4 * Copyright (C) 2003-2014, International Business Machines | 4 * Copyright (C) 2003-2015, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 * file name: pkgitems.cpp | 8 * file name: pkgitems.cpp |
9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
11 * indentation:4 | 11 * indentation:4 |
12 * | 12 * |
13 * created on: 2005sep18 | 13 * created on: 2005sep18 |
14 * created by: Markus W. Scherer | 14 * created by: Markus W. Scherer |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // check() already printed a complaint. | 403 // check() already printed a complaint. |
404 return; | 404 return; |
405 } | 405 } |
406 // TODO: Cache the native version in the Item itself. | 406 // TODO: Cache the native version in the Item itself. |
407 nativePool.setItem(pkg->getItem(index), ures_swap); | 407 nativePool.setItem(pkg->getItem(index), ures_swap); |
408 const UDataInfo *poolInfo=nativePool.getDataInfo(); | 408 const UDataInfo *poolInfo=nativePool.getDataInfo(); |
409 if(poolInfo->formatVersion[0]<=1) { | 409 if(poolInfo->formatVersion[0]<=1) { |
410 fprintf(stderr, "icupkg: %s is not a pool bundle\n", poolName); | 410 fprintf(stderr, "icupkg: %s is not a pool bundle\n", poolName); |
411 return; | 411 return; |
412 } | 412 } |
413 const int32_t *poolIndexes=(const int32_t *)nativePool.getBytes()+1; | 413 const int32_t *poolRoot=(const int32_t *)nativePool.getBytes(); |
| 414 const int32_t *poolIndexes=poolRoot+1; |
414 int32_t poolIndexLength=poolIndexes[URES_INDEX_LENGTH]&0xff; | 415 int32_t poolIndexLength=poolIndexes[URES_INDEX_LENGTH]&0xff; |
415 if(!(poolIndexLength>URES_INDEX_POOL_CHECKSUM && | 416 if(!(poolIndexLength>URES_INDEX_POOL_CHECKSUM && |
416 (poolIndexes[URES_INDEX_ATTRIBUTES]&URES_ATT_IS_POOL_BUNDLE)) | 417 (poolIndexes[URES_INDEX_ATTRIBUTES]&URES_ATT_IS_POOL_BUNDLE)) |
417 ) { | 418 ) { |
418 fprintf(stderr, "icupkg: %s is not a pool bundle\n", poolName); | 419 fprintf(stderr, "icupkg: %s is not a pool bundle\n", poolName); |
419 return; | 420 return; |
420 } | 421 } |
421 if(resData.pRoot[1+URES_INDEX_POOL_CHECKSUM]==poolIndexes[URES_INDEX_POO
L_CHECKSUM]) { | 422 if(resData.pRoot[1+URES_INDEX_POOL_CHECKSUM]==poolIndexes[URES_INDEX_POO
L_CHECKSUM]) { |
422 resData.poolBundleKeys=(const char *)(poolIndexes+poolIndexLength); | 423 resData.poolBundleKeys=(const char *)(poolIndexes+poolIndexLength); |
| 424 resData.poolBundleStrings=(const uint16_t *)(poolRoot+poolIndexes[UR
ES_INDEX_KEYS_TOP]); |
423 } else { | 425 } else { |
424 fprintf(stderr, "icupkg: %s has mismatched checksum for %s\n", poolN
ame, itemName); | 426 fprintf(stderr, "icupkg: %s has mismatched checksum for %s\n", poolN
ame, itemName); |
425 return; | 427 return; |
426 } | 428 } |
427 } | 429 } |
428 | 430 |
429 ures_enumDependencies( | 431 ures_enumDependencies( |
430 itemName, &resData, | 432 itemName, &resData, |
431 resData.rootRes, NULL, NULL, 0, | 433 resData.rootRes, NULL, NULL, 0, |
432 check, context, | 434 check, context, |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 break; | 623 break; |
622 } | 624 } |
623 | 625 |
624 if(U_FAILURE(errorCode)) { | 626 if(U_FAILURE(errorCode)) { |
625 exit(errorCode); | 627 exit(errorCode); |
626 } | 628 } |
627 } | 629 } |
628 } | 630 } |
629 | 631 |
630 U_NAMESPACE_END | 632 U_NAMESPACE_END |
OLD | NEW |