| 640 | |
| 641 | |
| 642 | void IntlManager::lookupCollation(const string& collationName, |
| 643 | const string& charSetName, |
| 644 | USHORT attributes, const UCHAR* specificAttributes, |
| 645 | ULONG specificAttributesLen, bool ignoreAttributes, |
| 646 | texttype* tt) |
| 647 | { |
| 648 | ExternalInfo charSetExternalInfo; |
| 649 | ExternalInfo collationExternalInfo; |
| 650 | char statusBuffer[BUFFER_LARGE] = ""; |
| 651 | |
| 652 | if (charSetCollations->get(charSetName + ":" + charSetName, charSetExternalInfo) && |
| 653 | charSetCollations->get(charSetName + ":" + collationName, collationExternalInfo)) |
| 654 | { |
| 655 | ModuleLoader::Module* module = nullptr; |
| 656 | |
| 657 | if (collationExternalInfo.moduleName.hasData()) |
| 658 | modules->get(collationExternalInfo.moduleName, module); |
| 659 | |
| 660 | pfn_INTL_lookup_texttype_with_status lookupStatusFunction = nullptr; |
| 661 | |
| 662 | if (collationExternalInfo.moduleName.isEmpty()) |
| 663 | lookupStatusFunction = INTL_builtin_lookup_texttype_status; |
| 664 | else if (module) |
| 665 | module->findSymbol(nullptr, STRINGIZE(TEXTTYPE_WITH_STATUS_ENTRYPOINT), lookupStatusFunction); |
| 666 | |
| 667 | if (lookupStatusFunction) |
| 668 | { |
| 669 | if ((*lookupStatusFunction)(statusBuffer, sizeof(statusBuffer), |
| 670 | tt, collationExternalInfo.name.c_str(), charSetExternalInfo.name.c_str(), |
| 671 | attributes, specificAttributes, specificAttributesLen, ignoreAttributes, |
| 672 | collationExternalInfo.configInfo.c_str())) |
| 673 | { |
| 674 | return; |
| 675 | } |
| 676 | } |
| 677 | else if (module) |
| 678 | { |
| 679 | pfn_INTL_lookup_texttype lookupFunction = nullptr; |
| 680 | module->findSymbol(nullptr, STRINGIZE(TEXTTYPE_ENTRYPOINT), lookupFunction); |
| 681 | |
| 682 | if (lookupFunction && |
| 683 | (*lookupFunction)(tt, collationExternalInfo.name.c_str(), charSetExternalInfo.name.c_str(), |
| 684 | attributes, specificAttributes, specificAttributesLen, ignoreAttributes, |
| 685 | collationExternalInfo.configInfo.c_str())) |
| 686 | { |
| 687 | return; |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | if (statusBuffer[0]) |
| 693 | { |
| 694 | (Arg::Gds(isc_collation_not_installed) << collationName << charSetName << |
| 695 | Arg::Gds(isc_random) << statusBuffer |
| 696 | ).raise(); |
| 697 | } |
| 698 | else |
| 699 | (Arg::Gds(isc_collation_not_installed) << collationName << charSetName).raise(); |