mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Basic INTL cleanup.
- Rework (mostly undo) John's changes - Some function type safety - Make INTL OO layer very thin (this should slightly improve performance)
This commit is contained in:
parent
7d61093fd6
commit
7b99b8a57b
@ -139,6 +139,7 @@ template <typename Value,
|
||||
class SortedArray : public Array<Value> {
|
||||
public:
|
||||
SortedArray(MemoryPool* p, int s) : Array<Value>(p, s) {}
|
||||
SortedArray(MemoryPool* p) : Array<Value>(p) {}
|
||||
bool find(const Key& item, int& pos) {
|
||||
int highBound = count, lowBound = 0;
|
||||
while (highBound > lowBound) {
|
||||
|
@ -195,8 +195,7 @@ dsql_nod* MAKE_constant(str* constant, dsql_constant_type numeric_flag)
|
||||
|
||||
/* Now invoke the string_to_date/time/timestamp routines */
|
||||
|
||||
CVT_move(&tmp, &node->nod_desc,
|
||||
reinterpret_cast<void (*)()> (ERRD_post));
|
||||
CVT_move(&tmp, &node->nod_desc, ERRD_post);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ static void post_error(ISC_STATUS, ...);
|
||||
void MOVD_move(const dsc* from, dsc* to)
|
||||
{
|
||||
|
||||
CVT_move(from, to, (FPTR_VOID) post_error);
|
||||
CVT_move(from, to, post_error);
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: movg.cpp,v 1.4 2003-10-05 06:54:37 robocop Exp $
|
||||
// $Id: movg.cpp,v 1.5 2003-11-03 17:14:41 skidder Exp $
|
||||
//
|
||||
|
||||
#include "firebird.h"
|
||||
@ -46,7 +46,7 @@
|
||||
#include "../jrd/cvt_proto.h"
|
||||
#include "../jrd/thd_proto.h"
|
||||
|
||||
static void post_error(void);
|
||||
static void post_error(ISC_STATUS, ...);
|
||||
|
||||
|
||||
//____________________________________________________________
|
||||
@ -57,7 +57,7 @@ static void post_error(void);
|
||||
void MOVG_move(const dsc* from, dsc* to)
|
||||
{
|
||||
|
||||
CVT_move(from, to, (FPTR_VOID) post_error);
|
||||
CVT_move(from, to, post_error);
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ void MOVG_move(const dsc* from, dsc* to)
|
||||
// A conversion error occurred. Complain.
|
||||
//
|
||||
|
||||
static void post_error(void)
|
||||
static void post_error(ISC_STATUS, ...)
|
||||
{
|
||||
|
||||
CPR_error("conversion error: illegal string literal");
|
||||
|
@ -27,7 +27,7 @@
|
||||
* Mark O'Donohue <mark.odonohue@ludwig.edu.au>
|
||||
*
|
||||
*
|
||||
* $Id: fb_types.h,v 1.28 2003-10-20 10:33:43 robocop Exp $
|
||||
* $Id: fb_types.h,v 1.29 2003-11-03 17:14:42 skidder Exp $
|
||||
*
|
||||
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete "OS/2" port
|
||||
*
|
||||
@ -133,6 +133,7 @@ typedef void (*FPTR_VOID_PTR) (void*);
|
||||
typedef int (*FPTR_INT) ();
|
||||
typedef int (*FPTR_INT_VOID_PTR) (void*);
|
||||
typedef void (*FPTR_PRINT_CALLBACK) (void*, SSHORT, const char*);
|
||||
typedef void (*FPTR_STATUS) (ISC_STATUS, ...);
|
||||
typedef ULONG RCRD_OFFSET;
|
||||
typedef USHORT FLD_LENGTH;
|
||||
typedef int (*lock_ast_t)(void*);
|
||||
|
@ -79,9 +79,6 @@ BLKDEF(type_map, map, 0)
|
||||
BLKDEF(type_log, log, 0)
|
||||
BLKDEF(type_dls, dls, 1)
|
||||
BLKDEF(type_ail, logfiles, 1) /* wal file */
|
||||
BLKDEF(type_texttype_alloc_id, texttype, 0) /* Intl Text Impl Object */
|
||||
BLKDEF(type_charset_alloc_id, charset, 0) /* Intl Charset definition */
|
||||
BLKDEF(type_csconvert_alloc_id, csconvert, 0) /* Intl character set converter */
|
||||
BLKDEF(type_prc, jrd_prc, 1) /* procedure block */
|
||||
BLKDEF(type_prm, prm, 1) /* parameter block */
|
||||
BLKDEF(type_sav, sav, 0) /* save points */
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
/* 64 turns out not to be enough indexes */
|
||||
/* #define MAX_IDX 64 */ /* that should be plenty of indexes */
|
||||
#define MAX_KEY 256 /* 256 isn't big enough for a key either */
|
||||
|
||||
enum idx_null_state {
|
||||
idx_nulls_none,
|
||||
|
@ -96,5 +96,8 @@ enum frb_sysflag {
|
||||
|
||||
#define MAX_INDEX_SEGMENTS 16
|
||||
|
||||
// Maximum index key length
|
||||
#define MAX_KEY 256
|
||||
|
||||
#endif /* JRD_CONSTANTS_H */
|
||||
|
||||
|
168
src/jrd/cvt.cpp
168
src/jrd/cvt.cpp
@ -175,13 +175,13 @@ static TEXT* cvt_failures_ptr = NULL;
|
||||
static TEXT* error_string(const char*, SSHORT);
|
||||
#endif
|
||||
|
||||
static void conversion_error(const dsc*, FPTR_VOID);
|
||||
static void datetime_to_text(const dsc*, dsc*, FPTR_VOID);
|
||||
static SSHORT decompose(const char*, USHORT, SSHORT, SLONG*, FPTR_VOID);
|
||||
static void float_to_text(const dsc*, dsc*, FPTR_VOID);
|
||||
static void integer_to_text(const dsc*, dsc*, FPTR_VOID);
|
||||
static void conversion_error(const dsc*, FPTR_STATUS);
|
||||
static void datetime_to_text(const dsc*, dsc*, FPTR_STATUS);
|
||||
static SSHORT decompose(const char*, USHORT, SSHORT, SLONG*, FPTR_STATUS);
|
||||
static void float_to_text(const dsc*, dsc*, FPTR_STATUS);
|
||||
static void integer_to_text(const dsc*, dsc*, FPTR_STATUS);
|
||||
static void string_to_datetime(const dsc*, GDS_TIMESTAMP*, EXPECT_DATETIME,
|
||||
FPTR_VOID);
|
||||
FPTR_STATUS);
|
||||
static double power_of_ten(const int);
|
||||
|
||||
#ifndef NATIVE_QUAD
|
||||
@ -219,7 +219,7 @@ typedef void (*pfn_cvt_private_cludge) (int, int);
|
||||
typedef void (*pfn_cvt_private_cludge2) (int, int, ...);
|
||||
|
||||
|
||||
double CVT_date_to_double(const dsc* desc, FPTR_VOID err)
|
||||
double CVT_date_to_double(const dsc* desc, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -281,7 +281,7 @@ to FPU register being 80 bits long and double being 64 bits long */
|
||||
}
|
||||
|
||||
|
||||
void CVT_double_to_date(double real, SLONG fixed[2], FPTR_VOID err)
|
||||
void CVT_double_to_date(double real, SLONG fixed[2], FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -303,7 +303,7 @@ void CVT_double_to_date(double real, SLONG fixed[2], FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
double CVT_get_double(const dsc* desc, FPTR_VOID err)
|
||||
double CVT_get_double(const dsc* desc, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -430,8 +430,7 @@ double CVT_get_double(const dsc* desc, FPTR_VOID err)
|
||||
later in this routine. */
|
||||
|
||||
if (exp >= SHORT_LIMIT)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
}
|
||||
else if (*p == '-' && !digit_seen && !sign)
|
||||
sign = -1;
|
||||
@ -454,7 +453,7 @@ double CVT_get_double(const dsc* desc, FPTR_VOID err)
|
||||
the user know... */
|
||||
|
||||
if (ABSOLUT(scale) > DBL_MAX_10_EXP)
|
||||
reinterpret_cast<pfn_cvt_private_cludge>(err)(gds_arith_except, 0);
|
||||
(*err)(gds_arith_except, 0);
|
||||
|
||||
/*
|
||||
Repeated division is a good way to mung the least significant bits
|
||||
@ -481,7 +480,7 @@ double CVT_get_double(const dsc* desc, FPTR_VOID err)
|
||||
break;
|
||||
|
||||
default:
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -495,7 +494,7 @@ double CVT_get_double(const dsc* desc, FPTR_VOID err)
|
||||
the user know... */
|
||||
|
||||
if (ABSOLUT(scale) > DBL_MAX_10_EXP)
|
||||
reinterpret_cast<pfn_cvt_private_cludge>(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
|
||||
if (scale > 0)
|
||||
value *= power_of_ten(scale);
|
||||
@ -506,7 +505,7 @@ double CVT_get_double(const dsc* desc, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -567,14 +566,12 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
else if (scale < 0)
|
||||
do {
|
||||
if ((val64 > INT64_LIMIT) || (val64 < -INT64_LIMIT))
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
val64 *= 10;
|
||||
} while (++scale);
|
||||
|
||||
if ((val64 > LONG_MAX_int64) || (val64 < LONG_MIN_int64))
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
return (SLONG) val64;
|
||||
|
||||
case dtype_quad:
|
||||
@ -582,8 +579,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
high = ((SLONG *) p)[HIGH_WORD];
|
||||
if ((value >= 0 && !high) || (value < 0 && high == -1))
|
||||
break;
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_arith_except,
|
||||
0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
break;
|
||||
|
||||
case dtype_real:
|
||||
@ -620,14 +616,12 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
if (d < (double) LONG_MIN_real) {
|
||||
if (d > (double) LONG_MIN_real - 1.)
|
||||
return LONG_MIN;
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
}
|
||||
if (d > (double) LONG_MAX_real) {
|
||||
if (d < (double) LONG_MAX_real + 1.)
|
||||
return LONG_MAX_int;
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
}
|
||||
return (SLONG) d;
|
||||
|
||||
@ -649,7 +643,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
break;
|
||||
|
||||
default:
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err)(gds_badblk, 0); /* internal error */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -682,8 +676,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
else if (scale < 0)
|
||||
do {
|
||||
if (value > LONG_LIMIT || value < -LONG_LIMIT)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
value *= 10;
|
||||
} while (++scale);
|
||||
|
||||
@ -693,7 +686,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
|
||||
UCHAR CVT_get_numeric(const UCHAR* string,
|
||||
const USHORT length,
|
||||
SSHORT* scale, double* ptr, FPTR_VOID err)
|
||||
SSHORT* scale, double* ptr, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -806,7 +799,7 @@ UCHAR CVT_get_numeric(const UCHAR* string,
|
||||
}
|
||||
|
||||
|
||||
SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -891,8 +884,7 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
return QUAD_MIN_int;
|
||||
else if (d < (double) QUAD_MAX_real + 1.)
|
||||
return QUAD_MAX_int;
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err)(gds_arith_except, 0);
|
||||
}
|
||||
return QUAD_FROM_DOUBLE(d, err);
|
||||
|
||||
@ -914,7 +906,7 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
break;
|
||||
|
||||
default:
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err)(gds_badblk, 0); /* internal error */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -924,7 +916,7 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
return value;
|
||||
|
||||
#ifndef NATIVE_QUAD
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err)(gds_badblk, 0); /* internal error */
|
||||
#else
|
||||
if (scale > 0) {
|
||||
if (desc->dsc_dtype == dtype_short ||
|
||||
@ -963,7 +955,7 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1045,8 +1037,7 @@ SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
double, and thus will have no effect on the sum. */
|
||||
|
||||
if (d < (double) QUAD_MIN_real || (double) QUAD_MAX_real < d)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
|
||||
return (SINT64) d;
|
||||
|
||||
@ -1068,7 +1059,7 @@ SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
break;
|
||||
|
||||
default:
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1102,8 +1093,7 @@ SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
else if (scale < 0)
|
||||
do {
|
||||
if (value > INT64_LIMIT || value < -INT64_LIMIT)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
value *= 10;
|
||||
} while (++scale);
|
||||
|
||||
@ -1114,7 +1104,7 @@ SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, FPTR_VOID err)
|
||||
USHORT CVT_get_string_ptr(const dsc* desc,
|
||||
USHORT* ttype,
|
||||
UCHAR** address,
|
||||
vary* temp, USHORT length, FPTR_VOID err)
|
||||
vary* temp, USHORT length, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1182,7 +1172,7 @@ USHORT CVT_get_string_ptr(const dsc* desc,
|
||||
}
|
||||
|
||||
|
||||
GDS_DATE CVT_get_sql_date(const dsc* desc, FPTR_VOID err)
|
||||
GDS_DATE CVT_get_sql_date(const dsc* desc, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1208,7 +1198,7 @@ GDS_DATE CVT_get_sql_date(const dsc* desc, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
GDS_TIME CVT_get_sql_time(const dsc* desc, FPTR_VOID err)
|
||||
GDS_TIME CVT_get_sql_time(const dsc* desc, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1234,7 +1224,7 @@ GDS_TIME CVT_get_sql_time(const dsc* desc, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
GDS_TIMESTAMP CVT_get_timestamp(const dsc* desc, FPTR_VOID err)
|
||||
GDS_TIMESTAMP CVT_get_timestamp(const dsc* desc, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1265,7 +1255,7 @@ USHORT CVT_make_string(const dsc* desc,
|
||||
const char** address,
|
||||
VARY* temp,
|
||||
USHORT length,
|
||||
FPTR_VOID err)
|
||||
FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1315,7 +1305,7 @@ USHORT CVT_make_string(const dsc* desc,
|
||||
}
|
||||
|
||||
|
||||
void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1370,8 +1360,9 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
isc_decode_timestamp(&date, ×);
|
||||
if ((times.tm_year + 1900) < MIN_YEAR
|
||||
|| (times.tm_year) + 1900 > MAX_YEAR)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (isc_date_range_exceeded, 0);
|
||||
{
|
||||
(*err) (isc_date_range_exceeded, 0);
|
||||
}
|
||||
|
||||
((GDS_TIMESTAMP *) to->dsc_address)->timestamp_date = date.timestamp_date;
|
||||
((GDS_TIMESTAMP *) to->dsc_address)->timestamp_time = date.timestamp_time;
|
||||
@ -1457,8 +1448,9 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
isc_decode_timestamp(&date, ×);
|
||||
if ((times.tm_year + 1900) < MIN_YEAR
|
||||
|| (times.tm_year) + 1900 > MAX_YEAR)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (isc_date_range_exceeded, 0);
|
||||
{
|
||||
(*err) (isc_date_range_exceeded, 0);
|
||||
}
|
||||
|
||||
*((GDS_DATE *) to->dsc_address) = date.timestamp_date;
|
||||
}
|
||||
@ -1476,8 +1468,9 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
isc_decode_timestamp(&new_date, ×);
|
||||
if ((times.tm_year + 1900) < MIN_YEAR
|
||||
|| (times.tm_year) + 1900 > MAX_YEAR)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (isc_date_range_exceeded, 0);
|
||||
{
|
||||
(*err) (isc_date_range_exceeded, 0);
|
||||
}
|
||||
|
||||
*((GDS_DATE *) to->dsc_address) =
|
||||
((GDS_TIMESTAMP *) from->dsc_address)->timestamp_date;
|
||||
@ -1567,13 +1560,13 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
#ifndef REQUESTER
|
||||
#ifndef SUPERCLIENT
|
||||
if ((INTL_TTYPE(from) == ttype_dynamic) &&
|
||||
(err == (FPTR_VOID) ERR_post))
|
||||
(err == ERR_post))
|
||||
charset1 = INTL_charset(NULL, INTL_TTYPE(from), err);
|
||||
else
|
||||
charset1 = INTL_TTYPE(from);
|
||||
|
||||
if ((INTL_TTYPE(to) == ttype_dynamic) &&
|
||||
(err == (FPTR_VOID) ERR_post))
|
||||
(err == ERR_post))
|
||||
charset2 = INTL_charset(NULL, INTL_TTYPE(to), err);
|
||||
else
|
||||
charset2 = INTL_TTYPE(to);
|
||||
@ -1587,15 +1580,14 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
(charset1 != ttype_binary) &&
|
||||
(charset2 != ttype_binary) &&
|
||||
(charset1 != ttype_dynamic) && (charset2 != ttype_dynamic)) {
|
||||
if (err == (FPTR_VOID) ERR_post) {
|
||||
if (err == ERR_post) {
|
||||
INTL_convert_string(to, from, err);
|
||||
return;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
#ifndef REQUESTER
|
||||
#ifndef SUPERCLIENT
|
||||
}
|
||||
@ -1663,8 +1655,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
|
||||
do {
|
||||
if (*q++ != ASCII_SPACE)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
} while (--l);
|
||||
}
|
||||
return;
|
||||
@ -1707,11 +1698,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
}
|
||||
|
||||
if (to->dsc_dtype != from->dsc_dtype)
|
||||
reinterpret_cast < pfn_cvt_private_cludge2 > (err) (gds_wish_list,
|
||||
gds_arg_gds,
|
||||
gds_blobnotsup,
|
||||
gds_arg_string,
|
||||
"move", 0);
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_blobnotsup, gds_arg_string, "move", 0);
|
||||
|
||||
/* Note: DSC_EQUIV failed above as the blob sub_types were different,
|
||||
* or their character sets were different. In V4 we aren't trying
|
||||
@ -1728,8 +1715,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
/* assert(l <= MAX_SSHORT); */
|
||||
*(SSHORT *) p = (SSHORT) l;
|
||||
if (*(SSHORT *) p != l)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
return;
|
||||
|
||||
case dtype_long:
|
||||
@ -1754,8 +1740,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
double d_value;
|
||||
d_value = CVT_get_double(from, err);
|
||||
if (ABSOLUT(d_value) > FLOAT_MAX)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
*(float*) p = (float) d_value;
|
||||
}
|
||||
return;
|
||||
@ -1773,17 +1758,13 @@ void CVT_move(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
}
|
||||
|
||||
if (from->dsc_dtype == dtype_array || from->dsc_dtype == dtype_blob)
|
||||
reinterpret_cast<pfn_cvt_private_cludge2>(err) (gds_wish_list,
|
||||
gds_arg_gds,
|
||||
gds_blobnotsup,
|
||||
gds_arg_string,
|
||||
"move", 0);
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_blobnotsup, gds_arg_string, "move", 0);
|
||||
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
}
|
||||
|
||||
|
||||
static void conversion_error(const dsc* desc, FPTR_VOID err)
|
||||
static void conversion_error(const dsc* desc, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1815,12 +1796,11 @@ static void conversion_error(const dsc* desc, FPTR_VOID err)
|
||||
#endif
|
||||
}
|
||||
|
||||
reinterpret_cast<pfn_cvt_private_cludge2>(err)(gds_convert_error,
|
||||
gds_arg_string, p, 0);
|
||||
(*err)(gds_convert_error, gds_arg_string, p, 0);
|
||||
}
|
||||
|
||||
|
||||
static void datetime_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
static void datetime_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1866,7 +1846,7 @@ static void datetime_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1950,7 +1930,7 @@ static SSHORT decompose(const char* string,
|
||||
USHORT length,
|
||||
SSHORT dtype,
|
||||
SLONG* return_value,
|
||||
FPTR_VOID err)
|
||||
FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1967,7 +1947,7 @@ static SSHORT decompose(const char* string,
|
||||
supported by the platform as a native datatype. */
|
||||
|
||||
if (dtype == dtype_quad)
|
||||
reinterpret_cast<pfn_cvt_private_cludge> (err) (gds_badblk, 0); /* internal error */
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
#endif
|
||||
|
||||
dsc errd;
|
||||
@ -2002,12 +1982,10 @@ static SSHORT decompose(const char* string,
|
||||
if (value >= limit_by_10) {
|
||||
/* possibility of an overflow */
|
||||
if (value > limit_by_10)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
else if (((*p > '8') && (sign == -1))
|
||||
|| ((*p > '7') && (sign != -1)))
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
}
|
||||
|
||||
value = value * 10 + *p - '0';
|
||||
@ -2053,8 +2031,7 @@ static SSHORT decompose(const char* string,
|
||||
applied to the value. */
|
||||
|
||||
if (exp >= SHORT_LIMIT)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
}
|
||||
else if (*p == '-' && !digit_seen && !sign)
|
||||
sign = -1;
|
||||
@ -2120,7 +2097,7 @@ static TEXT* error_string(const char* in_string, SSHORT length)
|
||||
#endif
|
||||
|
||||
|
||||
static void float_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
static void float_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2190,8 +2167,7 @@ static void float_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
/* If we cannot print at least two digits, one on each side of the
|
||||
".", report an overflow exception. */
|
||||
if (precision < 2)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
|
||||
chars_printed = sprintf(temp, num_format, width, precision, d);
|
||||
|
||||
@ -2203,8 +2179,7 @@ static void float_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
if (chars_printed > width) {
|
||||
precision -= (chars_printed - width);
|
||||
if (precision < 2)
|
||||
reinterpret_cast < pfn_cvt_private_cludge >
|
||||
(err) (gds_arith_except, 0);
|
||||
(*err) (gds_arith_except, 0);
|
||||
chars_printed = sprintf(temp, num_format, width, precision, d);
|
||||
}
|
||||
}
|
||||
@ -2237,7 +2212,7 @@ static void float_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
static void integer_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
static void integer_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2255,7 +2230,7 @@ static void integer_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
supported by the platform as a native datatype. */
|
||||
|
||||
if (from->dsc_dtype == dtype_quad)
|
||||
reinterpret_cast < pfn_cvt_private_cludge > (err) (gds_badblk, 0); /* internal error */
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
#endif
|
||||
|
||||
SSHORT pad = 0, decimal = 0, neg = 0;
|
||||
@ -2382,7 +2357,7 @@ static void integer_to_text(const dsc* from, dsc* to, FPTR_VOID err)
|
||||
static void string_to_datetime(
|
||||
const dsc* desc,
|
||||
GDS_TIMESTAMP* date,
|
||||
EXPECT_DATETIME expect_type, FPTR_VOID err)
|
||||
EXPECT_DATETIME expect_type, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2718,8 +2693,7 @@ static void string_to_datetime(
|
||||
if ((times.tm_year + 1900) < MIN_YEAR
|
||||
|| (times.tm_year) + 1900 > MAX_YEAR)
|
||||
{
|
||||
reinterpret_cast<pfn_cvt_private_cludge>
|
||||
(err) (isc_date_range_exceeded, 0);
|
||||
(*err) (isc_date_range_exceeded, 0);
|
||||
}
|
||||
|
||||
if (times.tm_year != times2.tm_year ||
|
||||
|
@ -97,12 +97,7 @@ static const BYTE compare_priority[] = { dtype_null, /* dtype_null through dtype
|
||||
dtype_long + 1
|
||||
}; /* int64 goes right after long */
|
||||
|
||||
#pragma FB_COMPILER_MESSAGE("Fix this! Ugly function pointer cast!")
|
||||
typedef void (*pfn_cvt_private_cludge) (int, int);
|
||||
typedef void (*pfn_cvt_private_cludge2) (int, int, ...);
|
||||
|
||||
|
||||
SSHORT CVT2_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
SSHORT CVT2_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -493,11 +488,11 @@ SSHORT CVT2_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
return CVT2_blob_compare(arg1, arg2, err);
|
||||
|
||||
case dtype_array:
|
||||
reinterpret_cast < void (*) (...) > (*err) (gds_wish_list,
|
||||
gds_arg_gds,
|
||||
gds_blobnotsup,
|
||||
gds_arg_string, "compare",
|
||||
0);
|
||||
(*err) (gds_wish_list,
|
||||
gds_arg_gds,
|
||||
gds_blobnotsup,
|
||||
gds_arg_string, "compare",
|
||||
0);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -508,7 +503,7 @@ SSHORT CVT2_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -529,7 +524,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
SSHORT l1, l2;
|
||||
USHORT ttype1, ttype2;
|
||||
SSHORT ret_val = 0;
|
||||
TextType *obj1 = 0, *obj2 = 0;
|
||||
TextType obj1 = NULL, obj2 = NULL;
|
||||
DSC desc1, desc2;
|
||||
bool bin_cmp = false, both_are_text = false;
|
||||
|
||||
@ -538,8 +533,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
/* DEV_BLKCHK (node, type_nod); */
|
||||
|
||||
if (arg1->dsc_dtype != dtype_blob)
|
||||
reinterpret_cast < pfn_cvt_private_cludge2 >
|
||||
(err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
|
||||
/* Is arg2 a blob? */
|
||||
if (arg2->dsc_dtype == dtype_blob)
|
||||
@ -588,8 +582,8 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
{
|
||||
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
||||
obj2 = INTL_texttype_lookup(tdbb, ttype2, err, NULL);
|
||||
ttype1 = obj1->getType();
|
||||
ttype2 = obj2->getType();
|
||||
ttype1 = obj1.getType();
|
||||
ttype2 = obj2.getType();
|
||||
}
|
||||
bin_cmp = (ttype1 == ttype2 || ttype1 == ttype_none || ttype1 == ttype_ascii
|
||||
|| ttype2 == ttype_none || ttype2 == ttype_ascii);
|
||||
@ -603,16 +597,15 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
characters per chunk from both blobs. */
|
||||
if (!bin_cmp && (blob1->blb_length > BUFFER_LARGE || blob2->blb_length > BUFFER_LARGE))
|
||||
{
|
||||
if (!obj1)
|
||||
if (obj1 == NULL)
|
||||
{
|
||||
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
||||
obj2 = INTL_texttype_lookup(tdbb, ttype2, err, NULL);
|
||||
}
|
||||
assert(obj1);
|
||||
assert(obj2);
|
||||
if (obj1->getBytesPerChar() != 1 || obj2->getBytesPerChar() != 1)
|
||||
reinterpret_cast < pfn_cvt_private_cludge2 >
|
||||
(err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
assert(obj1 != NULL);
|
||||
assert(obj2 != NULL);
|
||||
if (obj1.getBytesPerChar() != 1 || obj2.getBytesPerChar() != 1)
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
}
|
||||
|
||||
while (!(blob1->blb_flags & BLB_eof) && !(blob2->blb_flags & BLB_eof))
|
||||
@ -712,8 +705,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
}
|
||||
/* We do not accept arrays for now. Maybe ADS in the future. */
|
||||
else if (arg2->dsc_dtype == dtype_array)
|
||||
reinterpret_cast < pfn_cvt_private_cludge2 >
|
||||
(err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
/* The second parameter should be a string. */
|
||||
else
|
||||
{
|
||||
@ -744,16 +736,16 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
if (arg1->dsc_sub_type == BLOB_text)
|
||||
{
|
||||
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
||||
assert(obj1);
|
||||
ttype1 = obj1->getType();
|
||||
assert(obj1 != NULL);
|
||||
ttype1 = obj1.getType();
|
||||
if (ttype1 == ttype_none || ttype1 == ttype_ascii)
|
||||
bin_cmp = true;
|
||||
}
|
||||
if (arg2->dsc_dtype <= dtype_varying)
|
||||
{
|
||||
obj2 = INTL_texttype_lookup(tdbb, ttype2, err, NULL);
|
||||
assert(obj2);
|
||||
ttype2 = obj2->getType();
|
||||
assert(obj2 != NULL);
|
||||
ttype2 = obj2.getType();
|
||||
if (ttype2 == ttype_none || ttype2 == ttype_ascii)
|
||||
bin_cmp = true;
|
||||
}
|
||||
@ -763,8 +755,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
|
||||
/* I will stop execution here until I can complete this function. */
|
||||
if (!bin_cmp)
|
||||
reinterpret_cast < pfn_cvt_private_cludge2 >
|
||||
(err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
|
||||
if (arg2->dsc_length > BUFFER_LARGE)
|
||||
{
|
||||
@ -789,7 +780,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
void CVT2_get_name(const dsc* desc, TEXT* string, FPTR_VOID err)
|
||||
void CVT2_get_name(const dsc* desc, TEXT* string, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -817,7 +808,7 @@ void CVT2_get_name(const dsc* desc, TEXT* string, FPTR_VOID err)
|
||||
USHORT CVT2_make_string2(const dsc* desc,
|
||||
USHORT to_interp,
|
||||
UCHAR** address,
|
||||
VARY* temp, USHORT length, STR* ptr, FPTR_VOID err)
|
||||
VARY* temp, USHORT length, STR* ptr, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -24,11 +24,11 @@
|
||||
#ifndef JRD_CVT2_PROTO_H
|
||||
#define JRD_CVT2_PROTO_H
|
||||
|
||||
SSHORT CVT2_compare(const dsc*, const dsc*, FPTR_VOID);
|
||||
SSHORT CVT2_blob_compare(const dsc*, const dsc*, FPTR_VOID);
|
||||
void CVT2_get_name(const dsc*, TEXT*, FPTR_VOID);
|
||||
SSHORT CVT2_compare(const dsc*, const dsc*, FPTR_STATUS);
|
||||
SSHORT CVT2_blob_compare(const dsc*, const dsc*, FPTR_STATUS);
|
||||
void CVT2_get_name(const dsc*, TEXT*, FPTR_STATUS);
|
||||
USHORT CVT2_make_string2(const dsc*, USHORT, UCHAR**, vary*,
|
||||
USHORT, str**, FPTR_VOID);
|
||||
USHORT, str**, FPTR_STATUS);
|
||||
|
||||
#endif // JRD_CVT2_PROTO_H
|
||||
|
||||
|
@ -24,21 +24,21 @@
|
||||
#ifndef JRD_CVT_PROTO_H
|
||||
#define JRD_CVT_PROTO_H
|
||||
|
||||
double CVT_date_to_double(const dsc*, FPTR_VOID);
|
||||
void CVT_double_to_date(double, SLONG[2], FPTR_VOID);
|
||||
double CVT_get_double(const dsc*, FPTR_VOID);
|
||||
SLONG CVT_get_long(const dsc*, SSHORT, FPTR_VOID);
|
||||
SINT64 CVT_get_int64(const dsc*, SSHORT, FPTR_VOID);
|
||||
UCHAR CVT_get_numeric(const UCHAR*, const USHORT, SSHORT*, double*, FPTR_VOID);
|
||||
SQUAD CVT_get_quad(const dsc*, SSHORT, FPTR_VOID);
|
||||
double CVT_date_to_double(const dsc*, FPTR_STATUS);
|
||||
void CVT_double_to_date(double, SLONG[2], FPTR_STATUS);
|
||||
double CVT_get_double(const dsc*, FPTR_STATUS);
|
||||
SLONG CVT_get_long(const dsc*, SSHORT, FPTR_STATUS);
|
||||
SINT64 CVT_get_int64(const dsc*, SSHORT, FPTR_STATUS);
|
||||
UCHAR CVT_get_numeric(const UCHAR*, const USHORT, SSHORT*, double*, FPTR_STATUS);
|
||||
SQUAD CVT_get_quad(const dsc*, SSHORT, FPTR_STATUS);
|
||||
USHORT CVT_get_string_ptr(const dsc*, USHORT*, UCHAR**,
|
||||
vary*, USHORT, FPTR_VOID);
|
||||
GDS_DATE CVT_get_sql_date(const dsc*, FPTR_VOID);
|
||||
GDS_TIME CVT_get_sql_time(const dsc*, FPTR_VOID);
|
||||
GDS_TIMESTAMP CVT_get_timestamp(const dsc*, FPTR_VOID);
|
||||
vary*, USHORT, FPTR_STATUS);
|
||||
GDS_DATE CVT_get_sql_date(const dsc*, FPTR_STATUS);
|
||||
GDS_TIME CVT_get_sql_time(const dsc*, FPTR_STATUS);
|
||||
GDS_TIMESTAMP CVT_get_timestamp(const dsc*, FPTR_STATUS);
|
||||
USHORT CVT_make_string(const dsc*, USHORT, const char**, vary*,
|
||||
USHORT, FPTR_VOID);
|
||||
extern "C" void CVT_move(const dsc*, dsc*, FPTR_VOID);
|
||||
USHORT, FPTR_STATUS);
|
||||
extern "C" void CVT_move(const dsc*, dsc*, FPTR_STATUS);
|
||||
|
||||
#endif // JRD_CVT_PROTO_H
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
/* all applicable grant/revoke privileges for a procedure */
|
||||
#define DYN_MSG_FAC 8
|
||||
#define STUFF_COUNT 4
|
||||
#define MAX_KEY 256
|
||||
#define TEXT_BLOB_LENGTH 512
|
||||
|
||||
#define PRIMARY_KEY "PRIMARY KEY"
|
||||
|
112
src/jrd/evl.cpp
112
src/jrd/evl.cpp
@ -19,7 +19,7 @@
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
* $Id: evl.cpp,v 1.44 2003-11-02 11:54:49 dimitr Exp $
|
||||
* $Id: evl.cpp,v 1.45 2003-11-03 17:14:44 skidder Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -159,12 +159,12 @@ static DSC *record_version(TDBB, JRD_NOD, VLU);
|
||||
static BOOLEAN reject_duplicate(UCHAR *, UCHAR *, int);
|
||||
static DSC *scalar(TDBB, JRD_NOD, VLU);
|
||||
static SSHORT sleuth(TDBB, JRD_NOD, DSC *, DSC *);
|
||||
static BOOLEAN nc_sleuth_check(class TextType*, USHORT, UCHAR *, UCHAR *, UCHAR *,
|
||||
static BOOLEAN nc_sleuth_check(TextType, USHORT, UCHAR *, UCHAR *, UCHAR *,
|
||||
UCHAR *);
|
||||
static BOOLEAN nc_sleuth_class(class TextType*, USHORT, UCHAR *, UCHAR *, UCHAR);
|
||||
static BOOLEAN wc_sleuth_check(class TextType*, USHORT, UCS2_CHAR *, UCS2_CHAR *,
|
||||
static BOOLEAN nc_sleuth_class(TextType, USHORT, UCHAR *, UCHAR *, UCHAR);
|
||||
static BOOLEAN wc_sleuth_check(TextType, USHORT, UCS2_CHAR *, UCS2_CHAR *,
|
||||
UCS2_CHAR *, UCS2_CHAR *);
|
||||
static BOOLEAN wc_sleuth_class(class TextType*, USHORT, UCS2_CHAR *, UCS2_CHAR *,
|
||||
static BOOLEAN wc_sleuth_class(TextType, USHORT, UCS2_CHAR *, UCS2_CHAR *,
|
||||
UCS2_CHAR);
|
||||
static SSHORT string_boolean(TDBB, JRD_NOD, DSC *, DSC *);
|
||||
static SSHORT string_function(TDBB, JRD_NOD, SSHORT, UCHAR *, SSHORT, UCHAR *, USHORT);
|
||||
@ -1878,7 +1878,7 @@ void EVL_make_value(TDBB tdbb, DSC * desc, VLU value)
|
||||
|
||||
|
||||
USHORT EVL_mb_contains(TDBB tdbb,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
UCHAR * p1,
|
||||
USHORT l1,
|
||||
UCHAR * p2,
|
||||
@ -1904,8 +1904,8 @@ USHORT EVL_mb_contains(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
len1 = obj->to_wc(NULL, 0, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(NULL, 0, p2, l2, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(NULL, 0, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(NULL, 0, p2, l2, &err_code, &err_pos);
|
||||
|
||||
if (len1 > sizeof(buffer1)) {
|
||||
buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str();
|
||||
@ -1916,8 +1916,8 @@ USHORT EVL_mb_contains(TDBB tdbb,
|
||||
pp2 = (UCS2_CHAR *) buf2->str_data;
|
||||
}
|
||||
|
||||
len1 = obj->to_wc(pp1, len1, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(pp2, len2, p2, l2, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(pp1, len1, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(pp2, len2, p2, l2, &err_code, &err_pos);
|
||||
|
||||
ret_val = EVL_wc_contains(tdbb, obj, pp1, len1, pp2, len2);
|
||||
|
||||
@ -1931,7 +1931,7 @@ USHORT EVL_mb_contains(TDBB tdbb,
|
||||
|
||||
|
||||
USHORT EVL_mb_like(TDBB tdbb,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
UCHAR * p1,
|
||||
SSHORT l1,
|
||||
UCHAR * p2,
|
||||
@ -1964,8 +1964,8 @@ USHORT EVL_mb_like(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
len1 = obj->to_wc(NULL, 0, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(NULL, 0, p2, l2, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(NULL, 0, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(NULL, 0, p2, l2, &err_code, &err_pos);
|
||||
if (len1 > sizeof(buffer1)) {
|
||||
buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str();
|
||||
pp1 = (UCS2_CHAR *) buf1->str_data;
|
||||
@ -1975,8 +1975,8 @@ USHORT EVL_mb_like(TDBB tdbb,
|
||||
pp2 = (UCS2_CHAR *) buf2->str_data;
|
||||
}
|
||||
|
||||
len1 = obj->to_wc(pp1, len1, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(pp2, len2, p2, l2, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(pp1, len1, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(pp2, len2, p2, l2, &err_code, &err_pos);
|
||||
// CHECK ME: Shouldn't errors to be handled?
|
||||
|
||||
ret_val = EVL_wc_like(tdbb, obj, pp1, len1, pp2, len2, escape_char);
|
||||
@ -1991,7 +1991,7 @@ USHORT EVL_mb_like(TDBB tdbb,
|
||||
|
||||
|
||||
USHORT EVL_mb_matches(TDBB tdbb,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
UCHAR * p1,
|
||||
SSHORT l1,
|
||||
UCHAR * p2,
|
||||
@ -2021,8 +2021,8 @@ USHORT EVL_mb_matches(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
len1 = obj->to_wc(NULL, 0, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(NULL, 0, p2, l2, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(NULL, 0, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(NULL, 0, p2, l2, &err_code, &err_pos);
|
||||
if (len1 > sizeof(buffer1)) {
|
||||
buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str();
|
||||
pp1 = (UCS2_CHAR *) buf1->str_data;
|
||||
@ -2032,8 +2032,8 @@ USHORT EVL_mb_matches(TDBB tdbb,
|
||||
pp2 = (UCS2_CHAR *) buf2->str_data;
|
||||
}
|
||||
|
||||
len1 = obj->to_wc(pp1, len1, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(pp2, len2, p2, l2, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(pp1, len1, p1, l1, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(pp2, len2, p2, l2, &err_code, &err_pos);
|
||||
|
||||
ret_val = EVL_wc_matches(tdbb, obj, pp1, len1, pp2, len2);
|
||||
|
||||
@ -2047,7 +2047,7 @@ USHORT EVL_mb_matches(TDBB tdbb,
|
||||
|
||||
|
||||
USHORT EVL_mb_sleuth_check(TDBB tdbb,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
USHORT flags,
|
||||
UCHAR * search,
|
||||
USHORT search_bytes,
|
||||
@ -2083,13 +2083,13 @@ USHORT EVL_mb_sleuth_check(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
len1 = obj->to_wc(NULL, 0, search, search_bytes, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(NULL, 0, search, search_bytes, &err_code, &err_pos);
|
||||
if (len1 > sizeof(buffer1)) {
|
||||
buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str();
|
||||
pp1 = (UCS2_CHAR *) buf1->str_data;
|
||||
}
|
||||
|
||||
len1 = obj->to_wc(pp1, len1, search, search_bytes, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(pp1, len1, search, search_bytes, &err_code, &err_pos);
|
||||
|
||||
ret_val =
|
||||
EVL_wc_sleuth_check(tdbb, obj, 0, pp1, len1,
|
||||
@ -2104,7 +2104,7 @@ USHORT EVL_mb_sleuth_check(TDBB tdbb,
|
||||
|
||||
|
||||
USHORT EVL_mb_sleuth_merge(TDBB tdbb,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
UCHAR * match,
|
||||
USHORT match_bytes,
|
||||
UCHAR * control,
|
||||
@ -2137,8 +2137,8 @@ USHORT EVL_mb_sleuth_merge(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
len1 = obj->to_wc(NULL, 0, match, match_bytes, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(NULL, 0, control, control_bytes, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(NULL, 0, match, match_bytes, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(NULL, 0, control, control_bytes, &err_code, &err_pos);
|
||||
if (len1 > sizeof(buffer1)) {
|
||||
buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str();
|
||||
pp1 = (UCS2_CHAR *) buf1->str_data;
|
||||
@ -2148,8 +2148,8 @@ USHORT EVL_mb_sleuth_merge(TDBB tdbb,
|
||||
pp2 = (UCS2_CHAR *) buf2->str_data;
|
||||
}
|
||||
|
||||
len1 = obj->to_wc(pp1, len1, match, match_bytes, &err_code, &err_pos);
|
||||
len2 = obj->to_wc(pp2, len2, control, control_bytes, &err_code, &err_pos);
|
||||
len1 = obj.to_wc(pp1, len1, match, match_bytes, &err_code, &err_pos);
|
||||
len2 = obj.to_wc(pp2, len2, control, control_bytes, &err_code, &err_pos);
|
||||
|
||||
ret_val = EVL_wc_sleuth_merge(tdbb, obj, pp1, len1, pp2, len2,
|
||||
reinterpret_cast < UCS2_CHAR * >(combined),
|
||||
@ -2165,7 +2165,7 @@ USHORT EVL_mb_sleuth_merge(TDBB tdbb,
|
||||
|
||||
|
||||
USHORT EVL_nc_contains(TDBB tdbb_dummy,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
UCHAR * p1,
|
||||
USHORT l1,
|
||||
UCHAR * p2,
|
||||
@ -2194,7 +2194,7 @@ USHORT EVL_nc_contains(TDBB tdbb_dummy,
|
||||
return TRUE;
|
||||
c1 = *q1++;
|
||||
c2 = *q2++;
|
||||
} while (obj->to_upper(c1) == obj->to_upper(c2));
|
||||
} while (obj.to_upper(c1) == obj.to_upper(c2));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@ -2245,7 +2245,7 @@ USHORT EVL_nc_contains(TDBB tdbb_dummy,
|
||||
|
||||
|
||||
USHORT EVL_wc_contains(TDBB tdbb_dumm,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
UCS2_CHAR* p1,
|
||||
USHORT l1, /* byte count */
|
||||
UCS2_CHAR* p2,
|
||||
@ -2274,7 +2274,7 @@ USHORT EVL_wc_contains(TDBB tdbb_dumm,
|
||||
return TRUE;
|
||||
c1 = *q1++;
|
||||
c2 = *q2++;
|
||||
} while (obj->to_upper(c1) == obj->to_upper(c2));
|
||||
} while (obj.to_upper(c1) == obj.to_upper(c2));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@ -2387,8 +2387,8 @@ static DSC *add(DSC * desc, JRD_NOD node, VLU value)
|
||||
result->dsc_length = sizeof(SQUAD);
|
||||
result->dsc_scale = node->nod_scale;
|
||||
value->vlu_misc.vlu_quad = (node->nod_type == nod_subtract) ?
|
||||
QUAD_SUBTRACT(q2, q1, (FPTR_VOID) ERR_post) :
|
||||
QUAD_ADD(q1, q2, (FPTR_VOID) ERR_post);
|
||||
QUAD_SUBTRACT(q2, q1, ERR_post) :
|
||||
QUAD_ADD(q1, q2, ERR_post);
|
||||
result->dsc_address = (UCHAR *) & value->vlu_misc.vlu_quad;
|
||||
|
||||
return result;
|
||||
@ -2472,8 +2472,8 @@ static DSC *add2(DSC * desc, JRD_NOD node, VLU value)
|
||||
result->dsc_length = sizeof(SQUAD);
|
||||
result->dsc_scale = node->nod_scale;
|
||||
value->vlu_misc.vlu_quad = (node->nod_type == nod_subtract2) ?
|
||||
QUAD_SUBTRACT(q2, q1, (FPTR_VOID) ERR_post) :
|
||||
QUAD_ADD(q1, q2, (FPTR_VOID) ERR_post);
|
||||
QUAD_SUBTRACT(q2, q1, ERR_post) :
|
||||
QUAD_ADD(q1, q2, ERR_post);
|
||||
result->dsc_address = (UCHAR *) & value->vlu_misc.vlu_quad;
|
||||
|
||||
return result;
|
||||
@ -3634,7 +3634,7 @@ static SINT64 get_day_fraction(DSC * d)
|
||||
result.dsc_address = reinterpret_cast < UCHAR * >(&result_days);
|
||||
|
||||
/* Convert the input number to a double */
|
||||
CVT_move(d, &result, reinterpret_cast < void (*)() > (ERR_post));
|
||||
CVT_move(d, &result, ERR_post);
|
||||
|
||||
/* There's likely some loss of precision here due to rounding of number */
|
||||
|
||||
@ -3718,7 +3718,7 @@ static SINT64 get_timestamp_to_isc_ticks(DSC * d)
|
||||
result.dsc_length = sizeof(GDS_TIMESTAMP);
|
||||
result.dsc_address = reinterpret_cast < UCHAR * >(&result_timestamp);
|
||||
|
||||
CVT_move(d, &result, reinterpret_cast < void (*)() > (ERR_post));
|
||||
CVT_move(d, &result, ERR_post);
|
||||
|
||||
return ((SINT64) result_timestamp.timestamp_date) * ISC_TICKS_PER_DAY
|
||||
+ (SINT64) result_timestamp.timestamp_time;
|
||||
@ -4037,7 +4037,7 @@ static DSC *multiply(DSC * desc, VLU value, JRD_NOD node)
|
||||
value->vlu_desc.dsc_length = sizeof(SQUAD);
|
||||
value->vlu_desc.dsc_scale = node->nod_scale;
|
||||
value->vlu_misc.vlu_quad =
|
||||
QUAD_MULTIPLY(q1, q2, (FPTR_VOID) ERR_post);
|
||||
QUAD_MULTIPLY(q1, q2, ERR_post);
|
||||
value->vlu_desc.dsc_address = (UCHAR *) & value->vlu_misc.vlu_quad;
|
||||
|
||||
return &value->vlu_desc;
|
||||
@ -4135,7 +4135,7 @@ static DSC *multiply2(DSC * desc, VLU value, JRD_NOD node)
|
||||
value->vlu_desc.dsc_length = sizeof(SQUAD);
|
||||
value->vlu_desc.dsc_scale = node->nod_scale;
|
||||
value->vlu_misc.vlu_quad =
|
||||
QUAD_MULTIPLY(q1, q2, (FPTR_VOID) ERR_post);
|
||||
QUAD_MULTIPLY(q1, q2, ERR_post);
|
||||
value->vlu_desc.dsc_address = (UCHAR *) & value->vlu_misc.vlu_quad;
|
||||
|
||||
return &value->vlu_desc;
|
||||
@ -4381,7 +4381,7 @@ static DSC *negate_dsc(TDBB tdbb, DSC * desc, VLU value)
|
||||
|
||||
case dtype_quad:
|
||||
value->vlu_misc.vlu_quad =
|
||||
QUAD_NEGATE(value->vlu_misc.vlu_quad, (FPTR_VOID) ERR_post);
|
||||
QUAD_NEGATE(value->vlu_misc.vlu_quad, ERR_post);
|
||||
break;
|
||||
|
||||
case dtype_int64:
|
||||
@ -4573,8 +4573,8 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
else
|
||||
ttype = INTL_TTYPE(desc1);
|
||||
|
||||
TextType* obj =
|
||||
INTL_texttype_lookup(tdbb, ttype, (FPTR_VOID) ERR_post, NULL);
|
||||
TextType obj =
|
||||
INTL_texttype_lookup(tdbb, ttype, ERR_post, NULL);
|
||||
|
||||
/* Get operator definition string (control string) */
|
||||
|
||||
@ -4589,7 +4589,7 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
reinterpret_cast<vary*>(temp2), TEMP_SIZE(temp2),
|
||||
&match_str);
|
||||
/* Merge search and control strings */
|
||||
l2 = obj->sleuth_merge(tdbb, p2, l2, p1, l1, control,
|
||||
l2 = obj.sleuth_merge(tdbb, p2, l2, p1, l1, control,
|
||||
BUFFER_SMALL);
|
||||
|
||||
/* l2 is result's byte-count */
|
||||
@ -4604,7 +4604,7 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
MOV_make_string2(desc1, ttype, &p1,
|
||||
reinterpret_cast<vary*>(temp1),
|
||||
TEMP_SIZE(temp1), &data_str);
|
||||
ret_val = obj->sleuth_check(tdbb, 0, p1, l1, control, l2);
|
||||
ret_val = obj.sleuth_check(tdbb, 0, p1, l1, control, l2);
|
||||
}
|
||||
else {
|
||||
/* Source string is a blob, things get interesting */
|
||||
@ -4617,7 +4617,7 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
while (!(blob->blb_flags & BLB_eof))
|
||||
{
|
||||
l1 = BLB_get_segment(tdbb, blob, buffer, sizeof(buffer));
|
||||
if (obj->sleuth_check(tdbb, 0, buffer, l1, control, l2))
|
||||
if (obj.sleuth_check(tdbb, 0, buffer, l1, control, l2))
|
||||
{
|
||||
ret_val = TRUE;
|
||||
break;
|
||||
@ -4751,8 +4751,6 @@ static SSHORT string_function(
|
||||
* or STARTS WITH.
|
||||
*
|
||||
**************************************/
|
||||
class TextType* obj;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
|
||||
@ -4767,12 +4765,12 @@ static SSHORT string_function(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
obj = INTL_texttype_lookup(tdbb, ttype, (FPTR_VOID) ERR_post, NULL);
|
||||
TextType obj = INTL_texttype_lookup(tdbb, ttype, ERR_post, NULL);
|
||||
|
||||
/* Handle contains */
|
||||
|
||||
if (node->nod_type == nod_contains) {
|
||||
return obj->contains(tdbb, p1, l1, p2, l2);
|
||||
return obj.contains(tdbb, p1, l1, p2, l2);
|
||||
}
|
||||
|
||||
/* Handle LIKE and MATCHES */
|
||||
@ -4794,17 +4792,17 @@ static SSHORT string_function(
|
||||
if (!l3)
|
||||
ERR_post(gds_like_escape_invalid, 0);
|
||||
/* Grab the first character from the string */
|
||||
consumed = obj->mbtowc(&escape, reinterpret_cast<unsigned char*>(const_cast<char*>(q1)), l3);
|
||||
consumed = obj.mbtowc(&escape, reinterpret_cast<unsigned char*>(const_cast<char*>(q1)), l3);
|
||||
|
||||
/* If characters left, or null byte character, return error */
|
||||
if (consumed <= 0 || consumed != l3 || (escape == 0))
|
||||
ERR_post(gds_like_escape_invalid, 0);
|
||||
|
||||
}
|
||||
return obj->like(tdbb, p1, l1, p2, l2, escape);
|
||||
return obj.like(tdbb, p1, l1, p2, l2, escape);
|
||||
}
|
||||
|
||||
return obj->matches(tdbb, p1, l1, p2, l2);
|
||||
return obj.matches(tdbb, p1, l1, p2, l2);
|
||||
}
|
||||
|
||||
|
||||
@ -4825,7 +4823,7 @@ static DSC *substring(
|
||||
DSC desc;
|
||||
UCHAR temp[32];
|
||||
USHORT ttype;
|
||||
TextType *obj1 = 0;
|
||||
TextType obj1 = NULL;
|
||||
/* CVC: I didn't bother to define a larger buffer because:
|
||||
- Native types when converted to string don't reach 31 bytes plus terminator.
|
||||
- String types do not need and do not use the buffer ("temp") to be pulled.
|
||||
@ -4848,8 +4846,8 @@ static DSC *substring(
|
||||
|
||||
if (dtype_blob == value->dsc_dtype && (BLOB_text != value->dsc_sub_type
|
||||
|| (ttype = value->dsc_scale) == ttype_ascii || ttype == ttype_none || ttype == ttype_binary
|
||||
|| ((obj1 = INTL_texttype_lookup(tdbb, ttype, (FPTR_VOID) ERR_post, NULL)) != 0
|
||||
&& 1 == obj1->getBytesPerChar())))
|
||||
|| ((obj1 = INTL_texttype_lookup(tdbb, ttype, ERR_post, NULL)) != NULL
|
||||
&& 1 == obj1.getBytesPerChar())))
|
||||
{
|
||||
/* Source string is a blob, things get interesting. */
|
||||
|
||||
@ -4927,7 +4925,7 @@ static DSC *substring(
|
||||
I couldn't find an appropriate message for this failure among current registered
|
||||
messages, so I will return empty.
|
||||
Finally I decided to use arithmetic exception or numeric overflow. */
|
||||
TextType *text_obj = 0;
|
||||
TextType text_obj = 0;
|
||||
UCHAR *p = (UCHAR*) desc.dsc_address;
|
||||
USHORT pcount = desc.dsc_length;
|
||||
BOOLEAN failure = FALSE;
|
||||
|
@ -28,8 +28,7 @@
|
||||
*/
|
||||
|
||||
#define SLEUTH_insensitive 1
|
||||
#define COND_UPPER(obj,c) ((flags & SLEUTH_insensitive) ? \
|
||||
(obj)->to_upper(c) : (c))
|
||||
#define COND_UPPER(obj,c) ((flags & SLEUTH_insensitive) ? (obj).to_upper(c) : (c))
|
||||
|
||||
#define SQL_MATCH_ONE '_'
|
||||
#define SQL_MATCH_ANY '%'
|
||||
@ -50,7 +49,7 @@
|
||||
#define GDML_RPAREN ')'
|
||||
|
||||
|
||||
USHORT LIKENAME(TDBB tdbb, class TextType* obj, LIKETYPE * p1, SSHORT l1_bytes, /* byte count */
|
||||
USHORT LIKENAME(TDBB tdbb, TextType obj, LIKETYPE * p1, SSHORT l1_bytes, /* byte count */
|
||||
LIKETYPE * p2, SSHORT l2_bytes, /* byte count */
|
||||
UCS2_CHAR escape_char)
|
||||
{
|
||||
@ -131,7 +130,7 @@ USHORT LIKENAME(TDBB tdbb, class TextType* obj, LIKETYPE * p1, SSHORT l1_bytes,
|
||||
|
||||
|
||||
USHORT MATCHESNAME(TDBB tdbb,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
MATCHESTYPE * p1,
|
||||
SSHORT l1_bytes, MATCHESTYPE * p2, SSHORT l2_bytes)
|
||||
{
|
||||
@ -194,7 +193,7 @@ USHORT MATCHESNAME(TDBB tdbb,
|
||||
|
||||
|
||||
USHORT SLEUTHNAME(TDBB tdbb_dummy,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
USHORT flags,
|
||||
SLEUTHTYPE * search,
|
||||
USHORT search_len, SLEUTHTYPE * match, USHORT match_len)
|
||||
@ -226,7 +225,7 @@ USHORT SLEUTHNAME(TDBB tdbb_dummy,
|
||||
|
||||
|
||||
USHORT SLEUTH_MERGE_NAME(TDBB tdbb_dummy,
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
SLEUTHTYPE * match,
|
||||
USHORT match_bytes,
|
||||
SLEUTHTYPE * control,
|
||||
@ -345,7 +344,7 @@ USHORT SLEUTH_MERGE_NAME(TDBB tdbb_dummy,
|
||||
|
||||
|
||||
static BOOLEAN SLEUTH_AUX(
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
USHORT flags,
|
||||
SLEUTHTYPE * search,
|
||||
SLEUTHTYPE * end_search,
|
||||
@ -459,7 +458,7 @@ SLEUTHTYPE * match, SLEUTHTYPE * end_match)
|
||||
|
||||
|
||||
static BOOLEAN SLEUTH_CLASS_NAME(
|
||||
class TextType* obj,
|
||||
TextType obj,
|
||||
USHORT flags,
|
||||
SLEUTHTYPE * class_,
|
||||
SLEUTHTYPE * end_class, SLEUTHTYPE character)
|
||||
|
@ -32,27 +32,27 @@ BOOLEAN EVL_boolean(TDBB tdbb, struct jrd_nod *);
|
||||
struct dsc* EVL_expr(TDBB tdbb, struct jrd_nod *);
|
||||
BOOLEAN EVL_field(struct jrd_rel *, struct rec *, USHORT, DSC *);
|
||||
USHORT EVL_group(TDBB tdbb, struct blk *, struct jrd_nod *, USHORT);
|
||||
USHORT EVL_mb_contains(TDBB tdbb, TextType*, UCHAR *, USHORT, UCHAR *, USHORT);
|
||||
USHORT EVL_mb_like(TDBB tdbb, TextType*, UCHAR *, SSHORT, UCHAR *, SSHORT, USHORT);
|
||||
USHORT EVL_mb_matches(TDBB tdbb, TextType*, UCHAR *, SSHORT, UCHAR *, SSHORT);
|
||||
USHORT EVL_mb_sleuth_check(TDBB tdbb, TextType*, USHORT, UCHAR *, USHORT,
|
||||
USHORT EVL_mb_contains(TDBB tdbb, TextType, UCHAR *, USHORT, UCHAR *, USHORT);
|
||||
USHORT EVL_mb_like(TDBB tdbb, TextType, UCHAR *, SSHORT, UCHAR *, SSHORT, USHORT);
|
||||
USHORT EVL_mb_matches(TDBB tdbb, TextType, UCHAR *, SSHORT, UCHAR *, SSHORT);
|
||||
USHORT EVL_mb_sleuth_check(TDBB tdbb, TextType, USHORT, UCHAR *, USHORT,
|
||||
UCHAR *,USHORT);
|
||||
USHORT EVL_mb_sleuth_merge(TDBB tdbb, TextType*, UCHAR *, USHORT, UCHAR *,
|
||||
USHORT EVL_mb_sleuth_merge(TDBB tdbb, TextType, UCHAR *, USHORT, UCHAR *,
|
||||
USHORT, UCHAR *, USHORT);
|
||||
void EVL_make_value(TDBB tdbb, struct dsc *, struct vlu *);
|
||||
USHORT EVL_nc_contains(TDBB tdbb, TextType*, UCHAR *, USHORT, UCHAR *, USHORT);
|
||||
USHORT EVL_nc_like(TDBB tdbb, TextType*, UCHAR *, SSHORT, UCHAR *, SSHORT, USHORT);
|
||||
USHORT EVL_nc_matches(TDBB tdbb, TextType*, UCHAR *, SSHORT, UCHAR *, SSHORT);
|
||||
USHORT EVL_nc_sleuth_check(TDBB tdbb, TextType*, USHORT, UCHAR *, USHORT,
|
||||
USHORT EVL_nc_contains(TDBB tdbb, TextType, UCHAR *, USHORT, UCHAR *, USHORT);
|
||||
USHORT EVL_nc_like(TDBB tdbb, TextType, UCHAR *, SSHORT, UCHAR *, SSHORT, USHORT);
|
||||
USHORT EVL_nc_matches(TDBB tdbb, TextType, UCHAR *, SSHORT, UCHAR *, SSHORT);
|
||||
USHORT EVL_nc_sleuth_check(TDBB tdbb, TextType, USHORT, UCHAR *, USHORT,
|
||||
UCHAR *, USHORT);
|
||||
USHORT EVL_nc_sleuth_merge(TDBB tdbb, TextType*, UCHAR *, USHORT, UCHAR *,
|
||||
USHORT EVL_nc_sleuth_merge(TDBB tdbb, TextType, UCHAR *, USHORT, UCHAR *,
|
||||
USHORT, UCHAR *, USHORT);
|
||||
USHORT EVL_wc_contains(TDBB tdbb, TextType*, USHORT *, USHORT, USHORT *, USHORT);
|
||||
USHORT EVL_wc_like(TDBB tdbb, TextType*, USHORT *, SSHORT, USHORT *, SSHORT, USHORT);
|
||||
USHORT EVL_wc_matches(TDBB tdbb, TextType*, USHORT *, SSHORT, USHORT *, SSHORT);
|
||||
USHORT EVL_wc_sleuth_check(TDBB tdbb, TextType*, USHORT, USHORT *, USHORT,
|
||||
USHORT EVL_wc_contains(TDBB tdbb, TextType, USHORT *, USHORT, USHORT *, USHORT);
|
||||
USHORT EVL_wc_like(TDBB tdbb, TextType, USHORT *, SSHORT, USHORT *, SSHORT, USHORT);
|
||||
USHORT EVL_wc_matches(TDBB tdbb, TextType, USHORT *, SSHORT, USHORT *, SSHORT);
|
||||
USHORT EVL_wc_sleuth_check(TDBB tdbb, TextType, USHORT, USHORT *, USHORT,
|
||||
USHORT *, USHORT);
|
||||
USHORT EVL_wc_sleuth_merge(TDBB tdbb, TextType*, USHORT *, USHORT, USHORT *,
|
||||
USHORT EVL_wc_sleuth_merge(TDBB tdbb, TextType, USHORT *, USHORT, USHORT *,
|
||||
USHORT, USHORT *, USHORT);
|
||||
|
||||
#endif // JRD_EVL_PROTO_H
|
||||
|
@ -667,7 +667,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
USHORT result_length;
|
||||
|
||||
typedef struct ctlaux {
|
||||
CsConvert *ctlaux_obj1; /* Intl object that does tx for us */
|
||||
CsConvert ctlaux_obj1; /* Intl object that does tx for us */
|
||||
BYTE *ctlaux_buffer1; /* Temporary buffer for transliteration */
|
||||
CTL ctlaux_subfilter; /* For chaining transliterate filters */
|
||||
ISC_STATUS ctlaux_source_blob_status; /* marks when source is EOF, etc */
|
||||
@ -713,7 +713,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
aux->ctlaux_obj1 = INTL_convert_lookup(tdbb, dest_cs, source_cs);
|
||||
if (!aux->ctlaux_obj1) {
|
||||
if (aux->ctlaux_obj1 == NULL) {
|
||||
/* Do the convert the hard way, via Unicode.
|
||||
In this case, we become the filter from Unicode to
|
||||
the destination format. And we setup as our source
|
||||
@ -729,7 +729,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
INTL_convert_lookup(tdbb, CS_UNICODE_UCS2, source_cs);
|
||||
}
|
||||
|
||||
if (!aux->ctlaux_obj1) {
|
||||
if (aux->ctlaux_obj1 == NULL) {
|
||||
control->ctl_status[0] = gds_arg_gds;
|
||||
control->ctl_status[1] = gds_text_subtype;
|
||||
control->ctl_status[2] = gds_arg_number;
|
||||
@ -769,7 +769,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
|
||||
if (action == ACTION_open) {
|
||||
control->ctl_max_segment =
|
||||
aux->ctlaux_obj1->convert(NULL, 0, NULL,
|
||||
aux->ctlaux_obj1.convert(NULL, 0, NULL,
|
||||
source->ctl_max_segment, &err_code, &err_position);
|
||||
|
||||
if (source->ctl_max_segment && control->ctl_max_segment)
|
||||
@ -800,7 +800,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
* for an appropriate buffer size, allocate that, and re-allocate
|
||||
* later if we guess wrong.
|
||||
*/
|
||||
tmp = aux->ctlaux_obj1->convert( NULL, 0, NULL,
|
||||
tmp = aux->ctlaux_obj1.convert( NULL, 0, NULL,
|
||||
128, &err_code, &err_position);
|
||||
aux->ctlaux_expansion_factor = (EXP_SCALE * tmp) / 128;
|
||||
|
||||
@ -851,7 +851,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
/* Now convert from the input buffer into the temporary buffer */
|
||||
|
||||
/* How much space do we need to convert? */
|
||||
result_length = aux->ctlaux_obj1->convert(NULL, 0,
|
||||
result_length = aux->ctlaux_obj1.convert(NULL, 0,
|
||||
control->ctl_buffer, control->ctl_buffer_length,
|
||||
&err_code, &err_position);
|
||||
|
||||
@ -867,7 +867,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
|
||||
/* convert the text */
|
||||
|
||||
result_length = aux->ctlaux_obj1->convert(aux->ctlaux_buffer1,
|
||||
result_length = aux->ctlaux_obj1.convert(aux->ctlaux_buffer1,
|
||||
aux->ctlaux_buffer1_len, control->ctl_buffer,
|
||||
control->ctl_buffer_length, &err_code, &err_position);
|
||||
|
||||
@ -959,7 +959,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
|
||||
/* Now convert from the temporary buffer into the destination buffer */
|
||||
|
||||
result_length = aux->ctlaux_obj1->convert(control->ctl_buffer,
|
||||
result_length = aux->ctlaux_obj1.convert(control->ctl_buffer,
|
||||
control->ctl_buffer_length, aux->ctlaux_buffer1, length,
|
||||
&err_code, &err_position);
|
||||
|
||||
|
1757
src/jrd/intl.cpp
1757
src/jrd/intl.cpp
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -24,328 +24,277 @@
|
||||
#ifndef JRD_INTL_CLASSES_H
|
||||
#define JRD_INTL_CLASSES_H
|
||||
|
||||
#include "../common/classes/alloc.h"
|
||||
|
||||
typedef unsigned short CHARSET_ID;
|
||||
typedef unsigned short COLLATE_ID;
|
||||
typedef unsigned short TTYPE_ID;
|
||||
typedef unsigned short UCS2_CHAR;
|
||||
typedef unsigned char NCHAR;
|
||||
typedef unsigned char MBCHAR;
|
||||
typedef class tdbb *TDBB;
|
||||
typedef signed char ASCII;
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned short (*FPTR_SHORT) ();
|
||||
|
||||
enum intl_object_types
|
||||
{
|
||||
type_texttype = 54,
|
||||
type_charset = 55,
|
||||
type_csconvert = 56
|
||||
};
|
||||
#include "firebird.h"
|
||||
#include "../jrd/jrd.h"
|
||||
#include "../jrd/constants.h"
|
||||
#include "../jrd/intlobj.h"
|
||||
|
||||
class TextType
|
||||
{
|
||||
public:
|
||||
TextType(unsigned short type, const char *name, CHARSET_ID cs_id,
|
||||
short country, unsigned char bpc) :
|
||||
texttype_type(type),
|
||||
texttype_name(name),
|
||||
texttype_character_set(cs_id),
|
||||
texttype_country(country),
|
||||
texttype_bytes_per_char(bpc)
|
||||
{}
|
||||
TextType(struct texttype *_tt) : tt(_tt) {}
|
||||
|
||||
// texttype_fn_init
|
||||
//static texttype *alloc(MemoryPool &, short parm1, short parm2);
|
||||
virtual unsigned short key_length(unsigned short) = 0;
|
||||
virtual unsigned short string_to_key(unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short) = 0;
|
||||
virtual short compare(unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*) = 0;
|
||||
virtual unsigned short to_upper(unsigned short) = 0;
|
||||
virtual unsigned short to_lower(unsigned short) = 0;
|
||||
virtual short str_to_upper(unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*) = 0;
|
||||
/* SD: to_wc returns estimated or real length of the result string in bytes that is rather strange */
|
||||
virtual unsigned short to_wc(UCS2_CHAR*, // destination buffer
|
||||
unsigned short, // length of the destination buffer in bytes
|
||||
unsigned char*, // source buffer
|
||||
unsigned short, // length of source buffer in bytes
|
||||
short*, // variable to return error code
|
||||
unsigned short*) = 0; // variable to return offset of the first
|
||||
// unprocessed char
|
||||
virtual unsigned short contains(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short) = 0;
|
||||
virtual unsigned short like(TDBB, unsigned char*,
|
||||
short,
|
||||
unsigned char*,
|
||||
short,
|
||||
short) = 0;
|
||||
virtual unsigned short matches(TDBB, unsigned char*, short,
|
||||
unsigned char*, short) = 0;
|
||||
virtual unsigned short sleuth_check(TDBB, unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short) = 0;
|
||||
virtual unsigned short sleuth_merge(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short) = 0;
|
||||
virtual unsigned short mbtowc(UCS2_CHAR*, unsigned char*, unsigned short) = 0;
|
||||
//virtual short get_wchar(unsigned short*, unsigned char*, unsigned short) = 0;
|
||||
// copy constructor
|
||||
TextType(TextType& obj) : tt(obj.tt) {}
|
||||
|
||||
//unsigned short getVersion() { return texttype_version; }
|
||||
//unsigned short getFlags() { return texttype_flags; }
|
||||
unsigned short getType() { return texttype_type; }
|
||||
const signed char *getName() { return (const signed char*)texttype_name; }
|
||||
CHARSET_ID getCharSet() { return texttype_character_set; }
|
||||
short getCountry() { return texttype_country; }
|
||||
unsigned char getBytesPerChar() { return texttype_bytes_per_char; }
|
||||
USHORT key_length(USHORT a) {
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_key_length);
|
||||
return (*(reinterpret_cast<USHORT (*)(TEXTTYPE,USHORT)>
|
||||
(tt->texttype_fn_key_length)))(tt,a);
|
||||
}
|
||||
|
||||
protected:
|
||||
unsigned short texttype_type; /* Interpretation ID */
|
||||
const char *texttype_name;
|
||||
CHARSET_ID texttype_character_set; /* ID of base character set */
|
||||
short texttype_country; /* ID of base country values */
|
||||
unsigned char texttype_bytes_per_char; /* max bytes per character */
|
||||
USHORT string_to_key(USHORT a,
|
||||
UCHAR *b,
|
||||
USHORT c,
|
||||
UCHAR *d,
|
||||
USHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_string_to_key);
|
||||
return (*(reinterpret_cast
|
||||
<USHORT(*)(TEXTTYPE,USHORT,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_string_to_key)))
|
||||
(tt,a,b,c,d,e);
|
||||
}
|
||||
|
||||
SSHORT compare(USHORT a,
|
||||
UCHAR *b,
|
||||
USHORT c,
|
||||
UCHAR *d)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_compare);
|
||||
return (*(reinterpret_cast
|
||||
<short (*)(TEXTTYPE,USHORT,UCHAR*,USHORT,UCHAR*)>
|
||||
(tt->texttype_fn_compare)))(tt,a,b,c,d);
|
||||
}
|
||||
|
||||
USHORT to_upper(USHORT a)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_to_upper);
|
||||
return (*(reinterpret_cast
|
||||
<short (*)(TEXTTYPE,USHORT)>
|
||||
(tt->texttype_fn_to_upper)))(tt,a);
|
||||
}
|
||||
|
||||
USHORT to_lower(USHORT a)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_to_lower);
|
||||
return (*(reinterpret_cast
|
||||
<USHORT (*)(TEXTTYPE,USHORT)>
|
||||
(tt->texttype_fn_to_lower)))(tt,a);
|
||||
}
|
||||
|
||||
SSHORT str_to_upper(USHORT a,
|
||||
UCHAR *b,
|
||||
USHORT c,
|
||||
UCHAR *d)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_str_to_upper);
|
||||
return (*(reinterpret_cast
|
||||
<short (*)(TEXTTYPE,USHORT,UCHAR*,USHORT,UCHAR*)>
|
||||
(tt->texttype_fn_str_to_upper)))
|
||||
(tt,a,b,c,d);
|
||||
}
|
||||
|
||||
USHORT to_wc(UCS2_CHAR *a,
|
||||
USHORT b,
|
||||
UCHAR *c,
|
||||
USHORT d,
|
||||
SSHORT *e,
|
||||
USHORT *f)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_to_wc);
|
||||
return (*(reinterpret_cast
|
||||
<USHORT (*)(TEXTTYPE,UCS2_CHAR*,USHORT,UCHAR*,USHORT,short*,USHORT*)>
|
||||
(tt->texttype_fn_to_wc)))
|
||||
(tt,a,b,c,d,e,f);
|
||||
}
|
||||
|
||||
USHORT mbtowc(UCS2_CHAR *a, UCHAR *b, USHORT c)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_mbtowc);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(TEXTTYPE, UCS2_CHAR*, UCHAR*, USHORT)>
|
||||
(tt->texttype_fn_mbtowc)))(tt,a,b,c);
|
||||
}
|
||||
|
||||
USHORT contains(class tdbb *a, UCHAR *b,
|
||||
USHORT c,
|
||||
UCHAR *d,
|
||||
USHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_contains);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(class tdbb *,TextType,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_contains)))
|
||||
(a,tt,b,c,d,e);
|
||||
}
|
||||
|
||||
USHORT like(class tdbb *tdbb, UCHAR *a,
|
||||
SSHORT b,
|
||||
UCHAR *c,
|
||||
SSHORT d,
|
||||
SSHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_like);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(class tdbb *,TextType,UCHAR*,short,UCHAR*,short,short)>
|
||||
(tt->texttype_fn_like)))(tdbb,tt,a,b,c,d,e);
|
||||
}
|
||||
|
||||
USHORT matches(class tdbb *tdbb, UCHAR *a, SSHORT b, UCHAR *c, SSHORT d)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_matches);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(class tdbb *,TextType,UCHAR*,short,UCHAR*,short)>
|
||||
(tt->texttype_fn_matches)))
|
||||
(tdbb,tt,a,b,c,d);
|
||||
}
|
||||
|
||||
USHORT sleuth_check(class tdbb *tdbb, USHORT a,
|
||||
UCHAR *b,
|
||||
USHORT c,
|
||||
UCHAR *d,
|
||||
USHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_sleuth_check);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(class tdbb *,TextType,USHORT,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_sleuth_check)))
|
||||
(tdbb,tt,a,b,c,d,e);
|
||||
}
|
||||
|
||||
USHORT sleuth_merge(class tdbb *tdbb, UCHAR *a,
|
||||
USHORT b,
|
||||
UCHAR *c,
|
||||
USHORT d,
|
||||
UCHAR *e,
|
||||
USHORT f)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_sleuth_merge);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(class tdbb *,TextType,UCHAR*,USHORT,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_sleuth_merge)))
|
||||
(tdbb,tt,a,b,c,d,e,f);
|
||||
}
|
||||
|
||||
|
||||
USHORT getType() const {
|
||||
assert(tt);
|
||||
return tt->texttype_type;
|
||||
}
|
||||
|
||||
const char *getName() const {
|
||||
assert(tt);
|
||||
return tt->texttype_name;
|
||||
}
|
||||
|
||||
CHARSET_ID getCharSet() const {
|
||||
assert(tt);
|
||||
return tt->texttype_character_set;
|
||||
}
|
||||
|
||||
SSHORT getCountry() const {
|
||||
assert(tt);
|
||||
return tt->texttype_country;
|
||||
}
|
||||
|
||||
UCHAR getBytesPerChar() const {
|
||||
assert(tt);
|
||||
return tt->texttype_bytes_per_char;
|
||||
}
|
||||
friend bool operator ==(const TextType& tt1, const TextType& tt2);
|
||||
friend bool operator !=(const TextType& tt1, const TextType& tt2);
|
||||
|
||||
private:
|
||||
struct texttype *tt;
|
||||
};
|
||||
|
||||
class TextTypeNC : public TextType
|
||||
{
|
||||
public:
|
||||
TextTypeNC(unsigned short type, const char *name, CHARSET_ID cs_id,
|
||||
short country, unsigned char bpc) :
|
||||
TextType(type, name, cs_id, country, bpc)
|
||||
{}
|
||||
|
||||
unsigned short to_wc(UCS2_CHAR*, // destination buffer
|
||||
unsigned short, // length of the destination buffer in bytes
|
||||
unsigned char*, // source buffer
|
||||
unsigned short, // length of source buffer in bytes
|
||||
short*, // variable to return error code
|
||||
unsigned short*); // variable to return offset of the first
|
||||
// unprocessed char
|
||||
unsigned short contains(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short like(TDBB, unsigned char*,
|
||||
short,
|
||||
unsigned char*,
|
||||
short,
|
||||
short);
|
||||
unsigned short matches(TDBB, unsigned char*, short,
|
||||
unsigned char*, short);
|
||||
unsigned short sleuth_check(TDBB, unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short sleuth_merge(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short mbtowc(UCS2_CHAR*, unsigned char*, unsigned short);
|
||||
};
|
||||
|
||||
class TextTypeWC : public TextType
|
||||
{
|
||||
public:
|
||||
TextTypeWC(unsigned short type, const char *name, CHARSET_ID cs_id,
|
||||
short country, unsigned char bpc) :
|
||||
TextType(type, name, cs_id, country, bpc)
|
||||
{}
|
||||
|
||||
unsigned short to_wc(UCS2_CHAR*, // destination buffer
|
||||
unsigned short, // length of the destination buffer in bytes
|
||||
unsigned char*, // source buffer
|
||||
unsigned short, // length of source buffer in bytes
|
||||
short*, // variable to return error code
|
||||
unsigned short*); // variable to return offset of the first
|
||||
// unprocessed char
|
||||
unsigned short contains(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short like(TDBB, unsigned char*,
|
||||
short,
|
||||
unsigned char*,
|
||||
short,
|
||||
short);
|
||||
unsigned short matches(TDBB, unsigned char*, short,
|
||||
unsigned char*, short);
|
||||
unsigned short sleuth_check(TDBB, unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short sleuth_merge(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short mbtowc(UCS2_CHAR*, unsigned char*, unsigned short);
|
||||
};
|
||||
|
||||
class TextTypeMB : public TextType
|
||||
{
|
||||
public:
|
||||
TextTypeMB(unsigned short type, const char *name, CHARSET_ID cs_id,
|
||||
short country, unsigned char bpc) :
|
||||
TextType(type, name, cs_id, country, bpc)
|
||||
{}
|
||||
|
||||
unsigned short contains(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short like(TDBB, unsigned char*,
|
||||
short,
|
||||
unsigned char*,
|
||||
short,
|
||||
short);
|
||||
unsigned short matches(TDBB, unsigned char*, short,
|
||||
unsigned char*, short);
|
||||
unsigned short sleuth_check(TDBB, unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short sleuth_merge(TDBB, unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short);
|
||||
unsigned short mbtowc(UCS2_CHAR*, unsigned char*, unsigned short);
|
||||
};
|
||||
|
||||
#define TEXTTYPE_init 1 /* object has been init'ed */
|
||||
#define TEXTTYPE_reverse_secondary 2 /* Reverse order of secondary keys */
|
||||
#define TEXTTYPE_ignore_specials 4 /* Do not put special values in keys */
|
||||
#define TEXTTYPE_expand_before 8 /* Expansion weights before litagure */
|
||||
static inline bool operator ==(const TextType& tt1, const TextType& tt2) {
|
||||
return tt1.tt == tt2.tt;
|
||||
}
|
||||
|
||||
static inline bool operator !=(const TextType& tt1, const TextType& tt2) {
|
||||
return tt1.tt != tt2.tt;
|
||||
}
|
||||
|
||||
class CsConvert
|
||||
{
|
||||
public:
|
||||
CsConvert(short id, const char *name, CHARSET_ID from, CHARSET_ID to) :
|
||||
csconvert_id(id),
|
||||
csconvert_name(name),
|
||||
csconvert_from(from),
|
||||
csconvert_to(to)
|
||||
{}
|
||||
CsConvert(struct csconvert *_cnvt) : cnvt(_cnvt) {}
|
||||
CsConvert(CsConvert& obj) : cnvt(obj.cnvt) {}
|
||||
|
||||
virtual unsigned short convert(unsigned char*,
|
||||
unsigned short,
|
||||
unsigned char*,
|
||||
unsigned short,
|
||||
short*,
|
||||
unsigned short*) = 0;
|
||||
USHORT convert(UCHAR *a,
|
||||
USHORT b,
|
||||
UCHAR *c,
|
||||
USHORT d,
|
||||
SSHORT *e,
|
||||
USHORT *f)
|
||||
{
|
||||
assert(cnvt != NULL);
|
||||
return (*(reinterpret_cast<USHORT (*)(struct csconvert*, UCHAR*,USHORT,
|
||||
UCHAR*,USHORT,short*,USHORT*)>(cnvt->csconvert_convert)))
|
||||
(cnvt,a,b,c,d,e,f);
|
||||
}
|
||||
|
||||
//unsigned short getVersion() { return csconvert_version; }
|
||||
//unsigned short getFlags() { return csconvert_flags; }
|
||||
short getId() { return csconvert_id; }
|
||||
const signed char *getName() { return (const signed char*)csconvert_name; }
|
||||
CHARSET_ID getFromCS() { return csconvert_from; }
|
||||
CHARSET_ID getToCS() { return csconvert_to; }
|
||||
|
||||
protected:
|
||||
short csconvert_id;
|
||||
const char *csconvert_name;
|
||||
CHARSET_ID csconvert_from;
|
||||
CHARSET_ID csconvert_to;
|
||||
SSHORT getId() const { assert(cnvt); return cnvt->csconvert_id; }
|
||||
const char *getName() const { assert(cnvt); return cnvt->csconvert_name; }
|
||||
CHARSET_ID getFromCS() const { assert(cnvt); return cnvt->csconvert_from; }
|
||||
CHARSET_ID getToCS() const { assert(cnvt); return cnvt->csconvert_to; }
|
||||
friend bool operator ==(const CsConvert& cv1, const CsConvert& cv2);
|
||||
friend bool operator !=(const CsConvert& cv1, const CsConvert& cv2);
|
||||
private:
|
||||
struct csconvert *cnvt;
|
||||
};
|
||||
|
||||
/* values for csconvert_flags */
|
||||
|
||||
#define CONVERTTYPE_init 1 /* object has been init'ed */
|
||||
|
||||
/* Conversion error codes */
|
||||
|
||||
#define CS_TRUNCATION_ERROR 1 /* output buffer too small */
|
||||
#define CS_CONVERT_ERROR 2 /* can't remap a character */
|
||||
#define CS_BAD_INPUT 3 /* input string detected as bad */
|
||||
|
||||
#define CS_CANT_MAP 0 /* Flag table entries that don't map */
|
||||
|
||||
|
||||
|
||||
static inline bool operator ==(const CsConvert& cv1, const CsConvert& cv2) {
|
||||
return cv1.cnvt == cv2.cnvt;
|
||||
}
|
||||
|
||||
static inline bool operator !=(const CsConvert& cv1, const CsConvert& cv2) {
|
||||
return cv1.cnvt != cv2.cnvt;
|
||||
}
|
||||
|
||||
class CharSet
|
||||
{
|
||||
public:
|
||||
CharSet(CHARSET_ID id, const char *name, unsigned char mnBpc, unsigned char mxBpc,
|
||||
unsigned char spLen, const char *spc) :
|
||||
charset_id(id),
|
||||
charset_name(name),
|
||||
charset_min_bytes_per_char(mnBpc),
|
||||
charset_max_bytes_per_char(mxBpc),
|
||||
charset_space_length(spLen),
|
||||
charset_space_character(spc),
|
||||
charset_to_unicode(0),
|
||||
charset_from_unicode(0)
|
||||
{}
|
||||
CharSet(struct charset *_cs) : cs(_cs) {}
|
||||
CharSet(CharSet &obj) : cs(obj.cs) {};
|
||||
|
||||
virtual ~CharSet()
|
||||
{ delete charset_to_unicode; delete charset_from_unicode; }
|
||||
CHARSET_ID getId() const { assert(cs); return cs->charset_id; }
|
||||
const char *getName() const { assert(cs); return cs->charset_name; }
|
||||
UCHAR minBytesPerChar() const { assert(cs); return cs->charset_min_bytes_per_char; }
|
||||
UCHAR maxBytesPerChar() const { assert(cs); return cs->charset_max_bytes_per_char; }
|
||||
UCHAR getSpaceLength() const { assert(cs); return cs->charset_space_length; }
|
||||
const UCHAR *getSpace() const { assert(cs); return cs->charset_space_character; }
|
||||
|
||||
//unsigned short getVersion() { return charset_version; }
|
||||
//unsigned short getFlags() { return charset_flags; }
|
||||
CHARSET_ID getId() { return charset_id; }
|
||||
const signed char *getName() { return (const signed char*)charset_name; }
|
||||
unsigned char minBytesPerChar() { return charset_min_bytes_per_char; }
|
||||
unsigned char maxBytesPerChar() { return charset_max_bytes_per_char; }
|
||||
unsigned char getSpaceLength() { return charset_space_length; }
|
||||
const unsigned char *getSpace() { return (const unsigned char*)charset_space_character; }
|
||||
|
||||
CsConvert *getConvToUnicode() { return charset_to_unicode; }
|
||||
CsConvert *getConvFromUnicode() { return charset_from_unicode; }
|
||||
CsConvert getConvToUnicode() { assert(cs); return &cs->charset_to_unicode; }
|
||||
CsConvert getConvFromUnicode() { assert(cs); return &cs->charset_from_unicode; }
|
||||
|
||||
protected:
|
||||
CHARSET_ID charset_id;
|
||||
const char *charset_name;
|
||||
unsigned char charset_min_bytes_per_char;
|
||||
unsigned char charset_max_bytes_per_char;
|
||||
unsigned char charset_space_length;
|
||||
const char *charset_space_character;
|
||||
|
||||
CsConvert *charset_to_unicode;
|
||||
CsConvert *charset_from_unicode;
|
||||
|
||||
/* These need to be moved elsewhere. They don't belong in this interface
|
||||
VEC charset_converters;
|
||||
VEC charset_collations;
|
||||
*/
|
||||
friend bool operator ==(const CharSet& cs1, const CharSet& cs2);
|
||||
friend bool operator !=(const CharSet& cs1, const CharSet& cs2);
|
||||
private:
|
||||
struct charset *cs;
|
||||
};
|
||||
|
||||
/* values for charset_flags */
|
||||
static inline bool operator ==(const CharSet& cs1, const CharSet& cs2) {
|
||||
return cs1.cs == cs2.cs;
|
||||
}
|
||||
|
||||
#define CHARSET_init 1
|
||||
#define CHARSET_narrow 2
|
||||
#define CHARSET_multi 4
|
||||
#define CHARSET_wide 8
|
||||
|
||||
|
||||
typedef CharSet *(*CharSetAllocFunc)(MemoryPool&, CHARSET_ID, CHARSET_ID);
|
||||
typedef TextType *(*TextTypeAllocFunc)(MemoryPool&, CHARSET_ID, CHARSET_ID);
|
||||
typedef CsConvert *(*CsConvertAllocFunc)(MemoryPool&, CHARSET_ID, CHARSET_ID);
|
||||
static inline bool operator !=(const CharSet& cs1, const CharSet& cs2) {
|
||||
return cs1.cs != cs2.cs;
|
||||
}
|
||||
|
||||
#endif /* JRD_INTL_CLASSES_H */
|
||||
|
@ -26,34 +26,35 @@
|
||||
|
||||
#include "../jrd/intl_classes.h"
|
||||
|
||||
CHARSET_ID INTL_charset(TDBB, USHORT, FPTR_VOID);
|
||||
int INTL_compare(TDBB, const struct dsc*, const struct dsc*, FPTR_VOID);
|
||||
CHARSET_ID INTL_charset(TDBB, USHORT, FPTR_STATUS);
|
||||
int INTL_compare(TDBB, const struct dsc*, const struct dsc*, FPTR_STATUS);
|
||||
USHORT INTL_convert_bytes(TDBB, CHARSET_ID, UCHAR *, USHORT, CHARSET_ID,
|
||||
BYTE *, USHORT, FPTR_VOID);
|
||||
CsConvert* INTL_convert_lookup(TDBB, CHARSET_ID, CHARSET_ID);
|
||||
int INTL_convert_string(struct dsc*, const struct dsc*, FPTR_VOID);
|
||||
BYTE *, USHORT, FPTR_STATUS);
|
||||
CsConvert INTL_convert_lookup(TDBB, CHARSET_ID, CHARSET_ID);
|
||||
int INTL_convert_string(struct dsc*, const struct dsc*, FPTR_STATUS);
|
||||
int INTL_data(const struct dsc*);
|
||||
int INTL_data_or_binary(const struct dsc*);
|
||||
int INTL_defined_type(TDBB, ISC_STATUS *, SSHORT);
|
||||
//SSHORT INTL_fss_mbtowc(struct texttype **, unsigned short *,
|
||||
// unsigned char *, USHORT);
|
||||
//USHORT INTL_fss_to_unicode(CsConvert *, USHORT *,
|
||||
// USHORT, unsigned char *, USHORT,
|
||||
// SSHORT *, USHORT *);
|
||||
unsigned short INTL_getch(TDBB, TextType**, SSHORT,
|
||||
unsigned short INTL_getch(TDBB, TextType*, SSHORT,
|
||||
UCHAR **, USHORT *);
|
||||
void INTL_init(TDBB);
|
||||
USHORT INTL_key_length(TDBB, USHORT, USHORT);
|
||||
CharSet* INTL_charset_lookup(TDBB tdbb, SSHORT parm1, ISC_STATUS * status);
|
||||
TextType* INTL_texttype_lookup(TDBB tdbb, SSHORT parm1, FPTR_VOID err,
|
||||
CharSet INTL_charset_lookup(TDBB tdbb, SSHORT parm1, ISC_STATUS * status);
|
||||
TextType INTL_texttype_lookup(TDBB tdbb, SSHORT parm1, FPTR_STATUS err,
|
||||
ISC_STATUS * status);
|
||||
//void* INTL_obj_lookup(TDBB, USHORT, SSHORT, FPTR_VOID, ISC_STATUS *);
|
||||
void INTL_pad_spaces(TDBB, struct dsc *, UCHAR *, USHORT);
|
||||
USHORT INTL_string_to_key(TDBB, USHORT, struct dsc *, struct dsc *, USHORT);
|
||||
int INTL_str_to_upper(TDBB, struct dsc *);
|
||||
//USHORT INTL_unicode_to_fss(CsConvert *, unsigned char *, USHORT,
|
||||
// USHORT *, USHORT, SSHORT *, USHORT *);
|
||||
UCHAR INTL_upper(TDBB, USHORT, UCHAR);
|
||||
|
||||
// Built-in charsets interface
|
||||
FPTR_SHORT INTL_builtin_lookup(USHORT, SSHORT, SSHORT);
|
||||
SSHORT INTL_builtin_nc_mbtowc(TEXTTYPE obj,
|
||||
WCHAR * wc, UCHAR * ptr, USHORT count);
|
||||
SSHORT INTL_builtin_mb_mbtowc(TEXTTYPE obj,
|
||||
WCHAR * wc, UCHAR * ptr, USHORT count);
|
||||
SSHORT INTL_builtin_wc_mbtowc(TEXTTYPE obj,
|
||||
WCHAR * wc, UCHAR * ptr, USHORT count);
|
||||
|
||||
#endif // JRD_INTL_PROTO_H
|
||||
|
||||
|
@ -31,21 +31,21 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define USHORT unsigned short
|
||||
#define SSHORT short
|
||||
#define UCHAR unsigned char
|
||||
#define CHAR char
|
||||
#define SCHAR char
|
||||
#define ULONG unsigned long
|
||||
#define LONG long
|
||||
#define SLONG signed long
|
||||
#define VEC void*
|
||||
#define BYTE unsigned char
|
||||
#ifndef INCLUDE_FB_TYPES_H
|
||||
typedef unsigned short USHORT;
|
||||
typedef short SSHORT;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef char CHAR;
|
||||
typedef char SCHAR;
|
||||
typedef unsigned char BYTE;
|
||||
|
||||
/* duplicate definition from flu.c */
|
||||
#pragma FB_COMPILER_MESSAGE("64-bit readiness problem!")
|
||||
typedef unsigned long ULONG;
|
||||
typedef long LONG;
|
||||
typedef signed long SLONG;
|
||||
#endif
|
||||
|
||||
typedef SSHORT(*FPTR_short) ();
|
||||
#ifndef INTL_ENGINE_INTERNAL
|
||||
typedef USHORT(*FPTR_SHORT) ();
|
||||
|
||||
typedef SSHORT CHARSET_ID;
|
||||
@ -55,12 +55,14 @@ typedef SCHAR ASCII;
|
||||
typedef unsigned char NCHAR; /* Narrow Char */
|
||||
typedef unsigned short UCS2_CHAR; /* Not very Wide Char */
|
||||
typedef unsigned char MBCHAR; /* Multibyte Char */
|
||||
typedef class vec* VEC;
|
||||
|
||||
#define type_texttype 54
|
||||
#define type_charset 55
|
||||
#define type_csconvert 56
|
||||
|
||||
#define MAX_KEY 256
|
||||
#ifndef JRD_CONSTANTS_H
|
||||
#define MAX_KEY 256
|
||||
#endif
|
||||
|
||||
typedef struct intl_blk {
|
||||
@ -98,12 +100,17 @@ typedef struct texttype {
|
||||
FPTR_SHORT texttype_fn_to_lower; /* One ch to lowercase */
|
||||
FPTR_short texttype_fn_str_to_upper; /* Convert string to uppercase */
|
||||
FPTR_SHORT texttype_fn_to_wc; /* convert string to wc */
|
||||
|
||||
// INTERNAL FUNCTIONS - do not implement in collation drivers !
|
||||
FPTR_SHORT texttype_fn_contains; /* s1 contains s2? */
|
||||
FPTR_SHORT texttype_fn_like; /* s1 like s2? */
|
||||
FPTR_SHORT texttype_fn_matches; /* s1 matches s2 */
|
||||
FPTR_SHORT texttype_fn_sleuth_check; /* s1 sleuth s2 */
|
||||
FPTR_SHORT texttype_fn_sleuth_merge; /* aux function for sleuth */
|
||||
//\\ END OF INTERNAL FUNCTIONS
|
||||
|
||||
FPTR_short texttype_fn_mbtowc; /* get next character */
|
||||
|
||||
BYTE *texttype_collation_table;
|
||||
BYTE *texttype_toupper_table;
|
||||
BYTE *texttype_tolower_table;
|
||||
|
@ -54,7 +54,7 @@ int MOV_compare(const dsc* arg1, const dsc* arg2)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT2_compare(arg1, arg2, (FPTR_VOID) ERR_post);
|
||||
return CVT2_compare(arg1, arg2, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ double MOV_date_to_double(const dsc* desc)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_date_to_double(desc, (FPTR_VOID) ERR_post);
|
||||
return CVT_date_to_double(desc, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ void MOV_double_to_date(double real, SLONG fixed[2])
|
||||
*
|
||||
**************************************/
|
||||
|
||||
CVT_double_to_date(real, fixed, (FPTR_VOID) ERR_post);
|
||||
CVT_double_to_date(real, fixed, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -298,7 +298,7 @@ double MOV_get_double(const dsc* desc)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_double(desc, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_double(desc, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -316,7 +316,7 @@ SLONG MOV_get_long(const dsc* desc, SSHORT scale)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_long(desc, scale, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_long(desc, scale, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -334,7 +334,7 @@ SINT64 MOV_get_int64(const dsc* desc, SSHORT scale)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_int64(desc, scale, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_int64(desc, scale, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -356,7 +356,7 @@ void MOV_get_metadata_str(const dsc* desc, TEXT* buffer, USHORT buffer_length)
|
||||
UCHAR *ptr;
|
||||
|
||||
USHORT length = CVT_get_string_ptr(desc, &dummy_type, &ptr,
|
||||
NULL, 0, (FPTR_VOID) ERR_post);
|
||||
NULL, 0, ERR_post);
|
||||
|
||||
#ifdef DEV_BUILD
|
||||
if ((dummy_type != ttype_metadata) &&
|
||||
@ -383,7 +383,7 @@ void MOV_get_name(const dsc* desc, TEXT* string)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
CVT2_get_name(desc, string, (FPTR_VOID) ERR_post);
|
||||
CVT2_get_name(desc, string, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -401,7 +401,7 @@ SQUAD MOV_get_quad(const dsc* desc, SSHORT scale)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_quad(desc, scale, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_quad(desc, scale, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -427,8 +427,7 @@ int MOV_get_string_ptr(
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_string_ptr(desc, ttype, address, temp, length,
|
||||
(FPTR_VOID) ERR_post);
|
||||
return CVT_get_string_ptr(desc, ttype, address, temp, length, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -462,7 +461,7 @@ GDS_DATE MOV_get_sql_date(const dsc* desc)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_sql_date(desc, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_sql_date(desc, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -479,7 +478,7 @@ GDS_TIME MOV_get_sql_time(const dsc* desc)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_sql_time(desc, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_sql_time(desc, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -496,7 +495,7 @@ GDS_TIMESTAMP MOV_get_timestamp(const dsc* desc)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_get_timestamp(desc, (FPTR_VOID) ERR_post);
|
||||
return CVT_get_timestamp(desc, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -525,8 +524,7 @@ int MOV_make_string(const dsc* desc,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT_make_string(desc, ttype, address, temp, length,
|
||||
(FPTR_VOID) ERR_post);
|
||||
return CVT_make_string(desc, ttype, address, temp, length, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -556,8 +554,7 @@ int MOV_make_string2(
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return CVT2_make_string2(desc, ttype, address, temp, length, ptr,
|
||||
(FPTR_VOID) ERR_post);
|
||||
return CVT2_make_string2(desc, ttype, address, temp, length, ptr, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
@ -574,7 +571,7 @@ void MOV_move(const dsc* from, dsc* to)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
CVT_move(from, to, (FPTR_VOID) ERR_post);
|
||||
CVT_move(from, to, ERR_post);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6155,7 +6155,7 @@ static JRD_NOD optimize_like(TDBB tdbb, JRD_NOD like_node)
|
||||
USHORT ch, escape_ch;
|
||||
USHORT p_count;
|
||||
UCHAR tmp_buffer[32]; /* large enough to hold 1 ch of escape string */
|
||||
TextType *text_obj;
|
||||
TextType text_obj = NULL;
|
||||
SET_TDBB(tdbb);
|
||||
DEV_BLKCHK(like_node, type_nod);
|
||||
JRD_NOD search_node = like_node->nod_arg[1];
|
||||
@ -6173,7 +6173,6 @@ static JRD_NOD optimize_like(TDBB tdbb, JRD_NOD like_node)
|
||||
(escape_node && escape_desc->dsc_dtype > dtype_any_text))
|
||||
return NULL;
|
||||
/* Get the escape character, if any */
|
||||
text_obj = NULL;
|
||||
if (escape_node)
|
||||
{
|
||||
/* Ensure escape string is same character set as search string
|
||||
|
@ -1382,7 +1382,7 @@ static JRD_NOD par_literal(TDBB tdbb, CSB csb)
|
||||
l = BLR_WORD;
|
||||
q = csb->csb_running;
|
||||
dtype =
|
||||
CVT_get_numeric(q, l, &scale, (double *) p, (FPTR_VOID) ERR_post);
|
||||
CVT_get_numeric(q, l, &scale, (double *) p, ERR_post);
|
||||
literal->lit_desc.dsc_dtype = dtype;
|
||||
if (dtype == dtype_double)
|
||||
literal->lit_desc.dsc_length = sizeof(double);
|
||||
|
@ -34,11 +34,7 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#pragma FB_COMPILER_MESSAGE("Fix this! Ugly function pointer cast!")
|
||||
typedef void (*pfn_quad_private_cludge) (int, int);
|
||||
|
||||
|
||||
SQUAD QUAD_add(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
SQUAD QUAD_add(SQUAD * arg1, SQUAD * arg2, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -51,7 +47,7 @@ SQUAD QUAD_add(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
reinterpret_cast < pfn_quad_private_cludge > (err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
(*err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
/* IBERROR (224); *//* msg 224 quad word arithmetic not supported */
|
||||
|
||||
SQUAD temp = { 0, 0 };
|
||||
@ -84,7 +80,7 @@ SSHORT QUAD_compare(SQUAD * arg1, SQUAD * arg2)
|
||||
}
|
||||
|
||||
|
||||
SQUAD QUAD_from_double(double *d, FPTR_VOID err)
|
||||
SQUAD QUAD_from_double(double *d, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -97,7 +93,7 @@ SQUAD QUAD_from_double(double *d, FPTR_VOID err)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
reinterpret_cast < pfn_quad_private_cludge > (err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
(*err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
/* BUGCHECK (190); *//* msg 190 conversion not supported for */
|
||||
/* specified data types */
|
||||
|
||||
@ -107,7 +103,7 @@ SQUAD QUAD_from_double(double *d, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
SQUAD QUAD_multiply(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
SQUAD QUAD_multiply(SQUAD * arg1, SQUAD * arg2, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -120,7 +116,7 @@ SQUAD QUAD_multiply(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
reinterpret_cast < pfn_quad_private_cludge > (err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
(*err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
/* IBERROR (224); *//* msg 224 quad word arithmetic not supported */
|
||||
|
||||
SQUAD temp = { 0, 0 };
|
||||
@ -128,7 +124,7 @@ SQUAD QUAD_multiply(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
SQUAD QUAD_negate(SQUAD * arg1, FPTR_VOID err)
|
||||
SQUAD QUAD_negate(SQUAD * arg1, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -141,7 +137,7 @@ SQUAD QUAD_negate(SQUAD * arg1, FPTR_VOID err)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
reinterpret_cast < pfn_quad_private_cludge > (err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
(*err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
/* IBERROR (224); *//* msg 224 quad word arithmetic not supported */
|
||||
|
||||
SQUAD temp = { 0, 0 };
|
||||
@ -149,7 +145,7 @@ SQUAD QUAD_negate(SQUAD * arg1, FPTR_VOID err)
|
||||
}
|
||||
|
||||
|
||||
SQUAD QUAD_subtract(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
SQUAD QUAD_subtract(SQUAD * arg1, SQUAD * arg2, FPTR_STATUS err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -162,7 +158,7 @@ SQUAD QUAD_subtract(SQUAD * arg1, SQUAD * arg2, FPTR_VOID err)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
reinterpret_cast < pfn_quad_private_cludge > (err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
(*err) (gds_badblk, 0); /* not really badblk, but internal error */
|
||||
/* IBERROR (224); *//* msg 224 quad word arithmetic not supported */
|
||||
|
||||
SQUAD temp = { 0, 0 };
|
||||
|
@ -42,12 +42,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SQUAD QUAD_add(SQUAD *, SQUAD *, FPTR_VOID);
|
||||
SQUAD QUAD_add(SQUAD *, SQUAD *, FPTR_STATUS);
|
||||
SSHORT QUAD_compare(SQUAD *, SQUAD *);
|
||||
SQUAD QUAD_from_double(double *, FPTR_VOID);
|
||||
SQUAD QUAD_multiply(SQUAD *, SQUAD *, FPTR_VOID);
|
||||
SQUAD QUAD_negate(SQUAD *, FPTR_VOID);
|
||||
SQUAD QUAD_subtract(SQUAD *, SQUAD *, FPTR_VOID);
|
||||
SQUAD QUAD_from_double(double *, FPTR_STATUS);
|
||||
SQUAD QUAD_multiply(SQUAD *, SQUAD *, FPTR_STATUS);
|
||||
SQUAD QUAD_negate(SQUAD *, FPTR_STATUS);
|
||||
SQUAD QUAD_subtract(SQUAD *, SQUAD *, FPTR_STATUS);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
@ -6211,7 +6211,7 @@ static ISC_STATUS mov_dsql_message( UCHAR* from_msg,
|
||||
to = *to_desc;
|
||||
from.dsc_address = from_msg + (SLONG) from.dsc_address;
|
||||
to.dsc_address = to_msg + (SLONG) to.dsc_address;
|
||||
CVT_move(&from, &to, (FPTR_VOID) move_error);
|
||||
CVT_move(&from, &to, move_error);
|
||||
}
|
||||
|
||||
} // try
|
||||
|
Loading…
Reference in New Issue
Block a user