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

-Use C++ struct declaration style.

This commit is contained in:
brodsom 2004-05-24 17:22:35 +00:00
parent f6be8fe698
commit a799e5f44b
7 changed files with 47 additions and 29 deletions

View File

@ -57,7 +57,7 @@ enum alice_shut_mode {
SHUT_FULL = 4
};
typedef struct user_action
struct user_action
{
ULONG ua_switches;
UCHAR* ua_user;
@ -74,7 +74,7 @@ typedef struct user_action
TEXT ua_log_file[MAXPATHLEN];
USHORT ua_db_SQL_dialect;
alice_shut_mode ua_shutdown_mode;
} *USER_ACTION;
};
@ -90,7 +90,7 @@ public:
// Transaction block: used to store info about a multidatabase transaction.
typedef struct tdr : public pool_alloc<alice_type_tdr>
struct tdr : public pool_alloc<alice_type_tdr>
{
tdr* tdr_next; // next subtransaction
SLONG tdr_id; // database-specific transaction id
@ -102,8 +102,9 @@ typedef struct tdr : public pool_alloc<alice_type_tdr>
FB_API_HANDLE tdr_db_handle; // reattached database handle
USHORT tdr_db_caps; // capabilities of database
USHORT tdr_state; // see flags below
} *TDR;
};
typedef tdr* TDR;
// Transaction Description Record
const int TDR_VERSION = 1;

View File

@ -505,7 +505,7 @@ enum att_type {
};
typedef enum att_type ATT_TYPE;
typedef att_type ATT_TYPE;
// TMN: Why was this even added in the first place???
//typedef SCHAR att_type;
@ -617,14 +617,16 @@ struct burp_prc {
};
typedef struct gfld {
struct gfld {
TEXT gfld_name [GDS_NAME_LEN];
ISC_QUAD gfld_vb;
ISC_QUAD gfld_vs;
ISC_QUAD gfld_vs2;
gfld* gfld_next;
USHORT gfld_flags;
} *GFLD;
};
typedef gfld* GFLD;
enum gfld_flags_vals {
GFLD_validation_blr = 1,
@ -692,13 +694,13 @@ const int INVALID_HANDLE_VALUE = -1;
// File block -- for multi-file databases
typedef enum {
enum SIZE_CODE {
size_n = 0, // none
size_k, // k = 1024
size_m, // m = k x 1024
size_g, // g = m x 1024
size_e // error
} SIZE_CODE;
};
struct burp_fil {
burp_fil* fil_next;
@ -713,19 +715,23 @@ const size_t FIL_LEN = sizeof(burp_fil);
/* Split & Join stuff */
typedef enum act_t {
enum act_t {
ACT_unknown, // action is unknown
ACT_backup,
ACT_backup_split,
ACT_restore,
ACT_restore_join
} ACT_T;
};
typedef struct act {
typedef act_t ACT_T;
struct act {
USHORT act_total;
burp_fil* act_file;
ACT_T act_action;
} *ACT;
};
typedef act* ACT;
const size_t ACT_LEN = sizeof(act);
@ -733,7 +739,7 @@ const ULONG MAX_LENGTH = -1UL; // Keep in sync with burp_fil.fil_length
// This structure has been cloned from spit.c
typedef struct hdr_split {
struct hdr_split {
TEXT hdr_split_tag[18];
TEXT hdr_split_timestamp[30];
TEXT hdr_split_text1[11];
@ -742,7 +748,9 @@ typedef struct hdr_split {
TEXT hdr_split_total[4]; // Total number of files
TEXT hdr_split_text3[2];
TEXT hdr_split_name[27]; // File name
} *HDR_SPLIT;
};
typedef hdr_split* HDR_SPLIT;
/* NOTE: size of the hdr_split_tag and HDR_SPLIT_TAG must be the same and equal
to 18. Otherwise we will not be able to join the gbk files v5.x */
@ -755,7 +763,7 @@ const unsigned int MIN_SPLIT_SIZE = 2048; // bytes
// Global switches and data
typedef struct tgbl
struct tgbl
{
thdd tgbl_thd_data;
const TEXT* gbl_database_file_name;
@ -881,7 +889,9 @@ typedef struct tgbl
isc_req_handle handles_write_procedure_prms_req_handle1;
USHORT hdr_forced_writes;
TEXT database_security_class[GDS_NAME_LEN]; // To save database security class for deferred update
} *TGBL;
};
typedef tgbl* TGBL;
// CVC: This aux routine declared here to not force inclusion of burp.h with burp_proto.h
// in other modules.

View File

@ -44,13 +44,15 @@ DATABASE DB = STATIC FILENAME "yachts.lnk";
const int array_desc_column_major = 1; // Set for FORTRAN
typedef struct gen_t {
struct gen_t {
UCHAR* gen_sdl;
UCHAR** gen_sdl_ptr;
UCHAR* gen_end;
ISC_STATUS* gen_status;
SSHORT gen_internal;
} *GEN_T;
};
typedef gen_t *GEN_T;
static void adjust_length(ISC_ARRAY_DESC*);
static void copy_exact_name (const char*, char*, SSHORT);

View File

@ -25,11 +25,13 @@
* MOD 29-Jun-2002
*/
typedef struct tok {
struct tok {
USHORT tok_ident;
const char* tok_string;
USHORT tok_version;
} TOK;
};
typedef tok TOK;
// These symbols are exported
extern "C" {

View File

@ -39,7 +39,7 @@
// an enumeration of the possible node types in a syntax tree
typedef enum nod_t
enum nod_t
{
nod_unknown_type = 0,
nod_commit = 1, // Commands, not executed.
@ -332,8 +332,9 @@ typedef enum nod_t
nod_exec_block, // EXECUTE BLOCK support
nod_param_val, // default value for SP parameters support
nod_rows // ROWS support
} NOD_TYPE;
};
typedef nod_t NOD_TYPE;
/* definition of a syntax node created both
in parsing and in context recognition */

View File

@ -29,7 +29,7 @@
const USHORT DIALECT_sqlda = 0;
const USHORT DIALECT_xsqlda = 1;
typedef struct
struct SQLVAR
{
SSHORT sqltype;
SSHORT sqllen;
@ -37,16 +37,16 @@ typedef struct
SSHORT* sqlind;
SSHORT sqlname_length;
SCHAR sqlname[30];
} SQLVAR;
};
typedef struct
struct SQLDA
{
SCHAR sqldaid[8];
SLONG sqldabc;
SSHORT sqln;
SSHORT sqld;
SQLVAR sqlvar[1];
} SQLDA;
};
#define SQLDA_LENGTH(n) (sizeof (SQLDA) + (n-1) * sizeof (SQLVAR))

View File

@ -28,7 +28,7 @@
// possible symbol types
typedef enum sym_type {
enum sym_type {
SYM_statement,
SYM_cursor,
SYM_keyword,
@ -40,7 +40,9 @@ typedef enum sym_type {
SYM_procedure,
SYM_intlsym,
SYM_eof
} SYM_TYPE;
};
typedef sym_type SYM_TYPE;
// symbol block