8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00
This commit is contained in:
robocop 2004-01-13 09:52:19 +00:00
parent e6b5e8aa54
commit b441cd9aef
42 changed files with 1413 additions and 1410 deletions

View File

@ -43,6 +43,8 @@
@cd %ROOT_PATH%\gen\examples
@del empbuild.fdb 2> nul
@del intlbuild.fdb 2> nul
:: CVC: I need this line to ensure isql is the correct one.
@copy %ROOT_PATH%\output\bin\isql.exe %ROOT_PATH%\gen\examples\ /y > nul
@%ROOT_PATH%\gen\examples\isql -i empbld.sql
@%ROOT_PATH%\gen\examples\isql -i intlbld.sql
@cd %ROOT_PATH%\builds\win32

View File

@ -37,7 +37,7 @@
*/
/*
$Id: backup.epp,v 1.47 2003-12-22 10:00:00 robocop Exp $
$Id: backup.epp,v 1.48 2004-01-13 09:52:09 robocop Exp $
*/
#include "firebird.h"
@ -95,18 +95,18 @@ inline const UCHAR* put_block(tgbl* tdgbl, const UCHAR* p, ULONG n)
void compress(const UCHAR*, ULONG);
int copy(const TEXT *, TEXT *, ULONG);
BURP_FLD get_fields(BURP_REL);
burp_fld* get_fields(burp_rel*);
SINT64 get_gen_id(const TEXT *, SSHORT);
void get_ranges(BURP_FLD);
void put_array(BURP_FLD, BURP_REL, ISC_QUAD *);
void get_ranges(burp_fld*);
void put_array(burp_fld*, burp_rel*, ISC_QUAD *);
void put_asciz(const SCHAR, const TEXT*);
void put_blob(BURP_FLD, ISC_QUAD *, ULONG);
void put_blob(burp_fld*, ISC_QUAD *, ULONG);
bool put_blr_blob(SCHAR, ISC_QUAD *);
void put_data(BURP_REL);
void put_index(BURP_REL);
void put_data(burp_rel*);
void put_index(burp_rel*);
int put_message(SCHAR, const TEXT *, ULONG);
void put_numeric(SCHAR, SLONG);
void put_relation(BURP_REL);
void put_relation(burp_rel*);
bool put_source_blob(SCHAR, SCHAR, ISC_QUAD *);
int put_text(SCHAR, const TEXT *, SSHORT);
void set_capabilities(void);
@ -301,7 +301,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
if (tdgbl->action->act_action == ACT_backup_split)
{
for (FIL fil = tdgbl->gbl_sw_files; fil; fil = fil->fil_next)
for (burp_fil* fil = tdgbl->gbl_sw_files; fil; fil = fil->fil_next)
{
tdgbl->action->act_file = fil;
if (MVOL_split_hdr_write() == FALSE)
@ -392,7 +392,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
// Now go back and write all data
for (BURP_REL relation = tdgbl->relations; relation; relation = relation->rel_next) {
for (burp_rel* relation = tdgbl->relations; relation; relation = relation->rel_next) {
put(tdgbl, (UCHAR) (rec_relation_data));
PUT_TEXT(att_relation_name, relation->rel_name);
put(tdgbl, (UCHAR) (att_end));
@ -608,7 +608,7 @@ void general_on_error(void)
}
BURP_FLD get_fields( BURP_REL relation)
burp_fld* get_fields( burp_rel* relation)
{
/**************************************
*
@ -621,13 +621,13 @@ BURP_FLD get_fields( BURP_REL relation)
* capabilities and get system specific
*
**************************************/
BURP_FLD field;
burp_fld* field;
ISC_QUAD *blob_id;
TGBL tdgbl = GET_THREAD_DATA;
USHORT count = 1;
BURP_FLD fields = NULL;
burp_fld* fields = NULL;
/* if we have all capabilities, use the first request to get the
most performance out of the latest engine; if we don't
@ -646,7 +646,7 @@ BURP_FLD get_fields( BURP_REL relation)
X.RDB$FIELD_SOURCE = Y.RDB$FIELD_NAME AND
X.RDB$RELATION_NAME EQ relation->rel_name
field = (BURP_FLD) BURP_alloc_zero(sizeof(burp_fld));
field = (burp_fld*) BURP_alloc_zero(sizeof(burp_fld));
field->fld_number = count++;
field->fld_type = Y.RDB$FIELD_TYPE;
field->fld_sub_type = Y.RDB$FIELD_SUB_TYPE;
@ -751,7 +751,7 @@ BURP_FLD get_fields( BURP_REL relation)
WITH X.RDB$FIELD_SOURCE = Y.RDB$FIELD_NAME AND
X.RDB$RELATION_NAME EQ relation->rel_name
field = (BURP_FLD) BURP_alloc_zero (sizeof(burp_fld));
field = (burp_fld*) BURP_alloc_zero (sizeof(burp_fld));
field->fld_number = count++;
field->fld_type = Y.RDB$FIELD_TYPE;
field->fld_sub_type = Y.RDB$FIELD_SUB_TYPE;
@ -1032,7 +1032,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len)
}
void get_ranges( BURP_FLD field)
void get_ranges( burp_fld* field)
{
/**************************************
*
@ -1075,7 +1075,7 @@ void get_ranges( BURP_FLD field)
}
void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD * blob_id)
{
/**************************************
*
@ -1097,7 +1097,7 @@ void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
if (!blob_id->gds_quad_low && !blob_id->gds_quad_high)
return;
LSTRING xdr_buffer;
lstring xdr_buffer;
xdr_buffer.lstr_allocated = 0;
UCHAR* blr = blr_buffer;
@ -1263,7 +1263,7 @@ void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
UCHAR* p;
if (tdgbl->gbl_sw_transportable)
{
LSTRING xdr_slice;
lstring xdr_slice;
xdr_slice.lstr_allocated = xdr_slice.lstr_length = return_length;
xdr_slice.lstr_address = slice;
return_length =
@ -1310,7 +1310,7 @@ void put_asciz( const SCHAR attribute, const TEXT* string)
}
void put_blob( BURP_FLD field, ISC_QUAD * blob_id, ULONG count)
void put_blob( burp_fld* field, ISC_QUAD * blob_id, ULONG count)
{
/**************************************
*
@ -1541,7 +1541,7 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
}
void put_data(BURP_REL relation)
void put_data(burp_rel* relation)
{
/**************************************
*
@ -1553,7 +1553,7 @@ void put_data(BURP_REL relation)
* Write relation meta-data and data.
*
**************************************/
BURP_FLD field;
burp_fld* field;
ISC_STATUS_ARRAY status_vector;
TGBL tdgbl = GET_THREAD_DATA;
@ -1790,7 +1790,7 @@ void put_data(BURP_REL relation)
SSHORT* eof = (SSHORT *) (buffer + eof_offset);
// the XDR representation may be even fluffier
LSTRING xdr_buffer;
lstring xdr_buffer;
if (tdgbl->gbl_sw_transportable)
{
xdr_buffer.lstr_length = xdr_buffer.lstr_allocated =
@ -1873,7 +1873,7 @@ void put_data(BURP_REL relation)
}
void put_index( BURP_REL relation)
void put_index( burp_rel* relation)
{
/**************************************
*
@ -2148,7 +2148,7 @@ void put_int64( SCHAR attribute, SINT64 value)
}
void put_relation( BURP_REL relation)
void put_relation( burp_rel* relation)
{
/**************************************
*
@ -2167,13 +2167,15 @@ void put_relation( BURP_REL relation)
/* Write local field information. This is made slightly more complicated
by the requirement that computational fields be aligned. */
BURP_FLD field, aligned, unaligned, aligned4, aligned8;
aligned = unaligned = aligned4 = aligned8 = NULL;
burp_fld* aligned = NULL;
burp_fld* unaligned = NULL;
burp_fld* aligned4 = NULL;
burp_fld* aligned8 = NULL;
BURP_FLD fields = get_fields(relation);
burp_fld* fields = get_fields(relation);
// sort the list of fields into three lists, depending on alignment
burp_fld* field;
for (field = fields; field = fields;)
{
fields = field->fld_next;
@ -3549,7 +3551,7 @@ void write_relations(void)
}
put(tdgbl, att_end);
BURP_REL relation = (BURP_REL) BURP_alloc_zero (sizeof(burp_rel));
burp_rel* relation = (burp_rel*) BURP_alloc_zero (sizeof(burp_rel));
relation->rel_next = tdgbl->relations;
tdgbl->relations = relation;
relation->rel_id = X.RDB$RELATION_ID;
@ -3626,7 +3628,7 @@ void write_relations(void)
END_ERROR;
}
put(tdgbl, att_end);
BURP_REL relation = (BURP_REL) BURP_alloc_zero (sizeof(burp_rel));
burp_rel* relation = (burp_rel*) BURP_alloc_zero (sizeof(burp_rel));
relation->rel_next = tdgbl->relations;
tdgbl->relations = relation;
relation->rel_id = X.RDB$RELATION_ID;

View File

@ -117,12 +117,12 @@ enum gbak_action
FDESC = 3
};
static void close_out_transaction(volatile gbak_action, isc_tr_handle *);
static void close_out_transaction(volatile gbak_action, isc_tr_handle*);
//static void enable_signals(void);
//static void excp_handler(void);
static SLONG get_number(const SCHAR *);
static ULONG get_size(const SCHAR *, FIL);
static gbak_action open_files(const TEXT *, const TEXT**, USHORT, USHORT, USHORT);
static SLONG get_number(const SCHAR*);
static ULONG get_size(const SCHAR*, burp_fil*);
static gbak_action open_files(const TEXT *, const TEXT**, bool, USHORT);
static int common_main(int, char**, pfn_svc_output, svc*);
#ifndef SUPERSERVER
tgbl *gdgbl;
@ -149,13 +149,6 @@ static inline void translate_cp(SCHAR* a)
}
#endif
static inline void exit_local(int code, TGBL tdgbl)
{
tdgbl->exit_code = ((volatile int)code);
if (tdgbl->burp_env != NULL)
Firebird::status_exception::raise(1);
}
static int output_svc(svc* output_data, const UCHAR* output_buf)
{
/**************************************
@ -244,9 +237,10 @@ int CLIB_ROUTINE main(int argc, char* argv[])
for (; q = in_sw_tab->in_sw_name; in_sw_tab++)
{
TEXT c;
for (const TEXT *p = string + 1; c = *p++;)
for (const TEXT *p = string + 1; c = *p++;) {
if (UPPER(c) != *q++)
break;
}
if (!c)
break;
}
@ -426,7 +420,7 @@ static int api_gbak(int argc,
*password = '\0';
}
char *const svc_name = (char *) gds__alloc((SLONG) (strlen(service) + 1));
char* const svc_name = (char *) gds__alloc((SLONG) (strlen(service) + 1));
if (svc_name == NULL) {
status[0] = isc_arg_gds;
@ -631,26 +625,26 @@ int common_main(int argc,
If this utility is started as a thread in the engine, then the first switch
will be "-svc_thd".
*/
tdgbl->gbl_sw_service_gbak = FALSE;
tdgbl->gbl_sw_service_thd = FALSE;
tdgbl->gbl_sw_service_gbak = false;
tdgbl->gbl_sw_service_thd = false;
tdgbl->service_blk = NULL;
tdgbl->status = const_cast<long* volatile>(tdgbl->status_vector);
if (argc > 1 && !strcmp(argv[1], "-svc")) {
tdgbl->gbl_sw_service_gbak = TRUE;
tdgbl->gbl_sw_service_gbak = true;
argv++;
argc--;
}
else if (argc > 1 && !strcmp(argv[1], "-svc_thd")) {
tdgbl->gbl_sw_service_gbak = TRUE;
tdgbl->gbl_sw_service_thd = TRUE;
tdgbl->gbl_sw_service_gbak = true;
tdgbl->gbl_sw_service_thd = true;
tdgbl->service_blk = (SVC) output_data;
tdgbl->status = tdgbl->service_blk->svc_status;
argv++;
argc--;
}
else if (argc > 4 && !strcmp(argv[1], "-svc_re")) {
tdgbl->gbl_sw_service_gbak = TRUE;
tdgbl->gbl_sw_service_gbak = true;
tdgbl->output_proc = output_svc;
long redir_in = atol(argv[2]);
long redir_out = atol(argv[3]);
@ -683,20 +677,21 @@ int common_main(int argc,
USHORT sw_replace = FALSE;
USHORT sw_tape = FALSE;
tdgbl->gbl_sw_compress = TRUE;
tdgbl->gbl_sw_convert_ext_tables = FALSE;
tdgbl->gbl_sw_transportable = TRUE;
tdgbl->gbl_sw_ignore_limbo = FALSE;
tdgbl->gbl_sw_compress = true;
tdgbl->gbl_sw_convert_ext_tables = false;
tdgbl->gbl_sw_transportable = true;
tdgbl->gbl_sw_ignore_limbo = false;
tdgbl->gbl_sw_blk_factor = 0;
tdgbl->gbl_sw_no_reserve = FALSE;
tdgbl->gbl_sw_no_reserve = false;
tdgbl->gbl_sw_old_descriptions = false;
tdgbl->gbl_sw_mode = false;
tdgbl->gbl_sw_skip_count = 0;
tdgbl->action = NULL;
tdgbl->dpb_length = 0;
FIL file = NULL, file_list = NULL;
burp_fil* file = NULL;
burp_fil* file_list = NULL;
tdgbl->io_buffer_size = GBAK_IO_BUFFER_SIZE;
const TEXT* const* const end = argv + argc;
@ -713,7 +708,7 @@ int common_main(int argc,
/* Miserable thing must be a filename
(dummy in a length for the backup file */
file = (FIL) BURP_alloc_zero(FIL_LEN);
file = (burp_fil*) BURP_alloc_zero(FIL_LEN);
file->fil_name = string;
file->fil_fd = INVALID_HANDLE_VALUE;
if (!file_list)
@ -870,14 +865,14 @@ int common_main(int argc,
BURP_print(66, redirect, 0, 0, 0, 0);
// msg 66 can't open status and error output file %s
ib_fclose(tmp_outfile);
exit_local(FINI_ERROR, const_cast<tgbl*>(tdgbl));
BURP_exit_local(FINI_ERROR, const_cast<tgbl*>(tdgbl));
}
if (!
(tdgbl->output_file =
ib_fopen(redirect, fopen_write_type))) {
BURP_print(66, redirect, 0, 0, 0, 0);
// msg 66 can't open status and error output file %s
exit_local(FINI_ERROR, const_cast<tgbl*>(tdgbl));
BURP_exit_local(FINI_ERROR, const_cast<tgbl*>(tdgbl));
}
}
} //else if (in_sw_tab->in_sw == IN_SW_BURP_Y)
@ -888,7 +883,7 @@ int common_main(int argc,
tdgbl->gbl_sw_files = NULL;
FIL next_file = NULL;
burp_fil* next_file = NULL;
for (file = file_list; file; file = next_file) {
next_file = file->fil_next;
file->fil_next = tdgbl->gbl_sw_files;
@ -941,11 +936,11 @@ int common_main(int argc,
break;
case (IN_SW_BURP_CO):
tdgbl->gbl_sw_convert_ext_tables = TRUE;
tdgbl->gbl_sw_convert_ext_tables = true;
break;
case (IN_SW_BURP_E):
tdgbl->gbl_sw_compress = FALSE;
tdgbl->gbl_sw_compress = false;
break;
case (IN_SW_BURP_G):
@ -957,7 +952,7 @@ int common_main(int argc,
break;
case (IN_SW_BURP_I):
tdgbl->gbl_sw_deactivate_indexes = TRUE;
tdgbl->gbl_sw_deactivate_indexes = true;
break;
case (IN_SW_BURP_IG):
@ -970,15 +965,15 @@ int common_main(int argc,
break;
case (IN_SW_BURP_K):
tdgbl->gbl_sw_kill = TRUE;
tdgbl->gbl_sw_kill = true;
break;
case (IN_SW_BURP_L):
tdgbl->gbl_sw_ignore_limbo = TRUE;
tdgbl->gbl_sw_ignore_limbo = true;
break;
case (IN_SW_BURP_M):
tdgbl->gbl_sw_meta = TRUE;
tdgbl->gbl_sw_meta = true;
break;
case (IN_SW_BURP_MODE):
@ -986,19 +981,19 @@ int common_main(int argc,
break;
case (IN_SW_BURP_N):
tdgbl->gbl_sw_novalidity = TRUE;
tdgbl->gbl_sw_novalidity = true;
break;
case (IN_SW_BURP_NT): // Backup non-transportable format
tdgbl->gbl_sw_transportable = FALSE;
tdgbl->gbl_sw_transportable = false;
break;
case (IN_SW_BURP_O):
tdgbl->gbl_sw_incremental = TRUE;
tdgbl->gbl_sw_incremental = true;
break;
case (IN_SW_BURP_OL):
tdgbl->gbl_sw_old_descriptions = TRUE;
tdgbl->gbl_sw_old_descriptions = true;
break;
case (IN_SW_BURP_PASS):
@ -1024,7 +1019,7 @@ int common_main(int argc,
break;
case (IN_SW_BURP_T):
tdgbl->gbl_sw_transportable = TRUE;
tdgbl->gbl_sw_transportable = true;
break;
case (IN_SW_BURP_U):
@ -1033,7 +1028,7 @@ int common_main(int argc,
break;
case (IN_SW_BURP_US):
tdgbl->gbl_sw_no_reserve = TRUE;
tdgbl->gbl_sw_no_reserve = true;
break;
case (IN_SW_BURP_ROLE):
@ -1061,13 +1056,13 @@ int common_main(int argc,
}
case (IN_SW_BURP_V):
tdgbl->gbl_sw_verbose = TRUE;
tdgbl->gbl_sw_verbose = true;
break;
case (IN_SW_BURP_Z):
BURP_print(91, (void*) GDS_VERSION, 0, 0, 0, 0);
// msg 91 gbak version %s
tdgbl->gbl_sw_version = TRUE;
tdgbl->gbl_sw_version = true;
break;
default:
@ -1141,7 +1136,7 @@ int common_main(int argc,
tdgbl->action->act_action = ACT_unknown;
action =
open_files(file1, &file2, tdgbl->gbl_sw_verbose, sw_replace, sw_tape);
open_files(file1, &file2, tdgbl->gbl_sw_verbose, sw_replace);
MVOL_init(tdgbl->io_buffer_size);
@ -1166,7 +1161,7 @@ int common_main(int argc,
if (result != FINI_OK && result != FINI_DB_NOT_ONLINE)
BURP_abort();
exit_local(result, const_cast<tgbl*>(tdgbl));
BURP_exit_local(result, const_cast<tgbl*>(tdgbl));
return result;
} // try
@ -1175,10 +1170,10 @@ int common_main(int argc,
// All calls to exit_local(), normal and error exits, wind up here
tdgbl->burp_env = NULL;
int exit_code = tdgbl->exit_code;
const int exit_code = tdgbl->exit_code;
// Close the gbak file handles if they still open
for (FIL file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
for (burp_fil* file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
{
if (file->fil_fd != INVALID_HANDLE_VALUE)
close_platf(file->fil_fd);
@ -1251,7 +1246,7 @@ void BURP_abort(void)
SVC_STARTED(tdgbl->service_blk);
exit_local(FINI_ERROR, tdgbl);
BURP_exit_local(FINI_ERROR, tdgbl);
}
void BURP_error(USHORT errcode, bool abort,
@ -1337,6 +1332,15 @@ void BURP_error_redirect(const ISC_STATUS* status_vector,
}
// Raises an exception when the old SEH system would jump to another place.
void BURP_exit_local(int code, TGBL tdgbl)
{
tdgbl->exit_code = ((volatile int)code);
if (tdgbl->burp_env != NULL)
Firebird::status_exception::raise(1);
}
void BURP_msg_partial( USHORT number,
const void* arg1,
const void* arg2,
@ -1649,9 +1653,8 @@ static SLONG get_number( const SCHAR* string)
static gbak_action open_files(const TEXT* file1,
const TEXT** file2,
USHORT sw_verbose,
USHORT sw_replace,
USHORT sw_tape)
bool sw_verbose,
USHORT sw_replace)
{
/**************************************
*
@ -1704,7 +1707,7 @@ static gbak_action open_files(const TEXT* file1,
return QUIT;
}
FIL fil = 0;
burp_fil* fil = 0;
if (sw_replace == IN_SW_BURP_B) {
// Now it is safe to skip a db file
@ -2090,11 +2093,11 @@ static void burp_output( const SCHAR* format, ...)
}
if (exit_code != 0)
exit_local(exit_code, tdgbl);
BURP_exit_local(exit_code, tdgbl);
}
static ULONG get_size( const SCHAR* string, FIL file)
static ULONG get_size( const SCHAR* string, burp_fil* file)
{
/**********************************************
*

View File

@ -534,7 +534,7 @@ const int TRIGGER_SEQUENCE_DEFAULT = 0;
/* field block, used to hold local field definitions */
typedef struct burp_fld {
struct burp_fld {
burp_fld* fld_next;
SSHORT fld_type;
SSHORT fld_sub_type;
@ -572,7 +572,7 @@ typedef struct burp_fld {
SSHORT fld_character_length;
SSHORT fld_character_set_id;
SSHORT fld_collation_id;
} *BURP_FLD;
};
enum fld_flags_vals {
FLD_computed = 1,
@ -586,7 +586,7 @@ enum fld_flags_vals {
/* relation definition - holds useful relation type stuff */
typedef struct burp_rel {
struct burp_rel {
burp_rel* rel_next;
burp_fld* rel_fields;
SSHORT rel_flags;
@ -600,7 +600,7 @@ typedef struct burp_rel {
ISC_QUAD rel_modify_source; /* trigger source blob id */
ISC_QUAD rel_erase_blr; /* trigger blr blob id */
ISC_QUAD rel_erase_source; /* trigger source blob id */
} *BURP_REL;
};
enum burp_rel_flags_vals {
REL_view = 1,
@ -609,12 +609,12 @@ enum burp_rel_flags_vals {
/* procedure definition - holds useful procedure type stuff */
typedef struct burp_prc {
struct burp_prc {
burp_prc* prc_next;
SSHORT prc_name_length;
GDS_NAME prc_name;
GDS_NAME prc_owner; /* relation owner, if not us */
} *BURP_PRC;
};
typedef struct gfld {
@ -700,16 +700,16 @@ typedef enum {
size_e /* error */
} SIZE_CODE;
typedef struct fil {
fil* fil_next;
struct burp_fil {
burp_fil* fil_next;
TEXT* fil_name;
ULONG fil_length;
DESC fil_fd;
USHORT fil_seq;
SIZE_CODE fil_size_code;
} *FIL;
};
const size_t FIL_LEN = sizeof(fil);
const size_t FIL_LEN = sizeof(burp_fil);
/* Split & Join stuff */
@ -722,14 +722,14 @@ typedef enum act_t {
} ACT_T;
typedef struct act {
USHORT act_total;
FIL act_file;
ACT_T act_action;
USHORT act_total;
burp_fil* act_file;
ACT_T act_action;
} *ACT;
const size_t ACT_LEN = sizeof(act);
const ULONG MAX_LENGTH = -1UL; // Keep in sync with fil.fil_length
const ULONG MAX_LENGTH = -1UL; // Keep in sync with burp_fil.fil_length
/* This structure has been cloned from spit.c */
@ -760,23 +760,23 @@ typedef struct tgbl
thdd tgbl_thd_data;
const TEXT* gbl_database_file_name;
TEXT gbl_backup_start_time[30];
USHORT gbl_sw_verbose;
USHORT gbl_sw_ignore_limbo;
USHORT gbl_sw_meta;
USHORT gbl_sw_novalidity;
bool gbl_sw_verbose;
bool gbl_sw_ignore_limbo;
bool gbl_sw_meta;
bool gbl_sw_novalidity;
USHORT gbl_sw_page_size;
USHORT gbl_sw_compress;
USHORT gbl_sw_version;
USHORT gbl_sw_transportable;
USHORT gbl_sw_incremental;
USHORT gbl_sw_deactivate_indexes;
USHORT gbl_sw_kill;
bool gbl_sw_compress;
bool gbl_sw_version;
bool gbl_sw_transportable;
bool gbl_sw_incremental;
bool gbl_sw_deactivate_indexes;
bool gbl_sw_kill;
USHORT gbl_sw_blk_factor;
USHORT gbl_sw_no_reserve;
USHORT gbl_sw_old_descriptions;
USHORT gbl_sw_service_gbak;
USHORT gbl_sw_service_thd;
USHORT gbl_sw_convert_ext_tables;
bool gbl_sw_no_reserve;
bool gbl_sw_old_descriptions;
bool gbl_sw_service_gbak;
bool gbl_sw_service_thd;
bool gbl_sw_convert_ext_tables;
bool gbl_sw_mode;
bool gbl_sw_mode_val;
SCHAR* gbl_sw_sql_role;
@ -784,8 +784,8 @@ typedef struct tgbl
SCHAR* gbl_sw_password;
SLONG gbl_sw_skip_count;
SLONG gbl_sw_page_buffers;
FIL gbl_sw_files;
FIL gbl_sw_backup_files;
burp_fil* gbl_sw_files;
burp_fil* gbl_sw_backup_files;
GFLD gbl_global_fields;
ACT action;
ULONG io_buffer_size;
@ -795,8 +795,8 @@ typedef struct tgbl
UCHAR* burp_env;
UCHAR* io_ptr;
int io_cnt;
BURP_REL relations;
BURP_PRC procedures;
burp_rel* relations;
burp_prc* procedures;
SLONG BCK_capabilities;
USHORT RESTORE_format;
ULONG mvol_io_buffer_size;
@ -823,12 +823,12 @@ typedef struct tgbl
pfn_svc_output output_proc;
svc* output_data;
IB_FILE* output_file;
SVC service_blk;
svc* service_blk;
/*
* Link list of global fields that were converted from V3 sub_type
* to V4 char_set_id/collate_id. Needed for local fields conversion.
*/
// BURP_FLD v3_cvt_fld_list;
// burp_fld* v3_cvt_fld_list;
isc_req_handle handles_get_character_sets_req_handle1;
isc_req_handle handles_get_chk_constraint_req_handle1;
@ -883,6 +883,10 @@ typedef struct tgbl
TEXT database_security_class[GDS_NAME_LEN]; /* To save database security class for deferred update */
} *TGBL;
// CVC: This aux routine declared here to not force inclusion of burp.h with burp_proto.h
// in other modules.
void BURP_exit_local(int code, tgbl* tdgbl);
#ifdef GET_THREAD_DATA
#undef GET_THREAD_DATA
#endif

View File

@ -31,7 +31,8 @@ int BURP_main(SVC service);
void BURP_abort(void);
void BURP_error(USHORT, bool, USHORT, const void*, USHORT, const void*,
USHORT, const void*, USHORT, const void*, USHORT, const void*);
void BURP_error(USHORT, bool, const void*, const void*, const void*, const void*, const void*);
void BURP_error(USHORT, bool, const void*, const void*, const void*,
const void*, const void*);
void BURP_print_status(const ISC_STATUS*);
void BURP_error_redirect(const ISC_STATUS*, USHORT, const void*, const void*);
void BURP_msg_partial(USHORT, const void*, const void*, const void*,

View File

@ -28,7 +28,7 @@
*
*/
/*
$Id: canonical.cpp,v 1.31 2003-11-03 23:49:47 brodsom Exp $
$Id: canonical.cpp,v 1.32 2004-01-13 09:52:09 robocop Exp $
*/
#include "firebird.h"
@ -58,8 +58,8 @@ static bool_t burp_setpostn(XDR*, u_int);
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, const UCHAR*);
static int xdr_init(XDR*, lstring*, enum xdr_op);
static bool_t xdr_slice(XDR*, lstring*, USHORT, const UCHAR*);
static xdr_t::xdr_ops burp_ops =
{
@ -76,9 +76,9 @@ static xdr_t::xdr_ops burp_ops =
const int increment = 1024;
ULONG CAN_encode_decode(BURP_REL relation,
LSTRING * buffer,
UCHAR * data,
ULONG CAN_encode_decode(burp_rel* relation,
lstring* buffer,
UCHAR* data,
bool_t direction)
{
/**************************************
@ -91,9 +91,8 @@ ULONG CAN_encode_decode(BURP_REL relation,
* encode and decode canonical backup.
*
**************************************/
BURP_FLD field;
const burp_fld* field;
SSHORT n;
UCHAR *p;
XDR xdr;
XDR* xdrs = &xdr;
@ -105,8 +104,8 @@ ULONG CAN_encode_decode(BURP_REL relation,
{
if (field->fld_flags & FLD_computed)
continue;
p = data + field->fld_offset;
bool array_fld = ((field->fld_flags & FLD_array) != 0);
UCHAR* p = data + field->fld_offset;
const bool array_fld = ((field->fld_flags & FLD_array) != 0);
FLD_LENGTH length;
if (array_fld)
length = 8;
@ -211,7 +210,7 @@ ULONG CAN_encode_decode(BURP_REL relation,
if (field->fld_flags & FLD_computed)
continue;
offset = FB_ALIGN(offset, sizeof(SSHORT));
p = data + offset;
UCHAR* p = data + offset;
if (!xdr_short(xdrs, (SSHORT *) p))
return FALSE;
offset += sizeof(SSHORT);
@ -220,11 +219,11 @@ ULONG CAN_encode_decode(BURP_REL relation,
}
ULONG CAN_slice(LSTRING * buffer,
LSTRING * slice,
ULONG CAN_slice(lstring* buffer,
lstring* slice,
bool_t direction,
USHORT sdl_length,
UCHAR * sdl)
UCHAR* sdl)
{
/**************************************
*
@ -297,7 +296,7 @@ static bool_t burp_getbytes(XDR* xdrs, SCHAR* buff, u_int bytecount)
}
static bool_t burp_getlong( XDR * xdrs, SLONG * lp)
static bool_t burp_getlong(XDR* xdrs, SLONG* lp)
{
/**************************************
*
@ -321,7 +320,7 @@ static bool_t burp_getlong( XDR * xdrs, SLONG * lp)
}
static u_int burp_getpostn( XDR * xdrs)
static u_int burp_getpostn(XDR* xdrs)
{
/**************************************
*
@ -338,7 +337,7 @@ static u_int burp_getpostn( XDR * xdrs)
}
static caddr_t burp_inline( XDR * xdrs, u_int bytecount)
static caddr_t burp_inline(XDR* xdrs, u_int bytecount)
{
/**************************************
*
@ -395,7 +394,7 @@ static bool_t burp_putbytes(XDR* xdrs, const SCHAR* buff, u_int bytecount)
}
static bool_t burp_putlong( XDR * xdrs, SLONG * lp)
static bool_t burp_putlong(XDR* xdrs, SLONG* lp)
{
/**************************************
*
@ -414,7 +413,7 @@ static bool_t burp_putlong( XDR * xdrs, SLONG * lp)
}
static bool_t burp_setpostn( XDR * xdrs, u_int bytecount)
static bool_t burp_setpostn(XDR* xdrs, u_int bytecount)
{
/**************************************
*
@ -436,7 +435,7 @@ static bool_t burp_setpostn( XDR * xdrs, u_int bytecount)
}
static bool_t expand_buffer( XDR * xdrs)
static bool_t expand_buffer(XDR* xdrs)
{
/**************************************
*
@ -450,32 +449,30 @@ static bool_t expand_buffer( XDR * xdrs)
* old one.
*
**************************************/
caddr_t p, q;
LSTRING* buffer = (LSTRING*) xdrs->x_public;
SSHORT length = (xdrs->x_private - xdrs->x_base) + xdrs->x_handy + increment;
lstring* buffer = (lstring*) xdrs->x_public;
const SSHORT length = (xdrs->x_private - xdrs->x_base) + xdrs->x_handy + increment;
buffer->lstr_allocated = buffer->lstr_length = length;
caddr_t new_ = (caddr_t) BURP_alloc(length);
caddr_t new_buf = (caddr_t) BURP_alloc(length);
for (p = new_, q = xdrs->x_base; q < xdrs->x_private; *p++ = *q++)
caddr_t p = new_buf;
for (caddr_t q = xdrs->x_base; q < xdrs->x_private; *p++ = *q++)
;
BURP_free(xdrs->x_base);
xdrs->x_base = new_;
xdrs->x_base = new_buf;
xdrs->x_private = p;
xdrs->x_handy += increment;
buffer->lstr_address = (UCHAR *) new_;
buffer->lstr_address = (UCHAR *) new_buf;
return TRUE;
}
static bool_t xdr_datum( XDR * xdrs, DSC * desc, UCHAR * buffer)
static bool_t xdr_datum(XDR* xdrs, DSC* desc, UCHAR* buffer)
{
/**************************************
*
@ -519,9 +516,10 @@ static bool_t xdr_datum( XDR * xdrs, DSC * desc, UCHAR * buffer)
break;
case dtype_cstring:
if (xdrs->x_op == XDR_ENCODE)
if (xdrs->x_op == XDR_ENCODE) {
n = MIN(strlen(reinterpret_cast<const char*>(p)),
(size_t) (desc->dsc_length - 1));
}
if (!xdr_short(xdrs, &n))
return FALSE;
if (!xdr_opaque(xdrs, reinterpret_cast<char*>(p), n))
@ -596,7 +594,9 @@ static bool_t xdr_quad(XDR* xdrs, SLONG* ip)
case XDR_ENCODE:
if ((*xdrs->x_ops->x_putlong) (xdrs, &ip[0]) &&
(*xdrs->x_ops->x_putlong) (xdrs, &ip[1]))
{
return TRUE;
}
return FALSE;
case XDR_DECODE:
@ -615,7 +615,7 @@ static bool_t xdr_quad(XDR* xdrs, SLONG* ip)
static int xdr_init( XDR * xdrs, LSTRING * buffer, enum xdr_op x_op)
static int xdr_init(XDR* xdrs, lstring* buffer, enum xdr_op x_op)
{
/**************************************
*
@ -640,7 +640,7 @@ static int xdr_init( XDR * xdrs, LSTRING * buffer, enum xdr_op x_op)
static bool_t xdr_slice(XDR* xdrs,
LSTRING* slice,
lstring* slice,
USHORT sdl_length,
const UCHAR* sdl)
{

View File

@ -116,8 +116,7 @@ UINT64 MVOL_fini_read()
{
close_platf(tdgbl->file_desc);
FIL file;
for (file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
for (burp_fil* file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
{
if (file->fil_fd == tdgbl->file_desc) {
file->fil_fd = INVALID_HANDLE_VALUE;
@ -146,7 +145,7 @@ UINT64 MVOL_fini_write(int* io_cnt, UCHAR** io_ptr)
if (strcmp(tdgbl->mvol_old_file, "stdout") != 0)
{
close_platf(tdgbl->file_desc);
for (FIL file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
for (burp_fil* file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
{
if (file->fil_fd == tdgbl->file_desc)
file->fil_fd = INVALID_HANDLE_VALUE;
@ -541,7 +540,7 @@ UCHAR MVOL_write(UCHAR c, int *io_cnt, UCHAR ** io_ptr)
if (tdgbl->action->act_file->fil_next)
{
close_platf(tdgbl->file_desc);
for (FIL file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
for (burp_fil* file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
{
if (file->fil_fd == tdgbl->file_desc)
file->fil_fd = INVALID_HANDLE_VALUE;
@ -608,7 +607,8 @@ UCHAR MVOL_write(UCHAR c, int *io_cnt, UCHAR ** io_ptr)
if (tdgbl->action->act_file->fil_next)
{
close_platf(tdgbl->file_desc);
for (FIL file = tdgbl->gbl_sw_backup_files; file; file = file->fil_next)
for (burp_fil* file = tdgbl->gbl_sw_backup_files; file;
file = file->fil_next)
{
if (file->fil_fd == tdgbl->file_desc)
file->fil_fd = INVALID_HANDLE_VALUE;
@ -1004,9 +1004,7 @@ static void prompt_for_name(SCHAR* name, int length)
BURP_msg_get(229, msg, 0, 0, 0, 0, 0);
// \n\nERROR: Backup incomplete\n
ib_fprintf(term_out, msg);
tdgbl->exit_code = FINI_ERROR;
if (tdgbl->burp_env != NULL)
Firebird::status_exception::raise(1);
BURP_exit_local(FINI_ERROR, tdgbl);
}
// If the user typed just a carriage return, they
@ -1137,7 +1135,7 @@ static bool read_header(DESC handle,
case att_backup_compress:
temp = get_numeric();
if (init_flag)
tdgbl->gbl_sw_compress = temp;
tdgbl->gbl_sw_compress = temp != 0;
break;
case att_backup_date:
@ -1202,7 +1200,7 @@ static bool read_header(DESC handle,
temp = get_numeric();
if (init_flag)
{
tdgbl->gbl_sw_transportable = temp;
tdgbl->gbl_sw_transportable = temp != 0;
}
break;

View File

@ -24,7 +24,7 @@
* 2003.08.17 Claudio Valderrama: Fix SF Bug #750659.
*/
/*
$Id: restore.epp,v 1.60 2004-01-12 18:56:47 arnobrinkman Exp $
$Id: restore.epp,v 1.61 2004-01-13 09:52:09 robocop Exp $
*/
#include "firebird.h"
@ -96,20 +96,20 @@ USHORT check_db_version();
void create_database (const TEXT*);
void decompress(UCHAR*, USHORT);
void eat_blob();
BURP_REL find_relation (const TEXT *);
burp_rel* find_relation (const TEXT *);
// CVC: when do these functions return false indeed???
// get_acl and get_index are the only exceptions but ironically their
// returned value is not checked by the caller!
bool get_acl (const TEXT*, ISC_QUAD*, ISC_QUAD*);
void get_array (BURP_REL, UCHAR*);
void get_array (burp_rel*, UCHAR*);
void get_blob (const burp_fld*, UCHAR*);
void get_blr_blob (ISC_QUAD*, bool);
bool get_character_set();
bool get_chk_constraint();
bool get_collation();
rec_type get_data (BURP_REL);
rec_type get_data (burp_rel*);
bool get_exception();
BURP_FLD get_field (BURP_REL);
burp_fld* get_field (burp_rel*);
bool get_field_dimensions();
bool get_files();
bool get_filter();
@ -133,15 +133,15 @@ void get_source_blob (ISC_QUAD*, bool);
USHORT get_text (TEXT*, ULONG);
bool get_trigger();
bool get_trigger_message();
bool get_trigger_old (BURP_REL);
bool get_trigger_old (burp_rel*);
bool get_type();
bool get_user_privilege();
bool get_view (BURP_REL);
void ignore_array (BURP_REL);
bool get_view (burp_rel*);
void ignore_array (burp_rel*);
void ignore_blob();
rec_type ignore_data (BURP_REL);
rec_type ignore_data (burp_rel*);
void realign(UCHAR*, const burp_rel*);
USHORT recompute_length (BURP_REL);
USHORT recompute_length (burp_rel*);
bool restore (const TEXT*, const TEXT*);
void restore_security_class (const TEXT*, const TEXT*);
USHORT get_view_base_relation_count(const TEXT*, USHORT);
@ -256,7 +256,7 @@ int RESTORE_restore (const TEXT* file_name,
tdgbl->RESTORE_format = 0;
tdgbl->global_trans = 0;
tdgbl->gbl_sw_transportable = tdgbl->gbl_sw_compress = FALSE;
tdgbl->gbl_sw_transportable = tdgbl->gbl_sw_compress = false;
if (!restore (file_name, database_name))
return FINI_ERROR;
@ -440,7 +440,7 @@ int RESTORE_restore (const TEXT* file_name,
** Change ownership of any procedures necessary
*/
for (BURP_PRC procedure = tdgbl->procedures; procedure;
for (burp_prc* procedure = tdgbl->procedures; procedure;
procedure = procedure->prc_next)
{
if (procedure->prc_owner[0])
@ -470,7 +470,7 @@ int RESTORE_restore (const TEXT* file_name,
// Change ownership of any relations necessary
for (BURP_REL relation = tdgbl->relations; relation; relation = relation->rel_next)
for (burp_rel* relation = tdgbl->relations; relation; relation = relation->rel_next)
{
if (relation->rel_owner[0])
{
@ -671,7 +671,7 @@ void add_files (const UCHAR* file_name)
SLONG start = 201; // Magic number, can be taken from some constant?
SLONG count = 0;
for (FIL file = tdgbl->gbl_sw_files; file; file = file->fil_next)
for (burp_fil* file = tdgbl->gbl_sw_files; file; file = file->fil_next)
{
if (strcmp (file->fil_name, (char*) file_name))
{
@ -909,7 +909,7 @@ void create_database (const TEXT* file_name)
tdgbl->hdr_forced_writes = forced_writes;
if (tdgbl->gbl_sw_no_reserve)
no_reserve = tdgbl->gbl_sw_no_reserve != FALSE;
no_reserve = tdgbl->gbl_sw_no_reserve;
// Override attribute setting with user requirement
if (tdgbl->gbl_sw_mode)
@ -1108,7 +1108,7 @@ void eat_blob()
get_skip(tdgbl, length);
}
BURP_REL find_relation (const TEXT* name)
burp_rel* find_relation (const TEXT* name)
{
/**************************************
*
@ -1363,7 +1363,7 @@ bool get_acl (const TEXT *owner_nm,
return true;
}
void get_array (BURP_REL relation,
void get_array (burp_rel* relation,
UCHAR *record_buffer)
{
/**************************************
@ -1377,17 +1377,17 @@ void get_array (BURP_REL relation,
* shiney, new array.
*
**************************************/
BURP_FLD field;
burp_fld* field;
ISC_STATUS_ARRAY status_vector;
USHORT count, field_number, field_length;
UCHAR *buffer, *p;
UCHAR blr_buffer[200]; // enough for a sdl with 16 dimensions
LSTRING xdr_slice;
lstring xdr_slice;
TGBL tdgbl = GET_THREAD_DATA;
// don't free something you don't allocate
LSTRING xdr_buffer;
lstring xdr_buffer;
xdr_buffer.lstr_allocated = 0;
// Pick up attributes
@ -2284,7 +2284,7 @@ bool get_collation()
return true;
}
rec_type get_data (BURP_REL relation)
rec_type get_data (burp_rel* relation)
{
/**************************************
*
@ -2495,7 +2495,7 @@ rec_type get_data (BURP_REL relation)
BURP_verbose (124, relation->rel_name, NULL, NULL, NULL, NULL);
// msg 124 restoring data for relation %s
LSTRING data;
lstring data;
data.lstr_allocated = 0;
data.lstr_address = NULL;
ULONG old_length = 0;
@ -2761,7 +2761,7 @@ bool get_exception(void)
}
BURP_FLD get_field (BURP_REL relation)
burp_fld* get_field (burp_rel* relation)
{
/**************************************
*
@ -2789,7 +2789,7 @@ BURP_FLD get_field (BURP_REL relation)
else
local_trans = gds_trans;
BURP_FLD field = (BURP_FLD) BURP_alloc_zero (sizeof(burp_fld));
burp_fld* field = (burp_fld*) BURP_alloc_zero (sizeof(burp_fld));
STORE (TRANSACTION_HANDLE local_trans
REQUEST_HANDLE tdgbl->handles_get_field_req_handle1)
@ -2913,7 +2913,7 @@ BURP_FLD get_field (BURP_REL relation)
field->fld_dimensions = (USHORT) get_numeric();
field->fld_flags |= FLD_array;
USHORT n = field->fld_dimensions;
for (SLONG *rp = field->fld_ranges; n; rp += 2, n--)
for (SLONG* rp = field->fld_ranges; n; rp += 2, n--)
{
if (get_attribute(&attribute, tdgbl) != att_field_range_low)
bad_attribute (scan_next_attr, attribute, 58);
@ -2949,8 +2949,13 @@ BURP_FLD get_field (BURP_REL relation)
break;
case att_field_null_flag:
X.RDB$NULL_FLAG.NULL = FALSE;
X.RDB$NULL_FLAG = (USHORT) get_numeric();
if (tdgbl->gbl_sw_novalidity) {
get_numeric(); // skip
}
else {
X.RDB$NULL_FLAG.NULL = FALSE;
X.RDB$NULL_FLAG = (USHORT) get_numeric();
}
break;
case att_field_character_set:
@ -3665,8 +3670,13 @@ bool get_global_field()
break;
case att_field_null_flag:
X.RDB$NULL_FLAG = (USHORT) get_numeric();
X.RDB$NULL_FLAG.NULL = FALSE;
if (tdgbl->gbl_sw_novalidity) {
get_numeric(); // skip
}
else {
X.RDB$NULL_FLAG = (USHORT) get_numeric();
X.RDB$NULL_FLAG.NULL = FALSE;
}
break;
case att_field_description:
@ -3941,8 +3951,13 @@ bool get_global_field()
break;
case att_field_null_flag:
X.RDB$NULL_FLAG = (USHORT) get_numeric();
X.RDB$NULL_FLAG.NULL = FALSE;
if (tdgbl->gbl_sw_novalidity) {
get_numeric(); // skip
}
else {
X.RDB$NULL_FLAG = (USHORT) get_numeric();
X.RDB$NULL_FLAG.NULL = FALSE;
}
break;
case att_field_description:
@ -4335,7 +4350,7 @@ bool get_procedure()
isc_tr_handle local_trans =
tdgbl->global_trans ? tdgbl->global_trans : gds_trans;
BURP_PRC procedure = (BURP_PRC) BURP_alloc_zero (sizeof(burp_prc));
burp_prc* procedure = (burp_prc*) BURP_alloc_zero (sizeof(burp_prc));
procedure->prc_next = tdgbl->procedures;
tdgbl->procedures = procedure;
@ -4615,7 +4630,7 @@ bool get_relation()
// Pick up relation attributes
BURP_REL relation = (BURP_REL) BURP_alloc_zero (sizeof(burp_rel));
burp_rel* relation = (burp_rel*) BURP_alloc_zero (sizeof(burp_rel));
relation->rel_next = tdgbl->relations;
tdgbl->relations = relation;
@ -4750,8 +4765,8 @@ bool get_relation()
END_ERROR;
// Eat up misc. records
BURP_FLD field = NULL;
BURP_FLD* ptr = &relation->rel_fields;
burp_fld* field = NULL;
burp_fld** ptr = &relation->rel_fields;
while (get_record(&record, tdgbl) != rec_data)
{
@ -5256,7 +5271,7 @@ USHORT get_text (
}
bool get_trigger_old (
BURP_REL relation)
burp_rel* relation)
{
/**************************************
*
@ -5764,7 +5779,7 @@ bool get_user_privilege()
{
case obj_procedure:
{
for (BURP_PRC proc = tdgbl->procedures; proc; proc = proc->prc_next)
for (const burp_prc* proc = tdgbl->procedures; proc; proc = proc->prc_next)
if (!strcmp(proc->prc_name, relation_name))
{
exists = true;
@ -5776,7 +5791,7 @@ bool get_user_privilege()
case obj_relation:
{
for (BURP_REL rel = tdgbl->relations; rel; rel = rel->rel_next)
for (const burp_rel* rel = tdgbl->relations; rel; rel = rel->rel_next)
if (!strcmp(rel->rel_name, relation_name))
{
exists = true;
@ -5874,7 +5889,7 @@ bool get_user_privilege()
return true;
}
bool get_view (BURP_REL relation)
bool get_view (burp_rel* relation)
{
/**************************************
*
@ -5931,7 +5946,7 @@ bool get_view (BURP_REL relation)
return true;
}
void ignore_array (BURP_REL relation)
void ignore_array (burp_rel* relation)
{
/**************************************
*
@ -5944,19 +5959,15 @@ void ignore_array (BURP_REL relation)
* dummy get_array().
*
**************************************/
BURP_FLD field;
burp_fld* field;
ATT_TYPE attribute;
SLONG *range, *end_ranges;
USHORT field_number;
//LSTRING xdr_buffer;
scan_attr_t scan_next_attr;
TGBL tdgbl = GET_THREAD_DATA;
// don't free something you don't allocate
//xdr_buffer.lstr_allocated = 0;
// Pick up attributes
// Pick up attributes
skip_init(&scan_next_attr);
while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_blob_data)
@ -6016,7 +6027,6 @@ void ignore_array (BURP_REL relation)
lcount |= get(tdgbl) << 8;
lcount |= get(tdgbl) << 16;
lcount |= get(tdgbl) << 24;
//xdr_buffer.lstr_length = xdr_buffer.lstr_allocated = lcount;
}
}
else
@ -6088,7 +6098,7 @@ void ignore_blob()
}
}
rec_type ignore_data (BURP_REL relation)
rec_type ignore_data (burp_rel* relation)
{
/**************************************
*
@ -6656,7 +6666,7 @@ void restore_security_class (const TEXT *owner_nm,
}
USHORT get_view_base_relation_count (const TEXT *current_view_name,
USHORT get_view_base_relation_count (const TEXT* current_view_name,
USHORT depth)
{
/**************************************
@ -6669,7 +6679,7 @@ USHORT get_view_base_relation_count (const TEXT *current_view_name,
* Return the number of base relations
* (tables) from a view. When a view is
* referenced in the view this function
* is called recursive.
* is called recursively.
*
**************************************/
@ -6694,7 +6704,7 @@ USHORT get_view_base_relation_count (const TEXT *current_view_name,
R.RDB$RELATION_NAME EQ D.RDB$DEPENDED_ON_NAME
if (R.RDB$VIEW_BLR.NULL) {
// This is relation is a table, so increment count
// This relation is a table, so increment count
result++;
}
else {
@ -6706,7 +6716,7 @@ USHORT get_view_base_relation_count (const TEXT *current_view_name,
ON_ERROR
MISC_release_request_silent(req_handle1);
general_on_error ();
general_on_error();
END_ERROR;
MISC_release_request_silent(req_handle1);
@ -6958,21 +6968,21 @@ void update_view_dbkey_lengths()
R.RDB$VIEW_BLR NOT MISSING AND
(R.RDB$SYSTEM_FLAG NE 1 OR R.RDB$SYSTEM_FLAG MISSING)
USHORT result = get_view_base_relation_count(R.RDB$RELATION_NAME, 0);
const USHORT result = get_view_base_relation_count(R.RDB$RELATION_NAME, 0);
MODIFY R;
R.RDB$DBKEY_LENGTH = (result * 8); // is a constant for DBKEY coded somewhere?
END_MODIFY;
ON_ERROR
MISC_release_request_silent(req_handle2);
general_on_error ();
general_on_error();
END_ERROR;
END_FOR;
ON_ERROR
MISC_release_request_silent(req_handle2);
general_on_error ();
general_on_error();
END_ERROR;
MISC_release_request_silent(req_handle2);

View File

@ -71,7 +71,7 @@ enum gsplit_option
};
static in_sw_tab_t spit_in_sw_table [] =
static in_sw_tab_t spit_in_sw_table[] =
{
{IN_SW_SPIT_SP, 0, "SPLIT_BK_FILE", 0, 0, 0, FALSE, 0, 0, NULL},
{IN_SW_SPIT_JT, 0, "JOIN_BK_FILE", 0, 0, 0, FALSE, 0, 0, NULL},
@ -168,8 +168,9 @@ int main( int argc, char *argv[])
*************************
*/
b_fil* file_ptr, *file_list, *prev_file;
file_ptr = file_list = prev_file = NULL;
b_fil* file_ptr = NULL;
b_fil* file_list = NULL;
b_fil* prev_file = NULL;
// Strange, never met a program with tenths of bytes... may need updating
// from double to int64.
double file_size = -1;
@ -194,7 +195,7 @@ int main( int argc, char *argv[])
bool file_nm_sw = false;
SCHAR* string = NULL;
SCHAR** end = argv + argc;
const SCHAR* const* const end = argv + argc;
++argv;
while (argv < end)
{
@ -347,7 +348,7 @@ int main( int argc, char *argv[])
ret_cd = free_file_list(file_list);
return FB_SUCCESS;
} /* end of main() */
} // end of main()
static int get_function_option(const SCHAR* prog_name,

View File

@ -161,7 +161,9 @@ ISC_STATUS API_ROUTINE isc_array_lookup_bounds(ISC_STATUS* status,
if (lookup_desc(status, db_handle, trans_handle,
field_name, relation_name, desc, global))
return status[1];
{
return status[1];
}
ISC_ARRAY_BOUND* tail = desc->array_desc_bounds;

View File

@ -3678,7 +3678,7 @@ static dsql_nod* pass1_field( dsql_req* request, dsql_nod* input, const bool lis
The explained query directly above doesn't work anymore, thus the day has come ;-)
It's allowed to use the same fieldname between different scope levels (sub-queries)
without being hit by the ambiguity check. The field uses the first match starting
from it's own level (ofcourse ambiguity-check on each level is done).
from it's own level (of course ambiguity-check on each level is done).
4.- Doesn't verify code derived automatically from check constraints. They are
ill-formed by nature but making that code generation more orthodox is not a

View File

@ -27,7 +27,7 @@
* Mark O'Donohue <mark.odonohue@ludwig.edu.au>
*
*
* $Id: fb_types.h,v 1.37 2004-01-12 05:40:01 skidder Exp $
* $Id: fb_types.h,v 1.38 2004-01-13 09:52:12 robocop Exp $
*
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete "OS/2" port
*
@ -118,7 +118,6 @@ struct lstring
ULONG lstr_allocated;
UCHAR* lstr_address;
};
typedef struct lstring LSTRING;
typedef unsigned char BOOLEAN;

View File

@ -73,7 +73,7 @@ static struct {
/* dtype_int64 */ {SQL_INT64, sizeof(SINT64)},
};
void ExecuteStatement::Open(TDBB tdbb, JRD_NOD sql, SSHORT nVars, bool SingleTon) {
void ExecuteStatement::Open(TDBB tdbb, jrd_nod* sql, SSHORT nVars, bool SingleTon) {
SET_TDBB(tdbb);
Sqlda = 0;
Transaction = 0;
@ -176,7 +176,7 @@ err_handler:
}
}
bool ExecuteStatement::Fetch(TDBB tdbb, JRD_NOD * JrdVar) {
bool ExecuteStatement::Fetch(TDBB tdbb, jrd_nod** JrdVar) {
// If already bugged - we should never get here
fb_assert(! (tdbb->tdbb_status_vector[0] == 1 &&
tdbb->tdbb_status_vector[1] != 0));

View File

@ -45,9 +45,10 @@ private:
ISC_STATUS ReMakeSqlda(ISC_STATUS *vector, TDBB tdbb);
ULONG ParseSqlda(void);
public:
void Open(TDBB tdbb, JRD_NOD sql, SSHORT nVars, bool SingleTon);
bool Fetch(TDBB tdbb, JRD_NOD * FirstVar);
void Open(TDBB tdbb, jrd_nod* sql, SSHORT nVars, bool SingleTon);
bool Fetch(TDBB tdbb, jrd_nod** FirstVar);
void Close(TDBB tdbb);
};
#endif // JRD_DynExec_H

View File

@ -33,7 +33,7 @@
*
*/
/*
$Id: blb.cpp,v 1.47 2004-01-09 01:51:27 skidder Exp $
$Id: blb.cpp,v 1.48 2004-01-13 09:52:13 robocop Exp $
*/
#include "firebird.h"
@ -821,7 +821,7 @@ void BLB_map_blobs(TDBB tdbb, BLB old_blob, BLB new_blob)
// which in turn calls BLB_create2 that writes in the blob id. Although the
// compiler allows to modify from_desc->dsc_address' contents when from_desc is
// constant, this is misleading so I didn't make the source descriptor constant.
void BLB_move(TDBB tdbb, dsc* from_desc, dsc* to_desc, JRD_NOD field)
void BLB_move(TDBB tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field)
{
/**************************************
*
@ -947,7 +947,7 @@ void BLB_move(TDBB tdbb, dsc* from_desc, dsc* to_desc, JRD_NOD field)
}
void BLB_move_from_string(TDBB tdbb, const dsc* from_desc, dsc* to_desc, JRD_NOD field)
void BLB_move_from_string(TDBB tdbb, const dsc* from_desc, dsc* to_desc, jrd_nod* field)
{
/**************************************
*

View File

@ -42,7 +42,7 @@ BLKDEF(type_fmt, fmt, sizeof(((FMT) NULL)->fmt_desc[0])) /* Done */
BLKDEF(type_vcl, vcl, sizeof(((VCL) NULL)->vcl_long[0])) /* Done */
BLKDEF(type_req, jrd_req, sizeof(((jrd_req*) NULL)->req_rpb[0])) /* Done */
BLKDEF(type_tra, jrd_tra, 1)
BLKDEF(type_nod, jrd_nod, sizeof(((JRD_NOD) NULL)->nod_arg[0])) /* Done */
BLKDEF(type_nod, jrd_nod, sizeof(((jrd_nod*) NULL)->nod_arg[0])) /* Done */
BLKDEF(type_csb, Csb, sizeof(((CSB) NULL)->csb_rpt[0])) /* Done */
BLKDEF(type_lls, lls, 0) /* linked list stack */
BLKDEF(type_rec, rec, 1) /* record parameter */

View File

@ -166,7 +166,7 @@ static USHORT compress_root(TDBB, IRT);
static void copy_key(const KEY*, KEY*);
static CONTENTS delete_node(TDBB, WIN *, UCHAR *);
static void delete_tree(TDBB, USHORT, USHORT, SLONG, SLONG);
static DSC *eval(TDBB, JRD_NOD, DSC *, bool *);
static DSC *eval(TDBB, jrd_nod*, DSC *, bool *);
static SLONG fast_load(TDBB, jrd_rel*, IDX *, USHORT, SCB, SelectivityList&);
static IRT fetch_root(TDBB, WIN *, jrd_rel*);
static UCHAR *find_node_start_point(BTR, KEY *, UCHAR *, USHORT *, bool, bool, bool = false, SLONG = NO_VALUE);
@ -1111,7 +1111,7 @@ USHORT BTR_lookup(TDBB tdbb, jrd_rel* relation, USHORT id, IDX * buffer)
void BTR_make_key(TDBB tdbb,
USHORT count,
JRD_NOD * exprs, IDX * idx, KEY * key, USHORT fuzzy)
jrd_nod** exprs, IDX * idx, KEY * key, USHORT fuzzy)
{
/**************************************
*
@ -2488,7 +2488,7 @@ static void delete_tree(TDBB tdbb,
}
static DSC *eval(TDBB tdbb, JRD_NOD node, DSC * temp, bool *isNull)
static DSC *eval(TDBB tdbb, jrd_nod* node, DSC * temp, bool *isNull)
{
/**************************************
*

View File

@ -1178,112 +1178,113 @@ void CCH_fini(TDBB tdbb)
**************************************/
SET_TDBB(tdbb);
DBB dbb = tdbb->tdbb_database;
BOOLEAN flush_error = FALSE;
bool flush_error = false;
// CVC: Patching a conversion error FB1->FB2 with crude logic
for (int i = 0; i < 2; ++i)
{
do {
try {
try {
/* If we've been initialized, either flush buffers
or release locks, depending on where we've been
bug-checked; as a defensive programming measure,
make sure that the buffers were actually allocated */
/* If we've been initialized, either flush buffers
or release locks, depending on where we've been
bug-checked; as a defensive programming measure,
make sure that the buffers were actually allocated */
bcb_repeat* tail;
BCB bcb = dbb->dbb_bcb;
if (bcb && (tail = bcb->bcb_rpt) && (tail->bcb_bdb)) {
if (dbb->dbb_flags & DBB_bugcheck || flush_error) {
for (const bcb_repeat* const end = bcb->bcb_rpt + bcb->bcb_count;
tail < end; tail++)
{
BDB bdb = tail->bcb_bdb;
if (bdb->bdb_expanded_buffer) {
delete bdb->bdb_expanded_buffer;
bdb->bdb_expanded_buffer = NULL;
bcb_repeat* tail;
BCB bcb = dbb->dbb_bcb;
if (bcb && (tail = bcb->bcb_rpt) && (tail->bcb_bdb)) {
if (dbb->dbb_flags & DBB_bugcheck || flush_error) {
for (const bcb_repeat* const end = bcb->bcb_rpt + bcb->bcb_count;
tail < end; tail++)
{
BDB bdb = tail->bcb_bdb;
if (bdb->bdb_expanded_buffer) {
delete bdb->bdb_expanded_buffer;
bdb->bdb_expanded_buffer = NULL;
}
PAGE_LOCK_RELEASE(bdb->bdb_lock);
}
PAGE_LOCK_RELEASE(bdb->bdb_lock);
}
else {
CCH_flush(tdbb, (USHORT) FLUSH_FINI, (SLONG) 0);
}
}
else {
CCH_flush(tdbb, (USHORT) FLUSH_FINI, (SLONG) 0);
}
}
#ifdef CACHE_READER
/* Shutdown the dedicated cache reader for this database. */
/* Shutdown the dedicated cache reader for this database. */
if ((bcb = dbb->dbb_bcb) && (bcb->bcb_flags & BCB_cache_reader)) {
EVENT event = dbb->dbb_reader_event;
bcb->bcb_flags &= ~BCB_cache_reader;
ISC_event_post(event);
SLONG count = ISC_event_clear(event);
THREAD_EXIT;
ISC_event_wait(1, &event, &count, 0, NULL, 0);
THREAD_ENTER;
/* Now dispose off the cache reader associated semaphore */
ISC_event_fini(event);
}
if ((bcb = dbb->dbb_bcb) && (bcb->bcb_flags & BCB_cache_reader)) {
EVENT event = dbb->dbb_reader_event;
bcb->bcb_flags &= ~BCB_cache_reader;
ISC_event_post(event);
SLONG count = ISC_event_clear(event);
THREAD_EXIT;
ISC_event_wait(1, &event, &count, 0, NULL, 0);
THREAD_ENTER;
/* Now dispose off the cache reader associated semaphore */
ISC_event_fini(event);
}
#endif
#ifdef CACHE_WRITER
/* Shutdown the dedicated cache writer for this database. */
/* Shutdown the dedicated cache writer for this database. */
if ((bcb = dbb->dbb_bcb) && (bcb->bcb_flags & BCB_cache_writer)) {
EVENT event = dbb->dbb_writer_event_fini;
/* initialize initialization event */
ISC_event_init(event, 0, 0);
SLONG count = ISC_event_clear(event);
if ((bcb = dbb->dbb_bcb) && (bcb->bcb_flags & BCB_cache_writer)) {
EVENT event = dbb->dbb_writer_event_fini;
/* initialize initialization event */
ISC_event_init(event, 0, 0);
SLONG count = ISC_event_clear(event);
bcb->bcb_flags &= ~BCB_cache_writer;
ISC_event_post(dbb->dbb_writer_event); /* Wake up running thread */
THREAD_EXIT;
ISC_event_wait(1, &event, &count, 0, NULL, 0);
THREAD_ENTER;
/* Cleanup initialization event */
ISC_event_fini(event);
}
bcb->bcb_flags &= ~BCB_cache_writer;
ISC_event_post(dbb->dbb_writer_event); /* Wake up running thread */
THREAD_EXIT;
ISC_event_wait(1, &event, &count, 0, NULL, 0);
THREAD_ENTER;
/* Cleanup initialization event */
ISC_event_fini(event);
}
#endif
/* close the database file and all associated shadow files */
/* close the database file and all associated shadow files */
PIO_close(dbb->dbb_file);
SDW_close();
PIO_close(dbb->dbb_file);
SDW_close();
if ( (bcb = dbb->dbb_bcb) ) {
while (bcb->bcb_memory) {
gds__free(LLS_POP(&bcb->bcb_memory));
}
if ( (bcb = dbb->dbb_bcb) ) {
while (bcb->bcb_memory) {
gds__free(LLS_POP(&bcb->bcb_memory));
}
#ifdef CACHE_WRITER
/* Dispose off any associated latching semaphores */
while (QUE_NOT_EMPTY(bcb->bcb_free_lwt)) {
QUE que = bcb->bcb_free_lwt.que_forward;
QUE_DELETE((*que));
lwt* lwt_ = (LWT) BLOCK(que, LWT, lwt_waiters);
ISC_event_fini(&lwt_->lwt_event);
}
/* Dispose off any associated latching semaphores */
while (QUE_NOT_EMPTY(bcb->bcb_free_lwt)) {
QUE que = bcb->bcb_free_lwt.que_forward;
QUE_DELETE((*que));
lwt* lwt_ = (LWT) BLOCK(que, LWT, lwt_waiters);
ISC_event_fini(&lwt_->lwt_event);
}
#endif
}
return;
} // try
catch (const std::exception&)
{
if (!flush_error) {
// Even if we were unable to flush our dirty buffers
// let's free resources and close files to prevent server collapse
flush_error = TRUE;
continue;
}
else {
ERR_punt();
}
}
} while (true);
} // try
catch (const std::exception&)
{
if (!flush_error) {
flush_error = true;
}
else {
ERR_punt();
}
}
if (!flush_error) { // wasn't set in the catch => no failure, just exit
break;
}
} // for
}
@ -1387,8 +1388,8 @@ void CCH_flush(TDBB tdbb, USHORT flush_flag, SLONG tra_number)
//
// Check if flush needed
//
int max_unflushed_writes = Config::getMaxUnflushedWrites();
time_t max_unflushed_write_time = Config::getMaxUnflushedWriteTime();
const int max_unflushed_writes = Config::getMaxUnflushedWrites();
const time_t max_unflushed_write_time = Config::getMaxUnflushedWriteTime();
bool max_num = (max_unflushed_writes >= 0);
bool max_time = (max_unflushed_write_time >= 0);

View File

@ -125,36 +125,36 @@ rel_MAX} RIDS;
#define MAX_REQUEST_SIZE 10485760 // 10 MB - just to be safe
static UCHAR* alloc_map(TDBB, CSB, USHORT);
static JRD_NOD catenate_nodes(TDBB, LLS);
static JRD_NOD copy(TDBB, CSB, JRD_NOD, UCHAR *, USHORT, JRD_NOD, bool);
static void expand_view_nodes(TDBB, CSB, USHORT, LLS *, NOD_T);
static void ignore_dbkey(TDBB, CSB, RSE, jrd_rel*);
static JRD_NOD make_defaults(TDBB, CSB, USHORT, JRD_NOD);
static JRD_NOD make_validation(TDBB, CSB, USHORT);
static JRD_NOD pass1(TDBB, CSB, JRD_NOD, jrd_rel*, USHORT, bool);
static void pass1_erase(TDBB, CSB, JRD_NOD);
static JRD_NOD pass1_expand_view(TDBB, CSB, USHORT, USHORT, bool);
static void pass1_modify(TDBB, CSB, JRD_NOD);
static RSE pass1_rse(TDBB, CSB, RSE, jrd_rel*, USHORT);
static void pass1_source(TDBB, CSB, RSE, JRD_NOD, JRD_NOD *, LLS *, jrd_rel*, USHORT);
static JRD_NOD pass1_store(TDBB, CSB, JRD_NOD);
static JRD_NOD pass1_update(TDBB, CSB, jrd_rel*, TRIG_VEC, USHORT, USHORT, USHORT, jrd_rel*,
static UCHAR* alloc_map(TDBB, Csb*, USHORT);
static jrd_nod* catenate_nodes(TDBB, LLS);
static jrd_nod* copy(TDBB, Csb*, jrd_nod*, UCHAR *, USHORT, jrd_nod*, bool);
static void expand_view_nodes(TDBB, Csb*, USHORT, LLS *, NOD_T);
static void ignore_dbkey(TDBB, Csb*, RSE, jrd_rel*);
static jrd_nod* make_defaults(TDBB, Csb*, USHORT, jrd_nod*);
static jrd_nod* make_validation(TDBB, Csb*, USHORT);
static jrd_nod* pass1(TDBB, Csb*, jrd_nod*, jrd_rel*, USHORT, bool);
static void pass1_erase(TDBB, Csb*, jrd_nod*);
static jrd_nod* pass1_expand_view(TDBB, Csb*, USHORT, USHORT, bool);
static void pass1_modify(TDBB, Csb*, jrd_nod*);
static RSE pass1_rse(TDBB, Csb*, RSE, jrd_rel*, USHORT);
static void pass1_source(TDBB, Csb*, RSE, jrd_nod*, jrd_nod**, LLS *, jrd_rel*, USHORT);
static jrd_nod* pass1_store(TDBB, Csb*, jrd_nod*);
static jrd_nod* pass1_update(TDBB, Csb*, jrd_rel*, TRIG_VEC, USHORT, USHORT, USHORT, jrd_rel*,
USHORT);
static JRD_NOD pass2(TDBB, CSB, jrd_nod* const, JRD_NOD);
static void pass2_rse(TDBB, CSB, RSE);
static JRD_NOD pass2_union(TDBB, CSB, JRD_NOD);
static void plan_check(CSB, RSE);
static void plan_set(CSB, RSE, JRD_NOD);
static void post_procedure_access(TDBB, CSB, jrd_prc*);
static RSB post_rse(TDBB, CSB, RSE);
static void post_trigger_access(TDBB, CSB, jrd_rel*, TRIG_VEC, jrd_rel*);
static void process_map(TDBB, CSB, JRD_NOD, fmt**);
static jrd_nod* pass2(TDBB, Csb*, jrd_nod* const, jrd_nod*);
static void pass2_rse(TDBB, Csb*, RSE);
static jrd_nod* pass2_union(TDBB, Csb*, jrd_nod*);
static void plan_check(Csb*, RSE);
static void plan_set(Csb*, RSE, jrd_nod*);
static void post_procedure_access(TDBB, Csb*, jrd_prc*);
static RSB post_rse(TDBB, Csb*, RSE);
static void post_trigger_access(TDBB, Csb*, jrd_rel*, TRIG_VEC, jrd_rel*);
static void process_map(TDBB, Csb*, jrd_nod*, fmt**);
static bool stream_in_rse(USHORT, RSE);
static SSHORT strcmp_space(const TEXT*, const TEXT*);
#ifdef PC_ENGINE
static USHORT base_stream(CSB, JRD_NOD *, bool);
static USHORT base_stream(Csb*, jrd_nod**, bool);
#endif
#ifdef CMP_DEBUG
@ -206,7 +206,7 @@ bool CMP_clone_is_active(const jrd_req* request)
}
JRD_NOD CMP_clone_node(TDBB tdbb, CSB csb, JRD_NOD node)
jrd_nod* CMP_clone_node(TDBB tdbb, Csb* csb, jrd_nod* node)
{
/**************************************
*
@ -370,7 +370,7 @@ jrd_req* CMP_compile2(TDBB tdbb, const UCHAR* blr, USHORT internal_flag)
try {
CSB csb = PAR_parse(tdbb, blr, internal_flag);
Csb* csb = PAR_parse(tdbb, blr, internal_flag);
request = CMP_make_request(tdbb, csb);
if (internal_flag) {
@ -403,7 +403,7 @@ jrd_req* CMP_compile2(TDBB tdbb, const UCHAR* blr, USHORT internal_flag)
}
csb_repeat* CMP_csb_element(CSB csb, USHORT element)
csb_repeat* CMP_csb_element(Csb* csb, USHORT element)
{
/**************************************
*
@ -532,7 +532,7 @@ void CMP_fini(TDBB tdbb)
}
FMT CMP_format(TDBB tdbb, CSB csb, USHORT stream)
FMT CMP_format(TDBB tdbb, Csb* csb, USHORT stream)
{
/**************************************
*
@ -566,7 +566,7 @@ FMT CMP_format(TDBB tdbb, CSB csb, USHORT stream)
}
void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
void CMP_get_desc(TDBB tdbb, Csb* csb, jrd_nod* node, DSC * desc)
{
/**************************************
*
@ -1712,7 +1712,7 @@ IDL CMP_get_index_lock(TDBB tdbb, jrd_rel* relation, USHORT id)
}
SLONG CMP_impure(CSB csb, USHORT size)
SLONG CMP_impure(Csb* csb, USHORT size)
{
/**************************************
*
@ -1737,7 +1737,7 @@ SLONG CMP_impure(CSB csb, USHORT size)
}
jrd_req* CMP_make_request(TDBB tdbb, CSB csb)
jrd_req* CMP_make_request(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -1962,7 +1962,7 @@ jrd_req* CMP_make_request(TDBB tdbb, CSB csb)
void CMP_post_access(TDBB tdbb,
CSB csb,
Csb* csb,
const TEXT* security_name,
SLONG view_id,
const TEXT* trig,
@ -2330,7 +2330,7 @@ void CMP_shutdown_database(TDBB tdbb)
}
static UCHAR* alloc_map(TDBB tdbb, CSB csb, USHORT stream)
static UCHAR* alloc_map(TDBB tdbb, Csb* csb, USHORT stream)
{
/**************************************
*
@ -2357,7 +2357,7 @@ static UCHAR* alloc_map(TDBB tdbb, CSB csb, USHORT stream)
#ifdef PC_ENGINE
static USHORT base_stream(CSB csb, JRD_NOD * stream_number, bool nav_stream)
static USHORT base_stream(Csb* csb, jrd_nod** stream_number, bool nav_stream)
{
/**************************************
*
@ -2373,7 +2373,7 @@ static USHORT base_stream(CSB csb, JRD_NOD * stream_number, bool nav_stream)
**************************************/
DEV_BLKCHK(csb, type_csb);
// note: *stream_number is NOT a JRD_NOD
// note: *stream_number is NOT a jrd_nod*
USHORT stream = (USHORT) *stream_number;
// if the stream references a view, follow map
@ -2396,7 +2396,7 @@ static USHORT base_stream(CSB csb, JRD_NOD * stream_number, bool nav_stream)
// in the node tree to point to the base table from now on
if (nav_stream) {
*stream_number = (JRD_NOD) stream;
*stream_number = (jrd_nod*) stream;
}
return stream;
@ -2404,7 +2404,7 @@ static USHORT base_stream(CSB csb, JRD_NOD * stream_number, bool nav_stream)
#endif
static JRD_NOD catenate_nodes(TDBB tdbb, LLS stack)
static jrd_nod* catenate_nodes(TDBB tdbb, LLS stack)
{
/**************************************
*
@ -2421,7 +2421,7 @@ static JRD_NOD catenate_nodes(TDBB tdbb, LLS stack)
DEV_BLKCHK(stack, type_lls);
jrd_nod* node1 = (JRD_NOD) LLS_POP(&stack);
jrd_nod* node1 = (jrd_nod*) LLS_POP(&stack);
if (!stack)
return node1;
@ -2435,12 +2435,12 @@ static JRD_NOD catenate_nodes(TDBB tdbb, LLS stack)
}
static JRD_NOD copy(TDBB tdbb,
CSB csb,
JRD_NOD input,
static jrd_nod* copy(TDBB tdbb,
Csb* csb,
jrd_nod* input,
UCHAR * remap,
USHORT field_id,
JRD_NOD message,
jrd_nod* message,
bool remap_fld)
{
/**************************************
@ -2454,7 +2454,7 @@ static JRD_NOD copy(TDBB tdbb,
* map isn't present, don't remap.
*
**************************************/
JRD_NOD node;
jrd_nod* node;
USHORT stream, new_stream;
SET_TDBB(tdbb);
@ -2641,7 +2641,7 @@ static JRD_NOD copy(TDBB tdbb,
new_rse->rse_projection =
copy(tdbb, csb, old_rse->rse_projection, remap, field_id,
message, remap_fld);
return (JRD_NOD) new_rse;
return (jrd_nod*) new_rse;
}
case nod_relation:
@ -2661,7 +2661,7 @@ static JRD_NOD copy(TDBB tdbb,
const int relative_stream = (stream) ? remap[stream - 1] : stream;
new_stream = csb->csb_n_stream++;
fb_assert(new_stream <= MAX_STREAMS);
node->nod_arg[e_rel_stream] = (JRD_NOD) (SLONG) new_stream;
node->nod_arg[e_rel_stream] = (jrd_nod*) (SLONG) new_stream;
remap[stream] = (UCHAR) new_stream;
node->nod_arg[e_rel_context] = input->nod_arg[e_rel_context];
@ -2689,7 +2689,7 @@ static JRD_NOD copy(TDBB tdbb,
stream 1 -------- X
stream 2 -------- V1
while expanding V1 the engine calls copy() with nod_relation.
A new stream 3 is created. Now the CSB looks like
A new stream 3 is created. Now the Csb looks like
stream 1 -------- X
stream 2 -------- V1 map [2,3]
stream 3 -------- T1
@ -2734,7 +2734,7 @@ static JRD_NOD copy(TDBB tdbb,
stream = (USHORT)(ULONG) input->nod_arg[e_prc_stream];
new_stream = csb->csb_n_stream++;
fb_assert(new_stream <= MAX_STREAMS);
node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) new_stream;
node->nod_arg[e_prc_stream] = (jrd_nod*) (SLONG) new_stream;
remap[stream] = (UCHAR) new_stream;
node->nod_arg[e_prc_procedure] = input->nod_arg[e_prc_procedure];
csb_repeat* element = CMP_csb_element(csb, new_stream);
@ -2758,7 +2758,7 @@ static JRD_NOD copy(TDBB tdbb,
fb_assert(stream <= MAX_STREAMS);
new_stream = csb->csb_n_stream++;
fb_assert(new_stream <= MAX_STREAMS);
node->nod_arg[e_agg_stream] = (JRD_NOD) (SLONG) new_stream;
node->nod_arg[e_agg_stream] = (jrd_nod*) (SLONG) new_stream;
// fb_assert(new_stream <= MAX_UCHAR);
remap[stream] = (UCHAR) new_stream;
CMP_csb_element(csb, new_stream);
@ -2786,7 +2786,7 @@ static JRD_NOD copy(TDBB tdbb,
fb_assert(stream <= MAX_STREAMS);
new_stream = csb->csb_n_stream++;
fb_assert(new_stream <= MAX_STREAMS);
node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) new_stream;
node->nod_arg[e_uni_stream] = (jrd_nod*) (SLONG) new_stream;
remap[stream] = (UCHAR) new_stream;
CMP_csb_element(csb, new_stream);
@ -2852,7 +2852,7 @@ static JRD_NOD copy(TDBB tdbb,
static void expand_view_nodes(TDBB tdbb,
CSB csb,
Csb* csb,
USHORT stream,
LLS * stack,
NOD_T type)
@ -2893,13 +2893,13 @@ static void expand_view_nodes(TDBB tdbb,
jrd_nod* node = PAR_make_node(tdbb, 1);
node->nod_count = 0;
node->nod_type = type;
node->nod_arg[0] = (JRD_NOD) (SLONG) stream;
node->nod_arg[0] = (jrd_nod*) (SLONG) stream;
LLS_PUSH(node, stack);
}
}
static void ignore_dbkey(TDBB tdbb, CSB csb, RSE rse, jrd_rel* view)
static void ignore_dbkey(TDBB tdbb, Csb* csb, RSE rse, jrd_rel* view)
{
/**************************************
*
@ -2953,7 +2953,7 @@ static void ignore_dbkey(TDBB tdbb, CSB csb, RSE rse, jrd_rel* view)
}
static JRD_NOD make_defaults(TDBB tdbb, CSB csb, USHORT stream, JRD_NOD statement)
static jrd_nod* make_defaults(TDBB tdbb, Csb* csb, USHORT stream, jrd_nod* statement)
{
/**************************************
*
@ -3016,7 +3016,7 @@ static JRD_NOD make_defaults(TDBB tdbb, CSB csb, USHORT stream, JRD_NOD statemen
}
static JRD_NOD make_validation(TDBB tdbb, CSB csb, USHORT stream)
static jrd_nod* make_validation(TDBB tdbb, Csb* csb, USHORT stream)
{
/**************************************
*
@ -3084,9 +3084,9 @@ static JRD_NOD make_validation(TDBB tdbb, CSB csb, USHORT stream)
}
static JRD_NOD pass1(TDBB tdbb,
CSB csb,
JRD_NOD node,
static jrd_nod* pass1(TDBB tdbb,
Csb* csb,
jrd_nod* node,
jrd_rel* view,
USHORT view_stream,
bool validate_expr)
@ -3111,7 +3111,7 @@ static JRD_NOD pass1(TDBB tdbb,
* function.)
*
**************************************/
JRD_NOD sub, *ptr, *end;
jrd_nod* sub, **ptr, **end;
USHORT stream;
csb_repeat *tail;
jrd_prc* procedure;
@ -3388,7 +3388,7 @@ static JRD_NOD pass1(TDBB tdbb,
case nod_rse:
case nod_stream:
return (JRD_NOD) pass1_rse(tdbb, csb, (RSE) node, view, view_stream);
return (jrd_nod*) pass1_rse(tdbb, csb, (RSE) node, view, view_stream);
case nod_max:
case nod_min:
@ -3443,7 +3443,7 @@ static JRD_NOD pass1(TDBB tdbb,
node->nod_count = 0;
node->nod_type = type;
node->nod_flags |= nod_agg_dbkey;
node->nod_arg[0] = (JRD_NOD) (SLONG) stream;
node->nod_arg[0] = (jrd_nod*) (SLONG) stream;
return node;
}
@ -3498,7 +3498,7 @@ static JRD_NOD pass1(TDBB tdbb,
}
static void pass1_erase(TDBB tdbb, CSB csb, JRD_NOD node)
static void pass1_erase(TDBB tdbb, Csb* csb, jrd_nod* node)
{
/**************************************
*
@ -3548,7 +3548,7 @@ static void pass1_erase(TDBB tdbb, CSB csb, JRD_NOD node)
if (relation->rel_view_rse && trigger) {
new_stream = csb->csb_n_stream++;
node->nod_arg[e_erase_stream] = (JRD_NOD) (SLONG) new_stream;
node->nod_arg[e_erase_stream] = (jrd_nod*) (SLONG) new_stream;
CMP_csb_element(csb, new_stream)->csb_relation = relation;
}
@ -3596,13 +3596,13 @@ static void pass1_erase(TDBB tdbb, CSB csb, JRD_NOD node)
parent = relation;
parent_stream = stream;
new_stream = (USHORT)(ULONG) source->nod_arg[e_rel_stream];
node->nod_arg[e_erase_stream] = (JRD_NOD) (SLONG) map[new_stream];
node->nod_arg[e_erase_stream] = (jrd_nod*) (SLONG) map[new_stream];
}
}
static JRD_NOD pass1_expand_view(TDBB tdbb,
CSB csb,
static jrd_nod* pass1_expand_view(TDBB tdbb,
Csb* csb,
USHORT org_stream,
USHORT new_stream,
bool remap)
@ -3666,7 +3666,7 @@ static JRD_NOD pass1_expand_view(TDBB tdbb,
}
static void pass1_modify(TDBB tdbb, CSB csb, JRD_NOD node)
static void pass1_modify(TDBB tdbb, Csb* csb, jrd_nod* node)
{
/**************************************
*
@ -3751,7 +3751,7 @@ static void pass1_modify(TDBB tdbb, CSB csb, JRD_NOD node)
fb_assert((int) (IPTR) source->nod_arg[e_rel_stream] <= MAX_STREAMS);
map[new_stream] = (UCHAR)(ULONG) source->nod_arg[e_rel_stream];
jrd_nod* view_node = copy(tdbb, csb, node, map, 0, NULL, true);
view_node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) stream;
view_node->nod_arg[e_mod_org_stream] = (jrd_nod*) (SLONG) stream;
view_node->nod_arg[e_mod_new_stream] =
source->nod_arg[e_rel_stream];
view_node->nod_arg[e_mod_map_view] = NULL;
@ -3770,7 +3770,7 @@ static void pass1_modify(TDBB tdbb, CSB csb, JRD_NOD node)
UCHAR* map = csb->csb_rpt[stream].csb_map;
stream = (USHORT)(ULONG) source->nod_arg[e_rel_stream];
node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) map[stream];
node->nod_arg[e_mod_org_stream] = (jrd_nod*) (SLONG) map[stream];
// next, do update stream
@ -3785,7 +3785,7 @@ static void pass1_modify(TDBB tdbb, CSB csb, JRD_NOD node)
static RSE pass1_rse(TDBB tdbb,
CSB csb,
Csb* csb,
RSE rse,
jrd_rel* view,
USHORT view_stream)
@ -3874,7 +3874,7 @@ static RSE pass1_rse(TDBB tdbb,
arg = rse->rse_relation + count;
while (stack) {
*--arg = (JRD_NOD) LLS_POP(&stack);
*--arg = (jrd_nod*) LLS_POP(&stack);
}
// finish of by processing other clauses
@ -3888,7 +3888,7 @@ static RSE pass1_rse(TDBB tdbb,
if (boolean) {
if (rse->rse_boolean) {
JRD_NOD additional = PAR_make_node(tdbb, 2);
jrd_nod* additional = PAR_make_node(tdbb, 2);
additional->nod_type = nod_and;
additional->nod_arg[0] = boolean;
additional->nod_arg[1] =
@ -3936,10 +3936,10 @@ static RSE pass1_rse(TDBB tdbb,
static void pass1_source(TDBB tdbb,
CSB csb,
Csb* csb,
RSE rse,
JRD_NOD source,
JRD_NOD* boolean,
jrd_nod* source,
jrd_nod** boolean,
LLS* stack,
jrd_rel* parent_view,
USHORT view_stream)
@ -3996,7 +3996,7 @@ static void pass1_source(TDBB tdbb,
pass1(tdbb, csb, sub_rse->rse_boolean, parent_view,
view_stream, false);
if (*boolean) {
JRD_NOD additional = PAR_make_node(tdbb, 2);
jrd_nod* additional = PAR_make_node(tdbb, 2);
additional->nod_type = nod_and;
additional->nod_arg[0] = node;
additional->nod_arg[1] = *boolean;
@ -4054,7 +4054,7 @@ static void pass1_source(TDBB tdbb,
jrd_rel* view = (jrd_rel*) source->nod_arg[e_rel_relation];
CMP_post_resource(tdbb, &csb->csb_resources, (BLK) view, rsc_relation,
view->rel_id);
source->nod_arg[e_rel_view] = (JRD_NOD) parent_view;
source->nod_arg[e_rel_view] = (jrd_nod*) parent_view;
const USHORT stream = (USHORT)(ULONG) source->nod_arg[e_rel_stream];
csb_repeat* element = CMP_csb_element(csb, stream);
@ -4103,7 +4103,7 @@ static void pass1_source(TDBB tdbb,
//if ((view_rse->rse_projection && rse->rse_projection)
|| rse->rse_jointype)
{
jrd_nod* node = copy(tdbb, csb, (JRD_NOD) view_rse, map, 0, NULL, false);
jrd_nod* node = copy(tdbb, csb, (jrd_nod*) view_rse, map, 0, NULL, false);
DEBUG;
LLS_PUSH(pass1(tdbb, csb, node, view, stream, false), stack);
DEBUG;
@ -4179,7 +4179,7 @@ static void pass1_source(TDBB tdbb,
}
static JRD_NOD pass1_store(TDBB tdbb, CSB csb, JRD_NOD node)
static jrd_nod* pass1_store(TDBB tdbb, Csb* csb, jrd_nod* node)
{
/**************************************
*
@ -4288,8 +4288,8 @@ static JRD_NOD pass1_store(TDBB tdbb, CSB csb, JRD_NOD node)
}
static JRD_NOD pass1_update(TDBB tdbb,
CSB csb,
static jrd_nod* pass1_update(TDBB tdbb,
Csb* csb,
jrd_rel* relation,
TRIG_VEC trigger,
USHORT stream,
@ -4362,7 +4362,7 @@ static JRD_NOD pass1_update(TDBB tdbb,
}
static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
static jrd_nod* pass2(TDBB tdbb, Csb* csb, jrd_nod* const node, jrd_nod* parent)
{
/**************************************
*
@ -4429,7 +4429,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_seek:
case nod_seek_no_warn:
// store the rse in whose scope we are defined
node->nod_arg[e_seek_rse] = (JRD_NOD) csb->csb_current_rse;
node->nod_arg[e_seek_rse] = (jrd_nod*) csb->csb_current_rse;
break;
#endif
@ -4494,7 +4494,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
!(tdbb->tdbb_flags & TDBB_prc_being_dropped))
{
node->nod_arg[e_fun_function] =
(JRD_NOD) FUN_resolve(csb, function, value);
(jrd_nod*) FUN_resolve(csb, function, value);
if (!node->nod_arg[e_fun_function]) {
ERR_post(isc_funmismat, isc_arg_string,
function->fun_symbol->sym_string, 0);
@ -4526,7 +4526,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_find:
stream = base_stream(csb, &node->nod_arg[e_find_stream], true);
if (!(node->nod_arg[e_find_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4536,7 +4536,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_find_dbkey_version:
stream = base_stream(csb, &node->nod_arg[e_find_dbkey_stream], true);
if (!(node->nod_arg[e_find_dbkey_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4545,7 +4545,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_set_index:
stream = base_stream(csb, &node->nod_arg[e_index_stream], true);
if (!(node->nod_arg[e_index_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4554,7 +4554,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_get_bookmark:
stream = base_stream(csb, &node->nod_arg[e_getmark_stream], true);
if (!(node->nod_arg[e_getmark_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4563,7 +4563,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_set_bookmark:
stream = base_stream(csb, &node->nod_arg[e_setmark_stream], true);
if (!(node->nod_arg[e_setmark_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4572,7 +4572,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_lock_record:
stream = base_stream(csb, &node->nod_arg[e_lockrec_stream], true);
if (!(node->nod_arg[e_lockrec_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4581,14 +4581,14 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_crack:
case nod_force_crack:
stream = base_stream(csb, &node->nod_arg[0], true);
if (!(node->nod_arg[1] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
if (!(node->nod_arg[1] = (jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
ERR_post(isc_stream_not_defined, 0);
break;
case nod_reset_stream:
stream = base_stream(csb, &node->nod_arg[e_reset_from_stream], true);
if (!(node->nod_arg[e_reset_from_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4597,7 +4597,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_cardinality:
stream = base_stream(csb, &node->nod_arg[e_card_stream], true);
if (!(node->nod_arg[e_card_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(isc_stream_not_defined, 0);
}
@ -4609,12 +4609,12 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
case nod_erase:
stream = base_stream(csb, &node->nod_arg[e_erase_stream], false);
node->nod_arg[e_erase_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr;
node->nod_arg[e_erase_rsb] = (jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr;
break;
case nod_modify:
stream = base_stream(csb, &node->nod_arg[e_mod_org_stream], false);
node->nod_arg[e_mod_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr;
node->nod_arg[e_mod_rsb] = (jrd_nod*) csb->csb_rpt[stream].csb_rsb_ptr;
break;
#endif
@ -4939,7 +4939,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, jrd_nod* const node, JRD_NOD parent)
}
static void pass2_rse(TDBB tdbb, CSB csb, RSE rse)
static void pass2_rse(TDBB tdbb, Csb* csb, RSE rse)
{
/**************************************
*
@ -4971,7 +4971,7 @@ static void pass2_rse(TDBB tdbb, CSB csb, RSE rse)
if (node->nod_type == nod_relation) {
USHORT stream = (USHORT)(ULONG) node->nod_arg[e_rel_stream];
csb->csb_rpt[stream].csb_flags |= csb_active;
pass2(tdbb, csb, node, (JRD_NOD) rse);
pass2(tdbb, csb, node, (jrd_nod*) rse);
}
else if (node->nod_type == nod_rse) {
pass2_rse(tdbb, csb, (RSE) node);
@ -4979,16 +4979,16 @@ static void pass2_rse(TDBB tdbb, CSB csb, RSE rse)
else if (node->nod_type == nod_procedure) {
USHORT stream = (USHORT)(ULONG) node->nod_arg[e_prc_stream];
csb->csb_rpt[stream].csb_flags |= csb_active;
pass2(tdbb, csb, node, (JRD_NOD) rse);
pass2(tdbb, csb, node, (jrd_nod*) rse);
}
else if (node->nod_type == nod_aggregate) {
USHORT stream = (USHORT)(ULONG) node->nod_arg[e_agg_stream];
fb_assert(stream <= MAX_STREAMS);
csb->csb_rpt[stream].csb_flags |= csb_active;
pass2(tdbb, csb, node, (JRD_NOD) rse);
pass2(tdbb, csb, node, (jrd_nod*) rse);
}
else {
pass2(tdbb, csb, node, (JRD_NOD) rse);
pass2(tdbb, csb, node, (jrd_nod*) rse);
}
}
@ -5019,7 +5019,7 @@ static void pass2_rse(TDBB tdbb, CSB csb, RSE rse)
}
static JRD_NOD pass2_union(TDBB tdbb, CSB csb, JRD_NOD node)
static jrd_nod* pass2_union(TDBB tdbb, Csb* csb, jrd_nod* node)
{
/**************************************
*
@ -5056,7 +5056,7 @@ static JRD_NOD pass2_union(TDBB tdbb, CSB csb, JRD_NOD node)
}
static void plan_check(CSB csb, RSE rse)
static void plan_check(Csb* csb, RSE rse)
{
/**************************************
*
@ -5092,7 +5092,7 @@ static void plan_check(CSB csb, RSE rse)
}
static void plan_set(CSB csb, RSE rse, JRD_NOD plan)
static void plan_set(Csb* csb, RSE rse, jrd_nod* plan)
{
/**************************************
*
@ -5276,7 +5276,7 @@ static void plan_set(CSB csb, RSE rse, JRD_NOD plan)
plan_relation->rel_name, 0);
}
plan_relation_node->nod_arg[e_rel_stream] = (JRD_NOD) (SLONG) *map;
plan_relation_node->nod_arg[e_rel_stream] = (jrd_nod*) (SLONG) *map;
}
// make some validity checks
@ -5307,7 +5307,7 @@ static void plan_set(CSB csb, RSE rse, JRD_NOD plan)
}
static void post_procedure_access(TDBB tdbb, CSB csb, jrd_prc* procedure)
static void post_procedure_access(TDBB tdbb, Csb* csb, jrd_prc* procedure)
{
/**************************************
*
@ -5367,7 +5367,7 @@ static void post_procedure_access(TDBB tdbb, CSB csb, jrd_prc* procedure)
}
static RSB post_rse(TDBB tdbb, CSB csb, RSE rse)
static RSB post_rse(TDBB tdbb, Csb* csb, RSE rse)
{
/**************************************
*
@ -5428,7 +5428,7 @@ static RSB post_rse(TDBB tdbb, CSB csb, RSE rse)
}
static void post_trigger_access(TDBB tdbb, CSB csb, jrd_rel* owner_relation, TRIG_VEC triggers, jrd_rel* view)
static void post_trigger_access(TDBB tdbb, Csb* csb, jrd_rel* owner_relation, TRIG_VEC triggers, jrd_rel* view)
{
/**************************************
*
@ -5579,7 +5579,7 @@ static void post_trigger_access(TDBB tdbb, CSB csb, jrd_rel* owner_relation, TRI
}
static void process_map(TDBB tdbb, CSB csb, JRD_NOD map, fmt** input_format)
static void process_map(TDBB tdbb, Csb* csb, jrd_nod* map, fmt** input_format)
{
/**************************************
*

View File

@ -225,7 +225,7 @@ int DBG_analyze(int pool_id)
p->sum_count++;
p->sum_length += length;
if (type == (SSHORT) type_nod) {
p = nodes + (int) ((JRD_NOD) block)->nod_type;
p = nodes + (int) ((jrd_nod*) block)->nod_type;
p->sum_count++;
p->sum_length += length;
}
@ -446,7 +446,7 @@ int DBG_block(BLK block)
block->blk_length);
if (block->blk_type == (SCHAR) type_nod)
ib_fprintf(dbg_file, " -- %s",
node_names[(int) ((JRD_NOD) block)->nod_type]);
node_names[(int) ((jrd_nod*) block)->nod_type]);
prt_fields(reinterpret_cast < char *>(block), fields);
@ -701,7 +701,7 @@ int DBG_pool(JrdMemoryPool *pool)
}
int DBG_pretty(JRD_NOD node, int column)
int DBG_pretty(jrd_nod* node, int column)
{
/**************************************
*
@ -716,7 +716,8 @@ int DBG_pretty(JRD_NOD node, int column)
RSE rse;
jrd_rel* relation;
jrd_prc* procedure;
JRD_NOD *ptr, *end;
jrd_nod** ptr;
jrd_nod** end;
IRB retrieval;
int i;

View File

@ -242,8 +242,8 @@ jrd_tra[] = {
},
jrd_nod[] = {
"NODE",
FLD(JRD_NOD, "Type: %x", nod_type),
FLD(JRD_NOD, "Impure: %x", nod_impure),
FLD(jrd_nod*, "Type: %x", nod_type),
FLD(jrd_nod*, "Impure: %x", nod_impure),
0
},
lls[] = {
@ -268,7 +268,7 @@ Rsb[] = {
},
opt[] = {
"OPTIMIZER",
FLD(OPT, "CSB: %x", opt_csb),
FLD(OPT, "Csb*: %x", opt_csb),
FLD(OPT, "Cnt: %x", opt_count),
0
},
@ -393,11 +393,11 @@ static TEXT_PTR srl[] = { "SRL", 0};
*/
static TEXT_PTR Csb[] = {
"COMPILE SCRATCH BLOCK",
FLD(CSB, "Count: %x", csb_count),
FLD(CSB, "Node: %x", csb_node),
FLD(CSB, "Streams: %x", csb_n_stream),
FLD(CSB, "Running: %x", csb_running),
FLD(CSB, "BLR: %x", csb_blr),
FLD(Csb*, "Count: %x", csb_count),
FLD(Csb*, "Node: %x", csb_node),
FLD(Csb*, "Streams: %x", csb_n_stream),
FLD(Csb*, "Running: %x", csb_running),
FLD(Csb*, "BLR: %x", csb_blr),
0
};

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: evl.cpp,v 1.58 2004-01-03 10:59:40 robocop Exp $
* $Id: evl.cpp,v 1.59 2004-01-13 09:52:13 robocop Exp $
*/
/*
@ -142,24 +142,24 @@ static dsc* cast(TDBB, const dsc*, const jrd_nod*, VLU);
static void compute_agg_distinct(TDBB, jrd_nod*);
static dsc* concatenate(TDBB, jrd_nod*, VLU);
static dsc* dbkey(TDBB, const jrd_nod*, VLU);
static dsc* eval_statistical(TDBB, JRD_NOD, VLU);
static dsc* eval_statistical(TDBB, jrd_nod*, VLU);
static SINT64 get_day_fraction(const dsc* d);
static dsc* get_mask(TDBB, JRD_NOD, VLU);
static dsc* get_mask(TDBB, jrd_nod*, VLU);
static SINT64 get_timestamp_to_isc_ticks(const dsc* d);
static void init_agg_distinct(TDBB, const jrd_nod*);
#ifdef PC_ENGINE
static dsc* lock_record(TDBB, JRD_NOD, VLU);
static dsc* lock_relation(TDBB, JRD_NOD, VLU);
static dsc* lock_record(TDBB, jrd_nod*, VLU);
static dsc* lock_relation(TDBB, jrd_nod*, VLU);
#endif
static dsc* lock_state(TDBB, JRD_NOD, VLU);
static dsc* lock_state(TDBB, jrd_nod*, VLU);
static dsc* multiply(const dsc*, VLU, const jrd_nod*);
static dsc* multiply2(const dsc*, VLU, const jrd_nod*);
static dsc* divide2(const dsc*, VLU, const jrd_nod*);
static dsc* negate_dsc(TDBB, const dsc*, VLU);
static dsc* record_version(TDBB, const jrd_nod*, VLU);
static bool reject_duplicate(const UCHAR*, const UCHAR*, void*);
static dsc* scalar(TDBB, JRD_NOD, VLU);
static SSHORT sleuth(TDBB, JRD_NOD, dsc*, dsc*);
static dsc* scalar(TDBB, jrd_nod*, VLU);
static SSHORT sleuth(TDBB, jrd_nod*, dsc*, dsc*);
static BOOLEAN nc_sleuth_check(TextType, USHORT, const UCHAR*, const UCHAR*,
const UCHAR*, const UCHAR*);
static BOOLEAN nc_sleuth_class(TextType, USHORT, const UCHAR*, const UCHAR*, UCHAR);
@ -167,8 +167,8 @@ static BOOLEAN wc_sleuth_check(TextType, USHORT, const UCS2_CHAR*, const UCS2_CH
const UCS2_CHAR*, const UCS2_CHAR*);
static BOOLEAN wc_sleuth_class(TextType, USHORT, const UCS2_CHAR*, const UCS2_CHAR*,
UCS2_CHAR);
static SSHORT string_boolean(TDBB, JRD_NOD, dsc*, dsc*, bool);
static SSHORT string_function(TDBB, JRD_NOD, SSHORT, const UCHAR*, SSHORT, const UCHAR*, USHORT, bool);
static SSHORT string_boolean(TDBB, jrd_nod*, dsc*, dsc*, bool);
static SSHORT string_function(TDBB, jrd_nod*, SSHORT, const UCHAR*, SSHORT, const UCHAR*, USHORT, bool);
static dsc* substring(TDBB, VLU, dsc*, SLONG, SLONG);
static dsc* upcase(TDBB, const dsc*, VLU);
static dsc* internal_info(TDBB, const dsc*, VLU);
@ -209,7 +209,7 @@ static const RSE_GET_MODE g_RSE_get_mode = RSE_get_forward;
dsc* EVL_assign_to(TDBB tdbb, JRD_NOD node)
dsc* EVL_assign_to(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -224,7 +224,7 @@ dsc* EVL_assign_to(TDBB tdbb, JRD_NOD node)
**************************************/
dsc* desc;
FMT format;
JRD_NOD message;
jrd_nod* message;
REC record;
SET_TDBB(tdbb);
@ -321,7 +321,7 @@ dsc* EVL_assign_to(TDBB tdbb, JRD_NOD node)
}
SBM* EVL_bitmap(TDBB tdbb, JRD_NOD node)
SBM* EVL_bitmap(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -379,7 +379,7 @@ SBM* EVL_bitmap(TDBB tdbb, JRD_NOD node)
}
BOOLEAN EVL_boolean(TDBB tdbb, JRD_NOD node)
BOOLEAN EVL_boolean(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -772,7 +772,7 @@ BOOLEAN EVL_boolean(TDBB tdbb, JRD_NOD node)
}
dsc* EVL_expr(TDBB tdbb, JRD_NOD node)
dsc* EVL_expr(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -1381,7 +1381,7 @@ bool EVL_field(jrd_rel* relation, REC record, USHORT id, dsc* desc)
}
USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
USHORT EVL_group(TDBB tdbb, Rsb* rsb, jrd_nod* node, USHORT state)
{
/**************************************
*
@ -1420,7 +1420,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
for (ptr = map->nod_arg, end = ptr + map->nod_count; ptr < end; ptr++) {
const jrd_nod* from = (*ptr)->nod_arg[e_asgn_from];
vlux* impure = (VLUX) ((SCHAR *) request + from->nod_impure);
vlux* impure = (vlux*) ((SCHAR *) request + from->nod_impure);
impure->vlux_count = 0;
switch (from->nod_type) {
case nod_agg_average:
@ -1537,7 +1537,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
ptr++)
{
jrd_nod* from = *ptr;
vlux* impure = (VLUX) ((SCHAR *) request + from->nod_impure);
vlux* impure = (vlux*) ((SCHAR *) request + from->nod_impure);
desc = EVL_expr(tdbb, from);
if (request->req_flags & req_null)
impure->vlu_desc.dsc_address = NULL;
@ -1561,7 +1561,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
ptr < end; ptr++)
{
jrd_nod* from = *ptr;
vlux* impure = (VLUX) ((SCHAR *) request + from->nod_impure);
vlux* impure = (vlux*) ((SCHAR *) request + from->nod_impure);
if (impure->vlu_desc.dsc_address)
EVL_make_value(tdbb, &impure->vlu_desc, &vtemp);
else
@ -1589,7 +1589,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
for (ptr = map->nod_arg, end = ptr + map->nod_count; ptr < end; ptr++)
{
jrd_nod* from = (*ptr)->nod_arg[e_asgn_from];
vlux* impure = (VLUX) ((SCHAR *) request + from->nod_impure);
vlux* impure = (vlux*) ((SCHAR *) request + from->nod_impure);
switch (from->nod_type)
{
case nod_agg_min:
@ -1671,7 +1671,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
break;
/* "Put" the value to sort. */
ASB asb = (ASB) from->nod_arg[1];
iasb* asb_impure = (IASB) ((SCHAR *) request + asb->nod_impure);
iasb* asb_impure = (iasb*) ((SCHAR *) request + asb->nod_impure);
UCHAR* data;
SORT_put(tdbb->tdbb_status_vector,
reinterpret_cast<scb*>(asb_impure->iasb_sort_handle),
@ -1713,7 +1713,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, JRD_NOD node, USHORT state)
id = (USHORT)(ULONG) field->nod_arg[e_fld_id];
record =
request->req_rpb[(int) (IPTR) field->nod_arg[e_fld_stream]].rpb_record;
vlux* impure = (VLUX) ((SCHAR *) request + from->nod_impure);
vlux* impure = (vlux*) ((SCHAR *) request + from->nod_impure);
switch (from->nod_type)
{
case nod_agg_min:
@ -2990,9 +2990,9 @@ static void compute_agg_distinct(TDBB tdbb, jrd_nod* node)
jrd_req* request = tdbb->tdbb_request;
ASB asb = (ASB) node->nod_arg[1];
iasb* asb_impure = (IASB) ((SCHAR *) request + asb->nod_impure);
iasb* asb_impure = (iasb*) ((SCHAR *) request + asb->nod_impure);
dsc* desc = &asb->asb_desc;
vlux* impure = (VLUX) ((SCHAR *) request + node->nod_impure);
vlux* impure = (vlux*) ((SCHAR *) request + node->nod_impure);
/* Sort the values already "put" to sort */
@ -3188,7 +3188,7 @@ static dsc* dbkey(TDBB tdbb, const jrd_nod* node, VLU impure)
}
static dsc* eval_statistical(TDBB tdbb, JRD_NOD node, VLU impure)
static dsc* eval_statistical(TDBB tdbb, jrd_nod* node, VLU impure)
{
/**************************************
*
@ -3441,7 +3441,7 @@ static SINT64 get_day_fraction(const dsc* d)
static dsc* get_mask(TDBB tdbb, JRD_NOD node, VLU impure)
static dsc* get_mask(TDBB tdbb, jrd_nod* node, VLU impure)
{
/**************************************
*
@ -3555,7 +3555,7 @@ static void init_agg_distinct(TDBB tdbb, const jrd_nod* node)
#ifdef PC_ENGINE
static dsc* lock_record(TDBB tdbb, JRD_NOD node, VLU impure)
static dsc* lock_record(TDBB tdbb, jrd_nod* node, VLU impure)
{
/**************************************
*
@ -3633,7 +3633,7 @@ static dsc* lock_record(TDBB tdbb, JRD_NOD node, VLU impure)
#ifdef PC_ENGINE
static dsc* lock_relation(TDBB tdbb, JRD_NOD node, VLU impure)
static dsc* lock_relation(TDBB tdbb, jrd_nod* node, VLU impure)
{
/**************************************
*
@ -3648,7 +3648,7 @@ static dsc* lock_relation(TDBB tdbb, JRD_NOD node, VLU impure)
**************************************/
dsc* desc;
USHORT lock_level;
JRD_NOD relation_node;
jrd_nod* relation_node;
jrd_rel* relation;
LCK lock = NULL;
@ -3708,7 +3708,7 @@ static dsc* lock_relation(TDBB tdbb, JRD_NOD node, VLU impure)
#endif
static dsc* lock_state(TDBB tdbb, JRD_NOD node, VLU impure)
static dsc* lock_state(TDBB tdbb, jrd_nod* node, VLU impure)
{
/**************************************
*
@ -4252,7 +4252,7 @@ static bool reject_duplicate(const UCHAR* data1, const UCHAR* data2, void* user_
}
static dsc* scalar(TDBB tdbb, JRD_NOD node, VLU impure)
static dsc* scalar(TDBB tdbb, jrd_nod* node, VLU impure)
{
/**************************************
*
@ -4299,7 +4299,7 @@ static dsc* scalar(TDBB tdbb, JRD_NOD node, VLU impure)
}
static SSHORT sleuth(TDBB tdbb, JRD_NOD node, dsc* desc1, dsc* desc2)
static SSHORT sleuth(TDBB tdbb, jrd_nod* node, dsc* desc1, dsc* desc2)
{
/**************************************
*
@ -4398,7 +4398,7 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, dsc* desc1, dsc* desc2)
}
static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, dsc* desc1, dsc* desc2, bool computed_invariant)
static SSHORT string_boolean(TDBB tdbb, jrd_nod* node, dsc* desc1, dsc* desc2, bool computed_invariant)
{
/**************************************
*
@ -4592,7 +4592,7 @@ static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, dsc* desc1, dsc* desc2, bo
static SSHORT string_function(
TDBB tdbb,
JRD_NOD node,
jrd_nod* node,
SSHORT l1,
const UCHAR* p1, SSHORT l2, const UCHAR* p2,
USHORT ttype, bool computed_invariant)

View File

@ -144,38 +144,38 @@ SLONG status_xcp::as_sqlcode() const
static void assign_xcp_message(TDBB, STR*, const TEXT*);
static void cleanup_rpb(TDBB, RPB *);
static JRD_NOD erase(TDBB, JRD_NOD, SSHORT);
static jrd_nod* erase(TDBB, jrd_nod*, SSHORT);
static void execute_looper(TDBB, jrd_req*, jrd_tra*, enum jrd_req::req_s);
static void exec_sql(TDBB, jrd_req*, DSC *);
static void execute_procedure(TDBB, JRD_NOD);
static void execute_procedure(TDBB, jrd_nod*);
static jrd_req* execute_triggers(TDBB, TRIG_VEC *, REC, REC, enum jrd_req::req_ta);
static JRD_NOD looper(TDBB, jrd_req*, JRD_NOD);
static JRD_NOD modify(TDBB, JRD_NOD, SSHORT);
static JRD_NOD receive_msg(TDBB, JRD_NOD);
static jrd_nod* looper(TDBB, jrd_req*, jrd_nod*);
static jrd_nod* modify(TDBB, jrd_nod*, SSHORT);
static jrd_nod* receive_msg(TDBB, jrd_nod*);
static void release_blobs(TDBB, jrd_req*);
static void release_proc_save_points(jrd_req*);
#ifdef SCROLLABLE_CURSORS
static JRD_NOD seek_rse(TDBB, jrd_req*, JRD_NOD);
static jrd_nod* seek_rse(TDBB, jrd_req*, jrd_nod*);
static void seek_rsb(TDBB, jrd_req*, RSB, USHORT, SLONG);
#endif
static JRD_NOD selct(TDBB, JRD_NOD);
static JRD_NOD send_msg(TDBB, JRD_NOD);
static void set_error(TDBB, const xcp_repeat*, JRD_NOD);
static JRD_NOD stall(TDBB, JRD_NOD);
static JRD_NOD store(TDBB, JRD_NOD, SSHORT);
static jrd_nod* selct(TDBB, jrd_nod*);
static jrd_nod* send_msg(TDBB, jrd_nod*);
static void set_error(TDBB, const xcp_repeat*, jrd_nod*);
static jrd_nod* stall(TDBB, jrd_nod*);
static jrd_nod* store(TDBB, jrd_nod*, SSHORT);
static bool test_and_fixup_error(TDBB, const XCP, jrd_req*);
static void trigger_failure(TDBB, jrd_req*);
static void validate(TDBB, JRD_NOD);
static void validate(TDBB, jrd_nod*);
inline void PreModifyEraseTriggers(TDBB, trig_vec**, SSHORT, RPB*, REC, jrd_req::req_ta);
#ifdef PC_ENGINE
static JRD_NOD find(TDBB, JRD_NOD);
static JRD_NOD find_dbkey(TDBB, JRD_NOD);
static jrd_nod* find(TDBB, jrd_nod*);
static jrd_nod* find_dbkey(TDBB, jrd_nod*);
static LCK implicit_record_lock(jrd_tra*, RPB *);
static JRD_NOD release_bookmark(TDBB, JRD_NOD);
static JRD_NOD set_bookmark(TDBB, JRD_NOD);
static JRD_NOD set_index(TDBB, JRD_NOD);
static JRD_NOD stream(TDBB, JRD_NOD);
static jrd_nod* release_bookmark(TDBB, jrd_nod*);
static jrd_nod* set_bookmark(TDBB, jrd_nod*);
static jrd_nod* set_index(TDBB, jrd_nod*);
static jrd_nod* stream(TDBB, jrd_nod*);
#endif
#if defined(DEBUG_GDS_ALLOC) && defined(PROD_BUILD)
@ -235,7 +235,7 @@ private:
#endif
void EXE_assignment(TDBB tdbb, JRD_NOD node)
void EXE_assignment(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -247,9 +247,6 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
* Perform an assignment
*
**************************************/
DSC temp;
DEV_BLKCHK(node, type_nod);
SET_TDBB(tdbb);
@ -263,7 +260,7 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
missing = EVL_expr(tdbb, node->nod_arg[e_asgn_missing]);
}
JRD_NOD to = node->nod_arg[e_asgn_to];
jrd_nod* to = node->nod_arg[e_asgn_to];
DSC* to_desc = EVL_assign_to(tdbb, to);
request->req_flags &= ~req_null;
@ -278,6 +275,7 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
/* If the value is non-missing, move/convert it. Otherwise fill the
field with appropriate nulls. */
dsc temp;
if (!null)
{
@ -285,7 +283,7 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
if (to->nod_type == nod_argument && to->nod_arg[e_arg_indicator])
{
DSC* indicator = EVL_assign_to(tdbb, to->nod_arg[e_arg_indicator]);
dsc* indicator = EVL_assign_to(tdbb, to->nod_arg[e_arg_indicator]);
temp.dsc_dtype = dtype_short;
temp.dsc_length = sizeof(SSHORT);
temp.dsc_scale = 0;
@ -336,26 +334,32 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
else if (!DSC_EQUIV(from_desc, to_desc))
MOV_move(from_desc, to_desc);
else if (from_desc->dsc_dtype == dtype_short)
else if (from_desc->dsc_dtype == dtype_short) {
*((SSHORT *) to_desc->dsc_address) =
*((SSHORT *) from_desc->dsc_address);
}
else if (from_desc->dsc_dtype == dtype_long)
else if (from_desc->dsc_dtype == dtype_long) {
*((SLONG *) to_desc->dsc_address) =
*((SLONG *) from_desc->dsc_address);
}
else if (from_desc->dsc_dtype == dtype_int64)
else if (from_desc->dsc_dtype == dtype_int64) {
*((SINT64 *) to_desc->dsc_address) =
*((SINT64 *) from_desc->dsc_address);
}
else if (((U_IPTR) from_desc->dsc_address & (ALIGNMENT - 1)) ||
((U_IPTR) to_desc->dsc_address & (ALIGNMENT - 1)))
{
MOVE_FAST(from_desc->dsc_address, to_desc->dsc_address,
from_desc->dsc_length);
}
else
else {
MOVE_FASTER(from_desc->dsc_address, to_desc->dsc_address,
from_desc->dsc_length);
}
to_desc->dsc_flags &= ~DSC_null;
}
else if (node->nod_arg[e_asgn_missing2] &&
@ -388,9 +392,9 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
break;
default:
do
do {
*p++ = 0;
while (--l);
} while (--l);
break;
}
to_desc->dsc_flags |= DSC_null;
@ -404,7 +408,8 @@ void EXE_assignment(TDBB tdbb, JRD_NOD node)
REC record = request->req_rpb[(int) (IPTR) to->nod_arg[e_fld_stream]].rpb_record;
if (null) {
SET_NULL(record, id);
} else {
}
else {
CLEAR_NULL(record, id);
}
}
@ -594,7 +599,7 @@ void EXE_receive(TDBB tdbb,
*
* Functional description
* Move a message from JRD to the host program. This corresponds to
* a JRD BLR/JRD_NOD send.
* a JRD BLR/jrd_nod* send.
*
**************************************/
SET_TDBB(tdbb);
@ -750,7 +755,7 @@ void EXE_send(TDBB tdbb,
/* look for an asynchronous send message--if such
a message was defined, we allow the user to send
us a message at any time during request execution */
JRD_NOD save_next = NULL, save_message = NULL;
jrd_nod* save_next = NULL, save_message = NULL;
if ((message = request->req_async_message) &&
(node = message->nod_arg[e_send_message]) &&
@ -956,7 +961,7 @@ void EXE_unwind(TDBB tdbb, jrd_req* request)
if (request->req_flags & req_active) {
if (request->req_fors.getCount()) {
JrdMemoryPool *old_pool = tdbb->tdbb_default;
JrdMemoryPool* old_pool = tdbb->tdbb_default;
tdbb->tdbb_default = request->req_pool;
jrd_req* old_request = tdbb->tdbb_request;
tdbb->tdbb_request = request;
@ -1095,7 +1100,7 @@ inline void PreModifyEraseTriggers(TDBB tdbb,
FB_NEW(*tdbb->tdbb_transaction->tra_pool)
traRpbList(tdbb->tdbb_transaction->tra_pool);
}
int rpblevel = tdbb->tdbb_transaction->
const int rpblevel = tdbb->tdbb_transaction->
tra_rpblist->PushRpb(rpb);
jrd_req* trigger = execute_triggers(tdbb, trigs,
rpb->rpb_record, rec, op);
@ -1106,7 +1111,7 @@ inline void PreModifyEraseTriggers(TDBB tdbb,
}
}
static JRD_NOD erase(TDBB tdbb, JRD_NOD node, SSHORT which_trig)
static jrd_nod* erase(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
{
/**************************************
*
@ -1415,7 +1420,7 @@ static void exec_sql(TDBB tdbb, jrd_req* request, DSC* dsc)
}
static void execute_procedure(TDBB tdbb, JRD_NOD node)
static void execute_procedure(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -1436,8 +1441,8 @@ static void execute_procedure(TDBB tdbb, JRD_NOD node)
jrd_nod* temp = node->nod_arg[e_esp_inputs];
if (temp) {
JRD_NOD *ptr, *end;
jrd_nod** ptr;
jrd_nod** end;
for (ptr = temp->nod_arg, end = ptr + temp->nod_count; ptr < end;
ptr++)
{
@ -1529,8 +1534,8 @@ static void execute_procedure(TDBB tdbb, JRD_NOD node)
temp = node->nod_arg[e_esp_outputs];
if (temp) {
JRD_NOD *ptr, *end;
jrd_nod** ptr;
jrd_nod** end;
for (ptr = temp->nod_arg, end = ptr + temp->nod_count; ptr < end;
ptr++)
{
@ -1622,7 +1627,7 @@ static jrd_req* execute_triggers(TDBB tdbb,
#ifdef PC_ENGINE
static JRD_NOD find(TDBB tdbb, JRD_NOD node)
static jrd_nod* find(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -1657,7 +1662,7 @@ static JRD_NOD find(TDBB tdbb, JRD_NOD node)
ERR_post(isc_invalid_operator, 0);
}
USHORT direction = (USHORT) MOV_get_long(EVL_expr(tdbb,
const USHORT direction = (USHORT) MOV_get_long(EVL_expr(tdbb,
node->nod_arg
[e_find_direction]),
0);
@ -1701,7 +1706,7 @@ static JRD_NOD find(TDBB tdbb, JRD_NOD node)
#ifdef PC_ENGINE
static JRD_NOD find_dbkey(TDBB tdbb, JRD_NOD node)
static jrd_nod* find_dbkey(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -1714,7 +1719,6 @@ static JRD_NOD find_dbkey(TDBB tdbb, JRD_NOD node)
* resetting the position of the stream to that record.
*
**************************************/
SET_TDBB(tdbb);
jrd_req* request = tdbb->tdbb_request;
BLKCHK(node, type_nod);
@ -1786,7 +1790,7 @@ static LCK implicit_record_lock(jrd_tra* transaction, RPB * rpb)
#endif
static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
static jrd_nod* looper(TDBB tdbb, jrd_req* request, jrd_nod* in_node)
{
/**************************************
*
@ -1802,8 +1806,8 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
SSHORT which_erase_trig = 0;
SSHORT which_sto_trig = 0;
SSHORT which_mod_trig = 0;
volatile JRD_NOD top_node = 0;
volatile JRD_NOD prev_node;
jrd_nod* volatile top_node = 0;
jrd_nod* volatile prev_node;
/* If an error happens during the backout of a savepoint, then the transaction
must be marked 'dead' because that is the only way to clean up after a
@ -1843,7 +1847,7 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
const SLONG save_point_number = (transaction->tra_save_point) ?
transaction->tra_save_point->sav_number : 0;
volatile JRD_NOD node = in_node;
jrd_nod* volatile node = in_node;
// Catch errors so we can unwind cleanly
@ -1860,7 +1864,9 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
if (request->req_operation == jrd_req::req_evaluate &&
(--tdbb->tdbb_quantum < 0) && !tdbb->tdbb_inhibit)
{
JRD_reschedule(tdbb, 0, true);
}
#endif
@ -1871,11 +1877,12 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
switch (node->nod_type) {
case nod_asn_list:
if (request->req_operation == jrd_req::req_evaluate) {
volatile JRD_NOD *ptr, *end;
for (ptr = node->nod_arg, end = ptr + node->nod_count;
jrd_nod** volatile ptr = node->nod_arg;
for (const jrd_nod* const* const end = ptr + node->nod_count;
ptr < end; ptr++)
{
EXE_assignment(tdbb, *ptr);
}
request->req_operation = jrd_req::req_return;
}
node = node->nod_parent;
@ -2258,8 +2265,6 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
case jrd_req::req_unwind:
{
volatile JRD_NOD *ptr, *end;
if (request->req_flags & req_leave)
{
// Although the req_operation is set to req_unwind,
@ -2273,7 +2278,9 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
for (save_point = transaction->tra_save_point;
save_point && count <= save_point->sav_number;
save_point = transaction->tra_save_point)
{
VERB_CLEANUP;
}
}
node = node->nod_parent;
break;
@ -2287,21 +2294,20 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
savepoint of this block will be dealt with below. */
for (save_point = transaction->tra_save_point;
save_point && count < save_point->sav_number;
save_point = transaction->tra_save_point) {
save_point = transaction->tra_save_point)
{
++transaction->tra_save_point->sav_verb_count;
VERB_CLEANUP;
}
}
volatile JRD_NOD handlers = node->nod_arg[e_blk_handlers];
jrd_nod* volatile handlers = node->nod_arg[e_blk_handlers];
if (handlers)
{
ULONG prev_req_error_handler;
node = node->nod_parent;
for (ptr = handlers->nod_arg,
end = ptr + handlers->nod_count; ptr < end;
ptr++)
jrd_nod** volatile ptr = handlers->nod_arg;
for (const jrd_nod* const* const end = ptr + handlers->nod_count;
ptr < end; ptr++)
{
const XCP xcp_node =
reinterpret_cast<XCP>((*ptr)->nod_arg[e_err_conditions]);
@ -2324,7 +2330,7 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
necessary if the error handler is deeply
nested. */
prev_req_error_handler =
const ULONG prev_req_error_handler =
request->req_flags & req_error_handler;
request->req_flags |= req_error_handler;
node = looper(tdbb, request, node);
@ -2387,7 +2393,9 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
for (save_point = transaction->tra_save_point;
save_point && count <= save_point->sav_number;
save_point = transaction->tra_save_point)
{
VERB_CLEANUP;
}
}
default:
node = node->nod_parent;
@ -2596,7 +2604,8 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
{
sta* impure = (STA) ((SCHAR *) request + node->nod_impure);
if ((request->req_operation == jrd_req::req_return) &&
(!impure->sta_state) && (node->nod_arg[e_sto_sub_store])) {
(!impure->sta_state) && (node->nod_arg[e_sto_sub_store]))
{
if (!top_node) {
top_node = node;
which_sto_trig = PRE_TRIG;
@ -2685,18 +2694,14 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
RLCK_release_lock(*(LCK *) desc->dsc_address);
#else
{
ATT attachment;
LCK lock;
ULONG slot;
VEC vector;
att* attachment = tdbb->tdbb_attachment;
attachment = tdbb->tdbb_attachment;
lock = NULL;
slot = *(ULONG *) desc->dsc_address;
if ((vector = attachment->att_lck_quick_ref) &&
slot < vector->vec_count)
lock = (LCK) vector->vec_object[slot];
lck* lock = NULL;
const ULONG slot = *(ULONG *) desc->dsc_address;
vec* vector = attachment->att_lck_quick_ref;
if (vector && slot < vector->vec_count) {
lock = (LCK) vector->vec_object[slot];
}
RLCK_release_lock(lock);
vector->vec_object[slot] = NULL;
}
@ -2737,9 +2742,7 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
case nod_set_generator:
if (request->req_operation == jrd_req::req_evaluate) {
DSC *desc;
desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
dsc* desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
DPM_gen_id(tdbb, (SLONG) node->nod_arg[e_gen_id], 1,
MOV_get_int64(desc, 0));
request->req_operation = jrd_req::req_return;
@ -2749,9 +2752,7 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
case nod_set_generator2:
if (request->req_operation == jrd_req::req_evaluate) {
DSC *desc;
desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
dsc* desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
DPM_gen_id(tdbb, (SLONG) node->nod_arg[e_gen_id], 1,
MOV_get_int64(desc, 0));
request->req_operation = jrd_req::req_return;
@ -2853,7 +2854,7 @@ static JRD_NOD looper(TDBB tdbb, jrd_req* request, JRD_NOD in_node)
}
static JRD_NOD modify(TDBB tdbb, JRD_NOD node, SSHORT which_trig)
static jrd_nod* modify(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
{
/**************************************
*
@ -2912,7 +2913,7 @@ static JRD_NOD modify(TDBB tdbb, JRD_NOD node, SSHORT which_trig)
transaction,
reinterpret_cast<BLK>(tdbb->tdbb_default), FALSE)))
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
VIO_data(tdbb, org_rpb,
reinterpret_cast<BLK>(tdbb->tdbb_request->req_pool));
@ -3161,7 +3162,7 @@ static JRD_NOD modify(TDBB tdbb, JRD_NOD node, SSHORT which_trig)
return node->nod_arg[e_mod_statement];
}
static JRD_NOD receive_msg(TDBB tdbb, JRD_NOD node)
static jrd_nod* receive_msg(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3240,7 +3241,7 @@ static void release_blobs(TDBB tdbb, jrd_req* request)
#ifdef PC_ENGINE
static JRD_NOD release_bookmark(TDBB tdbb, JRD_NOD node)
static jrd_nod* release_bookmark(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3292,7 +3293,7 @@ static void release_proc_save_points(jrd_req* request)
#ifdef SCROLLABLE_CURSORS
static JRD_NOD seek_rse(TDBB tdbb, jrd_req* request, JRD_NOD node)
static jrd_nod* seek_rse(TDBB tdbb, jrd_req* request, jrd_nod* node)
{
/**************************************
*
@ -3505,7 +3506,7 @@ static void seek_rsb(
#endif
static JRD_NOD selct(TDBB tdbb, JRD_NOD node)
static jrd_nod* selct(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3542,7 +3543,7 @@ static JRD_NOD selct(TDBB tdbb, JRD_NOD node)
static JRD_NOD send_msg(TDBB tdbb, JRD_NOD node)
static jrd_nod* send_msg(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3579,7 +3580,7 @@ static JRD_NOD send_msg(TDBB tdbb, JRD_NOD node)
#ifdef PC_ENGINE
static JRD_NOD set_bookmark(TDBB tdbb, JRD_NOD node)
static jrd_nod* set_bookmark(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3631,7 +3632,7 @@ static JRD_NOD set_bookmark(TDBB tdbb, JRD_NOD node)
#endif
static void set_error(TDBB tdbb, const xcp_repeat* exception, JRD_NOD msg_node)
static void set_error(TDBB tdbb, const xcp_repeat* exception, jrd_nod* msg_node)
{
/**************************************
*
@ -3730,7 +3731,7 @@ static void set_error(TDBB tdbb, const xcp_repeat* exception, JRD_NOD msg_node)
#ifdef PC_ENGINE
static JRD_NOD set_index(TDBB tdbb, JRD_NOD node)
static jrd_nod* set_index(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3778,7 +3779,7 @@ static JRD_NOD set_index(TDBB tdbb, JRD_NOD node)
#endif
static JRD_NOD stall(TDBB tdbb, JRD_NOD node)
static jrd_nod* stall(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -3814,7 +3815,7 @@ static JRD_NOD stall(TDBB tdbb, JRD_NOD node)
}
static JRD_NOD store(TDBB tdbb, JRD_NOD node, SSHORT which_trig)
static jrd_nod* store(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
{
/**************************************
*
@ -3978,7 +3979,7 @@ static JRD_NOD store(TDBB tdbb, JRD_NOD node, SSHORT which_trig)
#ifdef PC_ENGINE
static JRD_NOD stream(TDBB tdbb, JRD_NOD node)
static jrd_nod* stream(TDBB tdbb, jrd_nod* node)
{
/**************************************
*
@ -4135,7 +4136,7 @@ static void trigger_failure(TDBB tdbb, jrd_req* trigger)
}
static void validate(TDBB tdbb, JRD_NOD list)
static void validate(TDBB tdbb, jrd_nod* list)
{
/**************************************
*
@ -4151,10 +4152,11 @@ static void validate(TDBB tdbb, JRD_NOD list)
SET_TDBB(tdbb);
BLKCHK(list, type_nod);
JRD_NOD *ptr1, *ptr2;
jrd_nod** ptr1;
jrd_nod** end;
for (ptr1 = list->nod_arg, ptr2 = ptr1 + list->nod_count;
ptr1 < ptr2; ptr1++)
for (ptr1 = list->nod_arg, end = ptr1 + list->nod_count;
ptr1 < end; ptr1++)
{
if (!EVL_boolean(tdbb, (*ptr1)->nod_arg[e_val_boolean]))
{

View File

@ -86,7 +86,6 @@ public:
}*/
jrd_nod* nod_arg[1];
};
typedef jrd_nod* JRD_NOD;
#define nod_comparison 1
#define nod_id 1 /* marks a field node as a blr_fid guy */
@ -127,7 +126,7 @@ typedef rse* RSE;
#define rse_singular 2 /* flags rse-type node as from a singleton select */
#define rse_variant 4 /* flags rse as variant (not invariant?) */
#define rse_delta (sizeof(struct rse)-sizeof(struct jrd_nod))/sizeof(((JRD_NOD) NULL)->nod_arg[0])
#define rse_delta (sizeof(struct rse)-sizeof(struct jrd_nod))/sizeof(((jrd_nod*) NULL)->nod_arg[0])
// Types of nulls placement for each column in sort order
#define rse_nulls_default 0
@ -145,7 +144,7 @@ public:
};
typedef lit* LIT;
#define lit_delta ((sizeof(struct lit) - sizeof(struct jrd_nod) - sizeof(SINT64)) / sizeof(JRD_NOD*))
#define lit_delta ((sizeof(struct lit) - sizeof(struct jrd_nod) - sizeof(SINT64)) / sizeof(jrd_nod**))
/* Aggregate Sort Block (for DISTINCT aggregates) */
@ -165,7 +164,7 @@ public:
};
typedef asb* ASB;
#define asb_delta ((sizeof(struct asb) - sizeof(struct jrd_nod)) / sizeof (JRD_NOD*))
#define asb_delta ((sizeof(struct asb) - sizeof(struct jrd_nod)) / sizeof (jrd_nod**))
/* Various structures in the impure area */
@ -177,7 +176,7 @@ typedef struct sta {
typedef struct vlu {
struct dsc vlu_desc;
USHORT vlu_flags; // Computed/invariant flags
struct str *vlu_string;
struct str* vlu_string;
union {
SSHORT vlu_short;
SLONG vlu_long;
@ -193,9 +192,9 @@ typedef struct vlu {
} vlu_misc;
} *VLU;
typedef struct vlux : public vlu {
struct vlux : public vlu {
SLONG vlux_count;
} *VLUX;
};
#define VLU_computed 1 /* An invariant sub-query has been computed */
@ -211,9 +210,9 @@ typedef struct inv {
/* ASB impure area */
typedef struct iasb {
struct iasb {
SLONG *iasb_sort_handle;
} *IASB;
};
/* Various field positions */
@ -378,7 +377,7 @@ typedef struct iasb {
#define e_dcl_id 0
#define e_dcl_invariants 1
#define e_dcl_desc 2
#define e_dcl_length (2 + sizeof (DSC)/sizeof (JRD_NOD)) /* Room for descriptor */
#define e_dcl_length (2 + sizeof (DSC)/sizeof (jrd_nod*)) /* Room for descriptor */
#define e_dep_object 0 /* node for registering dependencies */
#define e_dep_object_type 1
@ -609,7 +608,6 @@ public:
typedef csb_repeat* rpt_itr;
Firebird::Array<csb_repeat> csb_rpt;
};
typedef Csb* CSB;
#define csb_internal 0x1 /* "csb_g_flag" switch */
#define csb_get_dependencies 0x2

View File

@ -341,7 +341,7 @@ void EXT_open(RSB rsb)
}
RSB EXT_optimize(OPT opt, SSHORT stream, JRD_NOD * sort_ptr)
RSB EXT_optimize(OPT opt, SSHORT stream, jrd_nod** sort_ptr)
{
/**************************************
*
@ -355,14 +355,14 @@ RSB EXT_optimize(OPT opt, SSHORT stream, JRD_NOD * sort_ptr)
*
**************************************/
/* all these are un refrenced due to the code commented below
JRD_NOD node, inversion;
jrd_nod* node, inversion;
opt::opt_repeat *tail, *opt_end;
SSHORT i, size;
*/
TDBB tdbb = GET_THREAD_DATA;
CSB csb = opt->opt_csb;
Csb* csb = opt->opt_csb;
csb_repeat* csb_tail = &csb->csb_rpt[stream];
jrd_rel* relation = csb_tail->csb_relation;

View File

@ -30,7 +30,7 @@
* 2003.08.10 Claudio Valderrama: Fix SF Bugs #544132 and #728839.
*/
/*
$Id: fun.epp,v 1.31 2004-01-03 10:59:40 robocop Exp $
$Id: fun.epp,v 1.32 2004-01-13 09:52:14 robocop Exp $
*/
#include "firebird.h"
@ -105,7 +105,7 @@ static SLONG blob_lseek(BLB, USHORT, SLONG);
static SLONG get_scalar_array(fun_repeat*, DSC*, SAD, LLS*);
void FUN_evaluate(FUN function, JRD_NOD node, VLU value)
void FUN_evaluate(FUN function, jrd_nod* node, VLU value)
{
/**************************************
*
@ -158,7 +158,7 @@ void FUN_evaluate(FUN function, JRD_NOD node, VLU value)
bool null_flag = (request->req_flags & req_null) == req_null;
fun_repeat* return_ptr = function->fun_rpt + function->fun_return_arg;
JRD_NOD* ptr = node->nod_arg;
jrd_nod** ptr = node->nod_arg;
value->vlu_desc = return_ptr->fun_desc;
value->vlu_desc.dsc_address = (UCHAR *) & value->vlu_misc;
@ -931,7 +931,7 @@ FUN FUN_lookup_function(TEXT * name, bool ShowAccessError)
}
FUN FUN_resolve(CSB csb, FUN function, JRD_NOD args)
FUN FUN_resolve(Csb* csb, FUN function, jrd_nod* args)
{
/**************************************
*
@ -943,22 +943,19 @@ FUN FUN_resolve(CSB csb, FUN function, JRD_NOD args)
* Resolve instance of potentially overloaded function.
*
**************************************/
FUN best;
JRD_NOD *ptr, *end;
DSC arg;
int best_score, score;
fun_repeat *tail;
TDBB tdbb;
tdbb = GET_THREAD_DATA;
TDBB tdbb = GET_THREAD_DATA;
best = NULL;
best_score = 0;
end = args->nod_arg + args->nod_count;
fun* best = NULL;
int best_score = 0;
const jrd_nod* const* const end = args->nod_arg + args->nod_count;
for (; function; function = function->fun_homonym)
if (function->fun_entrypoint && function->fun_args == args->nod_count) {
score = 0;
int score = 0;
jrd_nod** ptr;
fun_repeat* tail;
for (ptr = args->nod_arg, tail = function->fun_rpt + 1; ptr < end;
ptr++, tail++) {
CMP_get_desc(tdbb, csb, *ptr, &arg);

View File

@ -88,7 +88,7 @@ static bool key_equal(const KEY*, const KEY*);
static void signal_index_deletion(TDBB, jrd_rel*, USHORT);
void IDX_check_access(TDBB tdbb, CSB csb, jrd_rel* view, jrd_rel* relation,
void IDX_check_access(TDBB tdbb, Csb* csb, jrd_rel* view, jrd_rel* relation,
jrd_fld* field)
{
/**************************************

View File

@ -831,7 +831,7 @@ int INF_request_info(const jrd_req* request,
* Return information about requests.
*
**************************************/
JRD_NOD node;
jrd_nod* node;
FMT format;
SCHAR item;
SSHORT state;

View File

@ -3761,7 +3761,7 @@ ISC_STATUS GDS_TRANSACT_REQUEST(ISC_STATUS* user_status,
old_pool = tdbb->tdbb_default;
tdbb->tdbb_default = new_pool = JrdMemoryPool::createPool();
CSB csb = PAR_parse(tdbb, reinterpret_cast<const UCHAR*>(blr), FALSE);
Csb* csb = PAR_parse(tdbb, reinterpret_cast<const UCHAR*>(blr), FALSE);
request = CMP_make_request(tdbb, csb);
for (const acc* access = request->req_access; access;

View File

@ -37,7 +37,7 @@
*
*/
/*
$Id: met.epp,v 1.86 2004-01-06 10:33:12 robocop Exp $
$Id: met.epp,v 1.87 2004-01-13 09:52:14 robocop Exp $
*/
// This MUST be at the top of the file
#ifdef DARWIN
@ -137,14 +137,14 @@ static bool get_type(TDBB, SSHORT*, const UCHAR*, const TEXT*);
static void lookup_view_contexts(TDBB, jrd_rel*);
static void name_copy(TEXT*, const TEXT*);
static USHORT name_length(const TEXT *);
static jrd_nod* parse_procedure_blr(TDBB, jrd_prc*, SLONG[2], CSB);
static BOOLEAN par_messages(TDBB, const UCHAR*, USHORT, jrd_prc*, CSB);
static jrd_nod* parse_procedure_blr(TDBB, jrd_prc*, SLONG[2], Csb*);
static BOOLEAN par_messages(TDBB, const UCHAR*, USHORT, jrd_prc*, Csb*);
static BOOLEAN resolve_charset_and_collation(TDBB, SSHORT*, const UCHAR*,
const UCHAR*);
static str* save_name(TDBB, const TEXT*);
static void save_trigger_data(TDBB, TRIG_VEC*, jrd_rel*, JRD_REQ, STR,
const TEXT*, bool, USHORT);
static void store_dependencies(TDBB, CSB, const TEXT*, USHORT);
static void store_dependencies(TDBB, Csb*, const TEXT*, USHORT);
static bool verify_TRG_ignore_perm(TDBB, const TEXT*);
@ -935,13 +935,13 @@ BOOLEAN MET_get_char_subtype(TDBB tdbb,
}
JRD_NOD MET_get_dependencies(TDBB tdbb,
jrd_nod* MET_get_dependencies(TDBB tdbb,
jrd_rel* relation,
TEXT* blob,
CSB view_csb,
Csb* view_csb,
SLONG blob_id[2],
jrd_req** request,
CSB* csb_ptr,
Csb** csb_ptr,
const TEXT* object_name,
USHORT type)
{
@ -959,7 +959,7 @@ JRD_NOD MET_get_dependencies(TDBB tdbb,
SET_TDBB(tdbb);
DBB dbb = tdbb->tdbb_database;
CSB csb_ = Csb::newCsb(*tdbb->tdbb_default, 5);
Csb* csb_ = Csb::newCsb(*tdbb->tdbb_default, 5);
csb_->csb_g_flags |= csb_get_dependencies;
jrd_nod* node;
@ -2320,10 +2320,10 @@ jrd_rel* MET_lookup_relation_id(TDBB tdbb, SLONG id, BOOLEAN return_deleted)
}
JRD_NOD MET_parse_blob(TDBB tdbb,
jrd_nod* MET_parse_blob(TDBB tdbb,
jrd_rel* relation,
SLONG blob_id[2],
CSB* csb_ptr,
Csb** csb_ptr,
jrd_req** request_ptr,
BOOLEAN trigger,
BOOLEAN ignore_perm)
@ -2544,7 +2544,7 @@ jrd_prc* MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
vec::iterator ptr, end;
PRM parameter;
JrdMemoryPool *old_pool;
JRD_NOD node;
jrd_nod* node;
FMT format;
fmt::fmt_desc_iterator desc;
SSHORT i;
@ -2753,7 +2753,7 @@ jrd_prc* MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
old_pool = tdbb->tdbb_default;
tdbb->tdbb_default = JrdMemoryPool::createPool();
CSB csb_ = Csb::newCsb(*tdbb->tdbb_default, 5);
Csb* csb_ = Csb::newCsb(*tdbb->tdbb_default, 5);
parse_procedure_blr(tdbb, procedure, (SLONG*)&P.RDB$PROCEDURE_BLR, csb_);
procedure->prc_request->req_procedure = procedure;
for (i = 0; i < csb_->csb_rpt.getCount(); i++)
@ -3259,7 +3259,7 @@ void MET_scan_relation( TDBB tdbb, jrd_rel* relation)
/* Since this can be called recursively, find an inactive clone of the request */
request = (BLK) CMP_find_request(tdbb, irq_r_fields, IRQ_REQUESTS);
CSB csb_ = NULL;
Csb* csb_ = NULL;
FOR(REQUEST_HANDLE request)
REL IN RDB$RELATIONS WITH REL.RDB$RELATION_ID EQ relation->rel_id
@ -3924,7 +3924,7 @@ static USHORT name_length(const TEXT* name)
static jrd_nod* parse_procedure_blr(
TDBB tdbb,
jrd_prc* procedure, SLONG blob_id[2], CSB csb)
jrd_prc* procedure, SLONG blob_id[2], Csb* csb)
{
/**************************************
*
@ -3959,7 +3959,7 @@ static BOOLEAN par_messages(TDBB tdbb,
const UCHAR* blr,
USHORT blr_length,
jrd_prc* procedure,
CSB csb)
Csb* csb)
{
/**************************************
*
@ -4255,7 +4255,7 @@ static void save_trigger_data(TDBB tdbb, TRIG_VEC* ptr, jrd_rel* relation,
static void store_dependencies(TDBB tdbb,
CSB csb,
Csb* csb,
const TEXT* object_name,
USHORT dependency_type)
{
@ -4278,7 +4278,7 @@ static void store_dependencies(TDBB tdbb,
while (csb->csb_dependencies)
{
jrd_nod* node = (JRD_NOD) LLS_POP(&csb->csb_dependencies);
jrd_nod* node = (jrd_nod*) LLS_POP(&csb->csb_dependencies);
if (!node->nod_arg[e_dep_object])
continue;
const SSHORT dpdo_type = (SSHORT) (SLONG) node->nod_arg[e_dep_object_type];

View File

@ -150,7 +150,7 @@ EXP NAV_expand_index(WIN * window, IRSB_NAV impure)
#ifdef PC_ENGINE
BOOLEAN NAV_find_record(RSB rsb,
USHORT operator, USHORT direction, JRD_NOD find_key)
USHORT operator, USHORT direction, jrd_nod* find_key)
{
/**************************************
*
@ -487,7 +487,7 @@ BOOLEAN NAV_get_record(TDBB tdbb,
UCHAR* nextPointer = get_position(tdbb, rsb, impure, &window,
direction, &expanded_next);
MOVE_FAST(impure->irsb_nav_data, key.key_data, impure->irsb_nav_length);
JRD_NOD retrieval_node = (JRD_NOD) rsb->rsb_arg[RSB_NAV_index];
jrd_nod* retrieval_node = (jrd_nod*) rsb->rsb_arg[RSB_NAV_index];
IRB retrieval = (IRB) retrieval_node->nod_arg[e_idx_retrieval];
// set the upper (or lower) limit for navigational retrieval
@ -1147,7 +1147,7 @@ static BOOLEAN find_record(
jrd_req* request;
IRSB_NAV impure;
RPB *rpb;
JRD_NOD retrieval_node;
jrd_nod* retrieval_node;
IRB retrieval;
IDX *idx;
BTR page;
@ -1167,7 +1167,7 @@ static BOOLEAN find_record(
rpb = request->req_rpb + rsb->rsb_stream;
window.win_flags = 0;
retrieval_node = (JRD_NOD) rsb->rsb_arg[RSB_NAV_index];
retrieval_node = (jrd_nod*) rsb->rsb_arg[RSB_NAV_index];
retrieval = (IRB) retrieval_node->nod_arg[e_idx_retrieval];
// save the current equality retrieval key
@ -1683,7 +1683,7 @@ static UCHAR* nav_open(
IRB retrieval;
KEY lower, upper, *limit_ptr;
//EXP expanded_page;
JRD_NOD retrieval_node;
jrd_nod* retrieval_node;
SET_TDBB(tdbb);
@ -1700,7 +1700,7 @@ static UCHAR* nav_open(
}
// Find the starting leaf page
retrieval_node = (JRD_NOD) rsb->rsb_arg[RSB_NAV_index];
retrieval_node = (jrd_nod*) rsb->rsb_arg[RSB_NAV_index];
retrieval = (IRB) retrieval_node->nod_arg[e_idx_retrieval];
IDX *idx = (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
BTR page = BTR_find_page(tdbb, retrieval, window, idx, &lower,

File diff suppressed because it is too large Load Diff

View File

@ -436,7 +436,7 @@ RSB EXT_optimize(OPT opt, SSHORT stream, NOD * sort_ptr)
*
**************************************/
TDBB tdbb;
CSB csb;
Csb* csb;
REL relation;
RSB rsb;
NOD dbkey, inversion;

View File

@ -85,35 +85,35 @@ static const TEXT elements[][10] =
#include "gen/codetext.h"
static void error(CSB, ...);
static void error(Csb*, ...);
static SSHORT find_proc_field(jrd_prc*, TEXT *);
static JRD_NOD par_args(TDBB, CSB, USHORT);
static JRD_NOD par_cast(TDBB, CSB);
static XCP par_condition(TDBB, CSB);
static XCP par_conditions(TDBB, CSB);
static SSHORT par_context(CSB, SSHORT *);
static void par_dependency(TDBB, CSB, SSHORT, SSHORT, TEXT *);
static JRD_NOD par_exec_proc(TDBB, CSB, SSHORT);
static JRD_NOD par_fetch(TDBB, CSB, JRD_NOD);
static JRD_NOD par_field(TDBB, CSB, SSHORT);
static JRD_NOD par_function(TDBB, CSB);
static JRD_NOD par_literal(TDBB, CSB);
static JRD_NOD par_map(TDBB, CSB, USHORT);
static JRD_NOD par_message(TDBB, CSB);
static JRD_NOD par_modify(TDBB, CSB);
static USHORT par_name(CSB, TEXT *);
static JRD_NOD par_plan(TDBB, CSB);
static JRD_NOD par_procedure(TDBB, CSB, SSHORT);
static void par_procedure_parms(TDBB, CSB, jrd_prc*, JRD_NOD *, JRD_NOD *, USHORT);
static JRD_NOD par_relation(TDBB, CSB, SSHORT, BOOLEAN);
static JRD_NOD par_rse(TDBB, CSB, SSHORT);
static JRD_NOD par_sort(TDBB, CSB, BOOLEAN);
static JRD_NOD par_stream(TDBB, CSB);
static JRD_NOD par_union(TDBB, CSB);
static USHORT par_word(CSB);
static JRD_NOD parse(TDBB, CSB, USHORT, USHORT expected_optional = 0);
static void syntax_error(CSB, const TEXT *);
static void warning(CSB, ...);
static jrd_nod* par_args(TDBB, Csb*, USHORT);
static jrd_nod* par_cast(TDBB, Csb*);
static XCP par_condition(TDBB, Csb*);
static XCP par_conditions(TDBB, Csb*);
static SSHORT par_context(Csb*, SSHORT *);
static void par_dependency(TDBB, Csb*, SSHORT, SSHORT, TEXT *);
static jrd_nod* par_exec_proc(TDBB, Csb*, SSHORT);
static jrd_nod* par_fetch(TDBB, Csb*, jrd_nod*);
static jrd_nod* par_field(TDBB, Csb*, SSHORT);
static jrd_nod* par_function(TDBB, Csb*);
static jrd_nod* par_literal(TDBB, Csb*);
static jrd_nod* par_map(TDBB, Csb*, USHORT);
static jrd_nod* par_message(TDBB, Csb*);
static jrd_nod* par_modify(TDBB, Csb*);
static USHORT par_name(Csb*, TEXT *);
static jrd_nod* par_plan(TDBB, Csb*);
static jrd_nod* par_procedure(TDBB, Csb*, SSHORT);
static void par_procedure_parms(TDBB, Csb*, jrd_prc*, jrd_nod**, jrd_nod**, USHORT);
static jrd_nod* par_relation(TDBB, Csb*, SSHORT, BOOLEAN);
static jrd_nod* par_rse(TDBB, Csb*, SSHORT);
static jrd_nod* par_sort(TDBB, Csb*, BOOLEAN);
static jrd_nod* par_stream(TDBB, Csb*);
static jrd_nod* par_union(TDBB, Csb*);
static USHORT par_word(Csb*);
static jrd_nod* parse(TDBB, Csb*, USHORT, USHORT expected_optional = 0);
static void syntax_error(Csb*, const TEXT *);
static void warning(Csb*, ...);
#define BLR_PEEK *(csb->csb_running)
#define BLR_BYTE *(csb->csb_running)++
@ -121,11 +121,11 @@ static void warning(CSB, ...);
#define BLR_WORD par_word (csb)
JRD_NOD PAR_blr(TDBB tdbb,
jrd_nod* PAR_blr(TDBB tdbb,
jrd_rel* relation,
const UCHAR* blr,
CSB view_csb,
CSB* csb_ptr,
Csb* view_csb,
Csb** csb_ptr,
jrd_req** request_ptr,
BOOLEAN trigger,
USHORT flags)
@ -141,7 +141,7 @@ JRD_NOD PAR_blr(TDBB tdbb,
* Caller must do pool handling.
*
**************************************/
CSB csb;
Csb* csb;
SSHORT stream, count;
csb_repeat *t1, *t2;
@ -231,7 +231,7 @@ JRD_NOD PAR_blr(TDBB tdbb,
}
int PAR_desc(CSB csb, DSC * desc)
int PAR_desc(Csb* csb, DSC * desc)
{
/**************************************
*
@ -362,7 +362,7 @@ int PAR_desc(CSB csb, DSC * desc)
}
JRD_NOD PAR_gen_field(TDBB tdbb, USHORT stream, USHORT id)
jrd_nod* PAR_gen_field(TDBB tdbb, USHORT stream, USHORT id)
{
/**************************************
*
@ -378,14 +378,14 @@ JRD_NOD PAR_gen_field(TDBB tdbb, USHORT stream, USHORT id)
jrd_nod* node = FB_NEW_RPT(*tdbb->tdbb_default, e_fld_length) jrd_nod();
node->nod_type = nod_field;
node->nod_arg[e_fld_id] = (JRD_NOD) (SLONG) id;
node->nod_arg[e_fld_stream] = (JRD_NOD) (SLONG) stream;
node->nod_arg[e_fld_id] = (jrd_nod*) (SLONG) id;
node->nod_arg[e_fld_stream] = (jrd_nod*) (SLONG) stream;
return node;
}
JRD_NOD PAR_make_field(TDBB tdbb, CSB csb, USHORT context,
jrd_nod* PAR_make_field(TDBB tdbb, Csb* csb, USHORT context,
const TEXT* base_field)
{
/**************************************
@ -455,7 +455,7 @@ JRD_NOD PAR_make_field(TDBB tdbb, CSB csb, USHORT context,
}
JRD_NOD PAR_make_list(TDBB tdbb, LLS stack)
jrd_nod* PAR_make_list(TDBB tdbb, LLS stack)
{
/**************************************
*
@ -480,13 +480,13 @@ JRD_NOD PAR_make_list(TDBB tdbb, LLS stack)
jrd_nod** ptr = node->nod_arg + count;
while (stack)
*--ptr = (JRD_NOD) LLS_POP(&stack);
*--ptr = (jrd_nod*) LLS_POP(&stack);
return node;
}
JRD_NOD PAR_make_node(TDBB tdbb, int size)
jrd_nod* PAR_make_node(TDBB tdbb, int size)
{
/**************************************
*
@ -507,7 +507,7 @@ JRD_NOD PAR_make_node(TDBB tdbb, int size)
}
CSB PAR_parse(TDBB tdbb, const UCHAR* blr, USHORT internal_flag)
Csb* PAR_parse(TDBB tdbb, const UCHAR* blr, USHORT internal_flag)
{
/**************************************
*
@ -521,7 +521,7 @@ CSB PAR_parse(TDBB tdbb, const UCHAR* blr, USHORT internal_flag)
**************************************/
SET_TDBB(tdbb);
CSB csb = Csb::newCsb(*tdbb->tdbb_default, 5);
Csb* csb = Csb::newCsb(*tdbb->tdbb_default, 5);
csb->csb_running = csb->csb_blr = blr;
const SSHORT version = *csb->csb_running++;
if (internal_flag)
@ -587,7 +587,7 @@ SLONG PAR_symbol_to_gdscode(const char* name)
}
static void error(CSB csb, ...)
static void error(Csb* csb, ...)
{
/**************************************
*
@ -685,7 +685,7 @@ static SSHORT find_proc_field(jrd_prc* procedure, TEXT * name)
}
static JRD_NOD par_args(TDBB tdbb, CSB csb, USHORT expected)
static jrd_nod* par_args(TDBB tdbb, Csb* csb, USHORT expected)
{
/**************************************
*
@ -714,7 +714,7 @@ static JRD_NOD par_args(TDBB tdbb, CSB csb, USHORT expected)
}
static JRD_NOD par_cast(TDBB tdbb, CSB csb)
static jrd_nod* par_cast(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -733,7 +733,7 @@ static JRD_NOD par_cast(TDBB tdbb, CSB csb)
fmt* format = fmt::newFmt(*tdbb->tdbb_default, 1);
format->fmt_count = 1;
node->nod_arg[e_cast_fmt] = (JRD_NOD) format;
node->nod_arg[e_cast_fmt] = (jrd_nod*) format;
dsc* desc = &format->fmt_desc[0];
PAR_desc(csb, desc);
@ -745,7 +745,7 @@ static JRD_NOD par_cast(TDBB tdbb, CSB csb)
}
static XCP par_condition(TDBB tdbb, CSB csb)
static XCP par_condition(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -757,7 +757,7 @@ static XCP par_condition(TDBB tdbb, CSB csb)
* Parse an error conditions list.
*
**************************************/
JRD_NOD dep_node;
jrd_nod* dep_node;
TEXT name[32], *p;
SLONG code_number;
@ -805,8 +805,8 @@ static XCP par_condition(TDBB tdbb, CSB csb)
dep_node = PAR_make_node(tdbb, e_dep_length);
dep_node->nod_type = nod_dependency;
dep_node->nod_arg[e_dep_object] =
(JRD_NOD) exception_list->xcp_rpt[0].xcp_code;
dep_node->nod_arg[e_dep_object_type] = (JRD_NOD) obj_exception;
(jrd_nod*) exception_list->xcp_rpt[0].xcp_code;
dep_node->nod_arg[e_dep_object_type] = (jrd_nod*) obj_exception;
LLS_PUSH(dep_node, &csb->csb_dependencies);
break;
@ -819,7 +819,7 @@ static XCP par_condition(TDBB tdbb, CSB csb)
}
static XCP par_conditions(TDBB tdbb, CSB csb)
static XCP par_conditions(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -831,7 +831,7 @@ static XCP par_conditions(TDBB tdbb, CSB csb)
* Parse an error conditions list.
*
**************************************/
JRD_NOD dep_node;
jrd_nod* dep_node;
TEXT name[32], *p;
SLONG code_number;
@ -873,8 +873,8 @@ static XCP par_conditions(TDBB tdbb, CSB csb)
dep_node = PAR_make_node(tdbb, e_dep_length);
dep_node->nod_type = nod_dependency;
dep_node->nod_arg[e_dep_object] =
(JRD_NOD) exception_list->xcp_rpt[0].xcp_code;
dep_node->nod_arg[e_dep_object_type] = (JRD_NOD) obj_exception;
(jrd_nod*) exception_list->xcp_rpt[0].xcp_code;
dep_node->nod_arg[e_dep_object_type] = (jrd_nod*) obj_exception;
LLS_PUSH(dep_node, &csb->csb_dependencies);
break;
@ -893,7 +893,7 @@ static XCP par_conditions(TDBB tdbb, CSB csb)
}
static SSHORT par_context(CSB csb, SSHORT* context_ptr)
static SSHORT par_context(Csb* csb, SSHORT* context_ptr)
{
/**************************************
*
@ -935,7 +935,7 @@ static SSHORT par_context(CSB csb, SSHORT* context_ptr)
static void par_dependency(TDBB tdbb,
CSB csb,
Csb* csb,
SSHORT stream,
SSHORT id,
TEXT* field_name)
@ -957,13 +957,13 @@ static void par_dependency(TDBB tdbb,
node->nod_type = nod_dependency;
if (csb->csb_rpt[stream].csb_relation) {
node->nod_arg[e_dep_object] =
(JRD_NOD) csb->csb_rpt[stream].csb_relation;
node->nod_arg[e_dep_object_type] = (JRD_NOD) obj_relation;
(jrd_nod*) csb->csb_rpt[stream].csb_relation;
node->nod_arg[e_dep_object_type] = (jrd_nod*) obj_relation;
}
else if (csb->csb_rpt[stream].csb_procedure) {
node->nod_arg[e_dep_object] =
(JRD_NOD) csb->csb_rpt[stream].csb_procedure;
node->nod_arg[e_dep_object_type] = (JRD_NOD) obj_procedure;
(jrd_nod*) csb->csb_rpt[stream].csb_procedure;
node->nod_arg[e_dep_object_type] = (jrd_nod*) obj_procedure;
}
if (field_name) {
@ -974,20 +974,20 @@ static void par_dependency(TDBB tdbb,
str* string = FB_NEW_RPT(*tdbb->tdbb_default, length) str();
string->str_length = length;
strcpy(reinterpret_cast<char*>(string->str_data), field_name);
field_node->nod_arg[0] = (JRD_NOD) string->str_data;
field_node->nod_arg[0] = (jrd_nod*) string->str_data;
}
else if (id >= 0) {
jrd_nod* field_node = PAR_make_node(tdbb, 1);
node->nod_arg[e_dep_field] = field_node;
field_node->nod_type = nod_field;
field_node->nod_arg[0] = (JRD_NOD) (SLONG) id;
field_node->nod_arg[0] = (jrd_nod*) (SLONG) id;
}
LLS_PUSH(node, &csb->csb_dependencies);
}
static JRD_NOD par_exec_proc(TDBB tdbb, CSB csb, SSHORT operator_)
static jrd_nod* par_exec_proc(TDBB tdbb, Csb* csb, SSHORT operator_)
{
/**************************************
*
@ -1021,7 +1021,7 @@ static JRD_NOD par_exec_proc(TDBB tdbb, CSB csb, SSHORT operator_)
jrd_nod* node = PAR_make_node(tdbb, e_esp_length);
node->nod_type = nod_exec_proc;
node->nod_count = count_table[blr_exec_proc];
node->nod_arg[e_esp_procedure] = (JRD_NOD) procedure;
node->nod_arg[e_esp_procedure] = (jrd_nod*) procedure;
par_procedure_parms(tdbb, csb, procedure, &node->nod_arg[e_esp_in_msg],
&node->nod_arg[e_esp_inputs], TRUE);
@ -1030,8 +1030,8 @@ static JRD_NOD par_exec_proc(TDBB tdbb, CSB csb, SSHORT operator_)
jrd_nod* dep_node = PAR_make_node(tdbb, e_dep_length);
dep_node->nod_type = nod_dependency;
dep_node->nod_arg[e_dep_object] = (JRD_NOD) procedure;
dep_node->nod_arg[e_dep_object_type] = (JRD_NOD) obj_procedure;
dep_node->nod_arg[e_dep_object] = (jrd_nod*) procedure;
dep_node->nod_arg[e_dep_object_type] = (jrd_nod*) obj_procedure;
LLS_PUSH(dep_node, &csb->csb_dependencies);
@ -1039,7 +1039,7 @@ static JRD_NOD par_exec_proc(TDBB tdbb, CSB csb, SSHORT operator_)
}
static JRD_NOD par_fetch(TDBB tdbb, CSB csb, JRD_NOD for_node)
static jrd_nod* par_fetch(TDBB tdbb, Csb* csb, jrd_nod* for_node)
{
/**************************************
*
@ -1085,7 +1085,7 @@ static JRD_NOD par_fetch(TDBB tdbb, CSB csb, JRD_NOD for_node)
}
static JRD_NOD par_field(TDBB tdbb, CSB csb, SSHORT operator_)
static jrd_nod* par_field(TDBB tdbb, Csb* csb, SSHORT operator_)
{
/**************************************
*
@ -1211,7 +1211,7 @@ static JRD_NOD par_field(TDBB tdbb, CSB csb, SSHORT operator_)
}
static JRD_NOD par_function(TDBB tdbb, CSB csb)
static jrd_nod* par_function(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -1266,15 +1266,15 @@ static JRD_NOD par_function(TDBB tdbb, CSB csb)
jrd_nod* node = PAR_make_node(tdbb, e_fun_length);
node->nod_count = 1;
node->nod_arg[e_fun_function] = (JRD_NOD) function;
node->nod_arg[e_fun_function] = (jrd_nod*) function;
node->nod_arg[e_fun_args] = par_args(tdbb, csb, VALUE);
/* CVC: I will track ufds only if a proc is not being dropped. */
if (csb->csb_g_flags & csb_get_dependencies) {
JRD_NOD dep_node = PAR_make_node (tdbb, e_dep_length);
jrd_nod* dep_node = PAR_make_node (tdbb, e_dep_length);
dep_node->nod_type = nod_dependency;
dep_node->nod_arg [e_dep_object] = (JRD_NOD) function;
dep_node->nod_arg [e_dep_object_type] = (JRD_NOD) obj_udf;
dep_node->nod_arg [e_dep_object] = (jrd_nod*) function;
dep_node->nod_arg [e_dep_object_type] = (jrd_nod*) obj_udf;
LLS_PUSH (dep_node, &csb->csb_dependencies);
}
@ -1282,7 +1282,7 @@ static JRD_NOD par_function(TDBB tdbb, CSB csb)
}
static JRD_NOD par_literal(TDBB tdbb, CSB csb)
static jrd_nod* par_literal(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -1304,7 +1304,7 @@ static JRD_NOD par_literal(TDBB tdbb, CSB csb)
PAR_desc(csb, &desc);
const SSHORT count = lit_delta +
(desc.dsc_length + sizeof(jrd_nod*) - 1) / sizeof(jrd_nod*);
JRD_NOD node = PAR_make_node(tdbb, count);
jrd_nod* node = PAR_make_node(tdbb, count);
LIT literal = (LIT) node;
node->nod_count = 0;
literal->lit_desc = desc;
@ -1382,7 +1382,7 @@ static JRD_NOD par_literal(TDBB tdbb, CSB csb)
}
static JRD_NOD par_map(TDBB tdbb, CSB csb, USHORT stream)
static jrd_nod* par_map(TDBB tdbb, Csb* csb, USHORT stream)
{
/**************************************
*
@ -1419,7 +1419,7 @@ static JRD_NOD par_map(TDBB tdbb, CSB csb, USHORT stream)
}
static JRD_NOD par_message(TDBB tdbb, CSB csb)
static jrd_nod* par_message(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -1441,7 +1441,7 @@ static JRD_NOD par_message(TDBB tdbb, CSB csb)
jrd_nod* node = PAR_make_node(tdbb, e_msg_length);
tail->csb_message = node;
node->nod_count = 0;
node->nod_arg[e_msg_number] = (JRD_NOD) (SLONG) n;
node->nod_arg[e_msg_number] = (jrd_nod*) (SLONG) n;
if (n > csb->csb_msg_number)
csb->csb_msg_number = n;
@ -1450,7 +1450,7 @@ static JRD_NOD par_message(TDBB tdbb, CSB csb)
n = BLR_WORD;
fmt* format = fmt::newFmt(*tdbb->tdbb_default, n);
node->nod_arg[e_msg_format] = (JRD_NOD) format;
node->nod_arg[e_msg_format] = (jrd_nod*) format;
format->fmt_count = n;
ULONG offset = 0;
@ -1472,7 +1472,7 @@ static JRD_NOD par_message(TDBB tdbb, CSB csb)
}
static JRD_NOD par_modify(TDBB tdbb, CSB csb)
static jrd_nod* par_modify(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -1512,15 +1512,15 @@ static JRD_NOD par_modify(TDBB tdbb, CSB csb)
jrd_nod* node = PAR_make_node(tdbb, e_mod_length);
node->nod_count = 1;
node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) org_stream;
node->nod_arg[e_mod_new_stream] = (JRD_NOD) (SLONG) new_stream;
node->nod_arg[e_mod_org_stream] = (jrd_nod*) (SLONG) org_stream;
node->nod_arg[e_mod_new_stream] = (jrd_nod*) (SLONG) new_stream;
node->nod_arg[e_mod_statement] = parse(tdbb, csb, STATEMENT);
return node;
}
static USHORT par_name(CSB csb, TEXT* string)
static USHORT par_name(Csb* csb, TEXT* string)
{
/**************************************
*
@ -1547,7 +1547,7 @@ static USHORT par_name(CSB csb, TEXT* string)
}
static JRD_NOD par_plan(TDBB tdbb, CSB csb)
static jrd_nod* par_plan(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -1610,8 +1610,8 @@ static JRD_NOD par_plan(TDBB tdbb, CSB csb)
error(csb, isc_ctxnotdef, 0);
const SSHORT stream = csb->csb_rpt[n].csb_stream;
relation_node->nod_arg[e_rel_stream] = (JRD_NOD) (SLONG) stream;
relation_node->nod_arg[e_rel_context] = (JRD_NOD) (SLONG) n;
relation_node->nod_arg[e_rel_stream] = (jrd_nod*) (SLONG) stream;
relation_node->nod_arg[e_rel_context] = (jrd_nod*) (SLONG) n;
/* Access plan types (sequential is default) */
@ -1655,9 +1655,9 @@ static JRD_NOD par_plan(TDBB tdbb, CSB csb)
the relation could be a base relation of a view;
save the index name also, for convenience */
access_type->nod_arg[0] = (JRD_NOD) relation_id;
access_type->nod_arg[1] = (JRD_NOD) index_id;
access_type->nod_arg[2] = (JRD_NOD) ALL_cstring(name);
access_type->nod_arg[0] = (jrd_nod*) relation_id;
access_type->nod_arg[1] = (jrd_nod*) index_id;
access_type->nod_arg[2] = (jrd_nod*) ALL_cstring(name);
if (BLR_PEEK == blr_indices)
// dimitr: FALL INTO, if the plan item is ORDER ... INDEX (...)
@ -1710,9 +1710,9 @@ static JRD_NOD par_plan(TDBB tdbb, CSB csb)
the relation could be a base relation of a view;
save the index name also, for convenience */
*arg++ = (JRD_NOD) relation_id;
*arg++ = (JRD_NOD) index_id;
*arg++ = (JRD_NOD) ALL_cstring(name);
*arg++ = (jrd_nod*) relation_id;
*arg++ = (jrd_nod*) index_id;
*arg++ = (jrd_nod*) ALL_cstring(name);
}
break;
}
@ -1730,7 +1730,7 @@ static JRD_NOD par_plan(TDBB tdbb, CSB csb)
}
static JRD_NOD par_procedure(TDBB tdbb, CSB csb, SSHORT operator_)
static jrd_nod* par_procedure(TDBB tdbb, Csb* csb, SSHORT operator_)
{
/**************************************
*
@ -1765,10 +1765,10 @@ static JRD_NOD par_procedure(TDBB tdbb, CSB csb, SSHORT operator_)
jrd_nod* node = PAR_make_node(tdbb, e_prc_length);
node->nod_type = nod_procedure;
node->nod_count = count_table[blr_procedure];
node->nod_arg[e_prc_procedure] = (JRD_NOD) (SLONG) procedure->prc_id;
node->nod_arg[e_prc_procedure] = (jrd_nod*) (SLONG) procedure->prc_id;
const USHORT stream = par_context(csb, 0);
node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) stream;
node->nod_arg[e_prc_stream] = (jrd_nod*) (SLONG) stream;
csb->csb_rpt[stream].csb_procedure = procedure;
par_procedure_parms(tdbb, csb, procedure, &node->nod_arg[e_prc_in_msg],
@ -1783,10 +1783,10 @@ static JRD_NOD par_procedure(TDBB tdbb, CSB csb, SSHORT operator_)
static void par_procedure_parms(
TDBB tdbb,
CSB csb,
Csb* csb,
jrd_prc* procedure,
JRD_NOD * message_ptr,
JRD_NOD * parameter_ptr, USHORT input_flag)
jrd_nod** message_ptr,
jrd_nod** parameter_ptr, USHORT input_flag)
{
/**************************************
*
@ -1830,7 +1830,7 @@ static void par_procedure_parms(
message->nod_count = count_table[blr_message];
*message_ptr = message;
message->nod_count = 0;
message->nod_arg[e_msg_number] = (JRD_NOD)(ULONG) n;
message->nod_arg[e_msg_number] = (jrd_nod*)(ULONG) n;
const fmt* format =
input_flag ? procedure->prc_input_fmt : procedure->prc_output_fmt;
/* dimitr: procedure (with its parameter formats) is allocated out of
@ -1848,11 +1848,11 @@ static void par_procedure_parms(
to avoid unexpected cache cleanups, but that area is out of my
knowledge. So this fix should be considered a temporary solution.
message->nod_arg[e_msg_format] = (JRD_NOD) format;
message->nod_arg[e_msg_format] = (jrd_nod*) format;
*/
fmt* fmt_copy = fmt::newFmt(*tdbb->tdbb_default, format->fmt_count);
*fmt_copy = *format;
message->nod_arg[e_msg_format] = (JRD_NOD) fmt_copy;
message->nod_arg[e_msg_format] = (jrd_nod*) fmt_copy;
/* --- end of fix --- */
if (!mismatch)
n = format->fmt_count / 2;
@ -1886,13 +1886,13 @@ static void par_procedure_parms(
prm->nod_type = nod_argument;
prm->nod_count = 1;
prm->nod_arg[e_arg_message] = message;
prm->nod_arg[e_arg_number] = (JRD_NOD)(ULONG) i++;
prm->nod_arg[e_arg_number] = (jrd_nod*)(ULONG) i++;
jrd_nod* prm_f = prm->nod_arg[e_arg_flag] =
PAR_make_node(tdbb, e_arg_length);
prm_f->nod_type = nod_argument;
prm_f->nod_count = 0;
prm_f->nod_arg[e_arg_message] = message;
prm_f->nod_arg[e_arg_number] = (JRD_NOD)(ULONG) i++;
prm_f->nod_arg[e_arg_number] = (jrd_nod*)(ULONG) i++;
}
}
else if ((input_flag ? procedure->prc_inputs : procedure->prc_outputs) &&
@ -1906,9 +1906,9 @@ static void par_procedure_parms(
}
static JRD_NOD par_relation(
static jrd_nod* par_relation(
TDBB tdbb,
CSB csb, SSHORT operator_, BOOLEAN parse_context)
Csb* csb, SSHORT operator_, BOOLEAN parse_context)
{
/**************************************
*
@ -1960,7 +1960,7 @@ static JRD_NOD par_relation(
/* if an alias was passed, store with the relation */
if (alias_string)
node->nod_arg[e_rel_alias] = (JRD_NOD) alias_string;
node->nod_arg[e_rel_alias] = (jrd_nod*) alias_string;
/* Scan the relation if it hasn't already been scanned for meta data */
@ -1984,8 +1984,8 @@ static JRD_NOD par_relation(
SSHORT context;
const SSHORT stream = par_context(csb, &context);
fb_assert(stream <= MAX_STREAMS);
node->nod_arg[e_rel_stream] = (JRD_NOD) (SLONG) stream;
node->nod_arg[e_rel_context] = (JRD_NOD) (SLONG) context;
node->nod_arg[e_rel_stream] = (jrd_nod*) (SLONG) stream;
node->nod_arg[e_rel_context] = (jrd_nod*) (SLONG) context;
csb->csb_rpt[stream].csb_relation = relation;
csb->csb_rpt[stream].csb_alias = alias_string;
@ -1994,13 +1994,13 @@ static JRD_NOD par_relation(
par_dependency(tdbb, csb, stream, (SSHORT) - 1, 0);
}
node->nod_arg[e_rel_relation] = (JRD_NOD) relation;
node->nod_arg[e_rel_relation] = (jrd_nod*) relation;
return node;
}
static JRD_NOD par_rse(TDBB tdbb, CSB csb, SSHORT rse_op)
static jrd_nod* par_rse(TDBB tdbb, Csb* csb, SSHORT rse_op)
{
/**************************************
*
@ -2103,13 +2103,13 @@ static JRD_NOD par_rse(TDBB tdbb, CSB csb, SSHORT rse_op)
// RIGHT JOIN handling at lower engine levels
if (rse->rse_jointype == blr_right) {
// Swap sub-streams
JRD_NOD temp = rse->rse_relation[0];
jrd_nod* temp = rse->rse_relation[0];
rse->rse_relation[0] = rse->rse_relation[1];
rse->rse_relation[1] = temp;
rse->rse_jointype = blr_left;
}
return (JRD_NOD) rse;
return (jrd_nod*) rse;
}
}
syntax_error(csb, (TEXT*)((rse_op == blr_rs_stream) ?
@ -2120,7 +2120,7 @@ static JRD_NOD par_rse(TDBB tdbb, CSB csb, SSHORT rse_op)
}
static JRD_NOD par_sort(TDBB tdbb, CSB csb, BOOLEAN flag)
static jrd_nod* par_sort(TDBB tdbb, Csb* csb, BOOLEAN flag)
{
/**************************************
*
@ -2148,19 +2148,19 @@ static JRD_NOD par_sort(TDBB tdbb, CSB csb, BOOLEAN flag)
UCHAR code = BLR_BYTE;
switch (code) {
case blr_nullsfirst:
*ptr3++ = (JRD_NOD) (IPTR) rse_nulls_first;
*ptr3++ = (jrd_nod*) (IPTR) rse_nulls_first;
code = BLR_BYTE;
break;
case blr_nullslast:
*ptr3++ = (JRD_NOD) (IPTR) rse_nulls_last;
*ptr3++ = (jrd_nod*) (IPTR) rse_nulls_last;
code = BLR_BYTE;
break;
default:
*ptr3++ = (JRD_NOD) (IPTR) rse_nulls_default;
*ptr3++ = (jrd_nod*) (IPTR) rse_nulls_default;
}
*ptr2++ =
(JRD_NOD) (IPTR) ((code == blr_descending) ? TRUE : FALSE);
(jrd_nod*) (IPTR) ((code == blr_descending) ? TRUE : FALSE);
}
*ptr++ = parse(tdbb, csb, VALUE);
}
@ -2169,7 +2169,7 @@ static JRD_NOD par_sort(TDBB tdbb, CSB csb, BOOLEAN flag)
}
static JRD_NOD par_stream(TDBB tdbb, CSB csb)
static jrd_nod* par_stream(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -2197,14 +2197,14 @@ static JRD_NOD par_stream(TDBB tdbb, CSB csb)
default:
if (op == (UCHAR) blr_end)
return (JRD_NOD) rse;
return (jrd_nod*) rse;
syntax_error(csb, "stream_clause");
}
}
}
static JRD_NOD par_union(TDBB tdbb, CSB csb)
static jrd_nod* par_union(TDBB tdbb, Csb* csb)
{
/**************************************
*
@ -2224,7 +2224,7 @@ static JRD_NOD par_union(TDBB tdbb, CSB csb)
jrd_nod* node = PAR_make_node(tdbb, e_uni_length);
node->nod_count = 2;
const USHORT stream = par_context(csb, 0);
node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) stream;
node->nod_arg[e_uni_stream] = (jrd_nod*) (SLONG) stream;
SSHORT count = (unsigned int) BLR_BYTE;
/* Pick up the sub-rse's and maps */
@ -2242,7 +2242,7 @@ static JRD_NOD par_union(TDBB tdbb, CSB csb)
}
static USHORT par_word(CSB csb)
static USHORT par_word(Csb* csb)
{
/**************************************
*
@ -2261,7 +2261,7 @@ static USHORT par_word(CSB csb)
}
static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_optional)
static jrd_nod* parse(TDBB tdbb, Csb* csb, USHORT expected, USHORT expected_optional)
{
/**************************************
*
@ -2408,9 +2408,9 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
break;
case blr_user_savepoint:
*arg++ = (JRD_NOD) (ULONG) BLR_BYTE;
*arg++ = (jrd_nod*) (ULONG) BLR_BYTE;
par_name(csb, name);
*arg++ = (JRD_NOD) ALL_cstring(name);
*arg++ = (jrd_nod*) ALL_cstring(name);
break;
case blr_store:
@ -2442,7 +2442,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_erase_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
break;
case blr_modify:
@ -2482,14 +2482,14 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
break;
case blr_dcl_cursor:
node->nod_arg[e_dcl_cursor_number] = (JRD_NOD) (IPTR) BLR_WORD;
node->nod_arg[e_dcl_cursor_number] = (jrd_nod*) (IPTR) BLR_WORD;
node->nod_arg[e_dcl_cursor_rse] = parse(tdbb, csb, TYPE_RSE);
break;
case blr_cursor_stmt:
n = BLR_BYTE;
node->nod_arg[e_cursor_stmt_op] = (JRD_NOD) (IPTR) n;
node->nod_arg[e_cursor_stmt_number] = (JRD_NOD) (IPTR) BLR_WORD;
node->nod_arg[e_cursor_stmt_op] = (jrd_nod*) (IPTR) n;
node->nod_arg[e_cursor_stmt_number] = (jrd_nod*) (IPTR) BLR_WORD;
switch (n) {
case blr_cursor_open:
case blr_cursor_close:
@ -2528,7 +2528,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
break;
case blr_aggregate:
node->nod_arg[e_agg_stream] = (JRD_NOD) (SLONG) par_context(csb, 0);
node->nod_arg[e_agg_stream] = (jrd_nod*) (SLONG) par_context(csb, 0);
fb_assert((int) (IPTR)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
@ -2556,7 +2556,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
error(csb, isc_gennotdef,
isc_arg_string, ERR_cstring(name), 0);
}
node->nod_arg[e_gen_relation] = (JRD_NOD) tmp;
node->nod_arg[e_gen_relation] = (jrd_nod*) tmp;
node->nod_arg[e_gen_value] = parse(tdbb, csb, VALUE);
/* CVC: There're thousand ways to go wrong, but I don't see any value
@ -2565,10 +2565,10 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if ((operator_ == blr_gen_id)
&& (csb->csb_g_flags & csb_get_dependencies))
{
JRD_NOD dep_node = PAR_make_node (tdbb, e_dep_length);
jrd_nod* dep_node = PAR_make_node (tdbb, e_dep_length);
dep_node->nod_type = nod_dependency;
dep_node->nod_arg [e_dep_object] = (JRD_NOD) tmp;
dep_node->nod_arg [e_dep_object_type] = (JRD_NOD) obj_generator;
dep_node->nod_arg [e_dep_object] = (jrd_nod*) tmp;
dep_node->nod_arg [e_dep_object_type] = (jrd_nod*) obj_generator;
LLS_PUSH (dep_node, &csb->csb_dependencies);
}
@ -2580,7 +2580,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
n = BLR_BYTE;
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[0] = (JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[0] = (jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
break;
case blr_fetch:
@ -2615,7 +2615,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
case blr_dcl_variable:
{
n = BLR_WORD;
node->nod_arg[e_dcl_id] = (JRD_NOD) (SLONG) n;
node->nod_arg[e_dcl_id] = (jrd_nod*) (SLONG) n;
PAR_desc(csb, (DSC *) (node->nod_arg + e_dcl_desc));
vec* vector = csb->csb_variables =
vec::newVector(*tdbb->tdbb_default, csb->csb_variables, n + 1);
@ -2626,10 +2626,10 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
case blr_variable:
{
n = BLR_WORD;
node->nod_arg[e_var_id] = (JRD_NOD) (SLONG) n;
node->nod_arg[e_var_id] = (jrd_nod*) (SLONG) n;
vec* vector = csb->csb_variables;
if (!vector || n >= vector->count() ||
!(node->nod_arg[e_var_variable] = (JRD_NOD) (*vector)[n]))
!(node->nod_arg[e_var_variable] = (jrd_nod*) (*vector)[n]))
{
syntax_error(csb, "variable identifier");
}
@ -2640,7 +2640,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
case blr_parameter2:
case blr_parameter3:
{
JRD_NOD message;
jrd_nod* message;
n = (USHORT) BLR_BYTE;
if (n >= csb->csb_rpt.getCount() ||
!(message = csb->csb_rpt[n].csb_message))
@ -2649,7 +2649,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
}
node->nod_arg[e_arg_message] = message;
n = BLR_WORD;
node->nod_arg[e_arg_number] = (JRD_NOD) (SLONG) n;
node->nod_arg[e_arg_number] = (jrd_nod*) (SLONG) n;
const fmt* format = (FMT) message->nod_arg[e_msg_format];
if (n >= format->fmt_count)
error(csb, isc_badparnum, 0);
@ -2661,7 +2661,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
temp->nod_type = nod_argument;
temp->nod_arg[e_arg_message] = message;
n = BLR_WORD;
temp->nod_arg[e_arg_number] = (JRD_NOD) (SLONG) n;
temp->nod_arg[e_arg_number] = (jrd_nod*) (SLONG) n;
if (n >= format->fmt_count)
error(csb, isc_badparnum, 0);
}
@ -2673,7 +2673,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
temp->nod_type = nod_argument;
temp->nod_arg[e_arg_message] = message;
n = BLR_WORD;
temp->nod_arg[e_arg_number] = (JRD_NOD) (SLONG) n;
temp->nod_arg[e_arg_number] = (jrd_nod*) (SLONG) n;
if (n >= format->fmt_count)
error(csb, isc_badparnum, 0);
}
@ -2711,14 +2711,14 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
break;
case blr_error_handler:
node->nod_arg[e_err_conditions] = (JRD_NOD) par_conditions(tdbb, csb);
node->nod_arg[e_err_conditions] = (jrd_nod*) par_conditions(tdbb, csb);
node->nod_arg[e_err_action] = parse(tdbb, csb, sub_type);
break;
case blr_abort:
{
const bool flag = (BLR_PEEK == blr_exception_msg);
node->nod_arg[e_xcp_desc] = (JRD_NOD) par_condition(tdbb, csb);
node->nod_arg[e_xcp_desc] = (jrd_nod*) par_condition(tdbb, csb);
if (flag)
{
node->nod_arg[e_xcp_msg] = parse(tdbb, csb, sub_type);
@ -2738,12 +2738,12 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
break;
case blr_label:
node->nod_arg[e_lbl_label] = (JRD_NOD) (SLONG) BLR_BYTE;
node->nod_arg[e_lbl_label] = (jrd_nod*) (SLONG) BLR_BYTE;
node->nod_arg[e_lbl_statement] = parse(tdbb, csb, sub_type);
break;
case blr_leave:
node->nod_arg[0] = (JRD_NOD) (SLONG) BLR_BYTE;
node->nod_arg[0] = (jrd_nod*) (SLONG) BLR_BYTE;
break;
@ -2782,7 +2782,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_index_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[e_index_index] = parse(tdbb, csb, VALUE);
break;
@ -2791,7 +2791,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_find_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[e_find_operator] = parse(tdbb, csb, VALUE);
node->nod_arg[e_find_direction] = parse(tdbb, csb, VALUE);
node->nod_arg[e_find_args] = par_args(tdbb, csb, VALUE);
@ -2803,7 +2803,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_find_dbkey_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[e_find_dbkey_dbkey] = parse(tdbb, csb, VALUE);
if (operator_ == blr_find_dbkey_version)
@ -2815,7 +2815,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_getmark_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
break;
case blr_set_bookmark:
@ -2823,7 +2823,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_setmark_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[e_setmark_id] = parse(tdbb, csb, VALUE);
break;
@ -2840,7 +2840,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
n = BLR_BYTE;
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[0] = (JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[0] = (jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
break;
case blr_reset_stream:
@ -2848,13 +2848,13 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_reset_from_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
n = BLR_BYTE;
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_reset_to_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
break;
case blr_release_lock:
@ -2875,7 +2875,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_lockrec_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
node->nod_arg[e_lockrec_level] = parse(tdbb, csb, VALUE);
break;
@ -2912,7 +2912,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
error(csb, isc_ctxnotdef, 0);
node->nod_arg[e_card_stream] =
(JRD_NOD) (SLONG) csb->csb_rpt[n].csb_stream;
(jrd_nod*) (SLONG) csb->csb_rpt[n].csb_stream;
break;
#endif
@ -2937,7 +2937,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
}
static void syntax_error(CSB csb, const TEXT* string)
static void syntax_error(Csb* csb, const TEXT* string)
{
/**************************************
*
@ -2957,7 +2957,7 @@ static void syntax_error(CSB csb, const TEXT* string)
}
static void warning(CSB csb, ...)
static void warning(Csb* csb, ...)
{
/**************************************
*

View File

@ -70,7 +70,7 @@ int PCMET_expression_index(
jrd_rel* relation;
IDX idx;
PLB default_pool, new_pool = NULL;
CSB csb;
Csb* csb;
jrd_req* current_request;
SET_TDBB(tdbb);
@ -209,7 +209,7 @@ void PCMET_lookup_index( jrd_rel* relation, IDX * idx)
* the metadata cache if possible.
*
**************************************/
CSB csb = NULL;
Csb* csb = NULL;
TDBB tdbb = GET_THREAD_DATA;
DBB dbb = tdbb->tdbb_database;

View File

@ -206,7 +206,7 @@ void RNG_add_record(RPB * rpb)
#ifdef PC_ENGINE
JRD_NOD RNG_add_relation(JRD_NOD node)
jrd_nod* RNG_add_relation(jrd_nod* node)
{
/**************************************
*
@ -225,7 +225,7 @@ JRD_NOD RNG_add_relation(JRD_NOD node)
USHORT range_number;
VEC refresh_ranges;
RNG refresh_range;
JRD_NOD relation_node;
jrd_nod* relation_node;
jrd_rel* relation;
LCK relation_lock;
VEC relation_locks;
@ -359,7 +359,7 @@ void RNG_add_uncommitted_record(RPB * rpb)
#ifdef PC_ENGINE
DSC *RNG_begin(JRD_NOD node, VLU impure)
DSC *RNG_begin(jrd_nod* node, VLU impure)
{
/**************************************
*
@ -464,7 +464,7 @@ DSC *RNG_begin(JRD_NOD node, VLU impure)
#ifdef PC_ENGINE
JRD_NOD RNG_delete(JRD_NOD node)
jrd_nod* RNG_delete(jrd_nod* node)
{
/**************************************
*
@ -538,7 +538,7 @@ void RNG_delete_ranges(jrd_req* request)
#ifdef PC_ENGINE
JRD_NOD RNG_end(JRD_NOD node)
jrd_nod* RNG_end(jrd_nod* node)
{
/**************************************
*

View File

@ -20,7 +20,7 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* $Id: rse.cpp,v 1.49 2004-01-03 10:59:41 robocop Exp $
* $Id: rse.cpp,v 1.50 2004-01-13 09:52:14 robocop Exp $
*
* 2001.07.28: John Bellardo: Implemented rse_skip and made rse_first work with
* seekable streams.
@ -228,7 +228,7 @@ void RSE_close(TDBB tdbb, RSB rsb)
#ifdef PC_ENGINE
BOOLEAN RSE_find_dbkey(TDBB tdbb, RSB rsb, JRD_NOD find_key, JRD_NOD record_version)
BOOLEAN RSE_find_dbkey(TDBB tdbb, RSB rsb, jrd_nod* find_key, jrd_nod* record_version)
{
/**************************************
*
@ -357,7 +357,7 @@ BOOLEAN RSE_find_dbkey(TDBB tdbb, RSB rsb, JRD_NOD find_key, JRD_NOD record_vers
#ifdef PC_ENGINE
BOOLEAN RSE_find_record(TDBB tdbb,
RSB rsb,
USHORT operator, USHORT direction, JRD_NOD find_key)
USHORT operator, USHORT direction, jrd_nod* find_key)
{
/**************************************
*
@ -622,7 +622,7 @@ void RSE_open(TDBB tdbb, RSB rsb)
switch (rsb->rsb_type) {
case rsb_indexed:
impure->irsb_bitmap = EVL_bitmap(tdbb, (JRD_NOD) rsb->rsb_arg[0]);
impure->irsb_bitmap = EVL_bitmap(tdbb, (jrd_nod*) rsb->rsb_arg[0]);
impure->irsb_prefetch_number = -1;
case rsb_navigate:
@ -697,7 +697,7 @@ void RSE_open(TDBB tdbb, RSB rsb)
case rsb_first:
first_records = ((IRSB_FIRST) impure)->irsb_count =
MOV_get_int64(EVL_expr(tdbb, (JRD_NOD) rsb->rsb_arg[0]), 0);
MOV_get_int64(EVL_expr(tdbb, (jrd_nod*) rsb->rsb_arg[0]), 0);
if (((IRSB_FIRST) impure)->irsb_count < 0)
ERR_post(isc_bad_limit_param, 0);
@ -707,7 +707,7 @@ void RSE_open(TDBB tdbb, RSB rsb)
case rsb_skip:
skip_records = ((IRSB_SKIP) impure)->irsb_count =
MOV_get_int64(EVL_expr(tdbb, (JRD_NOD) rsb->rsb_arg[0]), 0);
MOV_get_int64(EVL_expr(tdbb, (jrd_nod*) rsb->rsb_arg[0]), 0);
if (((IRSB_SKIP) impure)->irsb_count < 0)
ERR_post(isc_bad_skip_param, 0);
@ -1342,7 +1342,7 @@ static BOOLEAN fetch_left(TDBB tdbb, RSB rsb, IRSB impure)
break;
}
if (rsb->rsb_arg[RSB_LEFT_boolean] &&
!EVL_boolean(tdbb, (JRD_NOD) rsb->rsb_arg[RSB_LEFT_boolean])) {
!EVL_boolean(tdbb, (jrd_nod*) rsb->rsb_arg[RSB_LEFT_boolean])) {
/* The boolean pertaining to the left sub-stream is false
so just join sub-stream to a null valued right sub-stream */
join_to_nulls(tdbb, rsb, RSB_LEFT_streams);
@ -1358,7 +1358,7 @@ static BOOLEAN fetch_left(TDBB tdbb, RSB rsb, IRSB impure)
{
if (!rsb->rsb_arg[RSB_LEFT_inner_boolean]
|| EVL_boolean(tdbb,
(JRD_NOD)
(jrd_nod*)
rsb->rsb_arg[RSB_LEFT_inner_boolean]))
{
impure->irsb_flags |= irsb_joined;
@ -1400,15 +1400,15 @@ static BOOLEAN fetch_left(TDBB tdbb, RSB rsb, IRSB impure)
if (
(!rsb->rsb_arg[RSB_LEFT_boolean]
|| EVL_boolean(tdbb,
(JRD_NOD) rsb->rsb_arg[RSB_LEFT_boolean]))
(jrd_nod*) rsb->rsb_arg[RSB_LEFT_boolean]))
&& (!rsb->rsb_arg[RSB_LEFT_inner_boolean]
|| EVL_boolean(tdbb,
(JRD_NOD)
(jrd_nod*)
rsb->rsb_arg
[RSB_LEFT_inner_boolean]))
&& (full == rsb->rsb_arg[RSB_LEFT_inner]
|| EVL_boolean(tdbb,
(JRD_NOD)
(jrd_nod*)
rsb->rsb_arg
[RSB_LEFT_inner]->rsb_arg[0])))
{
@ -1891,7 +1891,7 @@ static BOOLEAN get_merge_join(TDBB tdbb, RSB rsb, IRSB_MRG impure)
map_sort_data(request, map, get_merge_data(tdbb, mfb, record));
if (ptr != highest_ptr &&
compare(tdbb, (JRD_NOD) highest_ptr[1], (JRD_NOD) ptr[1]) < 0)
compare(tdbb, (jrd_nod*) highest_ptr[1], (jrd_nod*) ptr[1]) < 0)
highest_ptr = ptr;
}
@ -1906,7 +1906,7 @@ static BOOLEAN get_merge_join(TDBB tdbb, RSB rsb, IRSB_MRG impure)
if (highest_ptr != ptr)
{
while ( (result =
compare(tdbb, (JRD_NOD) highest_ptr[1], (JRD_NOD) ptr[1])) )
compare(tdbb, (jrd_nod*) highest_ptr[1], (jrd_nod*) ptr[1])) )
{
if (result < 0) {
highest_ptr = ptr;
@ -2302,8 +2302,8 @@ static BOOLEAN get_record(TDBB tdbb,
{
int result;
SSHORT select_value; /* select for ANY/ALL processing */
JRD_NOD select_node; /* ANY/ALL select node pointer */
JRD_NOD column_node; /* ANY/ALL column node pointer */
jrd_nod* select_node; /* ANY/ALL select node pointer */
jrd_nod* column_node; /* ANY/ALL column node pointer */
/* For ANY and ALL clauses (ALL is handled as a negated ANY),
we must first detect them, and then make sure that the returned
@ -2319,7 +2319,7 @@ static BOOLEAN get_record(TDBB tdbb,
select expression on the left, and the column comparison
on the right. */
column_node = (JRD_NOD) rsb->rsb_any_boolean;
column_node = (jrd_nod*) rsb->rsb_any_boolean;
if (column_node &&
(request->req_flags & (req_ansi_all | req_ansi_any)))
{
@ -2356,7 +2356,7 @@ static BOOLEAN get_record(TDBB tdbb,
any_true = FALSE;
while (get_record(tdbb, rsb->rsb_next, rsb, mode))
{
if (EVL_boolean(tdbb, (JRD_NOD) rsb->rsb_arg[0]))
if (EVL_boolean(tdbb, (jrd_nod*) rsb->rsb_arg[0]))
{
/* found a TRUE value */
@ -2418,7 +2418,7 @@ static BOOLEAN get_record(TDBB tdbb,
result = FALSE;
while (get_record(tdbb, rsb->rsb_next, rsb, mode))
{
if (EVL_boolean(tdbb, (JRD_NOD) rsb->rsb_arg[0])) {
if (EVL_boolean(tdbb, (jrd_nod*) rsb->rsb_arg[0])) {
result = TRUE;
break;
}
@ -2453,7 +2453,7 @@ static BOOLEAN get_record(TDBB tdbb,
/* look for a FALSE (and not null either) */
if (!EVL_boolean(tdbb, (JRD_NOD) rsb->rsb_arg[0]) &&
if (!EVL_boolean(tdbb, (jrd_nod*) rsb->rsb_arg[0]) &&
!(request->req_flags & req_null))
{
@ -2501,7 +2501,7 @@ static BOOLEAN get_record(TDBB tdbb,
/* look for a FALSE or null */
if (!EVL_boolean(tdbb, (JRD_NOD) rsb->rsb_arg[0]))
if (!EVL_boolean(tdbb, (jrd_nod*) rsb->rsb_arg[0]))
{
/* make sure it wasn't FALSE because there's
no select stream record */
@ -2538,7 +2538,7 @@ static BOOLEAN get_record(TDBB tdbb,
result = FALSE;
while (get_record(tdbb, rsb->rsb_next, rsb, mode))
{
if (EVL_boolean(tdbb, (JRD_NOD) rsb->rsb_arg[0])) {
if (EVL_boolean(tdbb, (jrd_nod*) rsb->rsb_arg[0])) {
result = TRUE;
break;
}
@ -2730,7 +2730,7 @@ static BOOLEAN get_record(TDBB tdbb,
case rsb_aggregate:
if ( (impure->irsb_count = EVL_group(tdbb, rsb->rsb_next,
(JRD_NOD) rsb->rsb_arg[0],
(jrd_nod*) rsb->rsb_arg[0],
impure->irsb_count)) ) break;
return FALSE;
@ -2836,7 +2836,7 @@ static BOOLEAN get_union(TDBB tdbb, RSB rsb, IRSB impure)
*
**************************************/
RSB *rsb_ptr;
JRD_NOD map, *ptr, *end;
jrd_nod* map, **ptr, **end;
SET_TDBB(tdbb);
rsb_ptr = rsb->rsb_arg + impure->irsb_count;
@ -2854,7 +2854,7 @@ static BOOLEAN get_union(TDBB tdbb, RSB rsb, IRSB impure)
/* We've got a record, map it into the target record */
map = (JRD_NOD) rsb_ptr[1];
map = (jrd_nod*) rsb_ptr[1];
for (ptr = map->nod_arg, end = ptr + map->nod_count; ptr < end; ptr++)
EXE_assignment(tdbb, *ptr);
@ -2923,7 +2923,7 @@ static void map_sort_data(jrd_req* request, SMB map, UCHAR * data)
UCHAR flag;
DSC from, to;
RPB *rpb;
JRD_NOD node;
jrd_nod* node;
REC record;
smb_repeat * item, *end_item;
@ -3041,14 +3041,14 @@ static void open_procedure(TDBB tdbb, RSB rsb, IRSB_PROCEDURE impure)
* Initialize a procedural view.
*
**************************************/
JRD_NOD *ptr, *end, in_message;
jrd_nod **ptr, **end, *in_message;
FMT format;
USHORT iml;
UCHAR *im;
SET_TDBB(tdbb);
jrd_nod* inputs = (JRD_NOD) rsb->rsb_arg[RSB_PRC_inputs];
jrd_nod* inputs = (jrd_nod*) rsb->rsb_arg[RSB_PRC_inputs];
jrd_prc* procedure = rsb->rsb_procedure;
jrd_req* request = tdbb->tdbb_request;
@ -3072,7 +3072,7 @@ static void open_procedure(TDBB tdbb, RSB rsb, IRSB_PROCEDURE impure)
}
request->req_operation = saved_state;
in_message = (JRD_NOD) rsb->rsb_arg[RSB_PRC_in_msg];
in_message = (jrd_nod*) rsb->rsb_arg[RSB_PRC_in_msg];
format = (FMT) in_message->nod_arg[e_msg_format];
iml = format->fmt_length;
im = (UCHAR *) request + in_message->nod_impure;

View File

@ -2328,7 +2328,7 @@ BOOLEAN VIO_writelock(TDBB tdbb, RPB * org_rpb, RSB rsb, jrd_tra* transaction)
// Make sure refetched record still fulfills search condition
RSB r;
for (r = rsb; r && r->rsb_type != rsb_boolean ; r = r->rsb_next);
if (r && !EVL_boolean(tdbb, (JRD_NOD) r->rsb_arg[0]))
if (r && !EVL_boolean(tdbb, (jrd_nod*) r->rsb_arg[0]))
return FALSE;
}

View File

@ -588,8 +588,8 @@ void MET_delete_database( DBB dbb)
}
while (log_stack) {
STR lstring = (STR) LLS_POP(&log_stack);
unlink(lstring->str_data); // do not check for error
const str* log_string = (str*) LLS_POP(&log_stack);
unlink(log_string->str_data); // do not check for error
}
if (unlink(dbb->dbb_filename))

View File

@ -79,9 +79,9 @@ static bool_t xdr_quad(XDR *, struct bid *);
static bool_t xdr_request(XDR *, USHORT, USHORT, USHORT);
#ifdef VMS
static bool_t xdr_semi_opaque(XDR *, REM_MSG, FMT);
static bool_t xdr_semi_opaque_slice(XDR *, LSTRING *);
static bool_t xdr_semi_opaque_slice(XDR *, lstring *);
#endif
static bool_t xdr_slice(XDR*, LSTRING*, USHORT, const UCHAR*);
static bool_t xdr_slice(XDR*, lstring*, USHORT, const UCHAR*);
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);
@ -1397,7 +1397,7 @@ static bool_t xdr_semi_opaque( XDR* xdrs, REM_MSG message, FMT format)
#ifdef VMS
static bool_t xdr_semi_opaque_slice( XDR* xdrs, LSTRING* slice)
static bool_t xdr_semi_opaque_slice( XDR* xdrs, lstring* slice)
{
/**************************************
*
@ -1458,7 +1458,7 @@ static bool_t xdr_semi_opaque_slice( XDR* xdrs, LSTRING* slice)
static bool_t xdr_slice(
XDR* xdrs,
LSTRING* slice, USHORT sdl_length, const UCHAR* sdl)
lstring* slice, USHORT sdl_length, const UCHAR* sdl)
{
/**************************************
*

View File

@ -32,7 +32,7 @@
*
*/
/*
$Id: protocol.h,v 1.17 2003-12-22 10:00:56 robocop Exp $
$Id: protocol.h,v 1.18 2004-01-13 09:52:18 robocop Exp $
*/
#ifndef REMOTE_PROTOCOL_H
#define REMOTE_PROTOCOL_H
@ -516,14 +516,14 @@ typedef struct p_slc {
struct bid p_slc_id; /* Slice id */
CSTRING p_slc_sdl; /* Slice description language */
CSTRING p_slc_parameters; /* Slice parameters */
LSTRING p_slc_slice; /* Slice proper */
lstring p_slc_slice; /* Slice proper */
ULONG p_slc_length; /* Number of elements */
} P_SLC;
/* Response to get_slice */
typedef struct p_slr {
LSTRING p_slr_slice; /* Slice proper */
lstring p_slr_slice; /* Slice proper */
ULONG p_slr_length; /* Total length of slice */
UCHAR *p_slr_sdl; /* *** not transfered *** */
USHORT p_slr_sdl_length; /* *** not transfered *** */

View File

@ -70,7 +70,7 @@
#define DEFAULT_SIZE 8192
static void cache_init(void);
static void db_get_sbc(SCHAR *, SCHAR *, SLONG *, SSHORT *);
static void db_get_sbc(const SCHAR*, SCHAR*, SLONG*, SSHORT*);
#if (defined WIN_NT)
static void db_error(SLONG);
@ -78,7 +78,7 @@ static void db_error(SLONG);
static void db_error(int);
#endif
static void db_open(UCHAR *, USHORT);
static void db_open(const UCHAR*, USHORT);
static PAG db_read(SLONG);
static void print_error(void);
static void print_header(TEXT *);
@ -95,7 +95,8 @@ static bool sw_page;
static bool sw_user;
static bool sw_free;
static bool sw_all;
static TEXT *dbname, sw_file[257];
static const TEXT* dbname;
static TEXT sw_file[257];
static SHB CASH_header;
static SCCB sccb;
@ -114,9 +115,9 @@ static int file;
SCHAR global_buffer[MAX_PAGE_SIZE];
static IB_FILE *sw_outfile;
static IB_FILE* sw_outfile;
SCHAR *page_type[] = {
const SCHAR* page_type[] = {
"pag_undefined ",
"pag_header ", /* Database header page */
"pag_pages ", /* Page inventory page */
@ -131,7 +132,7 @@ SCHAR *page_type[] = {
};
int CLIB_ROUTINE main( int argc, char *argv[])
int CLIB_ROUTINE main( int argc, char* argv[])
{
/**************************************
*
@ -143,15 +144,11 @@ int CLIB_ROUTINE main( int argc, char *argv[])
* Initialize shared cache for process.
*
**************************************/
SLONG length;
SCHAR *p, c;
ISC_STATUS_ARRAY status_vector;
TEXT expanded_filename[256];
SH_MEM_T shmem_data;
SLONG cache_buffers;
SSHORT cache_flags;
int nbuf;
int nfree_buf;
/* Perform some special handling when run as an Interbase service. The
first switch can be "-svc" (lower case!) or it can be "-svc_re" followed
@ -188,17 +185,18 @@ int CLIB_ROUTINE main( int argc, char *argv[])
/* Handle switches, etc. */
dbname = NULL;
nbuf = 0;
nfree_buf = 0;
int nbuf = 0;
int nfree_buf = 0;
argv++;
while (--argc) {
p = *argv++;
const SCHAR* p = *argv++;
if (p[0] != '-') {
dbname = p;
break;
}
SCHAR c;
while (c = *p++)
switch (UPPER(c)) {
case 'M':
@ -266,7 +264,7 @@ int CLIB_ROUTINE main( int argc, char *argv[])
cache_init, 0, -mapped_size, &shmem_data);
if (CASH_header && CASH_header->shb_length > mapped_size) {
length = CASH_header->shb_length;
const SLONG length = CASH_header->shb_length;
ISC_unmap_file(status_vector, &shmem_data, FALSE);
CASH_header = ISC_map_file(status_vector,
expanded_filename,
@ -367,9 +365,9 @@ static void cache_init(void)
static void db_get_sbc(
SCHAR * db,
SCHAR * name,
SLONG * cache_buffers, SSHORT * cache_flags)
const SCHAR* db,
SCHAR* name,
SLONG* cache_buffers, SSHORT* cache_flags)
{
/**************************************
*
@ -381,10 +379,8 @@ static void db_get_sbc(
* Get shared cache info.
*
**************************************/
HDR hdr;
db_open(db, strlen(db));
hdr = (HDR) db_read((SLONG) HEADER_PAGE);
HDR hdr = (HDR) db_read((SLONG) HEADER_PAGE);
*cache_buffers = hdr->hdr_cache_buffers;
*cache_flags = hdr->hdr_flags & hdr_disable_cache;
@ -422,7 +418,7 @@ static void db_error( SLONG status)
}
static void db_open( UCHAR * file_name, USHORT file_length)
static void db_open(const UCHAR* file_name, USHORT file_length)
{
/**************************************
*
@ -509,7 +505,7 @@ static void db_error( int status)
}
static void db_open( UCHAR * file_name, USHORT file_length)
static void db_open(const UCHAR* file_name, USHORT file_length)
{
/**************************************
*
@ -652,11 +648,9 @@ static void print_page_header( SDB sdb)
* header and log pages.
*
**************************************/
PAG page;
SDB journal_sdb;
if ((page_no >= 0) && (sdb->sdb_page != page_no))
if ((page_no >= 0) && (sdb->sdb_page != page_no)) {
return;
}
/* print sdb information */
@ -665,7 +659,7 @@ static void print_page_header( SDB sdb)
sdb->sdb_page, sdb->sdb_generation, sdb->sdb_length, sdb->sdb_flags,
sdb->sdb_precedence);
page = (PAG) ABS_PTR(sdb->sdb_buffer);
pag* page = (PAG) ABS_PTR(sdb->sdb_buffer);
/* Print page header */
@ -678,10 +672,12 @@ static void print_page_header( SDB sdb)
/* Print full page information for header and log page */
if (page_no >= 0) {
if (page_no == HEADER_PAGE)
if (page_no == HEADER_PAGE) {
PPG_print_header(page, HEADER_PAGE, sw_outfile);
else if (page_no == LOG_PAGE)
}
else if (page_no == LOG_PAGE) {
PPG_print_log(page, LOG_PAGE, sw_outfile);
}
}
if (sdb->sdb_flags) {
@ -710,7 +706,7 @@ static void print_page_header( SDB sdb)
}
if (sdb->sdb_journal) {
journal_sdb = (SDB) ABS_PTR(sdb->sdb_journal);
SDB journal_sdb = (SDB) ABS_PTR(sdb->sdb_journal);
ib_printf("\tJournal buffer information:\n");
ib_printf("\t\tCurrent Length %d\n", journal_sdb->sdb_length);
}
@ -719,7 +715,7 @@ static void print_page_header( SDB sdb)
}
// CVC: This PRB doesn't match jrd/event/h's prb struct.
// CVC: This PRB doesn't match jrd/event.h's prb struct.
static void print_process( PRB process)
{
/**************************************
@ -767,18 +763,16 @@ static void prt_que(
* param 2 - if specified, the number of entries to print.
*
**************************************/
SLONG count, offset;
SRQ next;
offset = REL_PTR(que);
const SLONG offset = REL_PTR(que);
if (offset == que->srq_forward && offset == que->srq_backward) {
ib_printf("%s: *empty*\n\n", string);
return;
}
count = 0;
SLONG count = 0;
SRQ next;
QUE_LOOP((*que), next) {
++count;
@ -808,18 +802,16 @@ static void prt_que_back(
* Same as prt_que, but traverse in reverse order.
*
**************************************/
SLONG count, offset;
SRQ next;
offset = REL_PTR(que);
const SLONG offset = REL_PTR(que);
if (offset == que->srq_forward && offset == que->srq_backward) {
ib_printf("%s: *empty*\n\n", string);
return;
}
count = 0;
SLONG count = 0;
SRQ next;
QUE_LOOP_BACK((*que), next) {
++count;