| 701 | |
| 702 | |
| 703 | bool IntlManager::setupCollationAttributes( |
| 704 | const string& collationName, const string& charSetName, |
| 705 | const string& specificAttributes, string& newSpecificAttributes) |
| 706 | { |
| 707 | ExternalInfo charSetExternalInfo; |
| 708 | ExternalInfo collationExternalInfo; |
| 709 | |
| 710 | newSpecificAttributes = specificAttributes; |
| 711 | |
| 712 | if (charSetCollations->get(charSetName + ":" + charSetName, charSetExternalInfo) && |
| 713 | charSetCollations->get(charSetName + ":" + collationName, collationExternalInfo)) |
| 714 | { |
| 715 | pfn_INTL_setup_attributes attributesFunction = NULL; |
| 716 | |
| 717 | if (collationExternalInfo.moduleName.isEmpty()) |
| 718 | attributesFunction = INTL_builtin_setup_attributes; |
| 719 | else |
| 720 | { |
| 721 | ModuleLoader::Module* module; |
| 722 | |
| 723 | if (modules->get(collationExternalInfo.moduleName, module) && module) |
| 724 | module->findSymbol(NULL, STRINGIZE(INTL_SETUP_ATTRIBUTES_ENTRYPOINT), attributesFunction); |
| 725 | } |
| 726 | |
| 727 | if (attributesFunction) |
| 728 | { |
| 729 | HalfStaticArray<UCHAR, BUFFER_MEDIUM> buffer; |
| 730 | |
| 731 | // first try with the static buffer |
| 732 | ULONG len = (*attributesFunction)(collationExternalInfo.name.c_str(), |
| 733 | charSetExternalInfo.name.c_str(), collationExternalInfo.configInfo.c_str(), |
| 734 | specificAttributes.length(), (const UCHAR*) specificAttributes.begin(), |
| 735 | buffer.getCapacity(), buffer.begin()); |
| 736 | |
| 737 | if (len == INTL_BAD_STR_LENGTH) |
| 738 | { |
| 739 | // ask the right buffer size |
| 740 | len = (*attributesFunction)(collationExternalInfo.name.c_str(), |
| 741 | charSetExternalInfo.name.c_str(), collationExternalInfo.configInfo.c_str(), |
| 742 | specificAttributes.length(), (const UCHAR*) specificAttributes.begin(), |
| 743 | 0, NULL); |
| 744 | |
| 745 | if (len != INTL_BAD_STR_LENGTH) |
| 746 | { |
| 747 | // try again |
| 748 | len = (*attributesFunction)(collationExternalInfo.name.c_str(), |
| 749 | charSetExternalInfo.name.c_str(), collationExternalInfo.configInfo.c_str(), |
| 750 | specificAttributes.length(), (const UCHAR*) specificAttributes.begin(), |
| 751 | len, buffer.getBuffer(len)); |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | if (len != INTL_BAD_STR_LENGTH) |
| 756 | newSpecificAttributes.assign((const char*) buffer.begin(), len); |
| 757 | else |
| 758 | return false; |
| 759 | } |
| 760 |
nothing calls this directly
no test coverage detected