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

-Remove GDS_VAL and GDS_REF

-BOOLEAN Cleaning
-Fix tab indent in restore and backup
This commit is contained in:
brodsom 2003-09-12 23:25:16 +00:00
parent 1884cba12f
commit ba7b5fdcf9
4 changed files with 6258 additions and 6271 deletions

View File

@ -37,7 +37,7 @@
*/
/*
$Id: backup.epp,v 1.36 2003-09-12 09:04:37 robocop Exp $
$Id: backup.epp,v 1.37 2003-09-12 23:25:16 brodsom Exp $
*/
#include "firebird.h"
@ -289,17 +289,12 @@ int BACKUP_backup(TEXT* dbb_file, const TEXT* file_name)
if (tdgbl->gbl_sw_ignore_limbo)
{
if (isc_start_transaction(status_vector,
GDS_REF(isc_trans),
1,
GDS_REF(tdgbl->db_handle),
sizeof(limbo_nau_tpb),
if (isc_start_transaction(status_vector, &isc_trans, 1,
&tdgbl->db_handle, sizeof(limbo_nau_tpb),
limbo_nau_tpb))
{
isc_start_transaction(status_vector,
GDS_REF(isc_trans),
1,
GDS_REF(tdgbl->db_handle),
isc_start_transaction(status_vector, &isc_trans, 1,
&tdgbl->db_handle,
sizeof(limbo_tpb), limbo_tpb);
}
}
@ -427,12 +422,12 @@ int BACKUP_backup(TEXT* dbb_file, const TEXT* file_name)
put(tdgbl, (UCHAR) (att_end));
if (!(relation->rel_flags & REL_view) &&
!(relation->rel_flags & REL_external)) {
!(relation->rel_flags & REL_external))
{
put_index(relation);
if (!tdgbl->gbl_sw_meta) {
if (!tdgbl->gbl_sw_meta)
put_data(relation);
}
}
put(tdgbl, (UCHAR) (rec_relation_end));
@ -1018,43 +1013,42 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len)
SSHORT blr_length = blr - blr_buffer;
if (isc_compile_request(status_vector,
GDS_REF(tdgbl->db_handle),
GDS_REF(gen_id_reqh),
blr_length, (char*) GDS_VAL(blr_buffer)))
if (isc_compile_request(status_vector, &tdgbl->db_handle, &gen_id_reqh,
blr_length, (char*) blr_buffer))
{
/* if there's no gen_id, never mind ... */
return 0;
}
if (isc_start_request(status_vector, GDS_REF(gen_id_reqh), GDS_REF(isc_trans), /* use the same one generated by gpre */
if (isc_start_request(status_vector, &gen_id_reqh,
&isc_trans, /* use the same one generated by gpre */
0))
{
BURP_error_redirect(status_vector, 25, NULL, NULL);
/* msg 25 Failed in put_blr_gen_id */
}
if (tdgbl->BCK_capabilities & BCK_ods10)
{
if (isc_receive(status_vector,
GDS_REF(gen_id_reqh),
0,
sizeof(read_msg1),
GDS_REF(read_msg1),
0))
if (isc_receive(status_vector, &gen_id_reqh, 0, sizeof(read_msg1),
&read_msg1, 0))
{
BURP_error_redirect(status_vector, 25, NULL, NULL);
/* msg 25 Failed in put_blr_gen_id */
}
}
else
{
if (isc_receive(status_vector,
GDS_REF(gen_id_reqh),
0,
sizeof(read_msg0),
GDS_REF(read_msg0),
0))
if (isc_receive(status_vector, &gen_id_reqh, 0, sizeof(read_msg0),
&read_msg0, 0))
{
BURP_error_redirect(status_vector, 25, NULL, NULL);
/* msg 25 Failed in put_blr_gen_id */
}
read_msg1 = (SINT64) read_msg0;
}
isc_release_request(status_vector, GDS_REF(gen_id_reqh));
isc_release_request(status_vector, &gen_id_reqh);
return read_msg1;
}
@ -1149,7 +1143,9 @@ void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
field->fld_type == blr_long ||
field->fld_type == blr_quad ||
field->fld_type == blr_int64)
{
STUFF(field->fld_scale);
}
if (field->fld_type == blr_text || field->fld_type == blr_varying)
STUFF_WORD(field->fld_length);
@ -1216,13 +1212,11 @@ void put_array( BURP_FLD field, BURP_REL relation, ISC_QUAD * blob_id)
}
ULONG return_length = 0;
if (isc_get_slice(status_vector,
GDS_REF(tdgbl->db_handle), GDS_REF(isc_trans),
GDS_VAL(blob_id), blr_length, (char*) blr_buffer,
if (isc_get_slice(status_vector, &tdgbl->db_handle, &isc_trans, blob_id,
blr_length, (char*) blr_buffer,
0, // param length for subset of an array handling
NULL, // param for subset of an array handling
slice_length, GDS_VAL(slice),
(SLONG*) GDS_REF(return_length)))
slice_length, slice, (SLONG*) &return_length))
{
BURP_print(81, field->fld_name, NULL, NULL, NULL, NULL);
/* msg 81 error accessing blob field %s -- continuing */
@ -1362,11 +1356,8 @@ void put_blob( BURP_FLD field, ISC_QUAD * blob_id, ULONG count)
FRBRD *blob = NULL;
if (isc_open_blob(status_vector,
GDS_REF(tdgbl->db_handle),
GDS_REF(isc_trans),
GDS_REF(blob),
GDS_VAL(blob_id)))
if (isc_open_blob(status_vector, &tdgbl->db_handle, &isc_trans, &blob,
blob_id))
{
BURP_print(81, field->fld_name, NULL, NULL, NULL, NULL);
/* msg 81 error accessing blob field %s -- continuing */
@ -1374,11 +1365,8 @@ void put_blob( BURP_FLD field, ISC_QUAD * blob_id, ULONG count)
return;
}
if (isc_blob_info(status_vector,
GDS_REF(blob),
sizeof(blob_items),
(SCHAR *) blob_items,
sizeof(blob_info),
if (isc_blob_info(status_vector, &blob, sizeof(blob_items),
(SCHAR *) blob_items, sizeof(blob_info),
(char*) blob_info))
{
BURP_error_redirect(status_vector, 20, NULL, NULL);
@ -1434,11 +1422,8 @@ void put_blob( BURP_FLD field, ISC_QUAD * blob_id, ULONG count)
while (segments > 0)
{
USHORT segment_length;
if (isc_get_segment(status_vector,
GDS_REF(blob),
GDS_REF(segment_length),
max_segment,
(char*) GDS_VAL(buffer)))
if (isc_get_segment(status_vector, &blob, &segment_length, max_segment,
(char*) buffer))
{
BURP_error_redirect(status_vector, 22, NULL, NULL);
}
@ -1453,7 +1438,7 @@ void put_blob( BURP_FLD field, ISC_QUAD * blob_id, ULONG count)
--segments;
}
if (isc_close_blob(status_vector, GDS_REF(blob)))
if (isc_close_blob(status_vector, &blob))
BURP_error_redirect(status_vector, 23, NULL, NULL);
/* msg 23 isc_close_blob failed */
@ -1489,21 +1474,15 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
FRBRD *blob = NULL;
if (isc_open_blob(status_vector,
GDS_REF(tdgbl->db_handle),
GDS_REF(isc_trans),
GDS_REF(blob),
GDS_VAL(blob_id)))
if (isc_open_blob(status_vector, &tdgbl->db_handle, &isc_trans, &blob,
blob_id))
{
BURP_error_redirect(status_vector, 24, NULL, NULL);
/* msg 24 isc_open_blob failed */
}
if (isc_blob_info(status_vector,
GDS_REF(blob),
sizeof(blr_items),
(SCHAR *) blr_items,
sizeof(blob_info),
if (isc_blob_info(status_vector, &blob, sizeof(blr_items),
(SCHAR *) blr_items, sizeof(blob_info),
(char*) blob_info))
{
BURP_error_redirect(status_vector, 20, NULL, NULL);
@ -1540,7 +1519,7 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
if (!length)
{
if (isc_close_blob(status_vector, GDS_REF(blob)))
if (isc_close_blob(status_vector, &blob))
BURP_error_redirect(status_vector, 23, NULL, NULL);
/* msg 23 isc_close_blob failed */
return false;
@ -1562,10 +1541,8 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
buffer = BURP_ALLOC(max_segment);
USHORT segment_length;
while (!isc_get_segment(status_vector,
GDS_REF(blob),
GDS_REF(segment_length),
(USHORT) max_segment, (char*) GDS_VAL(buffer)))
while (!isc_get_segment(status_vector, &blob, &segment_length,
(USHORT) max_segment, (char*) buffer))
{
if (segment_length)
{
@ -1573,7 +1550,7 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
}
}
if (isc_close_blob(status_vector, GDS_REF(blob)))
if (isc_close_blob(status_vector, &blob))
{
BURP_error_redirect(status_vector, 23, NULL, NULL);
}
@ -1810,14 +1787,12 @@ void put_data(BURP_REL relation)
FRBRD *request = NULL;
SSHORT blr_length = blr - blr_buffer;
if (isc_compile_request(status_vector,
GDS_REF(tdgbl->db_handle),
GDS_REF(request),
blr_length, (SCHAR*) GDS_VAL(blr_buffer)))
if (isc_compile_request(status_vector, &tdgbl->db_handle, &request,
blr_length, (SCHAR*) blr_buffer))
{
BURP_error_redirect(status_vector, 27, NULL, NULL);
/* msg 27 isc_compile_request failed */
isc_print_blr((char*) blr_buffer, NULL, NULL, 0);
isc_print_blr((char*) blr_buffer, (isc_callback)NULL, NULL, 0);
}
BURP_FREE(blr_buffer);
@ -1825,10 +1800,7 @@ void put_data(BURP_REL relation)
BURP_verbose(142, relation->rel_name, NULL, NULL, NULL, NULL);
/* msg 142 writing data for relation %s */
if (isc_start_request(status_vector,
GDS_REF(request),
GDS_REF(isc_trans),
0))
if (isc_start_request(status_vector, &request, &isc_trans, 0))
{
BURP_error_redirect(status_vector, 28, NULL, NULL);
// msg 28 isc_start_request failed
@ -1854,12 +1826,7 @@ void put_data(BURP_REL relation)
ULONG records = 0;
while (true)
{
if (isc_receive(status_vector,
GDS_REF(request),
0,
length,
GDS_VAL(buffer),
0))
if (isc_receive(status_vector, &request, 0, length, buffer, 0))
{
BURP_error_redirect(status_vector, 29, NULL, NULL);
/* msg 29 isc_receive failed */
@ -1922,7 +1889,7 @@ void put_data(BURP_REL relation)
BURP_verbose(108, (void *) (SLONG) records, NULL, NULL, NULL, NULL);
/* msg 108 %ld records written */
if (isc_release_request(status_vector, GDS_REF(request)))
if (isc_release_request(status_vector, &request))
BURP_error_redirect(status_vector, 30, NULL, NULL);
/* msg 30 isc_release_request failed */
}
@ -1978,7 +1945,8 @@ void put_index( BURP_REL relation)
if (count != (ULONG) X.RDB$SEGMENT_COUNT)
{
BURP_print (180, X.RDB$INDEX_NAME, (void*) count, (void*)(ULONG) X.RDB$SEGMENT_COUNT, NULL, NULL);
BURP_print(180, X.RDB$INDEX_NAME, (void*) count,
(void*)(ULONG) X.RDB$SEGMENT_COUNT, NULL, NULL);
continue;
}
@ -2007,9 +1975,12 @@ void put_index( BURP_REL relation)
PUT_NUMERIC (att_index_type, X.RDB$INDEX_TYPE);
if (!X.RDB$EXPRESSION_SOURCE.NULL)
put_source_blob (att_index_expression_source, att_index_expression_source, (ISC_QUAD *)&X.RDB$EXPRESSION_SOURCE);
put_source_blob (att_index_expression_source,
att_index_expression_source,
(ISC_QUAD *)&X.RDB$EXPRESSION_SOURCE);
if (!X.RDB$EXPRESSION_BLR.NULL)
put_blr_blob (att_index_expression_blr, (ISC_QUAD *)&X.RDB$EXPRESSION_BLR);
put_blr_blob (att_index_expression_blr,
(ISC_QUAD *)&X.RDB$EXPRESSION_BLR);
if (!X.RDB$FOREIGN_KEY.NULL)
PUT_TEXT (att_index_foreign_key, X.RDB$FOREIGN_KEY);
put(tdgbl, att_end);
@ -2051,7 +2022,8 @@ void put_index( BURP_REL relation)
if (count != (ULONG) X.RDB$SEGMENT_COUNT)
{
BURP_print (180, X.RDB$INDEX_NAME, (void*) count, (void*)(ULONG) X.RDB$SEGMENT_COUNT, NULL, NULL);
BURP_print(180, X.RDB$INDEX_NAME, (void*) count,
(void*)(ULONG) X.RDB$SEGMENT_COUNT, NULL, NULL);
continue;
}
@ -2078,7 +2050,8 @@ void put_index( BURP_REL relation)
ON_ERROR
general_on_error();
END_ERROR;
put_source_blob (att_index_description2, att_index_description, (ISC_QUAD *)&X.RDB$DESCRIPTION);
put_source_blob (att_index_description2, att_index_description,
(ISC_QUAD *)&X.RDB$DESCRIPTION);
if (tdgbl->BCK_capabilities & BCK_attributes_v3)
FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle6)
I IN RDB$INDICES WITH I.RDB$INDEX_NAME = X.RDB$INDEX_NAME
@ -2091,9 +2064,12 @@ void put_index( BURP_REL relation)
FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle7)
I IN RDB$INDICES WITH I.RDB$INDEX_NAME = X.RDB$INDEX_NAME
if (!I.RDB$EXPRESSION_SOURCE.NULL)
put_source_blob (att_index_expression_source, att_index_expression_source, (ISC_QUAD *)&I.RDB$EXPRESSION_SOURCE);
put_source_blob (att_index_expression_source,
att_index_expression_source,
(ISC_QUAD *)&I.RDB$EXPRESSION_SOURCE);
if (!I.RDB$EXPRESSION_BLR.NULL)
put_blr_blob (att_index_expression_blr, (ISC_QUAD *)&I.RDB$EXPRESSION_BLR);
put_blr_blob (att_index_expression_blr,
(ISC_QUAD *)&I.RDB$EXPRESSION_BLR);
if (!I.RDB$FOREIGN_KEY.NULL)
PUT_TEXT (att_index_foreign_key, I.RDB$FOREIGN_KEY);
END_FOR;
@ -2411,21 +2387,15 @@ bool put_source_blob(SCHAR attribute,
FRBRD *blob = NULL;
if (isc_open_blob(status_vector,
GDS_REF(tdgbl->db_handle),
GDS_REF(isc_trans),
GDS_REF(blob),
GDS_VAL(blob_id)))
if (isc_open_blob(status_vector, &tdgbl->db_handle, &isc_trans, &blob,
blob_id))
{
BURP_error_redirect(status_vector, 24, NULL, NULL);
/* msg 24 isc_open_blob failed */
}
if (isc_blob_info(status_vector,
GDS_REF(blob),
sizeof(source_items),
(SCHAR *) source_items,
sizeof(blob_info),
if (isc_blob_info(status_vector, &blob, sizeof(source_items),
(SCHAR *) source_items, sizeof(blob_info),
(SCHAR*) blob_info))
{
BURP_error_redirect(status_vector, 20, NULL, NULL);
@ -2466,7 +2436,7 @@ bool put_source_blob(SCHAR attribute,
if (!length)
{
if (isc_close_blob(status_vector, GDS_REF(blob)))
if (isc_close_blob(status_vector, &blob))
{
BURP_error_redirect(status_vector, 23, NULL, NULL);
/* msg 23 isc_close_blob failed */
@ -2490,11 +2460,8 @@ bool put_source_blob(SCHAR attribute,
buffer = BURP_ALLOC(max_segment);
USHORT segment_length;
while (!isc_get_segment(status_vector,
GDS_REF(blob),
GDS_REF(segment_length),
max_segment,
(SCHAR*) GDS_VAL(buffer)))
while (!isc_get_segment(status_vector, &blob, &segment_length,
max_segment, (SCHAR*) buffer))
{
if (segment_length)
{
@ -2503,7 +2470,7 @@ bool put_source_blob(SCHAR attribute,
put(tdgbl, (UCHAR) (NULL));
}
if (isc_close_blob(status_vector, GDS_REF(blob)))
if (isc_close_blob(status_vector, &blob))
BURP_error_redirect(status_vector, 23, NULL, NULL);
/* msg 23 isc_close_blob failed */
@ -2610,7 +2577,7 @@ void set_capabilities(void)
END_ERROR;
}
isc_release_request(isc_status, GDS_REF(req));
isc_release_request(isc_status, &req);
}
@ -2792,8 +2759,7 @@ void write_database( const TEXT * dbb_file)
put(tdgbl, (UCHAR) (rec_physical_db));
if (isc_database_info(status_vector,
GDS_REF(tdgbl->db_handle),
if (isc_database_info(status_vector, &tdgbl->db_handle,
sizeof(db_info_items),
(SCHAR *) db_info_items, sizeof(buffer), buffer))
{

View File

@ -546,7 +546,7 @@ int BURP_gbak(int argc,
tdgbl->gbl_sw_ignore_limbo = FALSE;
tdgbl->gbl_sw_blk_factor = 0;
tdgbl->gbl_sw_no_reserve = FALSE;
tdgbl->gbl_sw_mode = FALSE;
tdgbl->gbl_sw_mode = false;
tdgbl->gbl_sw_skip_count = 0;
tdgbl->action = NULL;
@ -639,12 +639,12 @@ int BURP_gbak(int argc,
BURP_error(279, 0, 0, 0, 0, 0); // msg 279: "read_only" or "read_write" required
string = *argv++;
if (!strcmp(string, BURP_SW_MODE_RO))
tdgbl->gbl_sw_mode_val = TRUE;
tdgbl->gbl_sw_mode_val = true;
else if (!strcmp(string, BURP_SW_MODE_RW))
tdgbl->gbl_sw_mode_val = FALSE;
tdgbl->gbl_sw_mode_val = false;
else
BURP_error(279, 0, 0, 0, 0, 0); // msg 279: "read_only" or "read_write" required
tdgbl->gbl_sw_mode = TRUE;
tdgbl->gbl_sw_mode = true;
}
else if (in_sw_tab->in_sw == IN_SW_BURP_PASS) {
if (argv >= end)
@ -815,7 +815,7 @@ int BURP_gbak(int argc,
break;
case (IN_SW_BURP_MODE):
tdgbl->gbl_sw_mode = TRUE;
tdgbl->gbl_sw_mode = true;
break;
case (IN_SW_BURP_N):

View File

@ -721,8 +721,8 @@ typedef struct tgbl
USHORT gbl_sw_service_gbak;
USHORT gbl_sw_service_thd;
USHORT gbl_sw_convert_ext_tables;
BOOLEAN gbl_sw_mode;
BOOLEAN gbl_sw_mode_val;
bool gbl_sw_mode;
bool gbl_sw_mode_val;
SCHAR *gbl_sw_sql_role;
SCHAR *gbl_sw_user;
SCHAR *gbl_sw_password;

File diff suppressed because it is too large Load Diff