OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * | 3 * |
4 * Copyright (C) 1999-2015, International Business Machines | 4 * Copyright (C) 1999-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: 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 /* =============================================================================
=====*/ | 617 /* =============================================================================
=====*/ |
618 | 618 |
619 | 619 |
620 /*----------------------------------------------------------------------* | 620 /*----------------------------------------------------------------------* |
621 * * | 621 * * |
622 * Add a static reference to the common data library * | 622 * Add a static reference to the common data library * |
623 * Unless overridden by an explicit udata_setCommonData, this will be * | 623 * Unless overridden by an explicit udata_setCommonData, this will be * |
624 * our common data. * | 624 * our common data. * |
625 * * | 625 * * |
626 *----------------------------------------------------------------------*/ | 626 *----------------------------------------------------------------------*/ |
627 extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT; | 627 extern "C" const ICU_Data_Header U_DATA_API U_ICUDATA_ENTRY_POINT; |
628 | 628 |
629 /* | 629 /* |
630 * This would be a good place for weak-linkage declarations of | 630 * This would be a good place for weak-linkage declarations of |
631 * partial-data-library access functions where each returns a pointer | 631 * partial-data-library access functions where each returns a pointer |
632 * to its data package, if it is linked in. | 632 * to its data package, if it is linked in. |
633 */ | 633 */ |
634 /* | 634 /* |
635 extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK; | 635 extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK; |
636 extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK; | 636 extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK; |
637 */ | 637 */ |
(...skipping 29 matching lines...) Expand all Loading... |
667 if(commonDataIndex >= UPRV_LENGTHOF(gCommonICUDataArray)) { | 667 if(commonDataIndex >= UPRV_LENGTHOF(gCommonICUDataArray)) { |
668 return NULL; | 668 return NULL; |
669 } | 669 } |
670 { | 670 { |
671 Mutex lock; | 671 Mutex lock; |
672 if(gCommonICUDataArray[commonDataIndex] != NULL) { | 672 if(gCommonICUDataArray[commonDataIndex] != NULL) { |
673 return gCommonICUDataArray[commonDataIndex]; | 673 return gCommonICUDataArray[commonDataIndex]; |
674 } | 674 } |
675 int32_t i; | 675 int32_t i; |
676 for(i = 0; i < commonDataIndex; ++i) { | 676 for(i = 0; i < commonDataIndex; ++i) { |
677 if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) { | 677 if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT.hdr
) { |
678 /* The linked-in data is already in the list. */ | 678 /* The linked-in data is already in the list. */ |
679 return NULL; | 679 return NULL; |
680 } | 680 } |
681 } | 681 } |
682 } | 682 } |
683 | 683 |
684 /* Add the linked-in data to the list. */ | 684 /* Add the linked-in data to the list. */ |
685 /* | 685 /* |
686 * This is where we would check and call weakly linked partial-data-libr
ary | 686 * This is where we would check and call weakly linked partial-data-libr
ary |
687 * access functions. | 687 * access functions. |
688 */ | 688 */ |
689 /* | 689 /* |
690 if (uprv_getICUData_collation) { | 690 if (uprv_getICUData_collation) { |
691 setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErrorCo
de); | 691 setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErrorCo
de); |
692 } | 692 } |
693 if (uprv_getICUData_conversion) { | 693 if (uprv_getICUData_conversion) { |
694 setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pErrorC
ode); | 694 setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pErrorC
ode); |
695 } | 695 } |
696 */ | 696 */ |
697 setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode); | 697 setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT.hdr, FALSE, pErrorCode); |
698 { | 698 { |
699 Mutex lock; | 699 Mutex lock; |
700 return gCommonICUDataArray[commonDataIndex]; | 700 return gCommonICUDataArray[commonDataIndex]; |
701 } | 701 } |
702 } | 702 } |
703 | 703 |
704 | 704 |
705 /* request is NOT for ICU Data. */ | 705 /* request is NOT for ICU Data. */ |
706 | 706 |
707 /* Find the base name portion of the supplied path. */ | 707 /* Find the base name portion of the supplied path. */ |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 } | 1405 } |
1406 } | 1406 } |
1407 } | 1407 } |
1408 | 1408 |
1409 | 1409 |
1410 U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess access, UErrorCode * /
*status*/) | 1410 U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess access, UErrorCode * /
*status*/) |
1411 { | 1411 { |
1412 // Note: this function is documented as not thread safe. | 1412 // Note: this function is documented as not thread safe. |
1413 gDataFileAccess = access; | 1413 gDataFileAccess = access; |
1414 } | 1414 } |
OLD | NEW |