mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:03:04 +01:00
Style.
This commit is contained in:
parent
2328f1ffd5
commit
46d7ff6550
@ -46,7 +46,7 @@ static void ascii_str_upper(UCHAR*);
|
||||
static bool get_sql_class(UCHAR *);
|
||||
static bool get_sql_code(SSHORT *);
|
||||
static bool get_sql_subclass(UCHAR *);
|
||||
static bool store_sql_msg(void);
|
||||
static bool store_sql_msg();
|
||||
static bool translate(const UCHAR*, UCHAR*, SSHORT);
|
||||
static bool get_symbol( UCHAR *);
|
||||
|
||||
@ -107,7 +107,8 @@ int main( int argc, char **argv)
|
||||
READY;
|
||||
START_TRANSACTION;
|
||||
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
printf("Facility: ");
|
||||
if (gets((char*) facility) == NULL)
|
||||
break;
|
||||
@ -120,9 +121,11 @@ int main( int argc, char **argv)
|
||||
if (!store_sql_msg())
|
||||
break;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
MODIFY X USING
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
printf(" Module: ");
|
||||
if (!gets((char*) module))
|
||||
break;
|
||||
@ -151,7 +154,8 @@ int main( int argc, char **argv)
|
||||
if (!gets((char*) symbol))
|
||||
break;
|
||||
|
||||
if (public_msg) {
|
||||
if (public_msg)
|
||||
{
|
||||
if (!symbol[0])
|
||||
if (!get_symbol(symbol))
|
||||
break;
|
||||
@ -258,7 +262,8 @@ static bool get_sql_class( UCHAR * sql_class)
|
||||
* return true if we get one, otherwise false
|
||||
*
|
||||
**************************************/
|
||||
while (true) {
|
||||
while (true)
|
||||
{
|
||||
printf(" SQLCLASS: ");
|
||||
gets((char*) sql_class);
|
||||
const SSHORT length = strlen((char*) sql_class);
|
||||
@ -295,7 +300,8 @@ static bool get_sql_code( SSHORT * sql_code)
|
||||
SSHORT srch_num;
|
||||
bool ret = false;
|
||||
|
||||
while (true) {
|
||||
while (true)
|
||||
{
|
||||
printf(" SQLCODE: ");
|
||||
if (!gets((char*) nstring))
|
||||
break;
|
||||
@ -332,7 +338,8 @@ static bool get_sql_code( SSHORT * sql_code)
|
||||
}
|
||||
|
||||
/* make sure that the SQL code is in the SQLERR facility */
|
||||
if (ret) {
|
||||
if (ret)
|
||||
{
|
||||
bool got_it = false;
|
||||
if (sql_num < 0) {
|
||||
srch_num = 1000 + sql_num;
|
||||
@ -373,7 +380,8 @@ static bool get_sql_subclass( UCHAR * sql_sub_class)
|
||||
* return true if we get one, otherwise false
|
||||
*
|
||||
**************************************/
|
||||
while (true) {
|
||||
while (true)
|
||||
{
|
||||
printf(" SQLSUBCLASS: ");
|
||||
gets((char*) sql_sub_class);
|
||||
const SSHORT length = strlen((char*) sql_sub_class);
|
||||
@ -418,7 +426,7 @@ static bool get_symbol( UCHAR * symbol)
|
||||
}
|
||||
|
||||
|
||||
static bool store_sql_msg(void)
|
||||
static bool store_sql_msg()
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -435,7 +443,8 @@ static bool store_sql_msg(void)
|
||||
UCHAR text[256], nstring[32];
|
||||
SSHORT sql_num;
|
||||
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
printf("Enter the sqlcode: ");
|
||||
if (!gets((char*) nstring))
|
||||
break;;
|
||||
@ -484,7 +493,8 @@ static bool translate( const UCHAR* source, UCHAR* target, SSHORT length)
|
||||
UCHAR* p = target;
|
||||
const UCHAR* q = source;
|
||||
|
||||
while (*q) {
|
||||
while (*q)
|
||||
{
|
||||
if (!--length)
|
||||
return false;
|
||||
if (*q == '\\') {
|
||||
|
@ -37,7 +37,7 @@ BLKDEF (type_str, qli_str, 1) // random string block
|
||||
BLKDEF (type_tok, qli_tok, 1) // token block
|
||||
BLKDEF (type_sym, qli_symbol, 1) // symbol block
|
||||
BLKDEF (type_msg, qli_msg, 0) // Message block
|
||||
BLKDEF (type_nam, nam, 1) // Name node
|
||||
BLKDEF (type_nam, qli_name, 1) // Name node
|
||||
BLKDEF (type_ctx, qli_ctx, 0) // Context block
|
||||
BLKDEF (type_con, qli_const, 1) // Constant block
|
||||
BLKDEF (type_itm, qli_print_item, 0) // Print item
|
||||
@ -48,8 +48,8 @@ BLKDEF (type_rpt, qli_rpt, 0)
|
||||
BLKDEF (type_pic, pics, 0)
|
||||
BLKDEF (type_prt, qli_prt, 0)
|
||||
BLKDEF (type_map, qli_map, 0)
|
||||
BLKDEF (type_qpr, qpr, 0)
|
||||
BLKDEF (type_qfn, qfn, 0)
|
||||
BLKDEF (type_qfl, qfl, 0)
|
||||
BLKDEF (type_qpr, qli_proc, 0)
|
||||
BLKDEF (type_qfn, qli_func, 0)
|
||||
BLKDEF (type_qfl, qli_filter, 0)
|
||||
BLKDEF (type_fun, qli_fun, sizeof(dsc)) // sizeof (((FUN) NULL)->fun_arg[0]))
|
||||
BLKDEF (type_rlb, qli_rlb, 0) // Request language block
|
||||
|
@ -85,8 +85,8 @@ void CMD_copy_procedure( qli_syntax* node)
|
||||
* across databases
|
||||
*
|
||||
**************************************/
|
||||
QPR old_proc = (QPR) node->syn_arg[0];
|
||||
QPR new_proc = (QPR) node->syn_arg[1];
|
||||
qli_proc* old_proc = (qli_proc*) node->syn_arg[0];
|
||||
qli_proc* new_proc = (qli_proc*) node->syn_arg[1];
|
||||
|
||||
PRO_copy_procedure(old_proc->qpr_database, old_proc->qpr_name->nam_string,
|
||||
new_proc->qpr_database, new_proc->qpr_name->nam_string);
|
||||
@ -106,7 +106,7 @@ void CMD_define_procedure( qli_syntax* node)
|
||||
* or in the most recently readied database.
|
||||
*
|
||||
**************************************/
|
||||
QPR proc = (QPR) node->syn_arg[0];
|
||||
qli_proc* proc = (qli_proc*) node->syn_arg[0];
|
||||
|
||||
if (!(proc->qpr_database))
|
||||
proc->qpr_database = QLI_databases;
|
||||
@ -128,7 +128,7 @@ void CMD_delete_proc( qli_syntax* node)
|
||||
* or in the most recently readied database.
|
||||
*
|
||||
**************************************/
|
||||
QPR proc = (QPR) node->syn_arg[0];
|
||||
qli_proc* proc = (qli_proc*) node->syn_arg[0];
|
||||
|
||||
if (!proc->qpr_database)
|
||||
proc->qpr_database = QLI_databases;
|
||||
@ -153,7 +153,7 @@ void CMD_edit_proc( qli_syntax* node)
|
||||
* Edit a procedure in the specified database.
|
||||
*
|
||||
**************************************/
|
||||
QPR proc = (QPR) node->syn_arg[0];
|
||||
qli_proc* proc = (qli_proc*) node->syn_arg[0];
|
||||
if (!proc->qpr_database)
|
||||
proc->qpr_database = QLI_databases;
|
||||
|
||||
@ -181,17 +181,17 @@ void CMD_extract( qli_syntax* node)
|
||||
qli_syntax** ptr = list->syn_arg;
|
||||
for (const qli_syntax* const* const end = ptr + list->syn_count; ptr < end; ptr++)
|
||||
{
|
||||
QPR proc = (QPR) *ptr;
|
||||
qli_proc* proc = (qli_proc*) *ptr;
|
||||
qli_dbb* database = proc->qpr_database;
|
||||
if (!database)
|
||||
database = QLI_databases;
|
||||
|
||||
NAM name = proc->qpr_name;
|
||||
const qli_name* name = proc->qpr_name;
|
||||
FB_API_HANDLE blob = PRO_fetch_procedure(database, name->nam_string);
|
||||
if (!blob) {
|
||||
ERRQ_msg_put(89, // Msg89 Procedure %s not found in database %s
|
||||
SafeArg() << name->nam_string <<
|
||||
database->dbb_symbol->sym_string);
|
||||
if (!blob)
|
||||
{
|
||||
ERRQ_msg_put(89, SafeArg() << name->nam_string << database->dbb_symbol->sym_string);
|
||||
// Msg89 Procedure %s not found in database %s
|
||||
continue;
|
||||
}
|
||||
dump_procedure(database, file, name->nam_string, name->nam_length, blob);
|
||||
@ -250,8 +250,8 @@ void CMD_rename_proc( qli_syntax* node)
|
||||
* or the most recently readied database.
|
||||
*
|
||||
**************************************/
|
||||
QPR old_proc = (QPR) node->syn_arg[0];
|
||||
QPR new_proc = (QPR) node->syn_arg[1];
|
||||
qli_proc* old_proc = (qli_proc*) node->syn_arg[0];
|
||||
qli_proc* new_proc = (qli_proc*) node->syn_arg[1];
|
||||
|
||||
qli_dbb* database = old_proc->qpr_database;
|
||||
if (!database)
|
||||
@ -259,8 +259,8 @@ void CMD_rename_proc( qli_syntax* node)
|
||||
|
||||
if (new_proc->qpr_database && (new_proc->qpr_database != database))
|
||||
IBERROR(84); // Msg84 Procedures can not be renamed across databases. Try COPY
|
||||
NAM old_name = old_proc->qpr_name;
|
||||
NAM new_name = new_proc->qpr_name;
|
||||
const qli_name* old_name = old_proc->qpr_name;
|
||||
const qli_name* new_name = new_proc->qpr_name;
|
||||
|
||||
if (PRO_rename_procedure(database, old_name->nam_string, new_name->nam_string))
|
||||
{
|
||||
@ -381,7 +381,7 @@ void CMD_set( qli_syntax* node)
|
||||
QLI_charset[0] = 0;
|
||||
break;
|
||||
}
|
||||
const TEXT* name = ((NAM) value)->nam_string;
|
||||
const TEXT* name = ((qli_name*) value)->nam_string;
|
||||
length = MIN(strlen(name), sizeof(QLI_charset));
|
||||
strncpy(QLI_charset, name, length);
|
||||
QLI_charset[length] = 0;
|
||||
|
@ -1113,7 +1113,7 @@ static qli_nod* compile_prompt( qli_nod* node)
|
||||
node->nod_arg[e_prm_string] = (qli_nod*) string;
|
||||
node->nod_desc.dsc_dtype = dtype_varying;
|
||||
node->nod_desc.dsc_length = prompt_length;
|
||||
node->nod_desc.dsc_address = (UCHAR *) string->str_data;
|
||||
node->nod_desc.dsc_address = (UCHAR*) string->str_data;
|
||||
QLI_validate_desc(node->nod_desc);
|
||||
|
||||
return node;
|
||||
|
@ -26,36 +26,40 @@
|
||||
|
||||
// Name nodes -- used to hold names between parse and compilation
|
||||
|
||||
typedef struct nam {
|
||||
struct qli_name
|
||||
{
|
||||
blk nam_header;
|
||||
qli_symbol* nam_symbol; // Symbol pointer, if any
|
||||
USHORT nam_length; // Length of name
|
||||
TEXT nam_string[1]; // Actual name string
|
||||
} *NAM;
|
||||
};
|
||||
|
||||
// Qualified procedure node -- used to hold qualified procedure names
|
||||
|
||||
typedef struct qpr {
|
||||
struct qli_proc
|
||||
{
|
||||
blk qpr_header;
|
||||
qli_dbb* qpr_database; // database block
|
||||
nam* qpr_name; // name block
|
||||
} *QPR;
|
||||
const qli_name* qpr_name; // name block
|
||||
};
|
||||
|
||||
// Qualified function node -- used to hold qualified function names
|
||||
|
||||
typedef struct qfn {
|
||||
struct qli_func
|
||||
{
|
||||
blk qfn_header;
|
||||
qli_dbb* qfn_database; // database block
|
||||
nam* qfn_name; // name block
|
||||
} *QFN;
|
||||
const qli_name* qfn_name; // name block
|
||||
};
|
||||
|
||||
// Qualified filter node -- used to hold qualified filter names
|
||||
|
||||
typedef struct qfl {
|
||||
struct qli_filter
|
||||
{
|
||||
blk qfl_header;
|
||||
qli_dbb* qfl_database; // database block
|
||||
nam* qfl_name; // name block
|
||||
} *QFL;
|
||||
const qli_name* qfl_name; // name block
|
||||
};
|
||||
|
||||
// SHOW options
|
||||
|
||||
|
@ -62,7 +62,7 @@ using MsgFormat::SafeArg;
|
||||
const char* STARTUP_FILE = "HOME"; // Assume its Unix
|
||||
|
||||
|
||||
extern TEXT *QLI_prompt;
|
||||
extern TEXT* QLI_prompt;
|
||||
|
||||
static void enable_signals();
|
||||
static bool process_statement(bool);
|
||||
|
@ -328,7 +328,7 @@ dsc* EVAL_parameter(qli_par* parameter)
|
||||
|
||||
if (missing_parameter = parameter->par_missing) {
|
||||
const USHORT* missing_flag = (USHORT*) (message->msg_buffer + missing_parameter->par_offset);
|
||||
desc->dsc_missing = (*missing_flag) ? DSC_missing : 0;
|
||||
desc->dsc_missing = *missing_flag ? DSC_missing : 0;
|
||||
}
|
||||
|
||||
desc->dsc_address = message->msg_buffer + parameter->par_offset;
|
||||
@ -659,7 +659,7 @@ static DSC *execute_edit( qli_nod* node)
|
||||
if (!desc)
|
||||
id->gds_quad_low = id->gds_quad_high = 0;
|
||||
|
||||
const TEXT* field_name = (TEXT *) node->nod_arg[e_edt_name];
|
||||
const TEXT* field_name = (TEXT*) node->nod_arg[e_edt_name];
|
||||
BLOB_edit(id, dbb->dbb_handle, dbb->dbb_transaction, field_name);
|
||||
|
||||
node->nod_desc.dsc_missing = UserBlob::blobIsNull(*id) ? DSC_missing : 0;
|
||||
|
@ -40,12 +40,12 @@
|
||||
using MsgFormat::SafeArg;
|
||||
|
||||
|
||||
static bool compare_names(const nam*, const qli_symbol*);
|
||||
static bool compare_names(const qli_name*, const qli_symbol*);
|
||||
static bool compare_symbols(const qli_symbol*, const qli_symbol*);
|
||||
static qli_symbol* copy_symbol(const qli_symbol*);
|
||||
static void declare_global(qli_fld*, qli_syntax*);
|
||||
static qli_syntax* decompile_field(qli_fld*, qli_ctx*);
|
||||
static NAM decompile_symbol(qli_symbol*);
|
||||
static qli_name* decompile_symbol(qli_symbol*);
|
||||
static qli_nod* expand_assignment(qli_syntax*, qli_lls*, qli_lls*);
|
||||
static qli_nod* expand_any(qli_syntax*, qli_lls*);
|
||||
static qli_nod* expand_boolean(qli_syntax*, qli_lls*);
|
||||
@ -70,7 +70,7 @@ static qli_nod* expand_sort(qli_syntax*, qli_lls*, qli_nod*);
|
||||
static qli_nod* expand_statement(qli_syntax*, qli_lls*, qli_lls*);
|
||||
static qli_nod* expand_store(qli_syntax*, qli_lls*, qli_lls*);
|
||||
static void expand_values(qli_syntax*, qli_lls*);
|
||||
static qli_ctx* find_context(const nam*, qli_lls*);
|
||||
static qli_ctx* find_context(const qli_name*, qli_lls*);
|
||||
static int generate_fields(qli_ctx*, qli_lls*, qli_syntax*);
|
||||
static int generate_items(const qli_syntax*, qli_lls*, qli_lls*, qli_nod*);
|
||||
static bool global_agg(const qli_syntax*, const qli_syntax*);
|
||||
@ -128,7 +128,7 @@ qli_nod* EXP_expand( qli_syntax* node)
|
||||
|
||||
case nod_def_database:
|
||||
case nod_sql_database:
|
||||
MET_ready(node, TRUE);
|
||||
MET_ready(node, true);
|
||||
return NULL;
|
||||
|
||||
case nod_def_field:
|
||||
@ -148,11 +148,11 @@ qli_nod* EXP_expand( qli_syntax* node)
|
||||
return NULL;
|
||||
|
||||
case nod_del_field:
|
||||
MET_delete_field((qli_dbb*)node->syn_arg[0], (NAM) node->syn_arg[1]);
|
||||
MET_delete_field((qli_dbb*)node->syn_arg[0], (qli_name*) node->syn_arg[1]);
|
||||
return NULL;
|
||||
|
||||
case nod_del_index:
|
||||
MET_delete_index((qli_dbb*)node->syn_arg[0], (NAM) node->syn_arg[1]);
|
||||
MET_delete_index((qli_dbb*)node->syn_arg[0], (qli_name*) node->syn_arg[1]);
|
||||
return NULL;
|
||||
|
||||
case nod_del_database:
|
||||
@ -188,7 +188,7 @@ qli_nod* EXP_expand( qli_syntax* node)
|
||||
return NULL;
|
||||
|
||||
case nod_ready:
|
||||
MET_ready(node, FALSE);
|
||||
MET_ready(node, false);
|
||||
return NULL;
|
||||
|
||||
case nod_rename_proc:
|
||||
@ -259,7 +259,7 @@ qli_nod* EXP_expand( qli_syntax* node)
|
||||
}
|
||||
|
||||
|
||||
static bool compare_names( const nam* name, const qli_symbol* symbol)
|
||||
static bool compare_names( const qli_name* name, const qli_symbol* symbol)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -424,17 +424,17 @@ static qli_syntax* decompile_field( qli_fld* field, qli_ctx* context)
|
||||
* Functional description
|
||||
* Take a perfectly good, completely compiled
|
||||
* field block and regress to a qli_syntax node and
|
||||
* and a NAM block.
|
||||
* and a qli_name block.
|
||||
* (Needed to support SQL idiocies)
|
||||
*
|
||||
**************************************/
|
||||
const int args = (context) ? 2 : 1;
|
||||
const int args = context ? 2 : 1;
|
||||
|
||||
qli_syntax* node = (qli_syntax*) ALLOCDV(type_syn, args);
|
||||
node->syn_type = nod_field;
|
||||
node->syn_count = args;
|
||||
|
||||
NAM name = decompile_symbol(field->fld_name);
|
||||
qli_name* name = decompile_symbol(field->fld_name);
|
||||
node->syn_arg[0] = (qli_syntax*) name;
|
||||
|
||||
if (context) {
|
||||
@ -450,7 +450,7 @@ static qli_syntax* decompile_field( qli_fld* field, qli_ctx* context)
|
||||
}
|
||||
|
||||
|
||||
static NAM decompile_symbol( qli_symbol* symbol)
|
||||
static qli_name* decompile_symbol( qli_symbol* symbol)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -465,7 +465,7 @@ static NAM decompile_symbol( qli_symbol* symbol)
|
||||
**************************************/
|
||||
const int l = symbol->sym_length;
|
||||
|
||||
NAM name = (NAM) ALLOCDV(type_nam, l);
|
||||
qli_name* name = (qli_name*) ALLOCDV(type_nam, l);
|
||||
name->nam_length = l;
|
||||
name->nam_symbol = symbol;
|
||||
if (l)
|
||||
@ -961,7 +961,7 @@ static qli_nod* expand_expression( qli_syntax* input, qli_lls* stack)
|
||||
|
||||
case nod_star:
|
||||
{
|
||||
NAM name = (NAM) input->syn_arg[0];
|
||||
qli_name* name = (qli_name*) input->syn_arg[0];
|
||||
ERRQ_print_error(141, name->nam_string);
|
||||
// Msg141 can't be used when a single element is required
|
||||
}
|
||||
@ -1004,7 +1004,7 @@ static qli_nod* expand_field( qli_syntax* input, qli_lls* stack, qli_syntax* sub
|
||||
const TEXT* const limit = p + sizeof(s) - 1;
|
||||
for (USHORT i = 0; i < input->syn_count; i++)
|
||||
{
|
||||
NAM name = (NAM) input->syn_arg[i];
|
||||
qli_name* name = (qli_name*) input->syn_arg[i];
|
||||
const TEXT* q = name->nam_string;
|
||||
USHORT l = name->nam_length;
|
||||
if (p < limit) {
|
||||
@ -1475,8 +1475,8 @@ static qli_print_item* expand_print_item( qli_syntax* syn_item, qli_lls* right)
|
||||
item->itm_type = item_value;
|
||||
qli_syntax* syn_expr = syn_item->syn_arg[s_itm_value];
|
||||
qli_nod* node = item->itm_value = expand_expression(syn_expr, right);
|
||||
item->itm_edit_string = (TEXT *) syn_item->syn_arg[s_itm_edit_string];
|
||||
item->itm_query_header = (TEXT *) syn_item->syn_arg[s_itm_header];
|
||||
item->itm_edit_string = (TEXT*) syn_item->syn_arg[s_itm_edit_string];
|
||||
item->itm_query_header = (TEXT*) syn_item->syn_arg[s_itm_header];
|
||||
expand_edit_string(node, item);
|
||||
return item;
|
||||
}
|
||||
@ -2161,7 +2161,7 @@ static void expand_values( qli_syntax* input, qli_lls* right)
|
||||
IBERROR(542); // this was a prompting expression. won't do at all
|
||||
}
|
||||
else if (input->syn_arg[s_sto_rse] && (value->syn_type == nod_star)) {
|
||||
qli_ctx* context = find_context((const nam*) value->syn_arg[0], right);
|
||||
qli_ctx* context = find_context((const qli_name*) value->syn_arg[0], right);
|
||||
if (!context)
|
||||
IBERROR(154); // Msg154 unrecognized context
|
||||
value_count += generate_fields(context, (qli_lls*) &values, input->syn_arg[s_sto_rse]);
|
||||
@ -2195,7 +2195,7 @@ static void expand_values( qli_syntax* input, qli_lls* right)
|
||||
}
|
||||
|
||||
|
||||
static qli_ctx* find_context( const nam* name, qli_lls* contexts)
|
||||
static qli_ctx* find_context( const qli_name* name, qli_lls* contexts)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2283,13 +2283,13 @@ static int generate_items(const qli_syntax* symbol, qli_lls* right, qli_lls* ite
|
||||
* include only the grouping fields.
|
||||
*
|
||||
**************************************/
|
||||
qli_nod* group_list = (rse) ? rse->nod_arg[e_rse_group_by] : NULL;
|
||||
qli_nod* group_list = rse ? rse->nod_arg[e_rse_group_by] : NULL;
|
||||
|
||||
// first identify the relation or context
|
||||
|
||||
const nam* name;
|
||||
const qli_name* name;
|
||||
if (symbol->syn_count == 1)
|
||||
name = (NAM) symbol->syn_arg[0];
|
||||
name = (qli_name*) symbol->syn_arg[0];
|
||||
else
|
||||
IBERROR(153);
|
||||
// Msg153 asterisk expressions require exactly one qualifying context
|
||||
@ -2484,21 +2484,21 @@ static bool invalid_syn_field( const qli_syntax* syn_node, const qli_syntax* lis
|
||||
|
||||
if (syn_node->syn_type == nod_field)
|
||||
{
|
||||
const nam* fctx = NULL;
|
||||
const nam* fname = (NAM) syn_node->syn_arg[0];
|
||||
const qli_name* fctx = NULL;
|
||||
const qli_name* fname = (qli_name*) syn_node->syn_arg[0];
|
||||
if (syn_node->syn_count == 2) {
|
||||
fctx = fname;
|
||||
fname = (NAM) syn_node->syn_arg[1];
|
||||
fname = (qli_name*) syn_node->syn_arg[1];
|
||||
}
|
||||
|
||||
for (SSHORT count = list->syn_count; count;)
|
||||
{
|
||||
const nam* gctx = NULL;
|
||||
const qli_name* gctx = NULL;
|
||||
const qli_syntax* element = list->syn_arg[--count];
|
||||
const nam* gname = (NAM) element->syn_arg[0];
|
||||
const qli_name* gname = (qli_name*) element->syn_arg[0];
|
||||
if (element->syn_count == 2) {
|
||||
gctx = gname;
|
||||
gname = (NAM) element->syn_arg[1];
|
||||
gname = (qli_name*) element->syn_arg[1];
|
||||
}
|
||||
if (!strcmp(fname->nam_string, gname->nam_string))
|
||||
{
|
||||
@ -2732,7 +2732,7 @@ static qli_nod* possible_literal(qli_syntax* input, qli_lls* stack, bool upper_f
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const nam* name = (NAM) input->syn_arg[0];
|
||||
const qli_name* name = (qli_name*) input->syn_arg[0];
|
||||
USHORT l = name->nam_length;
|
||||
qli_const* constant = (qli_const*) ALLOCDV(type_con, l);
|
||||
constant->con_desc.dsc_dtype = dtype_text;
|
||||
@ -2825,14 +2825,14 @@ static qli_fld* resolve( qli_syntax* node, qli_lls* stack, qli_ctx** out_context
|
||||
that the context name be given explicitly (used for special STORE
|
||||
context). */
|
||||
|
||||
NAM* base = (NAM*) node->syn_arg;
|
||||
qli_name** base = (qli_name**) node->syn_arg;
|
||||
|
||||
for (; stack; stack = stack->lls_next)
|
||||
{
|
||||
qli_ctx* context = (qli_ctx*) stack->lls_object;
|
||||
*out_context = context;
|
||||
NAM* ptr = base + node->syn_count;
|
||||
const nam* name = *--ptr;
|
||||
qli_name** ptr = base + node->syn_count;
|
||||
const qli_name* name = *--ptr;
|
||||
|
||||
switch (context->ctx_type)
|
||||
{
|
||||
@ -2851,7 +2851,7 @@ static qli_fld* resolve( qli_syntax* node, qli_lls* stack, qli_ctx** out_context
|
||||
case CTX_RELATION:
|
||||
if (context->ctx_primary) {
|
||||
*out_context = context = context->ctx_primary;
|
||||
if (!compare_names((NAM) node->syn_arg[0], context->ctx_symbol))
|
||||
if (!compare_names((qli_name*) node->syn_arg[0], context->ctx_symbol))
|
||||
break;
|
||||
}
|
||||
relation = context->ctx_relation;
|
||||
@ -2908,14 +2908,14 @@ static void resolve_really( qli_fld* variable, const qli_syntax* field_node)
|
||||
check for a qli_dbb (<db>.<glo_fld>), then for a rel (<rel>.<fld>). */
|
||||
|
||||
USHORT offset = field_node->syn_count;
|
||||
const nam* fld_name = (NAM) field_node->syn_arg[--offset];
|
||||
const qli_name* fld_name = (qli_name*) field_node->syn_arg[--offset];
|
||||
|
||||
NAM rel_name = NULL;
|
||||
//NAM db_name = NULL;
|
||||
qli_name* rel_name = NULL;
|
||||
//qli_name* db_name = NULL;
|
||||
if (offset) {
|
||||
rel_name = (NAM) field_node->syn_arg[--offset];
|
||||
rel_name = (qli_name*) field_node->syn_arg[--offset];
|
||||
//if (offset)
|
||||
// db_name = (NAM) field_node->syn_arg[--offset];
|
||||
// db_name = (qli_name*) field_node->syn_arg[--offset];
|
||||
}
|
||||
|
||||
bool resolved = false;
|
||||
|
@ -375,7 +375,7 @@ qli_nod* FMT_list(qli_nod* list)
|
||||
{
|
||||
if (q) {
|
||||
if (*q != '"' && *q != '\'')
|
||||
value->nod_desc.dsc_address = (UCHAR *) q;
|
||||
value->nod_desc.dsc_address = (UCHAR*) q;
|
||||
else {
|
||||
qli_str* header = (qli_str*) ALLOCDV(type_str, strlen(q));
|
||||
TEXT* p = header->str_data;
|
||||
@ -393,7 +393,7 @@ qli_nod* FMT_list(qli_nod* list)
|
||||
}
|
||||
else {
|
||||
value->nod_desc.dsc_length = name->sym_length;
|
||||
value->nod_desc.dsc_address = (UCHAR *) name->sym_string;
|
||||
value->nod_desc.dsc_address = (UCHAR*) name->sym_string;
|
||||
}
|
||||
QLI_validate_desc(value->nod_desc);
|
||||
column = MAX(column, value->nod_desc.dsc_length);
|
||||
|
@ -1186,7 +1186,7 @@ static void gen_function( qli_nod* node, qli_req* request)
|
||||
qli_fun* function = (qli_fun*) node->nod_arg[e_fun_function];
|
||||
qli_symbol* symbol = function->fun_symbol;
|
||||
STUFF(symbol->sym_length);
|
||||
for (const UCHAR* p = (UCHAR *) symbol->sym_string; *p;)
|
||||
for (const UCHAR* p = (UCHAR*) symbol->sym_string; *p;)
|
||||
STUFF(*p++);
|
||||
|
||||
// Generate function arguments
|
||||
@ -1667,7 +1667,7 @@ static void gen_sort( qli_nod* node, qli_req* request, const UCHAR operatr)
|
||||
for (qli_nod** const end = ptr + node->nod_count * 2; ptr < end; ptr += 2)
|
||||
{
|
||||
if (operatr == blr_sort)
|
||||
STUFF((ptr[1]) ? blr_descending : blr_ascending);
|
||||
STUFF(ptr[1] ? blr_descending : blr_ascending);
|
||||
gen_expression(ptr[0], request);
|
||||
}
|
||||
request->req_flags &= ~REQ_project;
|
||||
@ -1819,7 +1819,7 @@ static void gen_statistical( qli_nod* node, qli_req* request)
|
||||
break;
|
||||
|
||||
case nod_from:
|
||||
operatr = (node->nod_arg[e_stt_default]) ? blr_via : blr_from;
|
||||
operatr = node->nod_arg[e_stt_default] ? blr_via : blr_from;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -106,8 +106,9 @@ void HELP_help( qli_syntax* node)
|
||||
const TEXT** topic = topics;
|
||||
*topic++ = "QLI";
|
||||
|
||||
NAM *ptr, *end;
|
||||
for (ptr = (NAM *) node->syn_arg, end = ptr + node->syn_count; ptr < end; ptr++)
|
||||
qli_name** ptr;
|
||||
qli_name** end;
|
||||
for (ptr = (qli_name**) node->syn_arg, end = ptr + node->syn_count; ptr < end; ptr++)
|
||||
{
|
||||
*topic++ = (*ptr)->nam_string;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ static bool get_line(FILE*, TEXT*, USHORT);
|
||||
static int nextchar(const bool);
|
||||
static void next_line(const bool);
|
||||
static void retchar();
|
||||
static bool scan_number(SSHORT, TEXT **);
|
||||
static bool scan_number(SSHORT, TEXT**);
|
||||
static int skip_white();
|
||||
|
||||
static qli_lls* QLI_statements;
|
||||
@ -977,7 +977,7 @@ static void next_line(const bool eof_ok)
|
||||
* Get the next line from the input stream.
|
||||
*
|
||||
**************************************/
|
||||
TEXT *p;
|
||||
TEXT* p;
|
||||
|
||||
while (QLI_line)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ qli_tok* LEX_edit_string();
|
||||
qli_tok* LEX_filename();
|
||||
void LEX_fini ();
|
||||
void LEX_flush ();
|
||||
bool LEX_get_line (const TEXT*, TEXT *, int);
|
||||
bool LEX_get_line (const TEXT*, TEXT*, int);
|
||||
void LEX_init ();
|
||||
void LEX_mark_statement ();
|
||||
void LEX_pop_line ();
|
||||
|
@ -68,13 +68,13 @@ static ISC_STATUS detach(ISC_STATUS *, qli_dbb*);
|
||||
static void execute_dynamic_ddl(qli_dbb*, qli_rlb*);
|
||||
static int field_length(USHORT, USHORT);
|
||||
static void get_database_type(qli_dbb*);
|
||||
static TEXT *get_query_header(qli_dbb*, ISC_QUAD&);
|
||||
static TEXT* get_query_header(qli_dbb*, ISC_QUAD&);
|
||||
static void install(qli_dbb*);
|
||||
static qli_syntax* make_node(nod_t, USHORT);
|
||||
static TEXT *make_string(TEXT*, SSHORT);
|
||||
static qli_symbol* make_symbol(TEXT *, SSHORT);
|
||||
static TEXT* make_string(TEXT*, SSHORT);
|
||||
static qli_symbol* make_symbol(TEXT*, SSHORT);
|
||||
static qli_const* missing_value(ISC_QUAD&, qli_symbol*);
|
||||
static qli_syntax* parse_blr(UCHAR **, qli_symbol*);
|
||||
static qli_syntax* parse_blr(UCHAR**, qli_symbol*);
|
||||
static qli_syntax* parse_blr_blob(ISC_QUAD&, qli_symbol*);
|
||||
static void purge_relation(qli_rel*);
|
||||
static void put_dyn_string(qli_rlb*, const TEXT*);
|
||||
@ -158,7 +158,7 @@ static const rfr_tab_t rfr_table[] =
|
||||
};
|
||||
|
||||
|
||||
bool MET_declare( qli_dbb* database, qli_fld* variable, const nam* field_name)
|
||||
bool MET_declare( qli_dbb* database, qli_fld* variable, const qli_name* field_name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -275,7 +275,7 @@ void MET_define_index( qli_syntax* node)
|
||||
ERRQ_database_error(database, gds_status);
|
||||
END_ERROR;
|
||||
|
||||
NAM* ptr = (NAM*) fields->syn_arg;
|
||||
qli_name** ptr = (qli_name**) fields->syn_arg;
|
||||
for (int position = 0; position < fields->syn_count; ptr++, position++)
|
||||
{
|
||||
MET_fields(relation);
|
||||
@ -489,7 +489,7 @@ void MET_delete_database( qli_dbb* dbb)
|
||||
const TEXT* user;
|
||||
USHORT user_length;
|
||||
if (dbb->dbb_user) {
|
||||
user = (TEXT *) dbb->dbb_user->con_data;
|
||||
user = (TEXT*) dbb->dbb_user->con_data;
|
||||
user_length = dbb->dbb_user->con_desc.dsc_length;
|
||||
}
|
||||
else {
|
||||
@ -500,7 +500,7 @@ void MET_delete_database( qli_dbb* dbb)
|
||||
const TEXT* password;
|
||||
USHORT password_length;
|
||||
if (dbb->dbb_password) {
|
||||
password = (TEXT *) dbb->dbb_password->con_data;
|
||||
password = (TEXT*) dbb->dbb_password->con_data;
|
||||
password_length = dbb->dbb_user->con_desc.dsc_length;
|
||||
}
|
||||
else {
|
||||
@ -563,7 +563,7 @@ void MET_delete_database( qli_dbb* dbb)
|
||||
}
|
||||
|
||||
|
||||
void MET_delete_field( qli_dbb* database, NAM name)
|
||||
void MET_delete_field( qli_dbb* database, qli_name* name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -626,7 +626,7 @@ void MET_delete_field( qli_dbb* database, NAM name)
|
||||
}
|
||||
|
||||
|
||||
void MET_delete_index( qli_dbb* database, NAM name)
|
||||
void MET_delete_index( qli_dbb* database, qli_name* name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1258,7 +1258,7 @@ void MET_modify_index( qli_syntax* node)
|
||||
* of an index.
|
||||
*
|
||||
**************************************/
|
||||
NAM name = (NAM) node->syn_arg[s_mfi_name];
|
||||
qli_name* name = (qli_name*) node->syn_arg[s_mfi_name];
|
||||
qli_dbb* database = (qli_dbb*) node->syn_arg[s_mfi_database];
|
||||
database = setup_update(database);
|
||||
|
||||
@ -1350,7 +1350,7 @@ void MET_modify_relation( qli_rel* relation, qli_fld* fields)
|
||||
}
|
||||
|
||||
|
||||
void MET_ready( qli_syntax* node, USHORT create_flag)
|
||||
void MET_ready( qli_syntax* node, const bool create_flag)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1392,7 +1392,7 @@ void MET_ready( qli_syntax* node, USHORT create_flag)
|
||||
|
||||
const TEXT* q;
|
||||
if (temp->dbb_user) {
|
||||
q = (TEXT *) temp->dbb_user->con_data;
|
||||
q = (TEXT*) temp->dbb_user->con_data;
|
||||
length = temp->dbb_user->con_desc.dsc_length;
|
||||
}
|
||||
else {
|
||||
@ -1406,7 +1406,7 @@ void MET_ready( qli_syntax* node, USHORT create_flag)
|
||||
// get a password, if specified
|
||||
|
||||
if (temp->dbb_password) {
|
||||
q = (TEXT *) temp->dbb_password->con_data;
|
||||
q = (TEXT*) temp->dbb_password->con_data;
|
||||
length = temp->dbb_password->con_desc.dsc_length;
|
||||
}
|
||||
else {
|
||||
@ -1836,7 +1836,7 @@ static void blob_copy( qli_rlb* rlb, qli_rel* source, ISC_QUAD& source_blob_id)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
qli_dbb* source_dbb = (source->rel_database) ? source->rel_database : QLI_databases;
|
||||
qli_dbb* source_dbb = source->rel_database ? source->rel_database : QLI_databases;
|
||||
DB = source_dbb->dbb_handle;
|
||||
UserBlob source_blob(status_vector);
|
||||
|
||||
@ -1862,7 +1862,7 @@ static void blob_copy( qli_rlb* rlb, qli_rel* source, ISC_QUAD& source_blob_id)
|
||||
}
|
||||
else {
|
||||
buffer_length = max_segment;
|
||||
buffer = (TEXT *) gds__alloc((SLONG) buffer_length);
|
||||
buffer = (TEXT*) gds__alloc((SLONG) buffer_length);
|
||||
}
|
||||
|
||||
STUFF_WORD((USHORT) size);
|
||||
@ -2698,7 +2698,7 @@ static void get_database_type( qli_dbb* new_dbb)
|
||||
}
|
||||
|
||||
|
||||
static TEXT *get_query_header( qli_dbb* database, ISC_QUAD& blob_id)
|
||||
static TEXT* get_query_header( qli_dbb* database, ISC_QUAD& blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2795,7 +2795,7 @@ static void install( qli_dbb* old_dbb)
|
||||
|
||||
// If a name was given, make up a symbol for the database.
|
||||
|
||||
nam* name = (nam*) old_dbb->dbb_symbol;
|
||||
qli_name* name = (qli_name*) old_dbb->dbb_symbol;
|
||||
if (name) {
|
||||
qli_symbol* asymbol = make_symbol(name->nam_string, name->nam_length);
|
||||
new_dbb->dbb_symbol = asymbol;
|
||||
@ -2917,7 +2917,7 @@ static qli_syntax* make_node( nod_t type, USHORT count)
|
||||
}
|
||||
|
||||
|
||||
static TEXT *make_string( TEXT* string, SSHORT length)
|
||||
static TEXT* make_string( TEXT* string, SSHORT length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2995,7 +2995,7 @@ static qli_const* missing_value( ISC_QUAD& blob_id, qli_symbol* symbol)
|
||||
}
|
||||
|
||||
|
||||
static qli_syntax* parse_blr( UCHAR ** ptr, qli_symbol* symbol)
|
||||
static qli_syntax* parse_blr( UCHAR** ptr, qli_symbol* symbol)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3010,8 +3010,8 @@ static qli_syntax* parse_blr( UCHAR ** ptr, qli_symbol* symbol)
|
||||
qli_syntax** arg;
|
||||
qli_const* constant;
|
||||
nod_t operatr;
|
||||
NAM name;
|
||||
UCHAR *p;
|
||||
qli_name* name;
|
||||
UCHAR* p;
|
||||
SSHORT dtype, scale, length, l, op;
|
||||
|
||||
UCHAR* blr = *ptr;
|
||||
@ -3110,7 +3110,7 @@ static qli_syntax* parse_blr( UCHAR ** ptr, qli_symbol* symbol)
|
||||
BLR_BYTE;
|
||||
blr += 2;
|
||||
node = make_node(nod_field, 1);
|
||||
name = (NAM) ALLOCPV(type_nam, symbol->sym_length);
|
||||
name = (qli_name*) ALLOCPV(type_nam, symbol->sym_length);
|
||||
node->syn_arg[0] = (qli_syntax*) name;
|
||||
name->nam_length = symbol->sym_length;
|
||||
strcpy(name->nam_string, symbol->sym_string);
|
||||
@ -3120,10 +3120,10 @@ static qli_syntax* parse_blr( UCHAR ** ptr, qli_symbol* symbol)
|
||||
BLR_BYTE;
|
||||
length = BLR_BYTE;
|
||||
node = make_node(nod_field, 1);
|
||||
name = (NAM) ALLOCPV(type_nam, length);
|
||||
name = (qli_name*) ALLOCPV(type_nam, length);
|
||||
node->syn_arg[0] = (qli_syntax*) name;
|
||||
name->nam_length = length;
|
||||
p = (UCHAR *) name->nam_string;
|
||||
p = (UCHAR*) name->nam_string;
|
||||
do {
|
||||
*p++ = BLR_BYTE;
|
||||
} while (--length);
|
||||
@ -3517,12 +3517,12 @@ static void sql_grant_revoke( qli_syntax* node, USHORT type)
|
||||
qli_syntax* names = node->syn_arg[s_grant_users];
|
||||
qli_syntax* fields = node->syn_arg[s_grant_fields];
|
||||
|
||||
NAM* name = (NAM*) names->syn_arg;
|
||||
for (NAM* const end = name + names->syn_count; name < end; name++)
|
||||
qli_name** name = (qli_name**) names->syn_arg;
|
||||
for (qli_name** const end = name + names->syn_count; name < end; name++)
|
||||
{
|
||||
if (fields->syn_count) {
|
||||
NAM* field = (NAM *) fields->syn_arg;
|
||||
NAM* const end_field = field + fields->syn_count;
|
||||
qli_name** field = (qli_name**) fields->syn_arg;
|
||||
qli_name** const end_field = field + fields->syn_count;
|
||||
for (; field < end_field; field++)
|
||||
{
|
||||
stuff_priv(rlb, type, relation_name, privileges,
|
||||
|
@ -24,14 +24,14 @@
|
||||
#ifndef QLI_META_PROTO_H
|
||||
#define QLI_META_PROTO_H
|
||||
|
||||
bool MET_declare(qli_dbb*, qli_fld*, const nam*);
|
||||
bool MET_declare(qli_dbb*, qli_fld*, const qli_name*);
|
||||
void MET_define_field(qli_dbb*, qli_fld*);
|
||||
void MET_define_index(qli_syntax*);
|
||||
void MET_define_relation(qli_rel*, qli_rel*);
|
||||
void MET_define_sql_relation(qli_rel*);
|
||||
void MET_delete_database(qli_dbb*);
|
||||
void MET_delete_field(qli_dbb*, nam*);
|
||||
void MET_delete_index(qli_dbb*, nam*);
|
||||
void MET_delete_field(qli_dbb*, qli_name*);
|
||||
void MET_delete_index(qli_dbb*, qli_name*);
|
||||
void MET_delete_relation(qli_rel*);
|
||||
int MET_dimensions(qli_dbb*, const TEXT*);
|
||||
void MET_fields(qli_rel*);
|
||||
@ -44,7 +44,7 @@ FB_API_HANDLE MET_meta_transaction(qli_dbb*, bool);
|
||||
void MET_modify_field(qli_dbb*, qli_fld*);
|
||||
void MET_modify_index(qli_syntax*);
|
||||
void MET_modify_relation(qli_rel*, qli_fld*);
|
||||
void MET_ready(qli_syntax*, USHORT);
|
||||
void MET_ready(qli_syntax*, const bool);
|
||||
void MET_shutdown();
|
||||
void MET_sql_alter_table(qli_rel*, qli_fld*);
|
||||
void MET_sql_cr_view(qli_syntax*);
|
||||
|
@ -235,7 +235,7 @@ int MOVQ_compare(const dsc* arg1, const dsc* arg2)
|
||||
desc.dsc_dtype = dtype_timestamp;
|
||||
desc.dsc_length = sizeof(date);
|
||||
desc.dsc_scale = 0;
|
||||
desc.dsc_address = (UCHAR *) date;
|
||||
desc.dsc_address = (UCHAR*) date;
|
||||
desc.dsc_sub_type = 0;
|
||||
MOVQ_move(arg2, &desc);
|
||||
return MOVQ_compare(arg1, &desc);
|
||||
@ -244,7 +244,7 @@ int MOVQ_compare(const dsc* arg1, const dsc* arg2)
|
||||
desc.dsc_dtype = dtype_sql_time;
|
||||
desc.dsc_length = sizeof(date[0]);
|
||||
desc.dsc_scale = 0;
|
||||
desc.dsc_address = (UCHAR *) date;
|
||||
desc.dsc_address = (UCHAR*) date;
|
||||
desc.dsc_sub_type = 0;
|
||||
MOVQ_move(arg2, &desc);
|
||||
return MOVQ_compare(arg1, &desc);
|
||||
@ -253,7 +253,7 @@ int MOVQ_compare(const dsc* arg1, const dsc* arg2)
|
||||
desc.dsc_dtype = dtype_sql_date;
|
||||
desc.dsc_length = sizeof(date[0]);
|
||||
desc.dsc_scale = 0;
|
||||
desc.dsc_address = (UCHAR *) date;
|
||||
desc.dsc_address = (UCHAR*) date;
|
||||
desc.dsc_sub_type = 0;
|
||||
MOVQ_move(arg2, &desc);
|
||||
return MOVQ_compare(arg1, &desc);
|
||||
@ -332,7 +332,7 @@ double MOVQ_date_to_double(const dsc* desc)
|
||||
temp_desc.dsc_scale = 0;
|
||||
temp_desc.dsc_sub_type = 0;
|
||||
date = temp;
|
||||
temp_desc.dsc_address = (UCHAR *) date;
|
||||
temp_desc.dsc_address = (UCHAR*) date;
|
||||
QLI_validate_desc(temp_desc);
|
||||
MOVQ_move(desc, &temp_desc);
|
||||
}
|
||||
@ -529,7 +529,7 @@ SLONG MOVQ_get_long(const dsc* desc, SSHORT scale)
|
||||
|
||||
scale -= (SSHORT) desc->dsc_scale;
|
||||
|
||||
const TEXT* p = (TEXT *) desc->dsc_address;
|
||||
const TEXT* p = (TEXT*) desc->dsc_address;
|
||||
switch (desc->dsc_dtype)
|
||||
{
|
||||
case dtype_short:
|
||||
@ -644,14 +644,14 @@ int MOVQ_get_string(const dsc* desc, const TEXT** address, vary* temp, USHORT le
|
||||
the address and length. */
|
||||
|
||||
if (desc->dsc_dtype == dtype_text) {
|
||||
*address = (TEXT *) desc->dsc_address;
|
||||
*address = (TEXT*) desc->dsc_address;
|
||||
return desc->dsc_length;
|
||||
}
|
||||
|
||||
// Perhaps it a "C" type string?
|
||||
|
||||
if (desc->dsc_dtype == dtype_cstring) {
|
||||
*address = (TEXT *) desc->dsc_address;
|
||||
*address = (TEXT*) desc->dsc_address;
|
||||
return MIN(static_cast<int>(strlen((char*)desc->dsc_address)), desc->dsc_length - 1);
|
||||
}
|
||||
|
||||
@ -665,7 +665,7 @@ int MOVQ_get_string(const dsc* desc, const TEXT** address, vary* temp, USHORT le
|
||||
|
||||
dsc temp_desc;
|
||||
temp_desc.dsc_length = length;
|
||||
temp_desc.dsc_address = (UCHAR *) temp;
|
||||
temp_desc.dsc_address = (UCHAR*) temp;
|
||||
temp_desc.dsc_scale = 0;
|
||||
temp_desc.dsc_dtype = dtype_varying;
|
||||
temp_desc.dsc_sub_type = ttype_ascii;
|
||||
@ -1041,7 +1041,7 @@ static void sql_date_to_text( const SLONG date[1], DSC* to)
|
||||
|
||||
dsc desc;
|
||||
desc.dsc_length = p - temp;
|
||||
desc.dsc_address = (UCHAR *) temp;
|
||||
desc.dsc_address = (UCHAR*) temp;
|
||||
desc.dsc_dtype = dtype_text;
|
||||
desc.dsc_scale = 0;
|
||||
desc.dsc_sub_type = ttype_ascii;
|
||||
@ -1081,7 +1081,7 @@ static void sql_time_to_text( const ULONG date[1], DSC* to)
|
||||
|
||||
dsc desc;
|
||||
desc.dsc_length = p - temp;
|
||||
desc.dsc_address = (UCHAR *) temp;
|
||||
desc.dsc_address = (UCHAR*) temp;
|
||||
desc.dsc_dtype = dtype_text;
|
||||
desc.dsc_scale = 0;
|
||||
desc.dsc_sub_type = ttype_ascii;
|
||||
@ -1123,7 +1123,7 @@ static void timestamp_to_text( const SLONG date[2], DSC* to)
|
||||
|
||||
dsc desc;
|
||||
desc.dsc_length = p - temp;
|
||||
desc.dsc_address = (UCHAR *) temp;
|
||||
desc.dsc_address = (UCHAR*) temp;
|
||||
desc.dsc_dtype = dtype_text;
|
||||
desc.dsc_scale = 0;
|
||||
desc.dsc_sub_type = ttype_ascii;
|
||||
@ -1218,7 +1218,7 @@ static void numeric_to_text(const dsc* from, dsc* to)
|
||||
intermediate.dsc_length = sizeof(SLONG);
|
||||
intermediate.dsc_scale = scale;
|
||||
intermediate.dsc_sub_type = 0;
|
||||
intermediate.dsc_address = (UCHAR *) &n;
|
||||
intermediate.dsc_address = (UCHAR*) &n;
|
||||
QLI_validate_desc(intermediate);
|
||||
|
||||
MOVQ_move(from, &intermediate);
|
||||
@ -1305,7 +1305,7 @@ static void numeric_to_text(const dsc* from, dsc* to)
|
||||
return;
|
||||
}
|
||||
|
||||
*(SSHORT *) (to->dsc_address) = (UCHAR *) q - to->dsc_address - sizeof(SSHORT);
|
||||
*(SSHORT*) (to->dsc_address) = (UCHAR*) q - to->dsc_address - sizeof(SSHORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ static void check_end();
|
||||
static void command_end();
|
||||
static qli_dbb* get_dbb(qli_symbol*);
|
||||
static qli_syntax* make_list(qli_lls*);
|
||||
static NAM make_name();
|
||||
static qli_name* make_name();
|
||||
static qli_const* make_numeric_constant(const TEXT*, USHORT);
|
||||
static TEXT* make_string(const TEXT*, USHORT);
|
||||
static qli_syntax* negate(qli_syntax*);
|
||||
@ -94,7 +94,7 @@ static qli_syntax* parse_modify();
|
||||
static qli_syntax* parse_modify_index();
|
||||
static qli_syntax* parse_modify_relation();
|
||||
static qli_syntax* parse_multiply(USHORT*, bool*);
|
||||
static NAM parse_name();
|
||||
static qli_name* parse_name();
|
||||
static qli_syntax* parse_not(USHORT *);
|
||||
static int parse_ordinal();
|
||||
static qli_syntax* parse_output();
|
||||
@ -102,9 +102,9 @@ static qli_syntax* parse_primitive_value(USHORT*, bool*);
|
||||
static qli_syntax* parse_print_list();
|
||||
static qli_syntax* parse_print();
|
||||
static qli_syntax* parse_prompt();
|
||||
static QFL parse_qualified_filter();
|
||||
static QFN parse_qualified_function();
|
||||
static QPR parse_qualified_procedure();
|
||||
static qli_filter* parse_qualified_filter();
|
||||
static qli_func* parse_qualified_function();
|
||||
static qli_proc* parse_qualified_procedure();
|
||||
static qli_rel* parse_qualified_relation();
|
||||
static qli_syntax* parse_ready(nod_t);
|
||||
static qli_syntax* parse_relational(USHORT*);
|
||||
@ -514,7 +514,7 @@ static qli_syntax* make_list( qli_lls* stack)
|
||||
}
|
||||
|
||||
|
||||
static NAM make_name()
|
||||
static qli_name* make_name()
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -541,7 +541,7 @@ static NAM make_name()
|
||||
break;
|
||||
}
|
||||
|
||||
NAM name = (NAM) ALLOCDV(type_nam, l);
|
||||
qli_name* name = (qli_name*) ALLOCDV(type_nam, l);
|
||||
name->nam_length = l;
|
||||
TEXT* p = name->nam_string;
|
||||
const TEXT* q = string;
|
||||
@ -593,7 +593,7 @@ static qli_const* make_numeric_constant(const TEXT* string, USHORT length)
|
||||
constant->con_desc.dsc_dtype = dtype_text;
|
||||
constant->con_desc.dsc_length = length;
|
||||
constant->con_desc.dsc_address = constant->con_data;
|
||||
TEXT* p = (TEXT *) constant->con_desc.dsc_address;
|
||||
TEXT* p = (TEXT*) constant->con_desc.dsc_address;
|
||||
*p++ = '0';
|
||||
memcpy(p, string, --length);
|
||||
}
|
||||
@ -792,7 +792,7 @@ static qli_syntax* parse_assignment()
|
||||
|
||||
qli_syntax* node = syntax_node(nod_assign, s_asn_count);
|
||||
node->syn_arg[s_asn_to] = parse_field_name(&field);
|
||||
NAM name = (NAM) field->syn_arg[0];
|
||||
qli_name* name = (qli_name*) field->syn_arg[0];
|
||||
|
||||
/* If the next token is an equals sign, the statement really is an
|
||||
assignment, and we're off the hook. */
|
||||
@ -807,7 +807,7 @@ static qli_syntax* parse_assignment()
|
||||
if (field->syn_count == 1)
|
||||
relation = resolve_relation(0, name->nam_symbol);
|
||||
else if (field->syn_count == 2 && name->nam_symbol) {
|
||||
NAM name2 = (NAM) field->syn_arg[1];
|
||||
qli_name* name2 = (qli_name*) field->syn_arg[1];
|
||||
relation = resolve_relation(name->nam_symbol, name2->nam_symbol);
|
||||
}
|
||||
|
||||
@ -1020,8 +1020,8 @@ static qli_syntax* parse_declare()
|
||||
qli_rel* relation = NULL;
|
||||
if (field_node && field_node->syn_count == 3)
|
||||
{
|
||||
NAM db_name = (NAM) field_node->syn_arg[0];
|
||||
NAM rel_name = (NAM) field_node->syn_arg[1];
|
||||
qli_name* db_name = (qli_name*) field_node->syn_arg[0];
|
||||
qli_name* rel_name = (qli_name*) field_node->syn_arg[1];
|
||||
if (!db_name->nam_symbol)
|
||||
ERRQ_print_error(165, db_name->nam_string);
|
||||
// Msg165 %s is not a database
|
||||
@ -2030,7 +2030,7 @@ static qli_syntax* parse_in( qli_syntax* value, nod_t operatr, bool all_flag)
|
||||
qli_syntax* node = syntax_node(nod_any, 1);
|
||||
node->syn_arg[0] = rse;
|
||||
|
||||
return (all_flag) ? negate(node) : node;
|
||||
return all_flag ? negate(node) : node;
|
||||
}
|
||||
|
||||
|
||||
@ -2231,7 +2231,7 @@ static qli_const* parse_literal()
|
||||
qli_const* constant;
|
||||
|
||||
PAR_real();
|
||||
const UCHAR* q = (UCHAR *) QLI_token->tok_string;
|
||||
const UCHAR* q = (UCHAR*) QLI_token->tok_string;
|
||||
USHORT l = QLI_token->tok_length;
|
||||
|
||||
if (QLI_token->tok_type == tok_quoted)
|
||||
@ -2509,7 +2509,7 @@ static qli_syntax* parse_multiply( USHORT * paren_count, bool* bool_flag)
|
||||
}
|
||||
|
||||
|
||||
static NAM parse_name()
|
||||
static qli_name* parse_name()
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2529,7 +2529,7 @@ static NAM parse_name()
|
||||
ERRQ_syntax(199); // Msg199 identifier
|
||||
|
||||
SSHORT l = QLI_token->tok_length - 2 * int(isQuoted);
|
||||
NAM name = (NAM) ALLOCDV(type_nam, l);
|
||||
qli_name* name = (qli_name*) ALLOCDV(type_nam, l);
|
||||
name->nam_length = l;
|
||||
name->nam_symbol = QLI_token->tok_symbol;
|
||||
const TEXT* q = QLI_token->tok_string + int(isQuoted);
|
||||
@ -2931,7 +2931,7 @@ static qli_syntax* parse_prompt()
|
||||
}
|
||||
|
||||
|
||||
static QFL parse_qualified_filter()
|
||||
static qli_filter* parse_qualified_filter()
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2942,13 +2942,13 @@ static QFL parse_qualified_filter()
|
||||
* Functional description
|
||||
* This token ought to be a filter, possibly qualified.
|
||||
* Return a qualified filter block, containing the
|
||||
* filter name in a NAM block and the database in a
|
||||
* filter name in a qli_name block and the database in a
|
||||
* qli_dbb block if a database was specified. Somebody
|
||||
* else will decide what to do if the database was not
|
||||
* specified.
|
||||
*
|
||||
**************************************/
|
||||
QFL filter = (QFL) ALLOCD(type_qfl);
|
||||
qli_filter* filter = (qli_filter*) ALLOCD(type_qfl);
|
||||
filter->qfl_database = parse_database();
|
||||
filter->qfl_name = parse_name();
|
||||
return filter;
|
||||
@ -2956,7 +2956,7 @@ static QFL parse_qualified_filter()
|
||||
|
||||
|
||||
|
||||
static QFN parse_qualified_function()
|
||||
static qli_func* parse_qualified_function()
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2967,20 +2967,20 @@ static QFN parse_qualified_function()
|
||||
* Functional description
|
||||
* This token ought to be a function, possibly qualified.
|
||||
* Return a qualified function block, containing the
|
||||
* function name in a NAM block and the database in a
|
||||
* function name in a qli_name block and the database in a
|
||||
* qli_dbb block if a database was specified. Somebody
|
||||
* else will decide what to do if the database was not
|
||||
* specified.
|
||||
*
|
||||
**************************************/
|
||||
QFN func = (QFN) ALLOCD(type_qfn);
|
||||
qli_func* func = (qli_func*) ALLOCD(type_qfn);
|
||||
func->qfn_database = parse_database();
|
||||
func->qfn_name = parse_name();
|
||||
return func;
|
||||
}
|
||||
|
||||
|
||||
static QPR parse_qualified_procedure()
|
||||
static qli_proc* parse_qualified_procedure()
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2991,13 +2991,13 @@ static QPR parse_qualified_procedure()
|
||||
* Functional description
|
||||
* This token ought to be a procedure, possibly qualified.
|
||||
* Return a qualified procedure block, containing the
|
||||
* procedure name in a NAM block and the database in a
|
||||
* procedure name in a qli_name block and the database in a
|
||||
* qli_dbb block if a database was specified. Somebody
|
||||
* else will decide what to do if the database was not
|
||||
* specified.
|
||||
*
|
||||
**************************************/
|
||||
QPR proc = (QPR) ALLOCD(type_qpr);
|
||||
qli_proc* proc = (qli_proc*) ALLOCD(type_qpr);
|
||||
proc->qpr_database = parse_database();
|
||||
proc->qpr_name = parse_name();
|
||||
return proc;
|
||||
@ -3085,7 +3085,7 @@ static qli_syntax* parse_ready( nod_t node_type)
|
||||
case nod_def_database:
|
||||
case nod_ready:
|
||||
if (PAR_match(KW_AS)) {
|
||||
NAM name = parse_name();
|
||||
qli_name* name = parse_name();
|
||||
database->dbb_symbol = (qli_symbol*) name;
|
||||
if (HSH_lookup(name->nam_string, name->nam_length))
|
||||
ERRQ_error(408, name->nam_string);
|
||||
@ -3482,7 +3482,7 @@ static qli_syntax* parse_report()
|
||||
if (PAR_match(KW_REPORT))
|
||||
{
|
||||
qli_brk* control = (qli_brk*) ALLOCD(type_brk);
|
||||
qli_brk** ptr = (top) ? &report->rpt_top_rpt : &report->rpt_bottom_rpt;
|
||||
qli_brk** ptr = top ? &report->rpt_top_rpt : &report->rpt_bottom_rpt;
|
||||
control->brk_next = *ptr;
|
||||
*ptr = control;
|
||||
PAR_match(KW_PRINT);
|
||||
@ -3550,8 +3550,8 @@ static qli_syntax* parse_report()
|
||||
ctl_syn = qli_fld->syn_count - syn_count;
|
||||
USHORT i;
|
||||
for (i = 0; i < syn_count; i++) {
|
||||
const nam* name1 = (NAM) rse_fld->syn_arg[i + srt_syn];
|
||||
const nam* name2 = (NAM) qli_fld->syn_arg[i + ctl_syn];
|
||||
const qli_name* name1 = (qli_name*) rse_fld->syn_arg[i + srt_syn];
|
||||
const qli_name* name2 = (qli_name*) qli_fld->syn_arg[i + ctl_syn];
|
||||
if (strcmp(name1->nam_string, name2->nam_string))
|
||||
break;
|
||||
}
|
||||
@ -4147,7 +4147,7 @@ static qli_syntax* parse_show()
|
||||
}
|
||||
else {
|
||||
sw = show_procedure;
|
||||
QPR proc = (QPR) ALLOCD(type_qpr);
|
||||
qli_proc* proc = (qli_proc*) ALLOCD(type_qpr);
|
||||
proc->qpr_database = (qli_dbb*) value;
|
||||
proc->qpr_name = parse_name();
|
||||
value = (BLK) proc;
|
||||
|
@ -576,7 +576,7 @@ static void edit_date( const dsc* desc, pics* picture, TEXT** output)
|
||||
temp_desc.dsc_scale = 0;
|
||||
temp_desc.dsc_sub_type = 0;
|
||||
temp_desc.dsc_length = sizeof(date);
|
||||
temp_desc.dsc_address = (UCHAR *) date;
|
||||
temp_desc.dsc_address = (UCHAR*) date;
|
||||
QLI_validate_desc(temp_desc);
|
||||
MOVQ_move(desc, &temp_desc);
|
||||
|
||||
@ -1047,7 +1047,7 @@ static void edit_numeric(const dsc* desc, pics* picture, TEXT** output)
|
||||
float_char = c;
|
||||
if (!float_ptr) {
|
||||
float_ptr = out;
|
||||
*out++ = (n) ? c : ' ';
|
||||
*out++ = n ? c : ' ';
|
||||
break;
|
||||
}
|
||||
d = *digits++;
|
||||
@ -1058,12 +1058,12 @@ static void edit_numeric(const dsc* desc, pics* picture, TEXT** output)
|
||||
}
|
||||
*float_ptr = ' ';
|
||||
float_ptr = out;
|
||||
*out++ = (n) ? c : ' ';
|
||||
*out++ = n ? c : ' ';
|
||||
break;
|
||||
|
||||
case '(':
|
||||
case ')':
|
||||
*out++ = (negative) ? c : ' ';
|
||||
*out++ = negative ? c : ' ';
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
|
@ -100,7 +100,7 @@ void RPT_report( qli_nod* loop)
|
||||
|
||||
if (!report->rpt_buffer) {
|
||||
qli_str* string = (qli_str*) ALLOCDV(type_str, message->msg_length);
|
||||
report->rpt_buffer = (UCHAR *) string->str_data;
|
||||
report->rpt_buffer = (UCHAR*) string->str_data;
|
||||
}
|
||||
|
||||
memcpy(report->rpt_buffer, message->msg_buffer, (SLONG) message->msg_length);
|
||||
|
@ -59,13 +59,13 @@ static void show_dbb_parameters(qli_dbb*);
|
||||
static int show_field_detail(qli_dbb*, const TEXT*, const TEXT*, qli_syntax*);
|
||||
static int show_field_instances(qli_dbb*, const TEXT*);
|
||||
static void show_fields(qli_rel*, qli_fld*);
|
||||
static void show_filt(QFL);
|
||||
static int show_filter_detail(qli_dbb*, TEXT*);
|
||||
static void show_filt(qli_filter*);
|
||||
static int show_filter_detail(qli_dbb*, const TEXT*);
|
||||
static void show_filts(qli_dbb*);
|
||||
static int show_filters_detail(qli_dbb*);
|
||||
static void show_fld(qli_syntax*);
|
||||
static void show_func(QFN);
|
||||
static int show_func_detail(qli_dbb*, TEXT*);
|
||||
static void show_func(qli_func*);
|
||||
static int show_func_detail(qli_dbb*, const TEXT*);
|
||||
static void show_funcs(qli_dbb*);
|
||||
static int show_funcs_detail(qli_dbb*);
|
||||
static int show_insecure_fields(qli_dbb*, const TEXT*, const TEXT*);
|
||||
@ -77,7 +77,7 @@ static int show_gbl_fields_detail(qli_dbb*);
|
||||
static int show_indices_detail(qli_rel*);
|
||||
static void show_matching();
|
||||
static void show_names(const TEXT*, USHORT, TEXT*);
|
||||
static void show_proc(QPR);
|
||||
static void show_proc(qli_proc*);
|
||||
static void show_procs(qli_dbb*);
|
||||
static void show_rel(qli_rel*);
|
||||
static void show_rel_detail(qli_rel*);
|
||||
@ -94,7 +94,7 @@ static void show_trigger_messages(qli_dbb*, const TEXT*);
|
||||
static void show_trigger_status(TEXT*, USHORT, USHORT, USHORT);
|
||||
static void show_trigs(qli_dbb*);
|
||||
static int show_triggers_detail(qli_dbb*);
|
||||
static void show_var(const nam*);
|
||||
static void show_var(const qli_name*);
|
||||
static void show_vars();
|
||||
static void show_versions();
|
||||
static void show_view(qli_rel*);
|
||||
@ -150,7 +150,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
qli_rel* relation;
|
||||
qli_dbb* dbb;
|
||||
USHORT count;
|
||||
NAM name;
|
||||
qli_name* name;
|
||||
SSHORT width;
|
||||
|
||||
QLI_skip_line = true;
|
||||
@ -251,7 +251,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
|
||||
case show_security_class:
|
||||
count = 0;
|
||||
name = (NAM) value;
|
||||
name = (qli_name*) value;
|
||||
for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next)
|
||||
count += show_security_class_detail(dbb, name->nam_string);
|
||||
if (!count) {
|
||||
@ -327,7 +327,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
break;
|
||||
|
||||
case show_filter:
|
||||
show_filt((QFL) value);
|
||||
show_filt((qli_filter*) value);
|
||||
break;
|
||||
|
||||
case show_filters:
|
||||
@ -351,7 +351,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
*/
|
||||
|
||||
case show_function:
|
||||
show_func((QFN) value);
|
||||
show_func((qli_func*) value);
|
||||
break;
|
||||
|
||||
case show_functions:
|
||||
@ -377,7 +377,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
break;
|
||||
|
||||
case show_procedure:
|
||||
show_proc((QPR) value);
|
||||
show_proc((qli_proc*) value);
|
||||
break;
|
||||
|
||||
case show_version:
|
||||
@ -385,7 +385,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
break;
|
||||
|
||||
case show_variable:
|
||||
show_var((NAM) value);
|
||||
show_var((qli_name*) value);
|
||||
break;
|
||||
|
||||
case show_variables:
|
||||
@ -424,7 +424,7 @@ void SHOW_stuff( qli_syntax* node)
|
||||
}
|
||||
|
||||
|
||||
static void array_dimensions( qli_dbb* database, const TEXT * field_name)
|
||||
static void array_dimensions( qli_dbb* database, const TEXT* field_name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -514,7 +514,7 @@ static void display_blob(qli_dbb* dbb,
|
||||
buffer[length--] = 0;
|
||||
if (strip_line)
|
||||
{
|
||||
for (TEXT *b = buffer + length; b >= buffer;) {
|
||||
for (TEXT* b = buffer + length; b >= buffer;) {
|
||||
if (*b == '\n' || *b == '\t' || *b == ' ')
|
||||
*b-- = 0;
|
||||
else
|
||||
@ -746,7 +746,7 @@ static void show_datatype(qli_dbb* database,
|
||||
AND TYPE.RDB$TYPE EQ sub_type
|
||||
|
||||
TEXT* p = subtype;
|
||||
for (const TEXT *q = TYPE.RDB$TYPE_NAME; *q && *q != ' ';) {
|
||||
for (const TEXT* q = TYPE.RDB$TYPE_NAME; *q && *q != ' ';) {
|
||||
*p++ = *q++;
|
||||
}
|
||||
*p = 0;
|
||||
@ -1126,7 +1126,7 @@ static void show_fields( qli_rel* relation, qli_fld* fields)
|
||||
}
|
||||
|
||||
|
||||
static void show_filt( QFL filter)
|
||||
static void show_filt( qli_filter* filter)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1141,7 +1141,7 @@ static void show_filt( QFL filter)
|
||||
*
|
||||
**************************************/
|
||||
int count = 0;
|
||||
NAM name = filter->qfl_name;
|
||||
const qli_name* name = filter->qfl_name;
|
||||
|
||||
qli_dbb* database = filter->qfl_database;
|
||||
if (database)
|
||||
@ -1182,7 +1182,7 @@ static void show_filt( QFL filter)
|
||||
}
|
||||
|
||||
|
||||
static int show_filter_detail( qli_dbb* database, TEXT* filter_name)
|
||||
static int show_filter_detail( qli_dbb* database, const TEXT* filter_name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1205,10 +1205,10 @@ static int show_filter_detail( qli_dbb* database, TEXT* filter_name)
|
||||
F IN RDB$FILTERS WITH F.RDB$FUNCTION_NAME = filter_name
|
||||
|
||||
count++;
|
||||
fb_utils::exact_name(filter_name);
|
||||
fb_utils::exact_name(F.RDB$FUNCTION_NAME);
|
||||
|
||||
ERRQ_msg_put(444, // Msg444 Filter %s in database \"%s\" (%s):
|
||||
SafeArg() << filter_name << database->dbb_filename <<
|
||||
SafeArg() << F.RDB$FUNCTION_NAME << database->dbb_filename <<
|
||||
database->dbb_symbol->sym_string);
|
||||
ERRQ_msg_put(445, F.RDB$MODULE_NAME); // Msg445 Filter library is %s
|
||||
ERRQ_msg_put(446, SafeArg() << F.RDB$INPUT_SUB_TYPE); // Msg446 Input sub-type is %d
|
||||
@ -1304,17 +1304,17 @@ static void show_fld( qli_syntax* field_node)
|
||||
}
|
||||
|
||||
qli_dbb* database = NULL;
|
||||
NAM field_name = NULL;
|
||||
NAM relation_name = NULL;
|
||||
qli_name* field_name = NULL;
|
||||
qli_name* relation_name = NULL;
|
||||
for (qli_syntax** ptr = field_node->syn_arg + field_node->syn_count;
|
||||
--ptr >= field_node->syn_arg;)
|
||||
{
|
||||
if (!field_name)
|
||||
field_name = (NAM) * ptr;
|
||||
field_name = (qli_name*) * ptr;
|
||||
else if (!relation_name)
|
||||
relation_name = (NAM) * ptr;
|
||||
relation_name = (qli_name*) * ptr;
|
||||
else
|
||||
for (qli_symbol* symbol = ((NAM) *ptr)->nam_symbol; symbol; symbol = symbol->sym_homonym)
|
||||
for (qli_symbol* symbol = ((qli_name*) *ptr)->nam_symbol; symbol; symbol = symbol->sym_homonym)
|
||||
{
|
||||
if (symbol->sym_type == SYM_database) {
|
||||
database = (qli_dbb*) symbol->sym_object;
|
||||
@ -1323,7 +1323,7 @@ static void show_fld( qli_syntax* field_node)
|
||||
}
|
||||
}
|
||||
|
||||
const TEXT *string = (relation_name) ? relation_name->nam_string : NULL;
|
||||
const TEXT* string = relation_name ? relation_name->nam_string : NULL;
|
||||
TEXT s[65];
|
||||
|
||||
if (string)
|
||||
@ -1354,7 +1354,7 @@ static void show_fld( qli_syntax* field_node)
|
||||
}
|
||||
|
||||
|
||||
static void show_func( QFN func)
|
||||
static void show_func( qli_func* func)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1369,7 +1369,7 @@ static void show_func( QFN func)
|
||||
*
|
||||
**************************************/
|
||||
int count = 0;
|
||||
NAM name = func->qfn_name;
|
||||
const qli_name* name = func->qfn_name;
|
||||
|
||||
qli_dbb* database = func->qfn_database;
|
||||
if (database)
|
||||
@ -1408,7 +1408,7 @@ static void show_func( QFN func)
|
||||
}
|
||||
|
||||
|
||||
static int show_func_detail( qli_dbb* database, TEXT* func_name)
|
||||
static int show_func_detail( qli_dbb* database, const TEXT* func_name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1424,6 +1424,7 @@ static int show_func_detail( qli_dbb* database, TEXT* func_name)
|
||||
* description.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
MET_meta_transaction(database, false);
|
||||
int count = 0;
|
||||
|
||||
@ -1433,7 +1434,9 @@ static int show_func_detail( qli_dbb* database, TEXT* func_name)
|
||||
count++;
|
||||
fb_utils::exact_name(F.RDB$QUERY_NAME);
|
||||
fb_utils::exact_name(F.RDB$FUNCTION_NAME);
|
||||
strcpy(func_name, F.RDB$FUNCTION_NAME);
|
||||
|
||||
BASED ON RDB$FUNCTIONS.RDB$QUERY_NAME fq_name;
|
||||
strcpy(fq_name, F.RDB$FUNCTION_NAME);
|
||||
|
||||
if (F.RDB$QUERY_NAME[0]) {
|
||||
ERRQ_msg_put(424, // Msg424 Function %s (%s) in database \"%s\" (%s):
|
||||
@ -1451,7 +1454,7 @@ static int show_func_detail( qli_dbb* database, TEXT* func_name)
|
||||
|
||||
FOR(REQUEST_HANDLE database->dbb_requests[REQ_show_func_args])
|
||||
FA IN RDB$FUNCTION_ARGUMENTS WITH
|
||||
FA.RDB$FUNCTION_NAME = func_name SORTED BY FA.RDB$ARGUMENT_POSITION
|
||||
FA.RDB$FUNCTION_NAME = fq_name SORTED BY FA.RDB$ARGUMENT_POSITION
|
||||
if (FA.RDB$ARGUMENT_POSITION == 0) {
|
||||
ERRQ_msg_partial(427);
|
||||
// Msg427 Return argument is
|
||||
@ -1647,18 +1650,18 @@ static void show_gbl_field( qli_syntax* field_node)
|
||||
* otherwise show them all.
|
||||
*
|
||||
**************************************/
|
||||
NAM field_name = NULL;
|
||||
qli_name* field_name = NULL;
|
||||
qli_dbb* database = NULL;
|
||||
|
||||
for (qli_syntax** ptr = field_node->syn_arg + field_node->syn_count - 1;
|
||||
ptr >= field_node->syn_arg; ptr--)
|
||||
{
|
||||
if (!field_name) {
|
||||
field_name = (NAM) * ptr;
|
||||
field_name = (qli_name*) * ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
NAM name = (NAM) *ptr;
|
||||
qli_name* name = (qli_name*) *ptr;
|
||||
for (qli_symbol* symbol = name->nam_symbol; symbol; symbol = symbol->sym_homonym)
|
||||
{
|
||||
if (symbol->sym_type == SYM_database) {
|
||||
@ -1975,7 +1978,7 @@ static void show_names( const TEXT* name, USHORT width, TEXT* buffer)
|
||||
}
|
||||
|
||||
|
||||
static void show_proc( QPR proc)
|
||||
static void show_proc( qli_proc* proc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1989,7 +1992,7 @@ static void show_proc( QPR proc)
|
||||
* with that name.
|
||||
*
|
||||
**************************************/
|
||||
NAM name = proc->qpr_name;
|
||||
const qli_name* name = proc->qpr_name;
|
||||
|
||||
qli_dbb* database = proc->qpr_database;
|
||||
if (database)
|
||||
@ -2184,7 +2187,7 @@ static void show_rels( qli_dbb* dbb, enum show_t sw, SSHORT width)
|
||||
}
|
||||
|
||||
|
||||
static USHORT show_security_class_detail( qli_dbb* database, const TEXT * name)
|
||||
static USHORT show_security_class_detail( qli_dbb* database, const TEXT* name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2544,7 +2547,7 @@ static void show_trigger_status(TEXT* name, USHORT type, USHORT status, USHORT s
|
||||
}
|
||||
|
||||
ERRQ_msg_format(msg_num, sizeof(trigger_type), trigger_type);
|
||||
msg_num = (status) ? 374 : 373;
|
||||
msg_num = status ? 374 : 373;
|
||||
ERRQ_msg_format(msg_num, sizeof(trigger_active), trigger_active);
|
||||
|
||||
fb_utils::exact_name(name);
|
||||
@ -2652,7 +2655,7 @@ static int show_triggers_detail( qli_dbb* database)
|
||||
}
|
||||
|
||||
|
||||
static void show_var( const nam* var_name)
|
||||
static void show_var( const qli_name* var_name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2664,7 +2667,7 @@ static void show_var( const nam* var_name)
|
||||
* Display a global variables.
|
||||
*
|
||||
**************************************/
|
||||
qli_fld* variable;
|
||||
const qli_fld* variable;
|
||||
|
||||
for (variable = QLI_variables; variable; variable = variable->fld_next) {
|
||||
if (!strcmp(var_name->nam_string, variable->fld_name->sym_string))
|
||||
|
Loading…
Reference in New Issue
Block a user