| 980 | |
| 981 | |
| 982 | USHORT INTL_key_length(thread_db* tdbb, USHORT idxType, USHORT iLength) |
| 983 | { |
| 984 | /************************************** |
| 985 | * |
| 986 | * I N T L _ k e y _ l e n g t h |
| 987 | * |
| 988 | ************************************** |
| 989 | * |
| 990 | * Functional description |
| 991 | * Given an index type, and a maximum length (iLength) |
| 992 | * return the length of the byte string key descriptor to |
| 993 | * use when collating text of this type. |
| 994 | * |
| 995 | **************************************/ |
| 996 | SET_TDBB(tdbb); |
| 997 | |
| 998 | fb_assert(idxType >= idx_first_intl_string); |
| 999 | |
| 1000 | const USHORT ttype = INTL_INDEX_TO_TEXT(idxType); |
| 1001 | |
| 1002 | USHORT key_length; |
| 1003 | if (ttype <= ttype_last_internal) |
| 1004 | key_length = iLength; |
| 1005 | else |
| 1006 | { |
| 1007 | TextType* obj = INTL_texttype_lookup(tdbb, ttype); |
| 1008 | key_length = obj->key_length(iLength); |
| 1009 | } |
| 1010 | |
| 1011 | // Validity checks on the computed key_length |
| 1012 | |
| 1013 | if (key_length > MAX_KEY) |
| 1014 | key_length = MAX_KEY; |
| 1015 | |
| 1016 | if (key_length < iLength) |
| 1017 | key_length = iLength; |
| 1018 | |
| 1019 | return (key_length); |
| 1020 | } |
| 1021 | |
| 1022 | |
| 1023 | CharSet* INTL_charset_lookup(thread_db* tdbb, USHORT parm1) |
no test coverage detected