8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:43:04 +01:00
firebird-mirror/src/intl/lc_unicode_ucs2.cpp

93 lines
3.1 KiB
C++
Raw Normal View History

2003-01-25 04:08:11 +01:00
/*
* PROGRAM: InterBase International support
* MODULE: lc_unicode_ucs2.cpp
2003-01-25 04:08:11 +01:00
* DESCRIPTION: Language Drivers in the Unicode family.
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
2003-02-17 11:37:42 +01:00
#include "firebird.h"
2003-01-25 04:08:11 +01:00
#include "../intl/ldcommon.h"
#include "lc_ascii.h"
#include "cv_unicode_fss.h"
2003-09-21 01:33:36 +02:00
#include "ld_proto.h"
2003-01-25 04:08:11 +01:00
static inline bool FAMILY_UNICODE_WIDE_BIN(texttype* cache,
2003-09-19 00:06:59 +02:00
SSHORT country,
2005-05-28 00:45:31 +02:00
const ASCII* POSIX,
USHORT attributes,
const UCHAR*, // specific_attributes,
2005-05-28 00:45:31 +02:00
ULONG specific_attributes_length)
2003-09-19 00:06:59 +02:00
//#define FAMILY_UNICODE_WIDE_BIN(id_number, name, charset, country)
{
2005-05-28 00:45:31 +02:00
if ((attributes & ~TEXTTYPE_ATTR_PAD_SPACE) || specific_attributes_length)
return false;
cache->texttype_version = TEXTTYPE_VERSION_1;
cache->texttype_name = POSIX;
2003-09-19 00:06:59 +02:00
cache->texttype_country = country;
2005-05-28 00:45:31 +02:00
cache->texttype_pad_option = (attributes & TEXTTYPE_ATTR_PAD_SPACE) ? true : false;
2004-03-07 08:58:55 +01:00
cache->texttype_fn_key_length = famasc_key_length;
cache->texttype_fn_string_to_key= famasc_string_to_key;
cache->texttype_fn_compare = famasc_compare;
2005-05-28 00:45:31 +02:00
//cache->texttype_fn_str_to_upper = famasc_str_to_upper;
//cache->texttype_fn_str_to_lower = famasc_str_to_lower;
return true;
2003-09-19 00:06:59 +02:00
}
2003-01-25 04:08:11 +01:00
static inline bool FAMILY_UNICODE_MB_BIN(texttype* cache,
2003-09-19 00:06:59 +02:00
SSHORT country,
2005-05-28 00:45:31 +02:00
const ASCII* POSIX,
USHORT attributes,
const UCHAR*, //specific_attributes,
2005-05-28 00:45:31 +02:00
ULONG specific_attributes_length)
2003-09-19 00:06:59 +02:00
//#define FAMILY_UNICODE_MB_BIN(id_number, name, charset, country)
{
2005-05-28 00:45:31 +02:00
if ((attributes & ~TEXTTYPE_ATTR_PAD_SPACE) || specific_attributes_length)
return false;
cache->texttype_version = TEXTTYPE_VERSION_1;
cache->texttype_name = POSIX;
2003-09-19 00:06:59 +02:00
cache->texttype_country = country;
2005-05-28 00:45:31 +02:00
cache->texttype_pad_option = (attributes & TEXTTYPE_ATTR_PAD_SPACE) ? true : false;
2004-03-07 08:58:55 +01:00
cache->texttype_fn_key_length = famasc_key_length;
cache->texttype_fn_string_to_key= famasc_string_to_key;
cache->texttype_fn_compare = famasc_compare;
2005-05-28 00:45:31 +02:00
//cache->texttype_fn_str_to_upper = famasc_str_to_upper;
//cache->texttype_fn_str_to_lower = famasc_str_to_lower;
return true;
2003-09-19 00:06:59 +02:00
}
2003-01-25 04:08:11 +01:00
2009-05-02 15:00:09 +02:00
TEXTTYPE_ENTRY3(UNI200_init)
2003-01-25 04:08:11 +01:00
{
static ASCII POSIX[] = "C.UNICODE";
2005-05-28 00:45:31 +02:00
return FAMILY_UNICODE_WIDE_BIN(cache, CC_C, POSIX, attributes, specific_attributes, specific_attributes_length);
2003-01-25 04:08:11 +01:00
}
2009-05-02 15:00:09 +02:00
TEXTTYPE_ENTRY3(UNI201_init)
2003-01-25 04:08:11 +01:00
{
static ASCII POSIX[] = "C.UNICODE_FSS";
2005-05-28 00:45:31 +02:00
return FAMILY_UNICODE_MB_BIN(cache, CC_C, POSIX, attributes, specific_attributes, specific_attributes_length);
2003-01-25 04:08:11 +01:00
}