| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * | 3 * |
| 4 * Copyright (C) 1999-2010, International Business Machines | 4 * Copyright (C) 1999-2010, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ****************************************************************************** | 7 ****************************************************************************** |
| 8 * file name: udata.cpp | 8 * file name: udata.cpp |
| 9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
| 10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 /* =============================================================================
=====*/ | 603 /* =============================================================================
=====*/ |
| 604 | 604 |
| 605 | 605 |
| 606 /*----------------------------------------------------------------------* | 606 /*----------------------------------------------------------------------* |
| 607 * * | 607 * * |
| 608 * Add a static reference to the common data library * | 608 * Add a static reference to the common data library * |
| 609 * Unless overridden by an explicit udata_setCommonData, this will be * | 609 * Unless overridden by an explicit udata_setCommonData, this will be * |
| 610 * our common data. * | 610 * our common data. * |
| 611 * * | 611 * * |
| 612 *----------------------------------------------------------------------*/ | 612 *----------------------------------------------------------------------*/ |
| 613 extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT; | 613 extern "C" const ICU_Data_Header U_DATA_API U_ICUDATA_ENTRY_POINT; |
| 614 | 614 |
| 615 /* | 615 /* |
| 616 * This would be a good place for weak-linkage declarations of | 616 * This would be a good place for weak-linkage declarations of |
| 617 * partial-data-library access functions where each returns a pointer | 617 * partial-data-library access functions where each returns a pointer |
| 618 * to its data package, if it is linked in. | 618 * to its data package, if it is linked in. |
| 619 */ | 619 */ |
| 620 /* | 620 /* |
| 621 extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK; | 621 extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK; |
| 622 extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK; | 622 extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK; |
| 623 */ | 623 */ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 649 | 649 |
| 650 /* ??????? TODO revisit this */ | 650 /* ??????? TODO revisit this */ |
| 651 if (commonDataIndex >= 0) { | 651 if (commonDataIndex >= 0) { |
| 652 /* "mini-cache" for common ICU data */ | 652 /* "mini-cache" for common ICU data */ |
| 653 if(commonDataIndex >= LENGTHOF(gCommonICUDataArray)) { | 653 if(commonDataIndex >= LENGTHOF(gCommonICUDataArray)) { |
| 654 return NULL; | 654 return NULL; |
| 655 } | 655 } |
| 656 if(gCommonICUDataArray[commonDataIndex] == NULL) { | 656 if(gCommonICUDataArray[commonDataIndex] == NULL) { |
| 657 int32_t i; | 657 int32_t i; |
| 658 for(i = 0; i < commonDataIndex; ++i) { | 658 for(i = 0; i < commonDataIndex; ++i) { |
| 659 if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) { | 659 if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT.hdr
) { |
| 660 /* The linked-in data is already in the list. */ | 660 /* The linked-in data is already in the list. */ |
| 661 return NULL; | 661 return NULL; |
| 662 } | 662 } |
| 663 } | 663 } |
| 664 | 664 |
| 665 /* Add the linked-in data to the list. */ | 665 /* Add the linked-in data to the list. */ |
| 666 /* | 666 /* |
| 667 * This is where we would check and call weakly linked partial-data-
library | 667 * This is where we would check and call weakly linked partial-data-
library |
| 668 * access functions. | 668 * access functions. |
| 669 */ | 669 */ |
| 670 /* | 670 /* |
| 671 if (uprv_getICUData_collation) { | 671 if (uprv_getICUData_collation) { |
| 672 setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErr
orCode); | 672 setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErr
orCode); |
| 673 } | 673 } |
| 674 if (uprv_getICUData_conversion) { | 674 if (uprv_getICUData_conversion) { |
| 675 setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pEr
rorCode); | 675 setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pEr
rorCode); |
| 676 } | 676 } |
| 677 */ | 677 */ |
| 678 setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode); | 678 setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT.hdr, FALSE, pErrorCod
e); |
| 679 } | 679 } |
| 680 return gCommonICUDataArray[commonDataIndex]; | 680 return gCommonICUDataArray[commonDataIndex]; |
| 681 } | 681 } |
| 682 | 682 |
| 683 | 683 |
| 684 /* request is NOT for ICU Data. */ | 684 /* request is NOT for ICU Data. */ |
| 685 | 685 |
| 686 /* Find the base name portion of the supplied path. */ | 686 /* Find the base name portion of the supplied path. */ |
| 687 /* inBasename will be left pointing somewhere within the original path str
ing. */ | 687 /* inBasename will be left pointing somewhere within the original path str
ing. */ |
| 688 inBasename = findBasename(path); | 688 inBasename = findBasename(path); |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 pInfo->size=0; | 1349 pInfo->size=0; |
| 1350 } | 1350 } |
| 1351 } | 1351 } |
| 1352 } | 1352 } |
| 1353 | 1353 |
| 1354 | 1354 |
| 1355 U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess access, UErrorCode * /
*status*/) | 1355 U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess access, UErrorCode * /
*status*/) |
| 1356 { | 1356 { |
| 1357 gDataFileAccess = access; | 1357 gDataFileAccess = access; |
| 1358 } | 1358 } |
| OLD | NEW |