8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:43:04 +01:00

sdl is a plain char again. Some cleanup around it

This commit is contained in:
aafemt 2003-07-24 10:21:42 +00:00
parent cb6654dccd
commit b672867147
21 changed files with 135 additions and 144 deletions

View File

@ -36,7 +36,7 @@
*/
/*
$Id: backup.epp,v 1.25 2003-07-17 11:49:04 eku Exp $
$Id: backup.epp,v 1.26 2003-07-24 10:21:38 aafemt Exp $
*/
#include "firebird.h"
@ -1120,8 +1120,9 @@ static void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
ULONG return_length, slice_length;
SLONG *returned_range, range_buffer[16]; /* enough for 16 dimensions */
LSTRING xdr_buffer, xdr_slice;
UCHAR blr_buffer[200]; /* enough for a sdl with 16 dimensions */
UCHAR *blr, *slice, *p;
char blr_buffer[200]; /* enough for a sdl with 16 dimensions */
char *blr;
UCHAR *slice, *p;
USHORT blr_length, count, field_length;
TGBL tdgbl;
@ -1194,7 +1195,7 @@ static void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
#ifdef DEBUG
if (debug_on)
PRETTY_print_sdl((SCHAR*) blr_buffer, NULL, NULL, 0);
PRETTY_print_sdl(blr_buffer, NULL, NULL, 0);
#endif
blr_length = blr - blr_buffer;
@ -1227,7 +1228,7 @@ static void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
/* msg 81 error accessing blob field %s -- continuing */
BURP_print_status(status_vector);
#ifdef DEBUG
PRETTY_print_sdl((SCHAR*) blr_buffer, NULL, NULL, 0);
PRETTY_print_sdl(blr_buffer, NULL, NULL, 0);
#endif
return;
}

View File

@ -29,7 +29,7 @@ extern "C" {
#endif
extern ULONG CAN_encode_decode (struct burp_rel *, struct lstring *, UCHAR *, int);
extern ULONG CAN_slice (struct lstring *, struct lstring *, int, USHORT, UCHAR *);
extern ULONG CAN_slice (struct lstring *, struct lstring *, int, USHORT, char *);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -28,7 +28,7 @@
*
*/
/*
$Id: canonical.cpp,v 1.20 2003-04-16 10:16:39 aafemt Exp $
$Id: canonical.cpp,v 1.21 2003-07-24 10:21:38 aafemt Exp $
*/
#include "firebird.h"
@ -66,7 +66,7 @@ static bool_t expand_buffer(XDR*);
static bool_t xdr_datum(XDR*, DSC*, UCHAR*);
static bool_t xdr_quad(XDR*, SLONG*);
static int xdr_init(XDR*, LSTRING*, enum xdr_op);
static bool_t xdr_slice(XDR*, LSTRING*, USHORT, UCHAR*);
static bool_t xdr_slice(XDR*, LSTRING*, USHORT, char*);
static xdr_t::xdr_ops burp_ops =
{
@ -231,7 +231,7 @@ ULONG CAN_slice(LSTRING * buffer,
LSTRING * slice,
bool_t direction,
USHORT sdl_length,
UCHAR * sdl)
char * sdl)
{
/**************************************
*
@ -655,7 +655,7 @@ static int xdr_init( XDR * xdrs, LSTRING * buffer, enum xdr_op x_op)
static bool_t xdr_slice(XDR* xdrs,
LSTRING* slice,
USHORT sdl_length,
UCHAR* sdl)
char* sdl)
{
/**************************************
*

View File

@ -24,7 +24,7 @@
*
*/
/*
$Id: restore.epp,v 1.31 2003-06-30 10:42:49 brodsom Exp $
$Id: restore.epp,v 1.32 2003-07-24 10:21:38 aafemt Exp $
*/
#include "firebird.h"
@ -1405,7 +1405,7 @@ SLONG *blob_id, return_length, slice_length, *range, *end_ranges,
lcount;
USHORT blr_length, count, field_number, field_length;
UCHAR *buffer, *p;
SCHAR *blr, blr_buffer [200]; /* enough for a sdl with 16 dimensions */
char *blr, blr_buffer [200]; /* enough for a sdl with 16 dimensions */
LSTRING xdr_buffer, xdr_slice;
UCHAR scan_next_attr;
TGBL tdgbl;
@ -1726,7 +1726,7 @@ if (return_length != slice_length)
(void) GET_BLOCK (p, lcount);
if (tdgbl->gbl_sw_transportable)
CAN_slice (&xdr_buffer, &xdr_slice, FALSE, blr_length, (UCHAR*) blr_buffer);
CAN_slice (&xdr_buffer, &xdr_slice, FALSE, blr_length, blr_buffer);
}
if (isc_put_slice (status_vector,
@ -1849,7 +1849,7 @@ else
(void) GET_BLOCK (p, lcount);
if (tdgbl->gbl_sw_transportable)
CAN_slice (&xdr_buffer, &xdr_slice, FALSE, blr_length, (UCHAR*) blr_buffer);
CAN_slice (&xdr_buffer, &xdr_slice, FALSE, blr_length, blr_buffer);
if (isc_put_slice (status_vector,

View File

@ -45,9 +45,9 @@ DATABASE DB = STATIC FILENAME "yachts.lnk";
#define ARRAY_DESC_COLUMN_MAJOR 1 /* Set for FORTRAN */
typedef struct gen {
SCHAR *gen_sdl;
SCHAR **gen_sdl_ptr;
SCHAR *gen_end;
char *gen_sdl;
char **gen_sdl_ptr;
char *gen_end;
ISC_STATUS *gen_status;
SSHORT gen_internal;
} *GEN;
@ -56,13 +56,13 @@ static void adjust_length(ISC_ARRAY_DESC *);
static void copy_exact_name (char *, char*, SSHORT);
static ISC_STATUS copy_status(ISC_STATUS *, ISC_STATUS *);
static ISC_STATUS error(ISC_STATUS *, SSHORT, ...);
static ISC_STATUS gen_sdl(ISC_STATUS *, ISC_ARRAY_DESC *, SSHORT *, SCHAR **,
static ISC_STATUS gen_sdl(ISC_STATUS *, ISC_ARRAY_DESC *, SSHORT *, char **,
SSHORT *, BOOLEAN);
static ISC_STATUS lookup_desc(ISC_STATUS *, FRBRD **, FRBRD **, SCHAR *, SCHAR *,
ISC_ARRAY_DESC *, SCHAR *);
static ISC_STATUS stuff(GEN, SSHORT, ...);
static ISC_STATUS stuff_literal(GEN, SLONG);
static ISC_STATUS stuff_string(GEN, SCHAR, SCHAR *);
static ISC_STATUS stuff_string(GEN, char, char *);
/* STUFF_SDL used in place of STUFF to avoid confusion with BLR STUFF
macro defined in dsql.h */
@ -75,7 +75,7 @@ static ISC_STATUS stuff_string(GEN, SCHAR, SCHAR *);
ISC_STATUS API_ROUTINE isc_array_gen_sdl(ISC_STATUS * status,
ISC_ARRAY_DESC * desc,
SSHORT * sdl_buffer_length,
SCHAR * sdl_buffer, SSHORT * sdl_length)
char * sdl_buffer, SSHORT * sdl_length)
{
/**************************************
*
@ -108,7 +108,7 @@ ISC_STATUS API_ROUTINE isc_array_get_slice(ISC_STATUS * status,
* Functional description
*
**************************************/
SCHAR *sdl, sdl_buffer[512];
char *sdl, sdl_buffer[512];
SSHORT sdl_length;
sdl_length = sizeof(sdl_buffer);
@ -204,7 +204,7 @@ ISC_STATUS API_ROUTINE isc_array_put_slice(ISC_STATUS * status,
* Functional description
*
**************************************/
SCHAR *sdl, sdl_buffer[512];
char *sdl, sdl_buffer[512];
SSHORT sdl_length;
sdl_length = sizeof(sdl_buffer);
@ -387,7 +387,7 @@ static ISC_STATUS error( ISC_STATUS * status, SSHORT count, ...)
static ISC_STATUS gen_sdl(ISC_STATUS * status,
ISC_ARRAY_DESC * desc,
SSHORT * sdl_buffer_length,
SCHAR ** sdl_buffer,
char ** sdl_buffer,
SSHORT * sdl_length, BOOLEAN internal_flag)
{
/**************************************
@ -562,7 +562,7 @@ static ISC_STATUS stuff( GEN gen, SSHORT count, ...)
* Stuff a SDL byte.
*
**************************************/
SCHAR c, *new_sdl;
char c, *new_sdl;
va_list ptr;
SSHORT new_len, current_len;
@ -575,7 +575,7 @@ static ISC_STATUS stuff( GEN gen, SSHORT count, ...)
/* The sdl buffer is too small. Allocate a larger one. */
new_len = gen->gen_end - *gen->gen_sdl_ptr + 512 + count;
new_sdl = (SCHAR *) gds__alloc((SLONG) new_len);
new_sdl = (char *) gds__alloc(new_len);
if (!new_sdl)
return error(gen->gen_status, 5, (ISC_STATUS) gds_misc_interpreted,
(ISC_STATUS) gds_arg_string,
@ -631,7 +631,7 @@ static ISC_STATUS stuff_literal( GEN gen, SLONG literal)
}
static ISC_STATUS stuff_string( GEN gen, SCHAR sdl, SCHAR * string)
static ISC_STATUS stuff_string( GEN gen, char sdl, char * string)
{
/**************************************
*

View File

@ -25,7 +25,7 @@
#define _DSQL_ARRAY_PROTO_H_
extern ISC_STATUS API_ROUTINE isc_array_gen_sdl(ISC_STATUS *, ISC_ARRAY_DESC *,
SSHORT *, SCHAR *, SSHORT *);
SSHORT *, char *, SSHORT *);
extern ISC_STATUS API_ROUTINE isc_array_get_slice(ISC_STATUS *, void **, void **,
GDS_QUAD *, ISC_ARRAY_DESC *,
void *, SLONG *);

View File

@ -36,6 +36,6 @@ extern int PRETTY_print_mblr(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
#ifdef PYXIS
extern int PRETTY_print_menu(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
#endif
extern int PRETTY_print_sdl(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
extern int PRETTY_print_sdl(char *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
#endif /* _GPRE_PRETT_PROTO_H_ */

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: pretty.cpp,v 1.10 2003-04-02 11:49:35 brodsom Exp $
// $Id: pretty.cpp,v 1.11 2003-07-24 10:21:40 aafemt Exp $
//
#include "firebird.h"
@ -419,7 +419,7 @@ PRETTY_print_menu(SCHAR * blr,
#endif
int
PRETTY_print_sdl(SCHAR * blr,
PRETTY_print_sdl(char * blr,
//____________________________________________________________
//
// Pretty print slice description language.

View File

@ -33,7 +33,7 @@
*
*/
/*
$Id: blb.cpp,v 1.30 2003-04-10 06:49:10 aafemt Exp $
$Id: blb.cpp,v 1.31 2003-07-24 10:21:41 aafemt Exp $
*/
#include "firebird.h"
@ -628,7 +628,7 @@ USHORT BLB_get_segment(TDBB tdbb,
SLONG BLB_get_slice(TDBB tdbb,
JRD_TRA transaction,
BID blob_id,
UCHAR * sdl,
char * sdl,
USHORT param_length,
SLONG * param, SLONG slice_length, UCHAR * slice)
{
@ -725,7 +725,7 @@ SLONG BLB_get_slice(TDBB tdbb,
data,
desc,
variables,
reinterpret_cast < void (*)() > (slice_callback),
slice_callback,
reinterpret_cast < struct slice *>(&arg));
dbb->dbb_permanent->deallocate(data);
@ -1330,7 +1330,7 @@ void BLB_put_segment(TDBB tdbb, BLB blob, UCHAR* seg, USHORT segment_length)
void BLB_put_slice( TDBB tdbb,
JRD_TRA transaction,
BID blob_id,
UCHAR* sdl,
char* sdl,
USHORT param_length,
SLONG* param,
SLONG slice_length,
@ -1469,7 +1469,7 @@ void BLB_put_slice( TDBB tdbb,
array->arr_data,
&array_desc->arr_desc,
variables,
reinterpret_cast<void (*)()>(slice_callback),
slice_callback,
&arg))
{
ERR_punt();

View File

@ -54,7 +54,7 @@ void BLB_garbage_collect(TDBB, lls*, lls*, SLONG, jrd_rel*);
blb* BLB_get_array(TDBB, jrd_tra*, bid*, ads*);
SLONG BLB_get_data(TDBB, blb*, UCHAR *, SLONG);
USHORT BLB_get_segment(TDBB, blb*, UCHAR*, USHORT);
SLONG BLB_get_slice(TDBB, jrd_tra*, bid*, UCHAR*, USHORT, SLONG*, SLONG, UCHAR*);
SLONG BLB_get_slice(TDBB, jrd_tra*, bid*, char*, USHORT, SLONG*, SLONG, UCHAR*);
SLONG BLB_lseek(blb*, USHORT, SLONG);
void BLB_move(TDBB, dsc*, dsc*, jrd_nod*);
@ -63,7 +63,7 @@ blb* BLB_open(TDBB, jrd_tra*, bid*);
blb* BLB_open2(TDBB, jrd_tra*, bid*, USHORT,
UCHAR *);
void BLB_put_segment(TDBB, blb*, UCHAR *, USHORT);
void BLB_put_slice(TDBB, jrd_tra*, bid*, UCHAR*, USHORT, SLONG*, SLONG, UCHAR*);
void BLB_put_slice(TDBB, jrd_tra*, bid*, char*, USHORT, SLONG*, SLONG, UCHAR*);
void BLB_release_array(arr*);
void BLB_scalar(TDBB, jrd_tra*, bid*, USHORT, SLONG*, vlu*);
#ifdef __cplusplus

View File

@ -1869,46 +1869,43 @@ const unsigned char gds_dyn_last_dyn_value = 210;
#else /* c++ definitions */
const unsigned char gds_sdl_version1 = 1;
/* Opps, can't set an unsigned value to -1. Used to be:
* const unsigned char gds_sdl_eoc = -1;
*/
const unsigned char gds_sdl_eoc = 0xFF;
const unsigned char gds_sdl_relation = 2;
const unsigned char gds_sdl_rid = 3;
const unsigned char gds_sdl_field = 4;
const unsigned char gds_sdl_fid = 5;
const unsigned char gds_sdl_struct = 6;
const unsigned char gds_sdl_variable = 7;
const unsigned char gds_sdl_scalar = 8;
const unsigned char gds_sdl_tiny_integer = 9;
const unsigned char gds_sdl_short_integer = 10;
const unsigned char gds_sdl_long_integer = 11;
const unsigned char gds_sdl_literal = 12;
const unsigned char gds_sdl_add = 13;
const unsigned char gds_sdl_subtract = 14;
const unsigned char gds_sdl_multiply = 15;
const unsigned char gds_sdl_divide = 16;
const unsigned char gds_sdl_negate = 17;
const unsigned char gds_sdl_eql = 18;
const unsigned char gds_sdl_neq = 19;
const unsigned char gds_sdl_gtr = 20;
const unsigned char gds_sdl_geq = 21;
const unsigned char gds_sdl_lss = 22;
const unsigned char gds_sdl_leq = 23;
const unsigned char gds_sdl_and = 24;
const unsigned char gds_sdl_or = 25;
const unsigned char gds_sdl_not = 26;
const unsigned char gds_sdl_while = 27;
const unsigned char gds_sdl_assignment = 28;
const unsigned char gds_sdl_label = 29;
const unsigned char gds_sdl_leave = 30;
const unsigned char gds_sdl_begin = 31;
const unsigned char gds_sdl_end = 32;
const unsigned char gds_sdl_do3 = 33;
const unsigned char gds_sdl_do2 = 34;
const unsigned char gds_sdl_do1 = 35;
const unsigned char gds_sdl_element = 36;
const char gds_sdl_version1 = 1;
const char gds_sdl_eoc = -1;
const char gds_sdl_relation = 2;
const char gds_sdl_rid = 3;
const char gds_sdl_field = 4;
const char gds_sdl_fid = 5;
const char gds_sdl_struct = 6;
const char gds_sdl_variable = 7;
const char gds_sdl_scalar = 8;
const char gds_sdl_tiny_integer = 9;
const char gds_sdl_short_integer = 10;
const char gds_sdl_long_integer = 11;
const char gds_sdl_literal = 12;
const char gds_sdl_add = 13;
const char gds_sdl_subtract = 14;
const char gds_sdl_multiply = 15;
const char gds_sdl_divide = 16;
const char gds_sdl_negate = 17;
const char gds_sdl_eql = 18;
const char gds_sdl_neq = 19;
const char gds_sdl_gtr = 20;
const char gds_sdl_geq = 21;
const char gds_sdl_lss = 22;
const char gds_sdl_leq = 23;
const char gds_sdl_and = 24;
const char gds_sdl_or = 25;
const char gds_sdl_not = 26;
const char gds_sdl_while = 27;
const char gds_sdl_assignment = 28;
const char gds_sdl_label = 29;
const char gds_sdl_leave = 30;
const char gds_sdl_begin = 31;
const char gds_sdl_end = 32;
const char gds_sdl_do3 = 33;
const char gds_sdl_do2 = 34;
const char gds_sdl_do1 = 35;
const char gds_sdl_element = 36;
#endif

View File

@ -2661,7 +2661,7 @@ ISC_STATUS DLL_EXPORT GDS_GET_SLICE(ISC_STATUS * user_status,
JRD_TRA * tra_handle,
SLONG * array_id,
USHORT sdl_length,
UCHAR * sdl,
char * sdl,
USHORT param_length,
UCHAR * param,
SLONG slice_length,
@ -2860,7 +2860,7 @@ ISC_STATUS DLL_EXPORT GDS_PUT_SLICE(ISC_STATUS * user_status,
JRD_TRA * tra_handle,
SLONG * array_id,
USHORT sdl_length,
UCHAR * sdl,
char * sdl,
USHORT param_length,
UCHAR * param,
SLONG slice_length, UCHAR * slice)

View File

@ -76,7 +76,7 @@ extern ISC_STATUS DLL_EXPORT jrd8_get_segment(ISC_STATUS *, struct blb **, USHOR
USHORT, UCHAR *);
extern ISC_STATUS DLL_EXPORT jrd8_get_slice(ISC_STATUS *, struct att **,
struct jrd_tra **, SLONG *, USHORT,
UCHAR *, USHORT, UCHAR *, SLONG,
char *, USHORT, UCHAR *, SLONG,
UCHAR *, SLONG *);
extern ISC_STATUS DLL_EXPORT jrd8_open_blob2(ISC_STATUS *, struct att **,
struct jrd_tra **, struct blb **,
@ -87,7 +87,7 @@ extern ISC_STATUS DLL_EXPORT jrd8_put_segment(ISC_STATUS *, struct blb **, USHOR
UCHAR *);
extern ISC_STATUS DLL_EXPORT jrd8_put_slice(ISC_STATUS *, struct att **,
struct jrd_tra **, SLONG *, USHORT,
UCHAR *, USHORT, UCHAR *, SLONG,
char *, USHORT, UCHAR *, SLONG,
UCHAR *);
extern ISC_STATUS DLL_EXPORT jrd8_que_events(ISC_STATUS *, struct att **, SLONG *,
SSHORT, UCHAR *, FPTR_VOID, void *);

View File

@ -63,10 +63,10 @@
typedef struct sdl_arg {
USHORT sdl_arg_mode;
ADS sdl_arg_desc;
UCHAR *sdl_arg_sdl;
char *sdl_arg_sdl;
UCHAR *sdl_arg_array;
SLONG *sdl_arg_variables;
void (*sdl_arg_callback) ();
SDL_walk_callback sdl_arg_callback;
SLICE sdl_arg_argument;
ISC_STATUS *sdl_arg_status_vector;
IPTR sdl_arg_compiled[COMPILE_SIZE];
@ -82,12 +82,12 @@ typedef struct rng {
SDL_INFO rng_info;
} *RNG;
static UCHAR *compile(UCHAR *, SDL_ARG);
static char *compile(char *, SDL_ARG);
static ISC_STATUS error(ISC_STATUS *, ...);
static BOOLEAN execute(SDL_ARG);
static UCHAR *get_range(UCHAR *, RNG, SLONG *, SLONG *);
static SSHORT get_word(UCHAR **);
static UCHAR *sdl_desc(UCHAR *, DSC *);
static char *get_range(char *, RNG, SLONG *, SLONG *);
static SSHORT get_word(char **);
static char *sdl_desc(char *, DSC *);
static IPTR *stuff(IPTR, SDL_ARG);
@ -159,7 +159,7 @@ SLONG DLL_EXPORT SDL_compute_subscript(
ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS * status_vector,
UCHAR * sdl, SDL_INFO info, SLONG * vector)
char * sdl, SDL_INFO info, SLONG * vector)
{
/**************************************
*
@ -172,7 +172,7 @@ ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS * status_vector,
* element descriptor.
*
**************************************/
UCHAR *p;
char *p;
TEXT *q;
USHORT n, offset;
SLONG min, max;
@ -210,13 +210,13 @@ ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS * status_vector,
case gds_sdl_field:
for (n = *p++, q = info->sdl_info_field; n; --n)
*q++ = (TEXT) * p++;
*q++ = *p++;
*q = 0;
break;
case gds_sdl_relation:
for (n = *p++, q = info->sdl_info_relation; n; --n)
*q++ = (TEXT) * p++;
*q++ = *p++;
*q = 0;
break;
@ -228,7 +228,7 @@ ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS * status_vector,
range.rng_info = info;
min = max = -1;
if (!(p = get_range(p - 1, &range, &min, &max))
|| (((UCHAR) * p) != gds_sdl_eoc))
|| (*p != gds_sdl_eoc))
info->sdl_info_dimensions = 0;
}
return FB_SUCCESS;
@ -236,7 +236,7 @@ ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS * status_vector,
}
UCHAR *DLL_EXPORT SDL_prepare_slice(UCHAR * sdl, USHORT sdl_length)
char *DLL_EXPORT SDL_prepare_slice(char * sdl, USHORT sdl_length)
{
/**************************************
*
@ -249,9 +249,8 @@ UCHAR *DLL_EXPORT SDL_prepare_slice(UCHAR * sdl, USHORT sdl_length)
* blr_d_float to blr_double.
*
**************************************/
UCHAR* new_sdl;
UCHAR* old_sdl;
DSC junk;
char * new_sdl, * old_sdl;
DSC junk;
USHORT n;
new_sdl = old_sdl = sdl;
@ -259,7 +258,7 @@ UCHAR *DLL_EXPORT SDL_prepare_slice(UCHAR * sdl, USHORT sdl_length)
if (*sdl++ != gds_sdl_version1)
return old_sdl;
while ((UCHAR) * sdl != gds_sdl_eoc)
while (*sdl != gds_sdl_eoc)
{
switch (*sdl++)
{
@ -270,7 +269,7 @@ UCHAR *DLL_EXPORT SDL_prepare_slice(UCHAR * sdl, USHORT sdl_length)
{
if (new_sdl == old_sdl)
{
new_sdl = (UCHAR*)gds__alloc((SLONG) sdl_length);
new_sdl = (char*)gds__alloc((SLONG) sdl_length);
/* FREE: apparently never freed */
if (!new_sdl)
{ /* NOMEM: ignore operation */
@ -310,10 +309,10 @@ UCHAR *DLL_EXPORT SDL_prepare_slice(UCHAR * sdl, USHORT sdl_length)
int DLL_EXPORT SDL_walk(
ISC_STATUS * status_vector,
UCHAR * sdl,
char * sdl,
USHORT mode,
UCHAR * array,
ADS array_desc, SLONG * variables, void (*callback) (), SLICE argument)
ADS array_desc, SLONG * variables, SDL_walk_callback callback, SLICE argument)
{
/**************************************
*
@ -325,7 +324,7 @@ ADS array_desc, SLONG * variables, void (*callback) (), SLICE argument)
* Walk a slice.
*
**************************************/
UCHAR *p;
char *p;
DSC junk;
USHORT n, offset;
struct sdl_arg arg;
@ -340,7 +339,7 @@ ADS array_desc, SLONG * variables, void (*callback) (), SLICE argument)
arg.sdl_arg_status_vector = status_vector;
p = sdl + 1;
while ((UCHAR) * p != gds_sdl_eoc) {
while (*p != gds_sdl_eoc) {
switch (*p++) {
case gds_sdl_struct:
for (n = *p++; n; --n) {
@ -368,9 +367,7 @@ ADS array_desc, SLONG * variables, void (*callback) (), SLICE argument)
&& *(p - 1) <= gds_sdl_element);
arg.sdl_arg_next = arg.sdl_arg_compiled;
arg.sdl_arg_end =
(IPTR *) ((SCHAR *) arg.sdl_arg_compiled +
sizeof(arg.sdl_arg_compiled));
arg.sdl_arg_end = arg.sdl_arg_compiled+COMPILE_SIZE;
if (!(p = compile(p - 1, &arg)))
return FB_FAILURE;
if (!stuff((IPTR) op_exit, &arg))
@ -385,7 +382,7 @@ ADS array_desc, SLONG * variables, void (*callback) (), SLICE argument)
}
static UCHAR *compile(UCHAR * sdl, SDL_ARG arg)
static char *compile(char * sdl, SDL_ARG arg)
{
/**************************************
*
@ -398,9 +395,9 @@ static UCHAR *compile(UCHAR * sdl, SDL_ARG arg)
* is null, parse, but do not generate anything.
*
**************************************/
SLONG n, count, variable, value, op, operator_;
SLONG n, count, variable, value, operator_;
IPTR *label;
UCHAR *p, *ptr1, *expressions[16], **expr;
char op, *p, *ptr1, *expressions[16], **expr;
#define STUFF(word, arg) if (!stuff ((IPTR) word, arg)) return NULL
#define COMPILE(p, arg) if (!(p = compile (p, arg))) return NULL
@ -716,11 +713,9 @@ static BOOLEAN execute(SDL_ARG arg)
if (arg->sdl_arg_argument->slice_direction) {
/* Storing INTO array */
#pragma FB_COMPILER_MESSAGE("Fix. Bad function pointer cast.")
((void (*)(...)) (*arg->sdl_arg_callback)) (arg->sdl_arg_argument,
count,
&element_desc);
(*arg->sdl_arg_callback) (arg->sdl_arg_argument,
count,
&element_desc);
}
else {
/* Fetching FROM array */
@ -728,11 +723,9 @@ static BOOLEAN execute(SDL_ARG arg)
if ((BLOB_PTR *) element_desc.dsc_address <
(BLOB_PTR *) arg->sdl_arg_argument->slice_high_water) {
#pragma FB_COMPILER_MESSAGE("Fix. Bad function pointer cast.")
((void (*)(...)) (*arg->sdl_arg_callback)) (arg->sdl_arg_argument,
count,
&element_desc);
(*arg->sdl_arg_callback) (arg->sdl_arg_argument,
count,
&element_desc);
}
else {
slice_desc = &arg->sdl_arg_argument->slice_desc;
@ -753,7 +746,7 @@ static BOOLEAN execute(SDL_ARG arg)
}
static UCHAR *get_range(UCHAR * sdl, RNG arg, SLONG * min, SLONG * max)
static char *get_range(char * sdl, RNG arg, SLONG * min, SLONG * max)
{
/**************************************
*
@ -767,7 +760,7 @@ static UCHAR *get_range(UCHAR * sdl, RNG arg, SLONG * min, SLONG * max)
*
**************************************/
SLONG n, variable, value, min1, max1, min2, max2, junk1, junk2;
UCHAR *p, op;
char *p, op;
SDL_INFO info;
p = sdl;
@ -867,7 +860,7 @@ static UCHAR *get_range(UCHAR * sdl, RNG arg, SLONG * min, SLONG * max)
}
static SSHORT get_word(UCHAR ** ptr)
static SSHORT get_word(char ** ptr)
{
/**************************************
*
@ -878,7 +871,7 @@ static SSHORT get_word(UCHAR ** ptr)
* Functional description
*
**************************************/
UCHAR *p;
char *p;
SSHORT n;
p = *ptr;
@ -889,7 +882,7 @@ static SSHORT get_word(UCHAR ** ptr)
}
static UCHAR *sdl_desc(UCHAR * ptr, DSC * desc)
static char *sdl_desc(char * ptr, DSC * desc)
{
/**************************************
*
@ -902,7 +895,7 @@ static UCHAR *sdl_desc(UCHAR * ptr, DSC * desc)
* Return updated pointer is successful, otherwise NULL.
*
**************************************/
UCHAR *sdl;
char *sdl;
sdl = ptr;
desc->dsc_scale = 0;
@ -1011,8 +1004,7 @@ static UCHAR *sdl_desc(UCHAR * ptr, DSC * desc)
case dtype_long:
case dtype_quad:
case dtype_int64:
desc->dsc_scale = *((SCHAR *) sdl);
++sdl;
desc->dsc_scale = *sdl++;
break;
case dtype_text:

View File

@ -45,4 +45,5 @@ typedef struct slice {
SLONG slice_count;
} *SLICE;
typedef void (*SDL_walk_callback)(SLICE,ULONG,DSC *);
#endif /* JRD_SDL_H */

View File

@ -30,11 +30,11 @@ extern "C" {
extern SLONG DLL_EXPORT SDL_compute_subscript(ISC_STATUS *, struct ads *, USHORT,
SLONG *);
extern ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS *, UCHAR *, struct sdl_info *,
extern ISC_STATUS API_ROUTINE SDL_info(ISC_STATUS *, char *, struct sdl_info *,
SLONG *);
extern UCHAR *DLL_EXPORT SDL_prepare_slice(UCHAR *, USHORT);
extern int DLL_EXPORT SDL_walk(ISC_STATUS *, UCHAR *, USHORT, UCHAR *,
struct ads *, SLONG *, FPTR_VOID,
extern char *DLL_EXPORT SDL_prepare_slice(char *, USHORT);
extern int DLL_EXPORT SDL_walk(ISC_STATUS *, char *, USHORT, UCHAR *,
struct ads *, SLONG *, SDL_walk_callback,
struct slice *);
#ifdef __cplusplus

View File

@ -56,11 +56,11 @@ extern ISC_STATUS REM_prepare (ISC_STATUS *, struct rtr **, struct rsr **, USHOR
extern ISC_STATUS REM_set_cursor_name (ISC_STATUS *, struct rsr **, TEXT *, USHORT);
extern ISC_STATUS REM_sql_info (ISC_STATUS *, struct rsr **, SSHORT, SCHAR *, SSHORT, SCHAR *);
extern ISC_STATUS REM_get_segment (ISC_STATUS *, struct rbl **, USHORT *, USHORT, UCHAR *);
extern ISC_STATUS REM_get_slice (ISC_STATUS *, struct rdb **, struct rtr **, BID, USHORT, UCHAR *, USHORT, UCHAR *, SLONG, UCHAR *, SLONG *);
extern ISC_STATUS REM_get_slice (ISC_STATUS *, struct rdb **, struct rtr **, BID, USHORT, char *, USHORT, UCHAR *, SLONG, UCHAR *, SLONG *);
extern ISC_STATUS REM_open_blob2 (ISC_STATUS *, struct rdb **, struct rtr **, struct rbl **, BID, USHORT, UCHAR *);
extern ISC_STATUS REM_prepare_transaction (ISC_STATUS *, struct rtr **, USHORT, UCHAR *);
extern ISC_STATUS REM_put_segment (ISC_STATUS *, struct rbl **, USHORT, UCHAR *);
extern ISC_STATUS REM_put_slice (ISC_STATUS *, struct rdb **, struct rtr **, BID, USHORT, UCHAR *, USHORT, UCHAR *, SLONG, UCHAR *);
extern ISC_STATUS REM_put_slice (ISC_STATUS *, struct rdb **, struct rtr **, BID, USHORT, char *, USHORT, UCHAR *, SLONG, UCHAR *);
extern ISC_STATUS REM_que_events (ISC_STATUS *, struct rdb **, SLONG *, SSHORT, UCHAR *, void (*)(void*, USHORT, UCHAR*), void *);
extern ISC_STATUS REM_query_service (ISC_STATUS *, struct rdb **, USHORT, SCHAR *, USHORT, SCHAR *, USHORT, SCHAR *);
extern ISC_STATUS REM_receive (ISC_STATUS *, struct rrq **, USHORT, USHORT, UCHAR *, SSHORT);

View File

@ -2699,7 +2699,7 @@ ISC_STATUS GDS_GET_SLICE(ISC_STATUS * user_status,
RTR * tra_handle,
BID array_id,
USHORT sdl_length,
UCHAR * sdl,
char * sdl,
USHORT param_length,
UCHAR * param,
SLONG slice_length, UCHAR * slice, SLONG * return_length)
@ -2716,7 +2716,7 @@ ISC_STATUS GDS_GET_SLICE(ISC_STATUS * user_status,
**************************************/
RDB rdb;
RTR transaction;
UCHAR *new_sdl;
char *new_sdl;
PACKET *packet;
P_SLC *data;
P_SLR *response;
@ -2757,7 +2757,7 @@ ISC_STATUS GDS_GET_SLICE(ISC_STATUS * user_status,
data->p_slc_id = *array_id;
data->p_slc_length = slice_length;
data->p_slc_sdl.cstr_length = sdl_length;
data->p_slc_sdl.cstr_address = new_sdl;
data->p_slc_sdl.cstr_address = (UCHAR*) new_sdl;
data->p_slc_parameters.cstr_length = param_length;
data->p_slc_parameters.cstr_address = param;
@ -3035,7 +3035,7 @@ ISC_STATUS GDS_PUT_SLICE(ISC_STATUS * user_status,
RTR * tra_handle,
BID array_id,
USHORT sdl_length,
UCHAR * sdl,
char * sdl,
USHORT param_length,
UCHAR * param, SLONG slice_length, UCHAR * slice)
{
@ -3051,7 +3051,7 @@ ISC_STATUS GDS_PUT_SLICE(ISC_STATUS * user_status,
**************************************/
RDB rdb;
RTR transaction;
UCHAR *new_sdl;
char *new_sdl;
PACKET *packet;
P_SLC *data;
P_SLR *response;
@ -3092,7 +3092,7 @@ ISC_STATUS GDS_PUT_SLICE(ISC_STATUS * user_status,
data->p_slc_id = *array_id;
data->p_slc_length = slice_length;
data->p_slc_sdl.cstr_length = sdl_length;
data->p_slc_sdl.cstr_address = new_sdl;
data->p_slc_sdl.cstr_address = (UCHAR *) new_sdl;
data->p_slc_parameters.cstr_length = param_length;
data->p_slc_parameters.cstr_address = param;
data->p_slc_slice.lstr_length = slice_length;

View File

@ -80,7 +80,7 @@ static bool_t xdr_request(XDR *, USHORT, USHORT, USHORT);
static bool_t xdr_semi_opaque(XDR *, REM_MSG, FMT);
static bool_t xdr_semi_opaque_slice(XDR *, LSTRING *);
#endif
static bool_t xdr_slice(XDR *, LSTRING *, USHORT, BLOB_PTR *);
static bool_t xdr_slice(XDR *, LSTRING *, USHORT, char *);
static bool_t xdr_status_vector(XDR *, ISC_STATUS *, TEXT * strings[]);
static bool_t xdr_sql_blr(XDR *, SLONG, CSTRING *, int, SQL_STMT_TYPE);
static bool_t xdr_sql_message(XDR *, SLONG);
@ -608,7 +608,7 @@ bool_t xdr_protocol(XDR * xdrs, PACKET * p)
else
if (!xdr_slice(xdrs, &slice->p_slc_slice,
slice->p_slc_sdl.cstr_length,
slice->p_slc_sdl.cstr_address)) return P_FALSE;
reinterpret_cast<char *>(slice->p_slc_sdl.cstr_address))) return P_FALSE;
DEBUG_PRINTSIZE(p->p_operation);
return P_TRUE;
@ -1449,7 +1449,7 @@ static bool_t xdr_semi_opaque_slice( XDR * xdrs, LSTRING * slice)
static bool_t xdr_slice(
XDR * xdrs,
LSTRING * slice, USHORT sdl_length, BLOB_PTR * sdl)
LSTRING * slice, USHORT sdl_length, char * sdl)
{
/**************************************
*

View File

@ -32,7 +32,7 @@
*
*/
/*
$Id: protocol.h,v 1.12 2003-06-08 18:12:13 dimitr Exp $
$Id: protocol.h,v 1.13 2003-07-24 10:21:42 aafemt Exp $
*/
#ifndef _REMOTE_PROTOCOL_H_
#define _REMOTE_PROTOCOL_H_
@ -512,7 +512,7 @@ typedef struct p_slc {
typedef struct p_slr {
LSTRING p_slr_slice; /* Slice proper */
ULONG p_slr_length; /* Total length of slice */
UCHAR *p_slr_sdl; /* *** not transfered *** */
char *p_slr_sdl; /* *** not transfered *** */
USHORT p_slr_sdl_length; /* *** not transfered *** */
} P_SLR;

View File

@ -2509,7 +2509,7 @@ ISC_STATUS port::get_slice(P_SLC * stuff, PACKET* send)
send->p_operation = op_slice;
response->p_slr_slice.lstr_address = slice;
response->p_slr_slice.lstr_length = response->p_slr_length;
response->p_slr_sdl = stuff->p_slc_sdl.cstr_address;
response->p_slr_sdl = reinterpret_cast<char*>(stuff->p_slc_sdl.cstr_address);
response->p_slr_sdl_length = stuff->p_slc_sdl.cstr_length;
this->send(send);
response->p_slr_sdl = 0;