OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * | 3 * |
4 * Copyright (C) 1999-2013, International Business Machines | 4 * Copyright (C) 1999-2013, 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 /* =============================================================================
=====*/ | 614 /* =============================================================================
=====*/ |
615 | 615 |
616 | 616 |
617 /*----------------------------------------------------------------------* | 617 /*----------------------------------------------------------------------* |
618 * * | 618 * * |
619 * Add a static reference to the common data library * | 619 * Add a static reference to the common data library * |
620 * Unless overridden by an explicit udata_setCommonData, this will be * | 620 * Unless overridden by an explicit udata_setCommonData, this will be * |
621 * our common data. * | 621 * our common data. * |
622 * * | 622 * * |
623 *----------------------------------------------------------------------*/ | 623 *----------------------------------------------------------------------*/ |
624 extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT; | 624 extern "C" const ICU_Data_Header U_DATA_API U_ICUDATA_ENTRY_POINT; |
625 | 625 |
626 /* | 626 /* |
627 * This would be a good place for weak-linkage declarations of | 627 * This would be a good place for weak-linkage declarations of |
628 * partial-data-library access functions where each returns a pointer | 628 * partial-data-library access functions where each returns a pointer |
629 * to its data package, if it is linked in. | 629 * to its data package, if it is linked in. |
630 */ | 630 */ |
631 /* | 631 /* |
632 extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK; | 632 extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK; |
633 extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK; | 633 extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK; |
634 */ | 634 */ |
(...skipping 25 matching lines...) Expand all Loading... |
660 | 660 |
661 /* ??????? TODO revisit this */ | 661 /* ??????? TODO revisit this */ |
662 if (commonDataIndex >= 0) { | 662 if (commonDataIndex >= 0) { |
663 /* "mini-cache" for common ICU data */ | 663 /* "mini-cache" for common ICU data */ |
664 if(commonDataIndex >= LENGTHOF(gCommonICUDataArray)) { | 664 if(commonDataIndex >= LENGTHOF(gCommonICUDataArray)) { |
665 return NULL; | 665 return NULL; |
666 } | 666 } |
667 if(gCommonICUDataArray[commonDataIndex] == NULL) { | 667 if(gCommonICUDataArray[commonDataIndex] == NULL) { |
668 int32_t i; | 668 int32_t i; |
669 for(i = 0; i < commonDataIndex; ++i) { | 669 for(i = 0; i < commonDataIndex; ++i) { |
670 if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) { | 670 if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT.hdr
) { |
671 /* The linked-in data is already in the list. */ | 671 /* The linked-in data is already in the list. */ |
672 return NULL; | 672 return NULL; |
673 } | 673 } |
674 } | 674 } |
675 | 675 |
676 /* Add the linked-in data to the list. */ | 676 /* Add the linked-in data to the list. */ |
677 /* | 677 /* |
678 * This is where we would check and call weakly linked partial-data-
library | 678 * This is where we would check and call weakly linked partial-data-
library |
679 * access functions. | 679 * access functions. |
680 */ | 680 */ |
681 /* | 681 /* |
682 if (uprv_getICUData_collation) { | 682 if (uprv_getICUData_collation) { |
683 setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErr
orCode); | 683 setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErr
orCode); |
684 } | 684 } |
685 if (uprv_getICUData_conversion) { | 685 if (uprv_getICUData_conversion) { |
686 setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pEr
rorCode); | 686 setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pEr
rorCode); |
687 } | 687 } |
688 */ | 688 */ |
689 setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode); | 689 setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT.hdr, FALSE, pErrorCod
e); |
690 } | 690 } |
691 return gCommonICUDataArray[commonDataIndex]; | 691 return gCommonICUDataArray[commonDataIndex]; |
692 } | 692 } |
693 | 693 |
694 | 694 |
695 /* request is NOT for ICU Data. */ | 695 /* request is NOT for ICU Data. */ |
696 | 696 |
697 /* Find the base name portion of the supplied path. */ | 697 /* Find the base name portion of the supplied path. */ |
698 /* inBasename will be left pointing somewhere within the original path str
ing. */ | 698 /* inBasename will be left pointing somewhere within the original path str
ing. */ |
699 inBasename = findBasename(path); | 699 inBasename = findBasename(path); |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 pInfo->size=0; | 1368 pInfo->size=0; |
1369 } | 1369 } |
1370 } | 1370 } |
1371 } | 1371 } |
1372 | 1372 |
1373 | 1373 |
1374 U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess access, UErrorCode * /
*status*/) | 1374 U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess access, UErrorCode * /
*status*/) |
1375 { | 1375 { |
1376 gDataFileAccess = access; | 1376 gDataFileAccess = access; |
1377 } | 1377 } |
OLD | NEW |