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

-Replacing BOOLEAN, FALSE and TRUE.

-Code style cleaning
This commit is contained in:
brodsom 2003-09-05 11:25:53 +00:00
parent 73fd5496f1
commit 4d78970ab3
7 changed files with 583 additions and 489 deletions

View File

@ -25,7 +25,7 @@
#define _ISQL_EXTRA_PROTO_H_
extern SSHORT EXTRACT_ddl(int, SCHAR *);
extern SSHORT EXTRACT_list_table(SCHAR *, SCHAR *, SSHORT, SSHORT);
extern SSHORT EXTRACT_list_table(SCHAR *, SCHAR *, bool, SSHORT);
extern void EXTRACT_list_view(SCHAR *);
extern int EXTRACT_list_grants (SCHAR *);

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: extract.epp,v 1.12 2003-09-01 07:49:57 brodsom Exp $
* $Id: extract.epp,v 1.13 2003-09-05 11:25:53 brodsom Exp $
* Revision 1.3 2000/11/22 17:07:25 patrickgriffin
* In get_procedure_args change comment style from // to c style
*
@ -62,10 +62,10 @@ DATABASE DB = EXTERN COMPILETIME "yachts.lnk";
extern USHORT major_ods;
extern USHORT minor_ods;
extern SSHORT V33;
extern bool V33;
static void list_all_grants(void);
static int list_all_grants2 (BOOLEAN, SCHAR *);
static int list_all_grants2 (bool, SCHAR *);
static void list_all_procs(void);
static void list_all_tables(SSHORT, SSHORT);
static void list_all_triggers(void);
@ -114,7 +114,8 @@ static TEXT SQL_identifier2[BUFFER_LENGTH128];
SSHORT EXTRACT_ddl( int flag, SCHAR * tabname)
SSHORT EXTRACT_ddl(int flag,
SCHAR * tabname)
{
/**************************************
*
@ -129,8 +130,8 @@ SSHORT EXTRACT_ddl( int flag, SCHAR * tabname)
**************************************/
SCHAR errbuf[MSG_LENGTH];
SSHORT ret_code = FINI_OK;
USHORT did_attach = FALSE;
USHORT did_start = FALSE;
bool did_attach = false;
bool did_start = false;
SSHORT default_char_set_id;
if (!DB)
@ -140,10 +141,10 @@ SSHORT EXTRACT_ddl( int flag, SCHAR * tabname)
ISQL_errmsg(gds_status);
return (SSHORT) FINI_ERROR;
}
did_attach = TRUE;
did_attach = true;
}
ISQL_get_version(FALSE);
ISQL_get_version(false);
if (SQL_dialect != db_SQL_dialect)
{
sprintf(Print_buffer,
@ -192,7 +193,7 @@ SSHORT EXTRACT_ddl( int flag, SCHAR * tabname)
ISQL_errmsg(gds_status);
return (SSHORT) FINI_ERROR;
}
did_start = TRUE;
did_start = true;
}
default_char_set_id = ISQL_get_default_char_set_id();
@ -200,7 +201,7 @@ SSHORT EXTRACT_ddl( int flag, SCHAR * tabname)
/* If a table name was passed, extract only that table and domains */
if (*tabname)
{
if (EXTRACT_list_table(tabname, NULL, 1, default_char_set_id))
if (EXTRACT_list_table(tabname, NULL, true, default_char_set_id))
{
gds__msg_format(NULL, ISQL_MSG_FAC, NOT_FOUND, sizeof(errbuf),
errbuf, tabname, NULL, NULL, NULL, NULL);
@ -246,6 +247,7 @@ SSHORT EXTRACT_ddl( int flag, SCHAR * tabname)
return (SSHORT) ret_code;
}
int EXTRACT_list_grants (SCHAR *terminator)
{
/**************************************
@ -261,12 +263,14 @@ int EXTRACT_list_grants (SCHAR *terminator)
* If a new_name is passed, substitute it for relation_name
*
**************************************/
return list_all_grants2 (FALSE, terminator);
return list_all_grants2 (false, terminator);
}
SSHORT EXTRACT_list_table(SCHAR * relation_name,
SCHAR * new_name,
SSHORT domain_flag, SSHORT default_char_set_id)
bool domain_flag,
SSHORT default_char_set_id)
{
/**************************************
*
@ -328,19 +332,17 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
*
**************************************/
USHORT first;
SSHORT collation, char_set_id;
bool first = true;
SSHORT collation;
SSHORT char_set_id;
SSHORT i;
SCHAR *collist, char_sets[86];
SCHAR *collist = NULL;
SCHAR char_sets[86];
SSHORT subtype;
SSHORT intchar;
SSHORT intchar = 0;
/* Query to obtain relation detail information */
first = TRUE;
collist = NULL;
intchar = 0;
FOR REL IN RDB$RELATIONS CROSS
RFR IN RDB$RELATION_FIELDS CROSS
FLD IN RDB$FIELDS WITH
@ -351,7 +353,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
if (first)
{
first = FALSE;
first = false;
/* Do we need to print domains */
if (domain_flag)
list_domain_table (relation_name,default_char_set_id);
@ -432,7 +434,8 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
{
char_sets [0] = '\0';
collation = RFR.RDB$COLLATION_ID;
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, collation, TRUE, char_sets);
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, collation,
true, char_sets);
if (char_sets [0])
ISQL_printf (Out, char_sets);
}
@ -443,7 +446,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type)
{
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10)
{
@ -466,7 +469,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -477,7 +480,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
}
}
if (precision_known == FALSE)
if (precision_known == false)
{
/* Take a stab at numerics and decimals */
@ -562,7 +565,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
if (!FLD.RDB$CHARACTER_SET_ID.NULL)
char_set_id = FLD.RDB$CHARACTER_SET_ID;
if ((char_set_id != default_char_set_id) || collation)
ISQL_get_character_sets (char_set_id, 0, FALSE, char_sets);
ISQL_get_character_sets (char_set_id, 0, false, char_sets);
if (char_sets [0])
ISQL_printf (Out, char_sets);
if (!char_set_id)
@ -638,7 +641,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
if (collation)
{
char_sets[0] = '\0';
ISQL_get_character_sets (char_set_id, collation, TRUE, char_sets);
ISQL_get_character_sets (char_set_id, collation, true, char_sets);
if (char_sets [0])
ISQL_printf (Out, char_sets);
}
@ -690,14 +693,14 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
if (!strncmp (RELC.RDB$CONSTRAINT_TYPE, "PRIMARY", 7))
{
ISQL_get_index_segments (collist, RELC.RDB$INDEX_NAME, TRUE);
ISQL_get_index_segments (collist, RELC.RDB$INDEX_NAME, true);
sprintf (Print_buffer, "PRIMARY KEY (%s)", collist);
ISQL_printf (Out, Print_buffer);
}
else if (!strncmp (RELC.RDB$CONSTRAINT_TYPE, "UNIQUE", 6))
{
ISQL_get_index_segments (collist, RELC.RDB$INDEX_NAME, TRUE);
ISQL_get_index_segments (collist, RELC.RDB$INDEX_NAME, true);
sprintf (Print_buffer, "UNIQUE (%s)", collist);
ISQL_printf (Out, Print_buffer);
}
@ -721,6 +724,7 @@ SSHORT EXTRACT_list_table(SCHAR * relation_name,
return (SSHORT) FINI_OK;
}
static void get_procedure_args(char* proc_name)
{
/**************************************
@ -734,7 +738,9 @@ static void get_procedure_args(char* proc_name)
* extract file
*
**************************************/
SSHORT ptype, first_time, i;
SSHORT ptype;
bool first_time;
SSHORT i;
SCHAR char_sets[86];
/* query to retrieve the parameters. */
@ -751,7 +757,7 @@ static void get_procedure_args(char* proc_name)
for (ptype = 0; ptype < 2; ptype++)
{
first_time = TRUE;
first_time = true;
FOR PRM IN RDB$PROCEDURE_PARAMETERS CROSS
FLD IN RDB$FIELDS WITH
@ -762,7 +768,7 @@ static void get_procedure_args(char* proc_name)
if (first_time)
{
first_time = FALSE;
first_time = false;
if (ptype==0)
{ /* this is the input part */
ISQL_printf (Out, "(");
@ -794,7 +800,7 @@ static void get_procedure_args(char* proc_name)
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type)
{
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10)
{
@ -818,7 +824,7 @@ static void get_procedure_args(char* proc_name)
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -828,7 +834,7 @@ static void get_procedure_args(char* proc_name)
END_ERROR;
}
}
if (precision_known == FALSE)
if (precision_known == false)
{
/* Take a stab at numerics and decimals */
if ((FLD.RDB$FIELD_TYPE == SMALLINT) &&
@ -889,7 +895,7 @@ static void get_procedure_args(char* proc_name)
FLD.RDB$CHARACTER_SET_ID = 0;
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID,
FLD.RDB$COLLATION_ID, FALSE, char_sets);
FLD.RDB$COLLATION_ID, false, char_sets);
if (char_sets [0])
ISQL_printf (Out, char_sets);
}
@ -916,6 +922,7 @@ static void get_procedure_args(char* proc_name)
}
}
static void list_all_grants ()
{
/**************************************
@ -930,10 +937,12 @@ static void list_all_grants ()
* Wrapper around list_all_grants2().
*
**************************************/
list_all_grants2 (TRUE, Term);
list_all_grants2 (true, Term);
}
static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
static int list_all_grants2 (bool show_role_list,
SCHAR *terminator)
{
/**************************************
*
@ -947,7 +956,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
* Get separate permissions on table/views and then procedures
*
**************************************/
SSHORT first = TRUE;
bool first = true;
TEXT prev_owner[44];
int rc = 0;
@ -972,7 +981,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
/* Null terminate name string */
ISQL_blankterm (XX.RDB$ROLE_NAME);
@ -1011,7 +1020,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
/* This version of cursor gets only sql tables identified by security class
and misses views, getting only null view_source */
first = TRUE;
first = true;
FOR REL IN RDB$RELATIONS WITH
(REL.RDB$SYSTEM_FLAG NE 1 OR REL.RDB$SYSTEM_FLAG MISSING) AND
@ -1024,7 +1033,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
NEWLINE);
if (show_role_list) {
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
}
@ -1035,7 +1044,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
rc = SHOW_grants2 (REL.RDB$RELATION_NAME, terminator, obj_relation,
first ? Print_buffer : 0);
if (rc == SKIP) {
first = FALSE;
first = false;
}
END_FOR
@ -1049,7 +1058,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
NEWLINE, NEWLINE);
if (show_role_list) {
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
}
@ -1068,7 +1077,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
NEWLINE, NEWLINE);
if (show_role_list) {
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
}
@ -1079,7 +1088,7 @@ static int list_all_grants2 (BOOLEAN show_role_list, SCHAR *terminator)
rc = SHOW_grants2 (PRC.RDB$PROCEDURE_NAME, terminator, obj_procedure,
first ? Print_buffer: 0);
if (rc == SKIP)
first = FALSE;
first = false;
END_FOR
ON_ERROR
@ -1110,7 +1119,7 @@ static void list_all_procs()
* procname -- Name of procedure to investigate
*
**************************************/
SSHORT header = TRUE;
bool header = true;
TEXT msg[MSG_LENGTH];
static const SCHAR *create_procedure_str1 = "CREATE PROCEDURE %s ";
static const SCHAR *create_procedure_str2 = "BEGIN EXIT; END %s%s";
@ -1131,7 +1140,7 @@ static void list_all_procs()
ISQL_printf (Out, Print_buffer);
sprintf (Print_buffer, "%s/* Stored procedures */%s", NEWLINE, NEWLINE);
ISQL_printf (Out, Print_buffer);
header = FALSE;
header = false;
}
ISQL_blankterm (PRC.RDB$PROCEDURE_NAME);
if (db_SQL_dialect > SQL_DIALECT_V6_TRANSITION)
@ -1211,7 +1220,8 @@ static void list_all_procs()
}
static void list_all_tables( SSHORT flag, SSHORT default_char_set_id)
static void list_all_tables(SSHORT flag,
SSHORT default_char_set_id)
{
/**************************************
*
@ -1243,7 +1253,7 @@ static void list_all_tables( SSHORT flag, SSHORT default_char_set_id)
ISQL_blankterm (REL.RDB$RELATION_NAME);
if (flag || !strncmp (REL.RDB$SECURITY_CLASS, "SQL$", 4))
EXTRACT_list_table (REL.RDB$RELATION_NAME, NULL, 0,default_char_set_id);
EXTRACT_list_table (REL.RDB$RELATION_NAME, NULL, false,default_char_set_id);
END_FOR
ON_ERROR
ISQL_errmsg(gds_status);
@ -1267,7 +1277,7 @@ static void list_all_triggers()
* tables with sql source only.
*
**************************************/
SSHORT header = TRUE;
bool header = true;
/* Query gets the trigger info for non-system triggers with
@ -1289,7 +1299,7 @@ static void list_all_triggers()
NEWLINE,
NEWLINE);
ISQL_printf (Out, Print_buffer);
header = FALSE;
header = false;
}
ISQL_blankterm (TRG.RDB$TRIGGER_NAME);
ISQL_blankterm (TRG.RDB$RELATION_NAME);
@ -1419,7 +1429,7 @@ static void list_check(void)
}
static void print_set( SSHORT * set_used)
static void print_set(bool * set_used)
{
/**************************************
*
@ -1440,7 +1450,7 @@ static void print_set( SSHORT * set_used)
{
sprintf(Print_buffer, " SET ");
ISQL_printf(Out, Print_buffer);
*set_used = TRUE;
*set_used = true;
}
else
{
@ -1448,6 +1458,8 @@ static void print_set( SSHORT * set_used)
ISQL_printf(Out, Print_buffer);
}
}
static void list_create_db(void)
{
/**************************************
@ -1474,10 +1486,15 @@ static void list_create_db(void)
isc_info_end
};
SSHORT nodb = FALSE, first = TRUE, first_file = TRUE, has_wal =
FALSE, set_used = FALSE;
USHORT translate = FALSE;
SCHAR *d, *buffer, item;
bool nodb = false;
bool first = true;
bool first_file = true;
bool has_wal = false;
bool set_used = false;
bool translate = false;
SCHAR *d;
SCHAR *buffer;
SCHAR item;
int length;
SLONG value_out;
@ -1487,7 +1504,7 @@ static void list_create_db(void)
{
ISQL_printf(Out, "/* ");
strcpy(Target_db, Db_name);
nodb = TRUE;
nodb = true;
}
sprintf(Print_buffer, "CREATE DATABASE '%s'", Target_db);
ISQL_printf(Out, Print_buffer);
@ -1539,7 +1556,7 @@ static void list_create_db(void)
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
/* reset nulls to zero */
if (FIL.RDB$FILE_FLAGS.NULL)
@ -1628,7 +1645,7 @@ static void list_create_db(void)
FOR WAL IN RDB$LOG_FILES
SORTED BY WAL.RDB$FILE_FLAGS, WAL.RDB$FILE_SEQUENCE
has_wal = TRUE;
has_wal = true;
if (first)
{
if (nodb)
@ -1639,7 +1656,7 @@ static void list_create_db(void)
sprintf (Print_buffer, "%sALTER DATABASE ADD ", NEWLINE);
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
if (first_file)
ISQL_printf (Out, "LOGFILE ");
@ -1679,7 +1696,7 @@ static void list_create_db(void)
sprintf (Print_buffer, ",%s ", NEWLINE);
ISQL_printf (Out, Print_buffer);
}
first_file = FALSE;
first_file = false;
sprintf (Print_buffer, "'%s'", WAL.RDB$FILE_NAME);
ISQL_printf (Out, Print_buffer);
@ -1789,7 +1806,8 @@ static void list_create_db(void)
}
static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
static void list_domain_table(SCHAR * table_name,
SSHORT default_char_set_id)
{
/**************************************
*
@ -1805,7 +1823,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
* default_char_set_id -- character set def to supress
*
**************************************/
SSHORT first = TRUE;
bool first = true;
SSHORT i;
SCHAR char_sets[86];
SSHORT subtype;
@ -1826,7 +1844,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
{
sprintf (Print_buffer, "/* Domain definitions */%s", NEWLINE);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
ISQL_blankterm(FLD.RDB$FIELD_NAME);
@ -1836,7 +1854,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type)
{
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10)
{
@ -1859,7 +1877,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -1870,7 +1888,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
}
}
if (precision_known == FALSE)
if (precision_known == false)
{
/* Take a stab at numerics and decimals */
if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0))
@ -1932,7 +1950,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
char_sets[0] = 0;
if ((FLD.RDB$CHARACTER_SET_ID != default_char_set_id) ||
(!FLD.RDB$COLLATION_ID.NULL && FLD.RDB$COLLATION_ID != 0))
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, FALSE, FALSE, char_sets);
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, 0, false, char_sets);
if (char_sets[0])
ISQL_printf (Out, char_sets);
}
@ -1966,7 +1984,8 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
if (!FLD.RDB$COLLATION_ID.NULL && FLD.RDB$COLLATION_ID != 0)
{
char_sets[0] = 0;
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, FLD.RDB$COLLATION_ID, TRUE, char_sets);
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, FLD.RDB$COLLATION_ID,
true, char_sets);
if (char_sets[0])
ISQL_printf (Out, char_sets);
}
@ -1981,7 +2000,7 @@ static void list_domain_table( SCHAR * table_name, SSHORT default_char_set_id)
}
static void list_domains( SSHORT default_char_set_id)
static void list_domains(SSHORT default_char_set_id)
{
/**************************************
*
@ -1996,7 +2015,7 @@ static void list_domains( SSHORT default_char_set_id)
* default_char_set_id -- character set def to supress
*
**************************************/
SSHORT first = TRUE;
bool first = true;
SSHORT i;
SCHAR char_sets[86];
SSHORT subtype;
@ -2010,7 +2029,7 @@ static void list_domains( SSHORT default_char_set_id)
{
sprintf (Print_buffer, "/* Domain definitions */%s", NEWLINE);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
ISQL_blankterm(FLD.RDB$FIELD_NAME);
@ -2028,7 +2047,7 @@ static void list_domains( SSHORT default_char_set_id)
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type)
{
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10)
{
@ -2051,7 +2070,7 @@ static void list_domains( SSHORT default_char_set_id)
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -2062,7 +2081,7 @@ static void list_domains( SSHORT default_char_set_id)
}
}
if (precision_known == FALSE)
if (precision_known == false)
{
/* Take a stab at numerics and decimals */
if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0))
@ -2123,7 +2142,7 @@ static void list_domains( SSHORT default_char_set_id)
char_sets[0] = 0;
if ((FLD.RDB$CHARACTER_SET_ID != default_char_set_id) ||
(!FLD.RDB$COLLATION_ID.NULL && FLD.RDB$COLLATION_ID != 0))
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, FALSE, FALSE, char_sets);
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, 0, false, char_sets);
if (char_sets[0])
ISQL_printf (Out, char_sets);
}
@ -2157,7 +2176,8 @@ static void list_domains( SSHORT default_char_set_id)
if (!FLD.RDB$COLLATION_ID.NULL && FLD.RDB$COLLATION_ID != 0)
{
char_sets[0] = 0;
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, FLD.RDB$COLLATION_ID, TRUE, char_sets);
ISQL_get_character_sets (FLD.RDB$CHARACTER_SET_ID, FLD.RDB$COLLATION_ID,
true, char_sets);
if (char_sets[0])
ISQL_printf (Out, char_sets);
}
@ -2186,7 +2206,7 @@ static void list_exception(void)
* Parameters: none
*
**************************************/
SSHORT first = TRUE;
bool first = true;
FOR EXC IN RDB$EXCEPTIONS
SORTED BY EXC.RDB$EXCEPTION_NAME
@ -2196,7 +2216,7 @@ static void list_exception(void)
sprintf (Print_buffer, "%s/* Exceptions */%s", NEWLINE, NEWLINE);
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
ISQL_blankterm (EXC.RDB$EXCEPTION_NAME);
ISQL_copy_SQL_id (EXC.RDB$MESSAGE, SQL_identifier2, SINGLE_QUOTE);
@ -2237,7 +2257,7 @@ static void list_filters(void)
* DECLARE FILTER <fname> INPUT_TYPE <blob_sub_type> OUTPUT_TYPE <blob_subtype>
* ENTRY_POINT <string> MODULE_NAME <string>
**************************************/
SSHORT first = TRUE;
bool first = true;
FOR FIL IN RDB$FILTERS
SORTED BY FIL.RDB$FUNCTION_NAME
@ -2253,7 +2273,7 @@ static void list_filters(void)
NEWLINE);
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
sprintf (Print_buffer, "DECLARE FILTER %s INPUT_TYPE %d OUTPUT_TYPE %d%s%sENTRY_POINT '%s' MODULE_NAME '%s'%s%s%s",
FIL.RDB$FUNCTION_NAME, FIL.RDB$INPUT_SUB_TYPE, FIL.RDB$OUTPUT_SUB_TYPE,
@ -2312,7 +2332,7 @@ static void list_foreign()
ISQL_blankterm (RELC1.RDB$RELATION_NAME);
ISQL_blankterm (RELC2.RDB$RELATION_NAME);
ISQL_get_index_segments (collist, RELC1.RDB$INDEX_NAME, TRUE);
ISQL_get_index_segments (collist, RELC1.RDB$INDEX_NAME, true);
sprintf (Print_buffer, " %s", NEWLINE);
ISQL_printf (Out, Print_buffer);
@ -2362,7 +2382,7 @@ static void list_foreign()
/* Get the column list for the primary key */
ISQL_get_index_segments (collist, RELC2.RDB$INDEX_NAME, TRUE);
ISQL_get_index_segments (collist, RELC2.RDB$INDEX_NAME, true);
sprintf (Print_buffer, "(%s)", collist);
ISQL_printf (Out, Print_buffer);
@ -2372,14 +2392,14 @@ static void list_foreign()
{
ISQL_truncate_term (REFC.RDB$UPDATE_RULE,
strlen(REFC.RDB$UPDATE_RULE));
ISQL_ri_action_print (REFC.RDB$UPDATE_RULE, " ON UPDATE", TRUE);
ISQL_ri_action_print (REFC.RDB$UPDATE_RULE, " ON UPDATE", true);
}
if (!REFC.RDB$DELETE_RULE.NULL)
{
ISQL_truncate_term (REFC.RDB$DELETE_RULE,
strlen(REFC.RDB$DELETE_RULE));
ISQL_ri_action_print (REFC.RDB$DELETE_RULE, " ON DELETE", TRUE);
ISQL_ri_action_print (REFC.RDB$DELETE_RULE, " ON DELETE", true);
}
sprintf (Print_buffer, "%s%s", Term, NEWLINE);
@ -2415,7 +2435,9 @@ static void list_functions(void)
* RETURNS INTEGER BY VALUE
* ENTRY_POINT entrypoint MODULE_NAME module;
**************************************/
SSHORT first = TRUE, firstarg = TRUE, printarg = TRUE;
bool first = true;
bool firstarg = true;
bool printarg = true;
SSHORT i, ptype;
SCHAR *return_buffer;
SCHAR *type_buffer;
@ -2470,7 +2492,7 @@ static void list_functions(void)
NEWLINE,
NEWLINE);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
/* Start new function declaration */
@ -2479,7 +2501,7 @@ static void list_functions(void)
NEWLINE);
ISQL_printf (Out, Print_buffer);
firstarg = TRUE;
firstarg = true;
FOR FNA IN RDB$FUNCTION_ARGUMENTS WITH
FUN.RDB$FUNCTION_NAME EQ FNA.RDB$FUNCTION_NAME
@ -2519,7 +2541,7 @@ static void list_functions(void)
}
else
{
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if ( (major_ods >= ODS_VERSION10) &&
((FNA.RDB$FIELD_TYPE == SMALLINT) ||
@ -2541,7 +2563,7 @@ static void list_functions(void)
Integral_subtypes [FNA1.RDB$FIELD_SUB_TYPE],
FNA1.RDB$FIELD_PRECISION,
-FNA1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
} /* if field_precision is not null */
END_FOR
@ -2595,7 +2617,7 @@ static void list_functions(void)
if (ptype > MAX_UDFPARAM_TYPES + 1 || ptype < 0)
ptype = MAX_UDFPARAM_TYPES + 1;
printarg = TRUE;
printarg = true;
if (FUN.RDB$RETURN_ARGUMENT == FNA.RDB$ARGUMENT_POSITION) {
@ -2607,7 +2629,7 @@ static void list_functions(void)
sprintf (return_buffer, "RETURNS %s%s %s", type_buffer,
UDF_param_types[ptype],
(FNA.RDB$MECHANISM < 0 ? "FREE_IT" : ""));
printarg = FALSE;
printarg = false;
}
}
@ -2618,7 +2640,7 @@ static void list_functions(void)
sprintf (Print_buffer, "%s%s%s", (firstarg ? "" : ", "), type_buffer,
UDF_param_types[ptype]);
ISQL_printf (Out, Print_buffer);
firstarg = FALSE;
firstarg = false;
}
END_FOR
@ -2722,7 +2744,7 @@ static void list_index()
*
**************************************/
SCHAR *collist;
SSHORT first = TRUE;
bool first = true;
collist = NULL;
@ -2752,7 +2774,7 @@ static void list_index()
NEWLINE);
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
/* Strip trailing blanks */
ISQL_blankterm (IDX.RDB$RELATION_NAME);
@ -2778,7 +2800,7 @@ static void list_index()
/* Get column names */
if (ISQL_get_index_segments (collist, IDX.RDB$INDEX_NAME, TRUE))
if (ISQL_get_index_segments (collist, IDX.RDB$INDEX_NAME, true))
{
sprintf (Print_buffer, "%s)%s%s", collist, Term, NEWLINE);
ISQL_printf (Out, Print_buffer);
@ -2809,7 +2831,7 @@ static void list_views()
* Note: This should also contain check option
*
**************************************/
SSHORT first;
bool first;
/* If this is a view, use print_blob to print the view text */
@ -2819,7 +2841,7 @@ static void list_views()
REL.RDB$FLAGS = REL_sql
SORTED BY REL.RDB$RELATION_ID
first = TRUE;
first = true;
ISQL_blankterm (REL.RDB$RELATION_NAME);
if (db_SQL_dialect > SQL_DIALECT_V6_TRANSITION)
@ -2852,7 +2874,7 @@ static void list_views()
sprintf (Print_buffer, "%s%s", (first ? "" : ", "), SQL_identifier);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
END_FOR
ON_ERROR

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: isql.h,v 1.11 2003-08-26 23:11:54 brodsom Exp $
* $Id: isql.h,v 1.12 2003-09-05 11:25:53 brodsom Exp $
* Revision 1.2 2000/11/18 16:49:24 fsg
* Increased PRINT_BUFFER_LENGTH to 2048 to show larger plans
* Fixed Bug #122563 in extract.e get_procedure_args
@ -245,7 +245,7 @@ EXTERN SCHAR Db_name[128];
EXTERN SCHAR Target_db[128];
EXTERN SCHAR User[128], Password[128], Role[128], Charset[128];
EXTERN SCHAR Numbufs[16]; /* # of cache buffers on connect */
EXTERN SSHORT Merge_stderr;
EXTERN bool Merge_stderr;
EXTERN USHORT SQL_dialect;
EXTERN USHORT db_SQL_dialect;
#undef EXTERN

View File

@ -34,23 +34,23 @@ extern int ISQL_create_database(TEXT *,
SCHAR **,
SCHAR *,
SCHAR *, IB_FILE *, IB_FILE *, IB_FILE *);
extern BOOLEAN ISQL_dbcheck(void);
extern void ISQL_disconnect_database(int);
extern bool ISQL_dbcheck(void);
extern void ISQL_disconnect_database(bool);
extern void ISQL_errmsg(ISC_STATUS *);
extern void ISQL_warning(ISC_STATUS *);
extern void ISQL_exit_db(void);
extern int ISQL_extract(TEXT *, int, IB_FILE *, IB_FILE *, IB_FILE *);
extern int ISQL_frontend_command(TEXT *, IB_FILE *, IB_FILE *, IB_FILE *);
extern BOOLEAN ISQL_get_base_column_null_flag(TEXT *, SSHORT, TEXT *);
extern void ISQL_get_character_sets(SSHORT, SSHORT, USHORT, TEXT *);
extern bool ISQL_get_base_column_null_flag(TEXT *, SSHORT, TEXT *);
extern void ISQL_get_character_sets(SSHORT, SSHORT, bool, TEXT *);
extern SSHORT ISQL_get_default_char_set_id(void);
extern void ISQL_get_default_source(TEXT *, TEXT *, GDS__QUAD *);
extern SSHORT ISQL_get_field_length(TEXT *);
extern SSHORT ISQL_get_index_segments(TEXT *, TEXT *, BOOLEAN);
extern BOOLEAN ISQL_get_null_flag(TEXT *, TEXT *);
extern void ISQL_get_version(BOOLEAN);
extern SSHORT ISQL_get_index_segments(TEXT *, TEXT *, bool);
extern bool ISQL_get_null_flag(TEXT *, TEXT *);
extern void ISQL_get_version(bool);
extern SSHORT ISQL_init(IB_FILE *, IB_FILE *);
extern BOOLEAN ISQL_is_domain(TEXT *);
extern bool ISQL_is_domain(TEXT *);
extern SSHORT ISQL_main(int, char **);
extern void ISQL_make_upper(UCHAR *);
extern void ISQL_msg_get(USHORT,
@ -59,7 +59,7 @@ extern void ISQL_print_validation(IB_FILE *, GDS__QUAD *, SSHORT, FRBRD *);
extern void ISQL_printf(IB_FILE *, TEXT *);
extern void ISQL_query_database(SSHORT *, IB_FILE *, IB_FILE *, IB_FILE *);
extern void ISQL_reset_settings(void);
extern void ISQL_ri_action_print(TEXT *, TEXT *, BOOLEAN);
extern void ISQL_ri_action_print(TEXT *, TEXT *, bool);
extern int ISQL_sql_statement(TEXT *, IB_FILE *, IB_FILE *, IB_FILE *);
extern void ISQL_truncate_term(TEXT *, USHORT);
extern void ISQL_win_err(SCHAR *);

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: show.epp,v 1.19 2003-08-28 12:59:18 brodsom Exp $
* $Id: show.epp,v 1.20 2003-09-05 11:25:53 brodsom Exp $
* Revision 1.2 2000/11/19 07:02:49 fsg
* Change in show.e to use CHARACTER_LENGTH instead of FIELD_LENGTH in
* SHOW PROCEDURE
@ -64,8 +64,8 @@ DATABASE DB = EXTERN COMPILETIME "yachts.lnk";
extern USHORT major_ods;
extern USHORT minor_ods;
extern SSHORT V4;
extern SSHORT V33;
extern bool V4;
extern bool V33;
static void local_fprintf(const char*, const char*);
static void remove_delimited_double_quotes(TEXT *);
@ -286,10 +286,11 @@ const char* trigger_action(int type)
BOOLEAN SHOW_dbb_parameters(FRBRD * db_handle,
bool SHOW_dbb_parameters(FRBRD * db_handle,
SCHAR * info_buf,
SCHAR * db_items,
USHORT item_length, USHORT translate)
USHORT item_length,
bool translate)
{
/**************************************
*
@ -318,7 +319,7 @@ BOOLEAN SHOW_dbb_parameters(FRBRD * db_handle,
isc_status[1] = isc_virmemexh;
isc_status[2] = isc_arg_end;
ISQL_errmsg(isc_status);
return FALSE;
return false;
}
msg = (SCHAR *) ISQL_ALLOC(MSG_LENGTH);
if (!msg) {
@ -327,7 +328,7 @@ BOOLEAN SHOW_dbb_parameters(FRBRD * db_handle,
isc_status[2] = isc_arg_end;
ISQL_errmsg(isc_status);
ISQL_FREE(buffer);
return FALSE;
return false;
}
if (isc_database_info(status_vector, &db_handle, item_length,
@ -335,7 +336,7 @@ BOOLEAN SHOW_dbb_parameters(FRBRD * db_handle,
ISQL_errmsg(status_vector);
ISQL_FREE (buffer);
ISQL_FREE (msg);
return FALSE;
return false;
}
*info_buf = '\0';
@ -495,11 +496,13 @@ BOOLEAN SHOW_dbb_parameters(FRBRD * db_handle,
ISQL_FREE(buffer);
ISQL_FREE(msg);
return TRUE;
return true;
}
int SHOW_grants( SCHAR * object, SCHAR * terminator, USHORT obj_type)
int SHOW_grants(SCHAR * object,
SCHAR * terminator,
USHORT obj_type)
{
/**************************************
*
@ -515,8 +518,10 @@ int SHOW_grants( SCHAR * object, SCHAR * terminator, USHORT obj_type)
}
int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
TEXT *optional_msg)
int SHOW_grants2 (SCHAR *object,
SCHAR *terminator,
USHORT obj_type,
TEXT *optional_msg)
{
/**************************************
*
@ -546,7 +551,7 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
SCHAR user_string[44];
USHORT priv_flags;
SSHORT prev_field_null;
SSHORT first = TRUE;
bool first = true;
SCHAR role_name[BUFFER_LENGTH128];
if (!*object)
@ -602,7 +607,7 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
if (first && optional_msg)
ISQL_printf (Out, optional_msg);
first = FALSE;
first = false;
if (db_SQL_dialect > SQL_DIALECT_V6_TRANSITION)
ISQL_copy_SQL_id (object, SQL_identifier, DBL_QUOTE);
@ -730,7 +735,7 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
make_priv_string (priv_flags, (UCHAR*) priv_string);
if (first && optional_msg)
ISQL_printf (Out, optional_msg);
first = FALSE;
first = false;
if (db_SQL_dialect > SQL_DIALECT_V6_TRANSITION)
ISQL_copy_SQL_id (object, SQL_identifier, DBL_QUOTE);
@ -772,7 +777,7 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
if (first && optional_msg)
ISQL_printf (Out, optional_msg);
first = FALSE;
first = false;
ISQL_blankterm (PRV.RDB$USER);
switch (PRV.RDB$USER_TYPE) {
@ -832,7 +837,7 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
sprintf (Print_buffer, "GRANT EXECUTE ON PROCEDURE %s TO %s%s%s%s",
SQL_identifier, user_string, with_option, terminator, NEWLINE);
first = FALSE;
first = false;
ISQL_printf (Out, Print_buffer);
END_FOR
@ -887,7 +892,7 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
if (first && optional_msg)
ISQL_printf (Out, optional_msg);
first = FALSE;
first = false;
ISQL_printf (Out, Print_buffer);
END_FOR
@ -910,7 +915,8 @@ int SHOW_grants2 (SCHAR *object, SCHAR *terminator, USHORT obj_type,
}
void SHOW_grant_roles( SCHAR * terminator, SSHORT *first)
void SHOW_grant_roles(SCHAR * terminator,
bool *first)
{
/**************************************
*
@ -925,7 +931,9 @@ void SHOW_grant_roles( SCHAR * terminator, SSHORT *first)
SHOW_grant_roles2 (terminator, first, 0);
}
void SHOW_grant_roles2 (SCHAR *terminator, SSHORT *first, TEXT *optional_msg)
void SHOW_grant_roles2 (SCHAR *terminator,
bool *first,
TEXT *optional_msg)
{
/**************************************
*
@ -954,7 +962,7 @@ void SHOW_grant_roles2 (SCHAR *terminator, SSHORT *first, TEXT *optional_msg)
if (*first && optional_msg) {
ISQL_printf (Out, optional_msg);
}
*first = FALSE;
*first = false;
}
ISQL_blankterm (PRV.RDB$USER);
@ -985,7 +993,8 @@ void SHOW_grant_roles2 (SCHAR *terminator, SSHORT *first, TEXT *optional_msg)
}
void SHOW_print_metadata_text_blob( IB_FILE * fp, ISC_QUAD * blobid)
void SHOW_print_metadata_text_blob(IB_FILE * fp,
ISC_QUAD * blobid)
{
/**************************************
*
@ -1042,7 +1051,8 @@ void SHOW_print_metadata_text_blob( IB_FILE * fp, ISC_QUAD * blobid)
}
int SHOW_metadata( SCHAR ** cmd, SCHAR ** lcmd)
int SHOW_metadata(SCHAR ** cmd,
SCHAR ** lcmd)
{
/**************************************
*
@ -1407,7 +1417,8 @@ int SHOW_metadata( SCHAR ** cmd, SCHAR ** lcmd)
}
static void local_fprintf(const char* format, const char* string)
static void local_fprintf(const char* format,
const char* string)
{
/**************************************
*
@ -1470,7 +1481,8 @@ static void remove_delimited_double_quotes(TEXT* string)
}
static void make_priv_string( USHORT flags, UCHAR * string)
static void make_priv_string(USHORT flags,
UCHAR * string)
{
/**************************************
*
@ -1495,7 +1507,7 @@ static void make_priv_string( USHORT flags, UCHAR * string)
}
static int show_all_tables( SSHORT flag)
static int show_all_tables(SSHORT flag)
{
/**************************************
*
@ -1511,7 +1523,7 @@ static int show_all_tables( SSHORT flag)
*
**************************************/
SSHORT odd = 1;
SSHORT first = TRUE;
bool first = true;
if (flag == -1) {
/* Views */
@ -1519,7 +1531,7 @@ static int show_all_tables( SSHORT flag)
REL.RDB$VIEW_BLR NOT MISSING
SORTED BY REL.RDB$RELATION_NAME
first = FALSE;
first = false;
sprintf (Print_buffer, "%38s%s", REL.RDB$RELATION_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
odd = 1 - odd;
@ -1535,7 +1547,7 @@ static int show_all_tables( SSHORT flag)
REL.RDB$SYSTEM_FLAG EQ flag
SORTED BY REL.RDB$RELATION_NAME
first = FALSE;
first = false;
sprintf (Print_buffer, "%38s%s", REL.RDB$RELATION_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
odd = 1 - odd;
@ -1555,7 +1567,8 @@ static int show_all_tables( SSHORT flag)
return NOT_FOUND;
}
static void show_charsets( SCHAR * relation_name, SCHAR * field_name)
static void show_charsets(SCHAR * relation_name,
SCHAR * field_name)
{
/*************************************
*
@ -1620,13 +1633,13 @@ static void show_charsets( SCHAR * relation_name, SCHAR * field_name)
char_sets[0] = 0;
if ((char_set_id != default_char_set_id) || collation)
ISQL_get_character_sets(char_set_id, collation, FALSE, char_sets);
ISQL_get_character_sets(char_set_id, collation, false, char_sets);
if (char_sets[0])
ISQL_printf(Out, char_sets);
}
static int show_check( SCHAR * object)
static int show_check(SCHAR * object)
{
/**************************************
*
@ -1638,7 +1651,7 @@ static int show_check( SCHAR * object)
* Show check constraints for the named object
*
**************************************/
int first = TRUE;
bool first = true;
/* Only V4 databases have this information */
if (!V4)
@ -1657,7 +1670,7 @@ static int show_check( SCHAR * object)
SORTED BY CHK.RDB$CONSTRAINT_NAME
/* Use print_blob to print the blob */
first = FALSE;
first = false;
sprintf (Print_buffer, "CONSTRAINT %s:%s ", ISQL_blankterm(CHK.RDB$CONSTRAINT_NAME), NEWLINE);
ISQL_printf (Out, Print_buffer);
@ -1690,8 +1703,8 @@ static void show_db(void)
*
**************************************/
SCHAR *info_buf;
SSHORT is_wal = FALSE;
USHORT translate = TRUE;
bool is_wal = false;
bool translate = true;
/* First print the name of the database */
@ -1817,7 +1830,7 @@ static void show_db(void)
/* If there are log files, print Wal statistics */
is_wal = TRUE;
is_wal = true;
/* reset nulls to zero */
@ -1921,7 +1934,7 @@ static int show_dialect(void)
}
static int show_domains( SCHAR * domain_name)
static int show_domains(SCHAR * domain_name)
{
/*************************************
*
@ -1934,7 +1947,8 @@ static int show_domains( SCHAR * domain_name)
************************************/
SSHORT odd = 1, i;
ISC_QUAD default_source;
SSHORT subtype, first = TRUE;;
SSHORT subtype;
bool first = true;
if (!*domain_name) {
/* List all domain names in columns */
@ -1944,7 +1958,7 @@ static int show_domains( SCHAR * domain_name)
AND FLD.RDB$SYSTEM_FLAG NE 1
SORTED BY FLD.RDB$FIELD_NAME
first = FALSE;
first = false;
sprintf (Print_buffer, "%38s%s", FLD.RDB$FIELD_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
odd = 1 - odd;
@ -1965,7 +1979,7 @@ static int show_domains( SCHAR * domain_name)
isdigit (FLD.RDB$FIELD_NAME[4]))
continue;
first = FALSE;
first = false;
sprintf (Print_buffer, "%38s%s", FLD.RDB$FIELD_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
odd = 1 - odd;
@ -1983,7 +1997,7 @@ static int show_domains( SCHAR * domain_name)
FOR FLD IN RDB$FIELDS WITH
FLD.RDB$FIELD_NAME EQ domain_name;
first = FALSE;
first = false;
/* Print the name of the domain */
ISQL_blankterm (FLD.RDB$FIELD_NAME);
sprintf (Print_buffer, "%-32s", FLD.RDB$FIELD_NAME);
@ -2003,7 +2017,7 @@ static int show_domains( SCHAR * domain_name)
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type) {
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10) {
/* Handle Integral subtypes NUMERIC and DECIMAL */
@ -2022,7 +2036,7 @@ static int show_domains( SCHAR * domain_name)
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -2033,7 +2047,7 @@ static int show_domains( SCHAR * domain_name)
}
}
if (precision_known == FALSE) {
if (precision_known == false) {
/* Take a stab at numerics and decimals */
if ((FLD.RDB$FIELD_TYPE == SMALLINT) &&
(FLD.RDB$FIELD_SCALE < 0))
@ -2138,7 +2152,7 @@ static int show_domains( SCHAR * domain_name)
}
static int show_exceptions( SCHAR * object)
static int show_exceptions(SCHAR * object)
{
/**************************************
*
@ -2153,7 +2167,8 @@ static int show_exceptions( SCHAR * object)
* like other such functions.
*
**************************************/
SSHORT first = TRUE, first_dep = TRUE;
bool first = true;
bool first_dep = true;
SCHAR type[20];
FOR EXC IN RDB$EXCEPTIONS
@ -2168,13 +2183,13 @@ static int show_exceptions( SCHAR * object)
sprintf (Print_buffer, "Exception Name Used by, Type%s=============================== =============================================%s", NEWLINE, NEWLINE);
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
sprintf (Print_buffer, "%-31s ", EXC.RDB$EXCEPTION_NAME);
ISQL_printf (Out, Print_buffer);
/* Look up dependent objects --procedures and triggers */
first_dep = TRUE;
first_dep = true;
FOR DEP IN RDB$DEPENDENCIES WITH
DEP.RDB$DEPENDED_ON_TYPE = 7 AND
DEP.RDB$DEPENDED_ON_NAME EQ EXC.RDB$EXCEPTION_NAME
@ -2184,7 +2199,7 @@ static int show_exceptions( SCHAR * object)
sprintf (Print_buffer, " ");
ISQL_printf (Out, Print_buffer);
}
first_dep = FALSE;
first_dep = false;
ISQL_blankterm (DEP.RDB$DEPENDENT_NAME);
@ -2225,7 +2240,7 @@ static int show_exceptions( SCHAR * object)
}
static int show_filters( SCHAR * object)
static int show_filters(SCHAR * object)
{
/**************************************
*
@ -2237,7 +2252,8 @@ static int show_filters( SCHAR * object)
* Show blob filters in general or for the named filters
*
**************************************/
SSHORT odd = 1, first = TRUE;
SSHORT odd = 1;
bool first = true;
/* Show all functions */
@ -2245,7 +2261,7 @@ static int show_filters( SCHAR * object)
FOR FIL IN RDB$FILTERS
SORTED BY FIL.RDB$FUNCTION_NAME
first = FALSE;
first = false;
ISQL_blankterm (FIL.RDB$FUNCTION_NAME);
sprintf (Print_buffer, "%-38s%s", FIL.RDB$FUNCTION_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
@ -2266,7 +2282,7 @@ static int show_filters( SCHAR * object)
FOR FIL IN RDB$FILTERS WITH
FIL.RDB$FUNCTION_NAME EQ object
first = FALSE;
first = false;
ISQL_blankterm (FIL.RDB$FUNCTION_NAME);
ISQL_blankterm (FIL.RDB$MODULE_NAME);
@ -2294,7 +2310,7 @@ static int show_filters( SCHAR * object)
}
static int show_functions( SCHAR * object)
static int show_functions(SCHAR * object)
{
/**************************************
*
@ -2306,7 +2322,7 @@ static int show_functions( SCHAR * object)
* Show external functions in general or for the named function
*
**************************************/
SSHORT first = TRUE;
bool first = true;
SSHORT odd = 1;
SSHORT i, ptype;
@ -2316,7 +2332,7 @@ static int show_functions( SCHAR * object)
FOR FUN IN RDB$FUNCTIONS
SORTED BY FUN.RDB$FUNCTION_NAME
first = FALSE;
first = false;
ISQL_blankterm (FUN.RDB$FUNCTION_NAME);
sprintf (Print_buffer, "%-38s%s", FUN.RDB$FUNCTION_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
@ -2364,7 +2380,7 @@ static int show_functions( SCHAR * object)
ptype = MAX_UDFPARAM_TYPES + 1;
}
first = FALSE;
first = false;
if (FUN.RDB$RETURN_ARGUMENT == FNA.RDB$ARGUMENT_POSITION) {
sprintf (Print_buffer, "Returns %s%s ",
UDF_param_types[ptype],
@ -2380,7 +2396,7 @@ static int show_functions( SCHAR * object)
{
if (FNA.RDB$FIELD_TYPE == Column_types [i].type)
{
BOOLEAN precision_known = FALSE;
bool precision_known = false;
/* Handle Integral subtypes NUMERIC and DECIMAL */
if ( (major_ods >= ODS_VERSION10) &&
@ -2404,7 +2420,7 @@ static int show_functions( SCHAR * object)
Integral_subtypes [FNA1.RDB$FIELD_SUB_TYPE],
FNA1.RDB$FIELD_PRECISION,
-FNA1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -2414,7 +2430,7 @@ static int show_functions( SCHAR * object)
END_ERROR;
}
if (precision_known == FALSE)
if (precision_known == false)
{
/* Take a stab at numerics and decimals */
if ((FNA.RDB$FIELD_TYPE == SMALLINT) && (FNA.RDB$FIELD_SCALE < 0))
@ -2483,7 +2499,7 @@ static int show_functions( SCHAR * object)
}
static int show_generators( SCHAR * object)
static int show_generators(SCHAR * object)
{
/**************************************
*
@ -2497,7 +2513,8 @@ static int show_generators( SCHAR * object)
* incrementing by 0 to not change the current value.
*
**************************************/
SSHORT indicator, first = TRUE;
SSHORT indicator;
bool first = true;
XSQLDA sqlda;
SINT64 genid64 = 0;
SLONG genid = 0;
@ -2574,7 +2591,7 @@ static int show_generators( SCHAR * object)
}
else
{
first = FALSE;
first = false;
if( SQL_dialect >= SQL_DIALECT_V6_TRANSITION)
{
sprintf (Print_buffer,
@ -2608,7 +2625,9 @@ static int show_generators( SCHAR * object)
static void show_index(SCHAR * relation_name,
SCHAR * index_name,
SSHORT unique_flag, SSHORT index_type, SSHORT inactive)
SSHORT unique_flag,
SSHORT index_type,
SSHORT inactive)
{
/**************************************
*
@ -2645,7 +2664,7 @@ static void show_index(SCHAR * relation_name,
return;
}
if (ISQL_get_index_segments(collist, index_name, FALSE)) {
if (ISQL_get_index_segments(collist, index_name, false)) {
sprintf(Print_buffer, "(%s) %s%s", collist,
(inactive ? "(inactive)" : ""), NEWLINE);
ISQL_printf(Out, Print_buffer);
@ -2655,7 +2674,7 @@ static void show_index(SCHAR * relation_name,
}
static int show_indices( SCHAR ** cmd)
static int show_indices(SCHAR ** cmd)
{
/**************************************
*
@ -2672,7 +2691,7 @@ static int show_indices( SCHAR ** cmd)
*
**************************************/
SCHAR *name;
SSHORT first = TRUE;
bool first = true;
/* The names stored in the database are all upper case */
@ -2700,7 +2719,7 @@ static int show_indices( SCHAR ** cmd)
}
#endif
first = FALSE;
first = false;
END_FOR
ON_ERROR ISQL_errmsg(isc_status);
return ERR;
@ -2718,7 +2737,7 @@ static int show_indices( SCHAR ** cmd)
REL.RDB$SYSTEM_FLAG MISSING
SORTED BY IDX2.RDB$RELATION_NAME, IDX2.RDB$INDEX_NAME
first = FALSE;
first = false;
show_index (IDX2.RDB$RELATION_NAME, IDX2.RDB$INDEX_NAME,
IDX2.RDB$UNIQUE_FLAG, IDX2.RDB$INDEX_TYPE, IDX2.RDB$INDEX_INACTIVE);
@ -2746,7 +2765,7 @@ static int show_indices( SCHAR ** cmd)
}
static int show_proc( SCHAR * procname)
static int show_proc(SCHAR * procname)
{
/**************************************
*
@ -2763,7 +2782,8 @@ static int show_proc( SCHAR * procname)
**************************************/
SCHAR type_name[33], lenstring[33]="";
SSHORT i;
SSHORT first_proc = TRUE, first = TRUE;
bool first_proc = true;
bool first = true;
/* If this is not a V4 database, just return */
@ -2787,7 +2807,7 @@ static int show_proc( SCHAR * procname)
sprintf (Print_buffer,
"================================= ======================================%s", NEWLINE);
ISQL_printf (Out, Print_buffer);
first_proc = FALSE;
first_proc = false;
}
/* Strip trailing blanks */
@ -2796,7 +2816,7 @@ static int show_proc( SCHAR * procname)
sprintf (Print_buffer, "%-34s", PRC.RDB$PROCEDURE_NAME);
ISQL_printf (Out, Print_buffer);
first = TRUE;
first = true;
FOR DEP IN RDB$DEPENDENCIES WITH
PRC.RDB$PROCEDURE_NAME EQ DEP.RDB$DEPENDENT_NAME
REDUCED TO DEP.RDB$DEPENDED_ON_TYPE, DEP.RDB$DEPENDED_ON_NAME
@ -2808,7 +2828,7 @@ static int show_proc( SCHAR * procname)
sprintf (Print_buffer, "%s%34s", NEWLINE, "");
ISQL_printf (Out, Print_buffer);
}
first = FALSE;
first = false;
sprintf (Print_buffer, "%s, %s", DEP.RDB$DEPENDED_ON_NAME,
Object_types[DEP.RDB$DEPENDED_ON_TYPE]);
ISQL_printf (Out, Print_buffer);
@ -2834,7 +2854,7 @@ static int show_proc( SCHAR * procname)
FOR PRC IN RDB$PROCEDURES WITH
PRC.RDB$PROCEDURE_NAME EQ procname
first = FALSE;
first = false;
sprintf (Print_buffer, "Procedure text:%s", NEWLINE);
ISQL_printf (Out, Print_buffer);
@ -2861,7 +2881,7 @@ static int show_proc( SCHAR * procname)
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type) {
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10) {
/* Handle Integral subtypes NUMERIC and DECIMAL */
@ -2881,7 +2901,7 @@ static int show_proc( SCHAR * procname)
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -2892,7 +2912,7 @@ static int show_proc( SCHAR * procname)
} /* if field_type ... */
} /* if major_ods ... */
if (precision_known == FALSE) {
if (precision_known == false) {
/* Take a stab at numerics and decimals */
if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0))
sprintf (type_name, "NUMERIC(4, %d)", -FLD.RDB$FIELD_SCALE);
@ -2943,11 +2963,11 @@ static int show_proc( SCHAR * procname)
}
static int show_role( SCHAR * object)
static int show_role(SCHAR * object)
{
SCHAR role_name[BUFFER_LENGTH128];
SCHAR user_string[44];
SSHORT first = TRUE;
bool first = true;
SSHORT odd = 1;
if (object == NULL) { /* show role with no parameters, show all roles */
@ -2962,7 +2982,7 @@ static int show_role( SCHAR * object)
X.RDB$ROLE_NAME NOT MISSING
SORTED BY X.RDB$ROLE_NAME
first = FALSE;
first = false;
sprintf (Print_buffer, "%38s%s", X.RDB$ROLE_NAME, (odd ? " " : NEWLINE));
ISQL_printf (Out, Print_buffer);
odd = 1 - odd;
@ -2987,7 +3007,7 @@ static int show_role( SCHAR * object)
{
/* show role with role supplied, display users granted this role */
FOR FIRST 1 R IN RDB$ROLES WITH R.RDB$ROLE_NAME EQ object;
first = FALSE;
first = false;
FOR PRV IN RDB$USER_PRIVILEGES WITH
PRV.RDB$OBJECT_TYPE EQ obj_sql_role AND
@ -3007,7 +3027,7 @@ static int show_role( SCHAR * object)
strcpy (user_string, PRV.RDB$USER);
sprintf(Print_buffer, "%s\n", user_string);
first = FALSE;
first = false;
ISQL_printf (Out, Print_buffer);
END_FOR
@ -3030,7 +3050,7 @@ static int show_role( SCHAR * object)
}
static int show_table( SCHAR * relation_name)
static int show_table(SCHAR * relation_name)
{
/**************************************
*
@ -3048,10 +3068,8 @@ static int show_table( SCHAR * relation_name)
*
**************************************/
SSHORT i, subtype;
SCHAR *collist;
SSHORT first = TRUE;
collist = NULL;
SCHAR *collist = NULL;
bool first = true;
/* Query to obtain relation information */
@ -3063,7 +3081,7 @@ static int show_table( SCHAR * relation_name)
ISQL_printf (Out, Print_buffer);
}
}
first = FALSE;
first = false;
END_FOR
ON_ERROR
ISQL_errmsg(isc_status);
@ -3133,7 +3151,7 @@ static int show_table( SCHAR * relation_name)
for (i = 0; Column_types [i].type; i++)
if (FLD.RDB$FIELD_TYPE == Column_types [i].type) {
BOOLEAN precision_known = FALSE;
bool precision_known = false;
if (major_ods >= ODS_VERSION10) {
/* Handle Integral subtypes NUMERIC and DECIMAL */
@ -3153,7 +3171,7 @@ static int show_table( SCHAR * relation_name)
Integral_subtypes [FLD1.RDB$FIELD_SUB_TYPE],
FLD1.RDB$FIELD_PRECISION,
-FLD1.RDB$FIELD_SCALE);
precision_known = TRUE;
precision_known = true;
}
}
END_FOR
@ -3164,7 +3182,7 @@ static int show_table( SCHAR * relation_name)
}
}
if (precision_known == FALSE) {
if (precision_known == false) {
/* Take a stab at numerics and decimals */
if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0)) {
sprintf (Print_buffer, "NUMERIC(4, %d)", -FLD.RDB$FIELD_SCALE);
@ -3312,7 +3330,7 @@ static int show_table( SCHAR * relation_name)
RELC1.RDB$RELATION_NAME EQ relation_name
SORTED BY RELC1.RDB$CONSTRAINT_TYPE, RELC1.RDB$CONSTRAINT_NAME
ISQL_get_index_segments (collist, RELC1.RDB$INDEX_NAME, FALSE);
ISQL_get_index_segments (collist, RELC1.RDB$INDEX_NAME, false);
if (!strncmp (RELC1.RDB$CONSTRAINT_TYPE, "PRIMARY", 7)) {
ISQL_blankterm (RELC1.RDB$CONSTRAINT_NAME);
sprintf (Print_buffer, "CONSTRAINT %s:%s", RELC1.RDB$CONSTRAINT_NAME, NEWLINE);
@ -3331,7 +3349,7 @@ static int show_table( SCHAR * relation_name)
ISQL_blankterm (RELC1.RDB$CONSTRAINT_NAME);
sprintf (Print_buffer, "CONSTRAINT %s:%s", RELC1.RDB$CONSTRAINT_NAME, NEWLINE);
ISQL_printf (Out, Print_buffer);
ISQL_get_index_segments (collist, RELC1.RDB$INDEX_NAME, FALSE);
ISQL_get_index_segments (collist, RELC1.RDB$INDEX_NAME, false);
sprintf (Print_buffer, " Foreign key (%s)", collist);
ISQL_printf (Out, Print_buffer);
@ -3340,7 +3358,7 @@ static int show_table( SCHAR * relation_name)
RELC2.RDB$CONSTRAINT_NAME EQ REFC.RDB$CONST_NAME_UQ AND
REFC.RDB$CONSTRAINT_NAME EQ RELC1.RDB$CONSTRAINT_NAME
ISQL_get_index_segments (collist, RELC2.RDB$INDEX_NAME, FALSE);
ISQL_get_index_segments (collist, RELC2.RDB$INDEX_NAME, false);
ISQL_blankterm (RELC2.RDB$RELATION_NAME);
sprintf (Print_buffer, " References %s (%s)",
@ -3351,14 +3369,14 @@ static int show_table( SCHAR * relation_name)
ISQL_truncate_term (REFC.RDB$UPDATE_RULE,
sizeof(REFC.RDB$UPDATE_RULE));
ISQL_ri_action_print (REFC.RDB$UPDATE_RULE, " On Update",
FALSE);
false);
}
if (!REFC.RDB$DELETE_RULE.NULL) {
ISQL_truncate_term (REFC.RDB$DELETE_RULE,
sizeof(REFC.RDB$DELETE_RULE));
ISQL_ri_action_print (REFC.RDB$DELETE_RULE, " On Delete",
FALSE);
false);
}
sprintf (Print_buffer, "%s", NEWLINE);
@ -3418,7 +3436,8 @@ static int show_table( SCHAR * relation_name)
}
static int show_trigger( SCHAR * object, SSHORT flag)
static int show_trigger(SCHAR * object,
SSHORT flag)
{
/**************************************
*
@ -3430,8 +3449,8 @@ static int show_trigger( SCHAR * object, SSHORT flag)
* Show triggers in general or for the named object or trigger
*
**************************************/
SSHORT first = TRUE;
SSHORT skip = FALSE;
bool first = true;
bool skip = false;
/* Show all triggers */
if (!*object)
@ -3453,7 +3472,7 @@ static int show_trigger( SCHAR * object, SSHORT flag)
sprintf (Print_buffer,
"=========== ============%s", NEWLINE);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
ISQL_blankterm (TRG.RDB$TRIGGER_NAME);
@ -3484,7 +3503,7 @@ static int show_trigger( SCHAR * object, SSHORT flag)
sprintf (Print_buffer,
"=========== ============%s", NEWLINE);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
ISQL_blankterm (TRG.RDB$TRIGGER_NAME);
@ -3515,12 +3534,12 @@ static int show_trigger( SCHAR * object, SSHORT flag)
SORTED BY TRG.RDB$RELATION_NAME, TRG.RDB$TRIGGER_TYPE,
TRG.RDB$TRIGGER_SEQUENCE, TRG.RDB$TRIGGER_NAME;
skip = FALSE;
skip = false;
if (V4) {
/* Skip triggers for check constraints */
FOR FIRST 1 CHK IN RDB$CHECK_CONSTRAINTS WITH
TRG.RDB$TRIGGER_NAME EQ CHK.RDB$TRIGGER_NAME
skip = TRUE;
skip = true;
END_FOR
ON_ERROR
ISQL_errmsg (isc_status);
@ -3538,7 +3557,7 @@ static int show_trigger( SCHAR * object, SSHORT flag)
TRG.RDB$RELATION_NAME,
NEWLINE);
ISQL_printf (Out, Print_buffer);
first = FALSE;
first = false;
}
sprintf (Print_buffer, "%s, Sequence: %d, Type: %s, %s%s",

View File

@ -26,11 +26,11 @@
extern BOOLEAN SHOW_dbb_parameters (FRBRD *, SCHAR *, SCHAR *, USHORT, USHORT);
extern bool SHOW_dbb_parameters (FRBRD *, SCHAR *, SCHAR *, USHORT, bool);
extern int SHOW_grants (SCHAR *, SCHAR *, USHORT);
extern int SHOW_grants2 (SCHAR *, SCHAR *, USHORT, TEXT *);
extern void SHOW_grant_roles (SCHAR *, SSHORT *);
extern void SHOW_grant_roles2 (SCHAR *, SSHORT *, TEXT *);
extern void SHOW_grant_roles (SCHAR *, bool *);
extern void SHOW_grant_roles2 (SCHAR *, bool *, TEXT *);
extern void SHOW_print_metadata_text_blob(IB_FILE *, GDS__QUAD *);
extern int SHOW_metadata(SCHAR **, SCHAR **);