diff --git a/src/gpre/gpre_meta.epp b/src/gpre/gpre_meta.epp index 1d53bd0521..7d9355bf17 100644 --- a/src/gpre/gpre_meta.epp +++ b/src/gpre/gpre_meta.epp @@ -26,7 +26,7 @@ * *____________________________________________________________ * - * $Id: gpre_meta.epp,v 1.21 2003-08-28 10:33:04 brodsom Exp $ + * $Id: gpre_meta.epp,v 1.22 2003-08-30 02:12:44 brodsom Exp $ */ #include "firebird.h" @@ -177,8 +177,7 @@ BOOLEAN MET_database(DBB dbb, BOOLEAN print_version) } if (gds__attach_database - (gds_status, 0, GDS_VAL(dbb->dbb_filename), GDS_REF(DB), d - &dpb[0], - dpb)) { + (gds_status, 0, dbb->dbb_filename, &DB, d - &dpb[0], dpb)) { /* We failed to attach, try in read only mode just in case if (d == dpb) *d++ = gds_dpb_version1; @@ -186,8 +185,8 @@ BOOLEAN MET_database(DBB dbb, BOOLEAN print_version) *d++ = 1; *d++ = TRUE; if (gds__attach_database - (gds_status, 0, GDS_VAL(dbb->dbb_filename), GDS_REF(DB), d - &dpb[0], - dpb)) {*/ + (gds_status, 0, dbb->dbb_filename, &DB, d - &dpb[0], dpb)) { + */ gds__print_status(gds_status); return FALSE; //} @@ -282,9 +281,7 @@ BOOLEAN MET_database(DBB dbb, BOOLEAN print_version) /* get the base level of the engine */ - if (gds__database_info(gds_status, - GDS_REF(DB), - sizeof(db_version_info), + if (gds__database_info(gds_status, &DB, sizeof(db_version_info), db_version_info, sizeof(buffer), buffer)) { gds__print_status(gds_status); return FALSE; @@ -1491,7 +1488,7 @@ void MET_load_hash_table( DBB dbb) X.RDB$SYSTEM_FLAG = 1 post_v3_flag = TRUE; END_FOR; - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); if (!post_v3_flag) dbb->dbb_flags |= DBB_v3; @@ -1544,7 +1541,7 @@ void MET_load_hash_table( DBB dbb) END_FOR; } - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); /* Pick up all procedures (necessary to parse parts of the GDML grammar) */ @@ -1566,7 +1563,7 @@ void MET_load_hash_table( DBB dbb) END_ERROR; if (handle) - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); /* Pickup any user defined functions. If the database does not support UDF's, * this may fail @@ -1619,9 +1616,9 @@ void MET_load_hash_table( DBB dbb) } END_FOR ON_ERROR END_ERROR; - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); if (handle2) - gds__release_request(gds_status, GDS_REF(handle2)); + gds__release_request(gds_status, &handle2); /* Pick up all Collation names, might have several collations * for a given character set. @@ -1671,9 +1668,9 @@ void MET_load_hash_table( DBB dbb) /* assume pre V4 database, no collations */ END_ERROR; - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); if (handle2) - gds__release_request(gds_status, GDS_REF(handle2)); + gds__release_request(gds_status, &handle2); /* Now pick up all character set names - with the subtype set to * the type of the default collation for the character set. @@ -1719,9 +1716,9 @@ void MET_load_hash_table( DBB dbb) /* assume pre V4 database, no character sets */ END_ERROR; - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); if (handle2) - gds__release_request(gds_status, GDS_REF(handle2)); + gds__release_request(gds_status, &handle2); /* Pick up name of database default character set for SQL */ @@ -1739,7 +1736,7 @@ void MET_load_hash_table( DBB dbb) /* Assume V3 Db, no default charset */ END_ERROR; - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); /* Pick up all generators for the database */ @@ -1751,7 +1748,7 @@ void MET_load_hash_table( DBB dbb) END_FOR ON_ERROR END_ERROR; - gds__release_request(gds_status, GDS_REF(handle)); + gds__release_request(gds_status, &handle); /* now that we have attached to the database, resolve the character set * request (if any) (and if we can) @@ -2105,7 +2102,7 @@ static int resolve_charset_and_collation( /* Assume V3 DB, without default character set */ END_ERROR; - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); if (charset == NULL) charset = (UCHAR *) DEFAULT_CHARACTER_SET_NAME; @@ -2126,7 +2123,7 @@ static int resolve_charset_and_collation( END_FOR ON_ERROR END_ERROR; - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); return (found); } @@ -2141,7 +2138,7 @@ static int resolve_charset_and_collation( *id = MAP_CHARSET_TO_TTYPE(CS.RDB$CHARACTER_SET_ID); END_FOR ON_ERROR END_ERROR; - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); return (found); } @@ -2159,7 +2156,7 @@ static int resolve_charset_and_collation( *id = MAP_CHARSET_TO_TTYPE(CS.RDB$CHARACTER_SET_ID); END_FOR ON_ERROR END_ERROR; - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); return (found); } diff --git a/src/qli/eval.cpp b/src/qli/eval.cpp index c0c53143ab..acd11510a2 100644 --- a/src/qli/eval.cpp +++ b/src/qli/eval.cpp @@ -985,9 +985,7 @@ static int sleuth( QLI_NOD node, DSC * desc1, DSC * desc2, DSC * desc3) if (!(buffer = make_blob_buffer( blob, &buffer_length))) buffer = fixed_buffer; - while (!gds__get_segment(status_vector, - GDS_REF(blob), - (USHORT*) GDS_REF(l1), buffer_length, GDS_VAL(buffer))) + while (!gds__get_segment(status_vector, &blob, (USHORT*) &l1, buffer_length, buffer)) if (sleuth_check(0, (UCHAR*) buffer, (UCHAR*) (buffer + l1), (UCHAR*) control, (UCHAR*) (control + l2))) { result = TRUE; @@ -997,7 +995,7 @@ static int sleuth( QLI_NOD node, DSC * desc1, DSC * desc2, DSC * desc3) if (buffer != fixed_buffer) gds__free(buffer); - if (gds__close_blob(status_vector, GDS_REF(blob))) { + if (gds__close_blob(status_vector, &blob)) { context = (QLI_CTX) node->nod_arg[e_fld_context]; request = context->ctx_request; dbb = request->req_database; @@ -1304,11 +1302,8 @@ static int string_boolean( QLI_NOD node) if (!(buffer = make_blob_buffer( blob, &buffer_length))) buffer = fixed_buffer; - while (!gds__get_segment(status_vector, - GDS_REF(blob), - (USHORT*) GDS_REF(l1), - buffer_length, - GDS_VAL(buffer))) + while (!gds__get_segment(status_vector, &blob, (USHORT*) &l1, + buffer_length, buffer)) if (string_function(node, l1, buffer, l2, p2)) { result = TRUE; break; @@ -1317,7 +1312,7 @@ static int string_boolean( QLI_NOD node) if (buffer != fixed_buffer) gds__free(buffer); - if (gds__close_blob(status_vector, GDS_REF(blob))) { + if (gds__close_blob(status_vector, &blob)) { context = (QLI_CTX) node->nod_arg[e_fld_context]; request = context->ctx_request; dbb = request->req_database; diff --git a/src/qli/exe.cpp b/src/qli/exe.cpp index 4afef7bfd4..1306754891 100644 --- a/src/qli/exe.cpp +++ b/src/qli/exe.cpp @@ -110,8 +110,7 @@ void EXEC_abort(void) for (request = QLI_requests; request; request = request->req_next) if (request->req_handle) - gds__unwind_request(status_vector, - GDS_REF(request->req_handle), 0); + gds__unwind_request(status_vector, &request->req_handle, 0); QLI_abort = TRUE; } @@ -265,13 +264,10 @@ FRBRD *EXEC_open_blob( QLI_NOD node) bpb_length = p - bpb; - if (gds__open_blob2(status_vector, - GDS_REF(dbb->dbb_handle), - GDS_REF(dbb->dbb_transaction), - GDS_REF(blob), - (GDS_QUAD*)GDS_VAL(desc->dsc_address), - bpb_length, - (char*) bpb)) ERRQ_database_error(dbb, status_vector); + if (gds__open_blob2(status_vector, &dbb->dbb_handle, &dbb->dbb_transaction, + &blob, (GDS_QUAD*) desc->dsc_address, bpb_length, + (char*) bpb)) + ERRQ_database_error(dbb, status_vector); return blob; } @@ -315,7 +311,8 @@ struct file *EXEC_open_output(QLI_NOD node) if (file = ib_fopen(filename, FOPEN_WRITE_TYPE)) return (struct file *) file; - ERRQ_print_error(42, filename, NULL, NULL, NULL, NULL); /* Msg42 Can't open output file %s */ + ERRQ_print_error(42, filename, NULL, NULL, NULL, NULL); + /* Msg42 Can't open output file %s */ } /* Output is to a file. Setup file and fork process */ @@ -405,12 +402,9 @@ DSC *EXEC_receive(QLI_MSG message, PAR parameter) request = message->msg_request; - if (gds__receive(status_vector, - GDS_REF(request->req_handle), - message->msg_number, - message->msg_length, - GDS_VAL(message->msg_buffer), - 0)) db_error(request, status_vector); + if (gds__receive(status_vector, &request->req_handle, message->msg_number, + message->msg_length, message->msg_buffer, 0)) + db_error(request, status_vector); if (!parameter) return NULL; @@ -438,12 +432,9 @@ void EXEC_send( QLI_MSG message) request = message->msg_request; map_data(message); - if (gds__send(status_vector, - GDS_REF(request->req_handle), - message->msg_number, - message->msg_length, - GDS_VAL(message->msg_buffer), - 0)) db_error(request, status_vector); + if (gds__send(status_vector, &request->req_handle, message->msg_number, + message->msg_length, message->msg_buffer, 0)) + db_error(request, status_vector); } @@ -464,18 +455,16 @@ void EXEC_start_request( QLI_REQ request, QLI_MSG message) if (message) { map_data(message); - if (!gds__start_and_send(status_vector, - GDS_REF(request->req_handle), - GDS_REF(request->req_database-> - dbb_transaction), + if (!gds__start_and_send(status_vector, &request->req_handle, + &request->req_database-> dbb_transaction, message->msg_number, message->msg_length, - GDS_VAL(message->msg_buffer), 0)) return; + message->msg_buffer, 0)) + return; } else - if (!gds__start_request(status_vector, - GDS_REF(request->req_handle), - GDS_REF(request->req_database-> - dbb_transaction), 0)) return; + if (!gds__start_request(status_vector, &request->req_handle, + &request->req_database-> dbb_transaction, 0)) + return; db_error(request, status_vector); } @@ -720,19 +709,16 @@ static int copy_blob( QLI_NOD value, PAR parameter) *p++ = to_desc->dsc_sub_type >> 8; bpb_length = p - bpb; - if (gds__create_blob(status_vector, - GDS_REF(to_dbb->dbb_handle), - GDS_REF(to_dbb->dbb_transaction), - GDS_REF(to_blob), (GDS__QUAD*) GDS_VAL(to_desc->dsc_address))) + if (gds__create_blob(status_vector, &to_dbb->dbb_handle, + &to_dbb->dbb_transaction, &to_blob, + (GDS__QUAD*) to_desc->dsc_address)) ERRQ_database_error(to_dbb, status_vector); - if (gds__open_blob2(status_vector, - GDS_REF(from_dbb->dbb_handle), - GDS_REF(from_dbb->dbb_transaction), - GDS_REF(from_blob), - (GDS__QUAD*) GDS_VAL(from_desc->dsc_address), - bpb_length, - (char*) bpb)) ERRQ_database_error(from_dbb, status_vector); + if (gds__open_blob2(status_vector, &from_dbb->dbb_handle, + &from_dbb->dbb_transaction, &from_blob, + (GDS__QUAD*) from_desc->dsc_address, bpb_length, + (char*) bpb)) + ERRQ_database_error(from_dbb, status_vector); gds__blob_size(&from_blob, &size, &segment_count, &max_segment); @@ -750,24 +736,19 @@ static int copy_blob( QLI_NOD value, PAR parameter) } - while (!gds__get_segment(status_vector, - GDS_REF(from_blob), - GDS_REF(length), - buffer_length, - (char*) GDS_VAL(buffer))) - if (gds__put_segment(status_vector, - GDS_REF(to_blob), - length, - (char*) GDS_VAL(buffer))) + while (!gds__get_segment(status_vector, &from_blob, &length, buffer_length, + (char*) buffer)) + if (gds__put_segment(status_vector, &to_blob, length, + (char*) buffer)) ERRQ_database_error(to_dbb, status_vector); if (buffer != fixed_buffer) gds__free(buffer); - if (gds__close_blob(status_vector, GDS_REF(from_blob))) + if (gds__close_blob(status_vector, &from_blob)) ERRQ_database_error(from_dbb, status_vector); - if (gds__close_blob(status_vector, GDS_REF(to_blob))) + if (gds__close_blob(status_vector, &to_blob)) ERRQ_database_error(to_dbb, status_vector); return TRUE; @@ -813,7 +794,8 @@ static void execute_abort( QLI_NOD node) MOVQ_get_string(EVAL_value(node->nod_arg[0]), (TEXT**) &ptr, (VARY*) temp, sizeof(temp)); MOVQ_terminate((SCHAR*) ptr, (SCHAR*) msg, l, sizeof(msg)); - ERRQ_error(40, (TEXT*) msg, NULL, NULL, NULL, NULL); /* Msg40 Request terminated by statement: %s */ + ERRQ_error(40, (TEXT*) msg, NULL, NULL, NULL, NULL); + /* Msg40 Request terminated by statement: %s */ } IBERROR(41); /* Msg41 Request terminated by statement */ @@ -1103,11 +1085,9 @@ static void map_data( QLI_MSG message) desc = ¶meter->par_desc; desc->dsc_address = message->msg_buffer + parameter->par_offset; if (missing_parameter = parameter->par_missing) { - missing_flag = - (USHORT *) (message->msg_buffer + + missing_flag = (USHORT *) (message->msg_buffer + missing_parameter->par_offset); - *missing_flag = - (desc->dsc_missing & DSC_missing) ? DSC_missing : 0; + *missing_flag = (desc->dsc_missing & DSC_missing) ? DSC_missing : 0; } from = parameter->par_value; @@ -1137,12 +1117,10 @@ static void print_counts( QLI_REQ request) ISC_STATUS_ARRAY status_vector; SCHAR count_buffer[COUNT_ITEMS * 7 + 1], *c; - if (gds__request_info(status_vector, - GDS_REF(request->req_handle), - 0, - sizeof(count_info), - count_info, - sizeof(count_buffer), count_buffer)) return; + if (gds__request_info(status_vector, &request->req_handle, 0, + sizeof(count_info), count_info, + sizeof(count_buffer), count_buffer)) + return; /* print out the counts of any records affected */ @@ -1229,13 +1207,11 @@ static void transaction_state( QLI_NOD node, DBB database) if (database->dbb_transaction) { if (node->nod_type == nod_commit_retaining) { - if (gds__commit_retaining(status, - GDS_REF(database->dbb_transaction))) + if (gds__commit_retaining(status, &database->dbb_transaction)) ERRQ_database_error(database, status); } else if (node->nod_type == nod_prepare) { - if (gds__prepare_transaction(status, - GDS_REF(database->dbb_transaction))) + if (gds__prepare_transaction(status, &database->dbb_transaction)) ERRQ_database_error(database, status); } } diff --git a/src/qli/format.cpp b/src/qli/format.cpp index 31bed7b086..5c8a481b4a 100644 --- a/src/qli/format.cpp +++ b/src/qli/format.cpp @@ -271,7 +271,7 @@ TEXT *FMT_format(LLS stack) size = (max_offset + 1) * (number_segments + 1) + 2; if (size >= 60000) - ERRQ_print_error(482, (TEXT *) max_offset, + ERRQ_print_error(482, (TEXT *)(ULONG) max_offset, (TEXT *) (number_segments + 1), NULL, NULL, NULL); header = (STR) ALLOCDV(type_str, size); @@ -560,7 +560,7 @@ void FMT_print( QLI_NOD list, PRT print) for (ptr = list->nod_arg; ptr < end; ptr++) { item = (ITM) * ptr; if (item->itm_dtype == dtype_blob && item->itm_stream) - gds__close_blob(status_vector, GDS_REF(item->itm_stream)); + gds__close_blob(status_vector, &item->itm_stream); } } @@ -1291,12 +1291,10 @@ static int print_line( ITM item, TEXT ** ptr) l = item->itm_print_length; - if ((status = gds__get_segment(status_vector, - GDS_REF(item->itm_stream), - GDS_REF(length), - l, GDS_VAL(p))) && status != gds_segment) { + if ((status = gds__get_segment(status_vector, &item->itm_stream, &length, + l, p)) && status != gds_segment) { long *null_status = 0; - gds__close_blob(null_status, GDS_REF(item->itm_stream)); + gds__close_blob(null_status, &item->itm_stream); if (status != gds_segstr_eof) ERRQ_database_error(0, status_vector); return EOF; diff --git a/src/qli/gener.cpp b/src/qli/gener.cpp index 3f199ac579..003c68ca2c 100644 --- a/src/qli/gener.cpp +++ b/src/qli/gener.cpp @@ -21,7 +21,7 @@ * Contributor(s): ______________________________________. */ /* -$Id: gener.cpp,v 1.17 2003-04-16 10:18:17 aafemt Exp $ +$Id: gener.cpp,v 1.18 2003-08-30 02:11:08 brodsom Exp $ */ #include "firebird.h" @@ -111,8 +111,7 @@ void GEN_release(void) for (; QLI_requests; QLI_requests = QLI_requests->req_next) { if (QLI_requests->req_handle) - gds__release_request(status_vector, - GDS_REF(QLI_requests->req_handle)); + gds__release_request(status_vector, &QLI_requests->req_handle); rlb = QLI_requests->req_blr; RELEASE_RLB; @@ -613,23 +612,19 @@ static void gen_compile( QLI_REQ request) dbb = request->req_database; - if (gds__compile_request(status_vector, - GDS_REF(dbb->dbb_handle), - GDS_REF(request->req_handle), - length, (char*) GDS_VAL(rlb->rlb_base))) { + if (gds__compile_request(status_vector, &dbb->dbb_handle, + &request->req_handle, length, + (char*) rlb->rlb_base)) { RELEASE_RLB; ERRQ_database_error(dbb, status_vector); } #ifdef DEV_BUILD if (QLI_explain && - !gds__request_info(status_vector, - GDS_REF(request->req_handle), - 0, - sizeof(explain_info), - explain_info, - sizeof(explain_buffer), - explain_buffer)) explain((UCHAR*) explain_buffer); + !gds__request_info(status_vector, &request->req_handle, 0, + sizeof(explain_info), explain_info, + sizeof(explain_buffer), explain_buffer)) + explain((UCHAR*) explain_buffer); #endif RELEASE_RLB; diff --git a/src/qli/lex.cpp b/src/qli/lex.cpp index 5610da88ea..a9a94a25a2 100644 --- a/src/qli/lex.cpp +++ b/src/qli/lex.cpp @@ -770,7 +770,7 @@ void LEX_put_procedure( FRBRD *blob, SLONG start, SLONG stop) } } if (l = p - buffer) - if (gds__put_segment(status_vector, GDS_REF(blob), l, buffer)) + if (gds__put_segment(status_vector, &blob, l, buffer)) BUGCHECK(58); /* Msg 58 gds__put_segment failed */ } diff --git a/src/qli/meta.epp b/src/qli/meta.epp index 2bf1b430af..8172d8b83e 100644 --- a/src/qli/meta.epp +++ b/src/qli/meta.epp @@ -554,12 +554,8 @@ void MET_delete_database( DBB dbb) if (dpb_length == 1) dpb_length = 0; - if (gds__attach_database(status_vector, - 0, - GDS_VAL(dbb->dbb_filename), - GDS_REF(dbb->dbb_handle), - dpb_length, - (char*) GDS_VAL(dpb))) + if (gds__attach_database(status_vector, 0, dbb->dbb_filename, + &dbb->dbb_handle, dpb_length, (char*) dpb)) ERRQ_database_error(dbb, status_vector); log_stack = stack = NULL; @@ -578,13 +574,10 @@ void MET_delete_database( DBB dbb) /* Get write ahead log information */ - if (gds__database_info(status_vector, - GDS_REF(DB), - sizeof(db_log_info), - (char*) db_log_info, - sizeof(db_info_buffer), - db_info_buffer)) ERRQ_database_error(dbb, - status_vector); + if (gds__database_info(status_vector, &DB, sizeof(db_log_info), + (char*) db_log_info, sizeof(db_info_buffer), + db_info_buffer)) + ERRQ_database_error(dbb, status_vector); /* extract info from buffer */ @@ -595,7 +588,7 @@ void MET_delete_database( DBB dbb) MET_transaction(nod_commit, dbb); - if (gds__detach_database(gds_status, GDS_REF(dbb->dbb_handle))) + if (gds__detach_database(gds_status, &dbb->dbb_handle)) gds__print_status(gds_status); for (database = QLI_databases; database; database = next) { @@ -1070,7 +1063,7 @@ void MET_index_info( END_ERROR; if (request_handle) - if (gds__release_request(gds_status, GDS_REF(request_handle))) + if (gds__release_request(gds_status, &request_handle)) ERRQ_database_error(NULL, gds_status); /* back up over the last space and finish off */ @@ -1098,8 +1091,7 @@ void MET_meta_commit( DBB database) ISC_STATUS_ARRAY status_vector; if (database->dbb_capabilities & DBB_cap_multi_trans) - if (gds__commit_transaction(status_vector, - GDS_REF(database->dbb_meta_trans))) { + if (gds__commit_transaction(status_vector, &database->dbb_meta_trans)) { rollback_update(database); ERRQ_database_error(database, status_vector); } @@ -1166,12 +1158,8 @@ FRBRD *MET_meta_transaction(DBB database, int update_flag) ((database->dbb_capabilities & DBB_cap_multi_trans) || !(database->dbb_capabilities & DBB_cap_single_trans))) { - if (gds__start_transaction(status_vector, - GDS_REF(transaction), - 1, - GDS_REF(database->dbb_handle), - sizeof(tpb), - tpb)) + if (gds__start_transaction(status_vector, &transaction, 1, + &database->dbb_handle, sizeof(tpb), tpb)) { database->dbb_capabilities |= DBB_cap_single_trans; } @@ -1535,17 +1523,11 @@ void MET_ready( SYN node, USHORT create_flag) for (ptr = node->syn_arg; ptr < end; ptr++) { dbb = (DBB) * ptr; if (create_flag) - gds__create_database(status_vector, - 0, - GDS_VAL(dbb->dbb_filename), - GDS_REF(dbb->dbb_handle), - dpb_length, (char*) GDS_VAL(dpb), 0); + gds__create_database(status_vector, 0, dbb->dbb_filename, + &dbb->dbb_handle, dpb_length, (char*) dpb, 0); else - gds__attach_database(status_vector, - 0, - GDS_VAL(dbb->dbb_filename), - GDS_REF(dbb->dbb_handle), - dpb_length, (char*) GDS_VAL(dpb)); + gds__attach_database(status_vector, 0, dbb->dbb_filename, + &dbb->dbb_handle, dpb_length, (char*) dpb); if (status_vector[1]) break; } @@ -1745,26 +1727,20 @@ FRBRD *MET_transaction( NOD_T node_type, DBB database) switch (node_type) { case nod_commit: - gds__commit_transaction(status_vector, - GDS_REF(database->dbb_transaction)); + gds__commit_transaction(status_vector, &database->dbb_transaction); break; case nod_rollback: - gds__rollback_transaction(status_vector, - GDS_REF(database->dbb_transaction)); + gds__rollback_transaction(status_vector, &database->dbb_transaction); break; case nod_prepare: - gds__prepare_transaction(status_vector, - GDS_REF(database->dbb_transaction)); + gds__prepare_transaction(status_vector, &database->dbb_transaction); break; case nod_start_trans: - gds__start_transaction(status_vector, - GDS_REF(database->dbb_transaction), - 1, - GDS_REF(database->dbb_handle), - sizeof(tpb), tpb); + gds__start_transaction(status_vector, &database->dbb_transaction, 1, + &database->dbb_handle, sizeof(tpb), tpb); database->dbb_flags &= ~DBB_updates & ~DBB_prepared; break; } @@ -1962,10 +1938,8 @@ static int blob_copy( RLB rlb, QLI_REL source, SLONG * source_blob_id) DB = source_dbb->dbb_handle; source_blob = NULL; - if (gds__open_blob(status_vector, - GDS_REF(DB), - GDS_REF(source_dbb->dbb_meta_trans), - GDS_REF(source_blob), (GDS__QUAD*) GDS_VAL(source_blob_id))) { + if (gds__open_blob(status_vector, &DB, &source_dbb->dbb_meta_trans, + &source_blob, (GDS__QUAD*) source_blob_id)) { rollback_update((DBB) DB); ERRQ_database_error(source_dbb, status_vector); } @@ -1983,10 +1957,8 @@ static int blob_copy( RLB rlb, QLI_REL source, SLONG * source_blob_id) STUFF_WORD((USHORT) size); - while (!gds__get_segment(status_vector, - GDS_REF(source_blob), - GDS_REF(length), - buffer_length, GDS_VAL(buffer))) { + while (!gds__get_segment(status_vector, &source_blob, &length, + buffer_length, buffer)) { while (rlb->rlb_limit - rlb->rlb_data < length) rlb = GEN_rlb_extend(rlb); p = buffer; @@ -2004,7 +1976,7 @@ static int blob_copy( RLB rlb, QLI_REL source, SLONG * source_blob_id) if (buffer != fixed_buffer) gds__free(buffer); - if (gds__close_blob(status_vector, GDS_REF(source_blob))) { + if (gds__close_blob(status_vector, &source_blob)) { rollback_update((DBB) DB); ERRQ_database_error(source_dbb, status_vector); } @@ -2368,10 +2340,10 @@ static int clone_fields( QLI_REL target, QLI_REL source) execute_dynamic_ddl(target->rel_database, rlb); if (req1) - if (gds__release_request(gds_status, GDS_REF(req1))) + if (gds__release_request(gds_status, &req1)) ERRQ_database_error(source->rel_database, gds_status); if (req2) - if (gds__release_request(gds_status, GDS_REF(req2))) + if (gds__release_request(gds_status, &req2)) ERRQ_database_error(source->rel_database, gds_status); return TRUE; } @@ -2594,13 +2566,13 @@ static int clone_global_fields( QLI_REL target, QLI_REL source) } if (req1) - if (gds__release_request(gds_status, GDS_REF(req1))) + if (gds__release_request(gds_status, &req1)) ERRQ_database_error(source->rel_database, gds_status); if (req2) - if (gds__release_request(gds_status, GDS_REF(req2))) + if (gds__release_request(gds_status, &req2)) ERRQ_database_error(target->rel_database, gds_status); if (req3) - if (gds__release_request(gds_status, GDS_REF(req3))) + if (gds__release_request(gds_status, &req3)) ERRQ_database_error(source->rel_database, gds_status); return TRUE; } @@ -2708,21 +2680,18 @@ static ISC_STATUS detach( ISC_STATUS * status_vector, DBB dbb) status = status_vector; if (dbb->dbb_transaction) - if (gds__commit_transaction(GDS_VAL(status), - GDS_REF(dbb->dbb_transaction))) + if (gds__commit_transaction(status, &dbb->dbb_transaction)) status = alt_vector; if (dbb->dbb_proc_trans && (dbb->dbb_capabilities & DBB_cap_multi_trans)) - if (gds__commit_transaction(GDS_VAL(status), - GDS_REF(dbb->dbb_proc_trans))) + if (gds__commit_transaction(status, &dbb->dbb_proc_trans)) status = alt_vector; if (dbb->dbb_meta_trans && (dbb->dbb_capabilities & DBB_cap_multi_trans)) - if (gds__commit_transaction(GDS_VAL(status), - GDS_REF(dbb->dbb_meta_trans))) + if (gds__commit_transaction(status, &dbb->dbb_meta_trans)) status = alt_vector; - gds__detach_database(GDS_VAL(status), GDS_REF(dbb->dbb_handle)); + gds__detach_database(status, &dbb->dbb_handle); return status_vector[1]; } @@ -2747,10 +2716,8 @@ static int execute_dynamic_ddl( DBB database, RLB rlb) if (QLI_blr) PRETTY_print_dyn((SCHAR*) rlb->rlb_base, (FPTR_INT) ib_printf, "%4d %s\n", 0); - if (gds__ddl(gds_status, - GDS_REF(database->dbb_handle), - GDS_REF(database->dbb_meta_trans), - length, (char*) GDS_VAL(rlb->rlb_base))) { + if (gds__ddl(gds_status, &database->dbb_handle, &database->dbb_meta_trans, + length, (char*) rlb->rlb_base)) { rollback_update(database); ERRQ_database_error(database, gds_status); } @@ -2815,9 +2782,8 @@ static void get_database_type( DBB new_dbb) USHORT l; UCHAR item, buffer[1024], *p, *q; - gds__database_info(status_vector, - GDS_REF(new_dbb->dbb_handle), - sizeof(db_info), (char*) db_info, sizeof(buffer), (char*) buffer); + gds__database_info(status_vector, &new_dbb->dbb_handle, sizeof(db_info), + (char*) db_info, sizeof(buffer), (char*) buffer); if (status_vector[1]) ERRQ_database_error(new_dbb, gds_status); @@ -2997,17 +2963,15 @@ static TEXT *get_query_header( DBB database, SLONG blob_id[2]) blob = NULL; - if (gds__open_blob(status_vector, - GDS_REF(database->dbb_handle), - GDS_REF(gds_trans), GDS_REF(blob), (GDS__QUAD*) GDS_VAL(blob_id))) + if (gds__open_blob(status_vector, &database->dbb_handle, + &gds_trans, &blob, (GDS__QUAD*) blob_id)) ERRQ_database_error(database, status_vector); p = header; for (;;) { - status = gds__get_segment(status_vector, - GDS_REF(blob), - GDS_REF(length), sizeof(buffer), buffer); + status = gds__get_segment(status_vector, &blob, &length, + sizeof(buffer), buffer); if (status && status != gds_segment) break; if (length && buffer[length - 1] == '\n') @@ -3026,7 +2990,7 @@ static TEXT *get_query_header( DBB database, SLONG blob_id[2]) } } - if (gds__close_blob(status_vector, GDS_REF(blob))) + if (gds__close_blob(status_vector, &blob)) ERRQ_database_error(database, gds_status); *p = 0; @@ -3131,7 +3095,7 @@ static void install( DBB old_dbb) END_ERROR; if (request) - if (gds__release_request(gds_status, GDS_REF(request))) + if (gds__release_request(gds_status, &request)) ERRQ_database_error(new_dbb, gds_status); /* Pick up functions, if appropriate */ @@ -3180,10 +3144,10 @@ static void install( DBB old_dbb) ERRQ_database_error(new_dbb, gds_status); END_ERROR; if (request) - if (gds__release_request(gds_status, GDS_REF(request))) + if (gds__release_request(gds_status, &request)) ERRQ_database_error(new_dbb, gds_status); if (request2) - if (gds__release_request(gds_status, GDS_REF(request2))) + if (gds__release_request(gds_status, &request2)) ERRQ_database_error(new_dbb, gds_status); } } @@ -3581,23 +3545,22 @@ static SYN parse_blr_blob( SLONG * blob_id, SYM symbol) handle = NULL; - if (gds__open_blob(status_vector, - GDS_REF(DB), - GDS_REF(gds_trans), - GDS_REF(handle), (GDS__QUAD*) GDS_VAL(blob_id))) return NULL; + if (gds__open_blob(status_vector, &DB, &gds_trans, &handle, + (GDS__QUAD*) blob_id)) + return NULL; ptr = buffer; for (;;) { if (!(length = buffer + sizeof(buffer) - ptr)) break; - if (gds__get_segment(status_vector, - GDS_REF(handle), - GDS_REF(length), length, (char*) GDS_VAL(ptr))) break; + if (gds__get_segment(status_vector, &handle, &length, length, + (char*) ptr)) + break; ptr += length; } - if (gds__close_blob(status_vector, GDS_REF(handle))) + if (gds__close_blob(status_vector, &handle)) return NULL; if (ptr == buffer) @@ -3702,8 +3665,7 @@ static void rollback_update( DBB database) if (gds_trans == database->dbb_meta_trans && (database->dbb_capabilities & DBB_cap_multi_trans)) - gds__rollback_transaction(alt_vector, - GDS_REF(database->dbb_meta_trans)); + gds__rollback_transaction(alt_vector, &database->dbb_meta_trans); /* Note: No message given if rollback fails */ gds_trans = NULL; @@ -3748,7 +3710,7 @@ static void set_capabilities( DBB database) } if (req) - if (gds__release_request(gds_status, GDS_REF(req))) + if (gds__release_request(gds_status, &req)) ERRQ_database_error(database, gds_status); } diff --git a/src/qli/proc.epp b/src/qli/proc.epp index cdcfe48c01..3faccced79 100644 --- a/src/qli/proc.epp +++ b/src/qli/proc.epp @@ -76,7 +76,7 @@ void PRO_close( DBB database, FRBRD *blob) **************************************/ ISC_STATUS_ARRAY status_vector; - if (database && gds__close_blob(status_vector, GDS_REF(blob))) + if (database && gds__close_blob(status_vector, &blob)) ERRQ_database_error(database, status_vector); } @@ -97,8 +97,7 @@ void PRO_commit( DBB database) if ((database->dbb_capabilities & DBB_cap_multi_trans) && !(LEX_active_procedure())) - if (gds__commit_transaction(status_vector, - GDS_REF(database->dbb_proc_trans))) { + if (gds__commit_transaction(status_vector, &database->dbb_proc_trans)) { PRO_rollback(database); ERRQ_database_error(database, status_vector); } @@ -165,21 +164,14 @@ void PRO_copy_procedure( NEW IN DB1.QLI$PROCEDURES USING strcpy(NEW.QLI$PROCEDURE_NAME, new_name); - if (gds__create_blob2(status_vector, - GDS_REF(new_database->dbb_handle), - GDS_REF(new_database->dbb_proc_trans), - GDS_REF(new_blob), - GDS_REF(NEW.QLI$PROCEDURE), - bpb_length, - (char*) bpb)) + if (gds__create_blob2(status_vector, &new_database->dbb_handle, + &new_database->dbb_proc_trans, &new_blob, + &NEW.QLI$PROCEDURE, bpb_length, (char*) bpb)) ERRQ_database_error(new_database, status_vector); - while (!(gds__get_segment(status_vector, - GDS_REF(old_blob), - (USHORT*) GDS_REF(length), - sizeof(buffer), GDS_VAL(buffer)))) { + while (!(gds__get_segment(status_vector, &old_blob, (USHORT*) &length, + sizeof(buffer), buffer))) { buffer[length] = 0; - if (gds__put_segment(status_vector, GDS_REF(new_blob), - length, buffer)) + if (gds__put_segment(status_vector, &new_blob, length, buffer)) ERRQ_database_error(new_database, status_vector); } PRO_close(old_database, old_blob); @@ -187,7 +179,7 @@ void PRO_copy_procedure( END_STORE; /* Release the FOR and STORE requests */ - gds__release_request(gds_status, GDS_REF(store_request)); + gds__release_request(gds_status, &store_request); PRO_commit(new_database); } @@ -231,13 +223,8 @@ void PRO_create( DBB database, TEXT * name) STORE(REQUEST_HANDLE database->dbb_store_blob) X IN DB.QLI$PROCEDURES gds__vtof(name, X.QLI$PROCEDURE_NAME, sizeof(X.QLI$PROCEDURE_NAME)); - if (gds__create_blob2(status_vector, - GDS_REF(database->dbb_handle), - GDS_REF(gds_trans), - GDS_REF(blob), - GDS_REF(X.QLI$PROCEDURE), - bpb_length, - (char*) bpb)) + if (gds__create_blob2(status_vector, &database->dbb_handle, &gds_trans, + &blob, &X.QLI$PROCEDURE, bpb_length, (char*) bpb)) ERRQ_database_error(database, status_vector); while (!MATCH(KW_END_PROCEDURE)) { if (QLI_token->tok_type == tok_eof) @@ -248,7 +235,7 @@ void PRO_create( DBB database, TEXT * name) } LEX_put_procedure(blob, start, stop); - gds__close_blob(status_vector, GDS_REF(blob)); + gds__close_blob(status_vector, &blob); END_STORE; /* Commit the procedure transaction, if there is one */ @@ -283,7 +270,7 @@ int PRO_delete_procedure( DBB database, TEXT * name) count++; END_FOR; - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); /* Commit the procedure transaction, if there is one */ @@ -381,7 +368,7 @@ int PRO_get_line( FRBRD *blob, TEXT * buffer, USHORT size) USHORT length; gds__get_segment(status_vector, - GDS_REF(blob), GDS_REF(length), size, GDS_VAL(buffer)); + &blob, &length, size, buffer); if (status_vector[1] && status_vector[1] != gds_segment) return FALSE; @@ -458,13 +445,10 @@ FRBRD *PRO_open_blob( DBB database, SLONG * blob_id) bpb_length = p - bpb; - if (gds__open_blob2(status_vector, - GDS_REF(database->dbb_handle), - GDS_REF(database->dbb_proc_trans), - GDS_REF(blob), - (GDS__QUAD*) GDS_VAL(blob_id), - bpb_length, - (char*) bpb)) ERRQ_database_error(database, status_vector); + if (gds__open_blob2(status_vector, &database->dbb_handle, + &database->dbb_proc_trans, &blob, (GDS__QUAD*) blob_id, + bpb_length, (char*) bpb)) + ERRQ_database_error(database, status_vector); return blob; } @@ -498,12 +482,12 @@ int PRO_rename_procedure( DBB database, TEXT * old_name, TEXT * new_name) gds__vtof(new_name, X.QLI$PROCEDURE_NAME, sizeof(X.QLI$PROCEDURE_NAME)); END_MODIFY ON_ERROR - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); ERRQ_database_error(database, status_vector); END_ERROR; END_FOR; - gds__release_request(gds_status, GDS_REF(request)); + gds__release_request(gds_status, &request); /* Commit the procedure transaction, if there is one */ @@ -529,8 +513,7 @@ void PRO_rollback( DBB database) ISC_STATUS_ARRAY status_vector; if (database->dbb_capabilities & DBB_cap_multi_trans) { - gds__rollback_transaction(status_vector, - GDS_REF(database->dbb_proc_trans)); + gds__rollback_transaction(status_vector, &database->dbb_proc_trans); gds_trans = NULL; } @@ -642,12 +625,8 @@ FRBRD *PRO_transaction( DBB database, int update_flag) if (!transaction && ((database->dbb_capabilities & DBB_cap_multi_trans) || !(database->dbb_capabilities & DBB_cap_single_trans))) - if (gds__start_transaction(status_vector, - GDS_REF(transaction), - 1, - GDS_REF(database->dbb_handle), - sizeof(tpb), - tpb)) + if (gds__start_transaction(status_vector, &transaction, 1, + &database->dbb_handle, sizeof(tpb), tpb)) database->dbb_capabilities |= DBB_cap_single_trans; else database->dbb_capabilities |= DBB_cap_multi_trans; @@ -710,10 +689,10 @@ static int clear_out_qli_procedures( DBB dbb) count++; END_FOR ON_ERROR - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); ERRQ_database_error(dbb, gds_status); END_ERROR; - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); if (count >= 2) { dbb->dbb_flags |= DBB_procedures; @@ -727,20 +706,20 @@ static int clear_out_qli_procedures( DBB dbb) count++; END_FOR ON_ERROR - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); ERRQ_database_error(dbb, gds_status); END_ERROR; - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); FOR(REQUEST_HANDLE req) X IN DB.RDB$INDEX_SEGMENTS WITH X.RDB$INDEX_NAME = "QLI$PROCEDURES_IDX1" ERASE X; count++; END_FOR ON_ERROR - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); ERRQ_database_error(dbb, gds_status); END_ERROR; - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); FOR(REQUEST_HANDLE req) X IN DB.RDB$RELATION_FIELDS WITH X.RDB$FIELD_NAME = "QLI$PROCEDURE_NAME" OR @@ -749,10 +728,10 @@ static int clear_out_qli_procedures( DBB dbb) count++; END_FOR ON_ERROR - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); ERRQ_database_error(dbb, gds_status); END_ERROR; - gds__release_request(gds_status, GDS_REF(req)); + gds__release_request(gds_status, &req); FOR(REQUEST_HANDLE req) X IN DB.RDB$FIELDS WITH X.RDB$FIELD_NAME = "QLI$PROCEDURE_NAME" OR @@ -761,10 +740,10 @@ static int clear_out_qli_procedures( DBB dbb) count++; END_FOR ON_ERROR - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); ERRQ_database_error(dbb, gds_status); END_ERROR; - gds__release_request(gds_status, GDS_REF(req)); + gds__release_request(gds_status, &req); FOR(REQUEST_HANDLE req) X IN DB.RDB$RELATIONS WITH X.RDB$RELATION_NAME = "QLI$PROCEDURES" @@ -772,10 +751,10 @@ static int clear_out_qli_procedures( DBB dbb) count++; END_FOR ON_ERROR - gds__release_request(status_vector, GDS_REF(req)); + gds__release_request(status_vector, &req); ERRQ_database_error(dbb, gds_status); END_ERROR; - gds__release_request(gds_status, GDS_REF(req)); + gds__release_request(gds_status, &req); return count; } @@ -807,33 +786,29 @@ static void create_qli_procedures( DBB dbb) if (dbb->dbb_flags & DBB_procedures) return; - if (gds__ddl(gds_status, - GDS_REF(DB), - GDS_REF(gds_trans), sizeof(dyn_gdl1), (char*) dyn_gdl1)) { + if (gds__ddl(gds_status, &DB, &gds_trans, sizeof(dyn_gdl1), + (char*) dyn_gdl1)) { PRO_rollback(dbb); IBERROR(73); /* Msg 73 Could not create QLI$PROCEDURE_NAME field */ } - if (gds__ddl(gds_status, - GDS_REF(DB), - GDS_REF(gds_trans), sizeof(dyn_gdl2), (char*) dyn_gdl2)) { + if (gds__ddl(gds_status, &DB, &gds_trans, sizeof(dyn_gdl2), + (char*) dyn_gdl2)) { PRO_rollback(dbb); IBERROR(74); /* Msg 74 Could not create QLI$PROCEDURE field */ } - if (gds__ddl(gds_status, - GDS_REF(DB), - GDS_REF(gds_trans), sizeof(dyn_gdl3), (char*) dyn_gdl3)) { + if (gds__ddl(gds_status, &DB, &gds_trans, sizeof(dyn_gdl3), + (char*) dyn_gdl3)) { PRO_rollback(dbb); IBERROR(75); /* Msg 75 Could not create QLI$PROCEDURES relation */ } - if (gds__ddl(gds_status, - GDS_REF(DB), - GDS_REF(gds_trans), sizeof(dyn_gdl4), (char*) dyn_gdl4)) { + if (gds__ddl(gds_status, &DB, &gds_trans, sizeof(dyn_gdl4), + (char*) dyn_gdl4)) { PRO_rollback(dbb); IBERROR(409); /* msg 409 Could not create QLI$PROCEDURES index */ @@ -864,7 +839,7 @@ static void probe( DBB database, TEXT * name) /* Probe to see if procedure is already in use */ if (blob = PRO_fetch_procedure(database, name)) { - gds__close_blob(status_vector, GDS_REF(blob)); + gds__close_blob(status_vector, &blob); ERRQ_print_error(76, name, database->dbb_symbol->sym_string, NULL, NULL, NULL); /* Msg 76 procedure name \"%s\" in use in database %s */