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

-Use C++ struct declaration style.

This commit is contained in:
brodsom 2004-05-24 17:31:47 +00:00
parent 18dc386661
commit 64c1dee04e
45 changed files with 403 additions and 214 deletions

View File

@ -164,12 +164,14 @@ static const struct { /* Used in make_int64_key() */
/* enumerate the possible outcomes of deleting a node */
typedef enum contents {
enum contents {
contents_empty = 0,
contents_single,
contents_below_threshold,
contents_above_threshold
} CONTENTS;
};
typedef contents CONTENTS;
static SLONG add_node(thread_db*, WIN*, index_insertion*, temporary_key*, SLONG*,
SLONG*, SLONG*);

View File

@ -20,7 +20,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: builtin.cpp,v 1.8 2003-12-22 10:00:46 robocop Exp $
* $Id: builtin.cpp,v 1.9 2004-05-24 17:28:32 brodsom Exp $
*/
#include "firebird.h"
@ -30,11 +30,11 @@
#include "../jrd/flu_proto.h"
#include "../jrd/gds_proto.h"
typedef struct {
struct FN {
const TEXT* fn_module;
const TEXT* fn_entrypoint;
FPTR_INT fn_function;
} FN;
};
static const FN isc_builtin_functions[] = {
/* Internal functions available for QA testing only */

View File

@ -194,14 +194,14 @@ mark - 0 - 0 */
/* LATCH types */
typedef enum
enum LATCH
{
LATCH_none,
LATCH_shared,
LATCH_io,
LATCH_exclusive,
LATCH_mark
} LATCH;
};
/* LWT -- Latch wait block */

View File

@ -49,7 +49,7 @@
*
*/
/*
$Id: common.h,v 1.119 2004-05-24 11:23:41 kkuznetsov Exp $
$Id: common.h,v 1.120 2004-05-24 17:28:32 brodsom Exp $
*/
#ifndef JRD_COMMON_H
@ -793,11 +793,11 @@ typedef unsigned long UATOM;
#ifndef ISC_TIMESTAMP_DEFINED
typedef SLONG ISC_DATE;
typedef ULONG ISC_TIME;
typedef struct
struct ISC_TIMESTAMP
{
ISC_DATE timestamp_date;
ISC_TIME timestamp_time;
} ISC_TIMESTAMP;
};
#define ISC_TIMESTAMP_DEFINED
#endif /* ISC_TIMESTAMP_DEFINED */

View File

@ -156,11 +156,11 @@ double MTH$CVT_D_G(), MTH$CVT_G_D();
#define CVT_COPY_BUFF(from,to,len) \
{if (len) {MOVE_FAST(from,to,len); from +=len; to+=len; len=0;} }
typedef enum {
enum EXPECT_DATETIME{
expect_timestamp,
expect_sql_date,
expect_sql_time
} EXPECT_DATETIME;
};
#if (defined REQUESTER || defined SUPERCLIENT)
static TEXT cvt_failures[CVT_FAILURE_SPACE];

View File

@ -31,12 +31,14 @@ enum s_type {
symb_absolute
};
typedef struct symb {
struct symb {
char *symb_string;
int (**symb_value) ();
enum s_type symb_type;
short symb_size;
} *SYMB;
};
typedef symb *SYMB;
#endif // JRD_DBG_H

View File

@ -36,7 +36,7 @@
// See MET_format() and make_format() in MET.EPP for enlightenment.
typedef struct dsc
struct dsc
{
typedef UCHAR dtype_t;
typedef SCHAR scale_t;
@ -141,8 +141,9 @@ typedef struct dsc
//bid asArrayId() const;
SINT64 asSBigInt() const;
UINT64 asUBigInt() const;
} DSC;
};
typedef dsc DSC;
// Data types

View File

@ -241,7 +241,7 @@ int des_cipher(const char* in, char* out, long salt, int num_iter);
* 8% performance penalty.
*/
typedef union {
union C_block{
unsigned char b[8];
struct {
#if defined(LONG_IS_32_BITS)
@ -253,7 +253,7 @@ typedef union {
long i1:32;
#endif
} b32;
} C_block;
};
/*

View File

@ -32,13 +32,15 @@ namespace Jrd {
/* Index error types */
typedef enum idx_e {
enum idx_e {
idx_e_ok = 0,
idx_e_duplicate,
idx_e_keytoobig,
idx_e_conversion,
idx_e_foreign
} IDX_E;
};
typedef idx_e IDX_E;
class jrd_rel;
} //namespace Jrd

View File

@ -41,7 +41,7 @@ const int FAST_ALLOC = 16;
const int EVH_HASH_SIZE = 7;
typedef struct evh {
struct evh {
SLONG evh_length; /* Current length of global section */
UCHAR evh_version; /* Version number of global section */
srq evh_events; /* Known processes */
@ -51,7 +51,9 @@ typedef struct evh {
MTX_T evh_mutex[1]; /* Mutex controlling access */
SLONG evh_request_id; /* Next request id */
SRQ_PTR evh_hash_table[EVH_HASH_SIZE];
} *EVH;
};
typedef evh *EVH;
/* Common block header */

View File

@ -38,11 +38,13 @@
#define NODE(type, name, keyword) type,
typedef enum nod_t {
enum nod_t {
#include "../jrd/nod.h"
nod_MAX
#undef NODE
} NOD_T;
};
typedef nod_t NOD_T;
#include "../jrd/dsc.h"
#include "../jrd/rse.h"

View File

@ -53,10 +53,12 @@ const int EXT_opened = 1; /* File has been opened */
const int EXT_eof = 2; /* Positioned at EOF */
const int EXT_readonly = 4; /* File could only be opened for read */
typedef struct irsb_ext {
struct irsb_ext {
USHORT irsb_flags; /* flags (a whole word!) */
UCHAR irsb_ext_dbkey[8]; /* DBKEY */
} *IRSB_EXT;
};
typedef irsb_ext* IRSB_EXT;
/* Overload record parameter block with external file stuff */

View File

@ -117,11 +117,13 @@ static const char* LOGFILE = "[syserr]firebird.log";
static const char* ISC_LOGICAL = "interbase:";
static const char* ISC_LOGICAL_LOCK = "interbase_lock:";
typedef struct isc_vms_prefix
struct isc_vms_prefix
{
TEXT* isc_prefix;
TEXT* vms_prefix;
} *ISC_VMS_PREFIX;
};
typedef struct isc_vms_prefix *ISC_VMS_PREFIX;
static struct isc_vms_prefix trans_prefix[] =
{

View File

@ -69,11 +69,13 @@ static const UCHAR char_tab[128] =
/* Miscellaneous filter stuff (should be moved someday) */
typedef struct tmp {
struct tmp {
tmp* tmp_next;
USHORT tmp_length;
TEXT tmp_string[1];
} *TMP;
};
typedef tmp *TMP;
#ifdef VMS
const char* const WILD_CARD_UIC = "<*,*>";

View File

@ -44,12 +44,14 @@ typedef void *HMOD;
/* External function module descriptor */
typedef struct mod {
struct mod {
HMOD mod_handle; /* Handle to search for entrypoints */
mod* mod_next; /* Linked list of open modules */
SLONG mod_use_count; /* Databases interested in module */
USHORT mod_length; /* Module name length */
TEXT mod_name[1]; /* Module name */
} *MOD;
};
typedef mod *MOD;
#endif /* JRD_FLU_H */

View File

@ -33,11 +33,11 @@
extern "C" {
typedef struct {
struct FN {
const char* fn_module;
const char* fn_entrypoint;
FPTR_INT fn_function;
} FN;
};
// FPTR_INT FUNCTIONS_entrypoint(char*, char*);

View File

@ -194,14 +194,16 @@ static char ib_prefix_msg_val[MAXPATHLEN];
// This structure is used to parse the firebird.msg file.
typedef struct gds_msg
struct gds_msg
{
ULONG msg_top_tree;
int msg_file;
USHORT msg_bucket_size;
USHORT msg_levels;
SCHAR msg_bucket[1];
} *GDS_MSG;
};
typedef gds_msg *GDS_MSG;
// CVC: This structure has a totally different layout than "class ctl" from
// blob_filter.h and "struct isc_blob_ctl" from ibase.h. These two should match
@ -249,12 +251,14 @@ static void safe_concat_path(TEXT* destbuf, const TEXT* srcbuf);
/* Generic cleanup handlers */
typedef struct clean
struct clean
{
struct clean* clean_next;
void (*clean_routine)(void*);
void* clean_arg;
} *CLEAN;
};
typedef clean *CLEAN;
static CLEAN cleanup_handlers = NULL;
static gds_msg* global_default_msg = NULL;

View File

@ -66,11 +66,13 @@ const UCHAR TIMESTAMP_SIZE = 8;
#define FIELD(type,name,dtype,length,sub_type,ods,dflt_blr) type,
typedef enum gflds {
enum gflds {
#include "../jrd/fields.h"
gfld_MAX} GFLDS;
gfld_MAX};
#undef FIELD
typedef gflds GFLDS;
/* Pick up actual global fields */
#ifndef GPRE
@ -106,13 +108,15 @@ static const struct gfld gfields[] = {
#define RELATION(name, id, ods) id,
#define FIELD(symbol, name, id, update, ods, upd_id, upd_ods)
#define END_RELATION
typedef enum rids {
enum rids {
#include "../jrd/relations.h"
rel_MAX} RIDS;
rel_MAX};
#undef RELATION
#undef FIELD
#undef END_RELATION
typedef rids RIDS;
/* Pick up relations themselves */
#define RELATION(name, id, ods) (UCHAR) name,(UCHAR) id, ods,
@ -179,11 +183,13 @@ static const rtyp types[] = {
#ifndef GPRE
/* obtain international names */
typedef struct initcharset {
struct initcharset {
const UCHAR* init_charset_name;
SSHORT init_charset_id;
USHORT init_charset_bytes_per_char;
} CS_TYPE;
};
typedef initcharset CS_TYPE;
#define CHARSET(name, cs_id, coll_id, bytes, num, s1, s2) \
{ (const UCHAR *) (name), (cs_id), (bytes)},
@ -200,11 +206,13 @@ static const CS_TYPE cs_types[] = {
#undef COLLATION
#undef END_CHARSET
typedef struct initcollation {
struct initcollation {
const UCHAR *init_collation_name;
SSHORT init_collation_charset;
SSHORT init_collation_id;
} COLL_TYPE;
};
typedef initcollation COLL_TYPE;
#define CHARSET(name, cs_id, coll_id, bytes, num, s1, s2) \
{ (const UCHAR *) (name), (cs_id), (coll_id) },

View File

@ -41,23 +41,27 @@ const USHORT ISC_MEM_REMOVE = 2;
/* InterBase platform-specific synchronization data structures */
#ifdef VMS
typedef struct itm {
struct itm {
SSHORT itm_length;
SSHORT itm_code;
SCHAR *itm_buffer;
SSHORT *itm_return_length;
} ITM;
};
typedef itm ITM;
struct event_t {
SLONG event_pid;
SLONG event_count;
};
typedef struct wait {
struct wait {
USHORT wait_count;
event_t* wait_events;
SLONG *wait_values;
} WAIT;
};
typedef wait WAIT;
/* Lock status block */
@ -70,16 +74,18 @@ struct lock_status {
/* Poke block (for asynchronous poking) */
typedef struct poke {
struct poke {
struct poke *poke_next;
lock_status poke_lksb;
SLONG poke_parent_id;
USHORT poke_value;
USHORT poke_use_count;
} *POKE;
};
typedef poke* POKE;
#define SH_MEM_STRUCTURE_DEFINED
typedef struct sh_mem {
struct sh_mem {
int sh_mem_system_flag;
UCHAR *sh_mem_address;
SLONG sh_mem_length_mapped;
@ -88,7 +94,9 @@ typedef struct sh_mem {
SLONG sh_mem_retadr[2];
SLONG sh_mem_channel;
TEXT sh_mem_filename[128];
} SH_MEM_T, *SH_MEM;
};
typedef struct sh_mem SH_MEM_T;
typedef struct sh_mem* SH_MEM;
#endif
@ -99,16 +107,20 @@ typedef struct sh_mem {
#ifdef ANY_THREADING
typedef struct mtx {
struct mtx {
THD_MUTEX_STRUCT mtx_mutex[1];
} MTX_T, *MTX;
};
typedef mtx MTX_T;
typedef mtx* MTX;
#else
typedef struct mtx {
struct mtx {
SLONG mtx_semid;
SSHORT mtx_semnum;
SCHAR mtx_use_count;
SCHAR mtx_wait;
} MTX_T, *MTX;
};
typedef mtx MTX_T;
typedef mtx* MTX;
#endif /* ANY_THREADING */
@ -131,23 +143,28 @@ struct event_t
#define SH_MEM_STRUCTURE_DEFINED
typedef struct sh_mem
struct sh_mem
{
int sh_mem_semaphores;
UCHAR *sh_mem_address;
SLONG sh_mem_length_mapped;
SLONG sh_mem_mutex_arg;
SLONG sh_mem_handle;
} SH_MEM_T, *SH_MEM;
};
typedef sh_mem SH_MEM_T;
typedef sh_mem *SH_MEM;
#endif /* UNIX */
#ifdef WIN_NT
#define MTX_STRUCTURE_DEFINED
typedef struct mtx
struct mtx
{
void* mtx_handle;
} MTX_T, *MTX;
};
typedef mtx MTX_T;
typedef mtx *MTX;
struct event_t
{
@ -159,7 +176,7 @@ struct event_t
};
#define SH_MEM_STRUCTURE_DEFINED
typedef struct sh_mem
struct sh_mem
{
UCHAR* sh_mem_address;
SLONG sh_mem_length_mapped;
@ -170,8 +187,9 @@ typedef struct sh_mem
void* sh_mem_hdr_object;
SLONG* sh_mem_hdr_address;
TEXT sh_mem_name[256];
} SH_MEM_T, *SH_MEM;
};
typedef sh_mem SH_MEM_T;
typedef sh_mem *SH_MEM;
#define THREAD_HANDLE_DEFINED
typedef void *THD_T;
#endif
@ -179,24 +197,28 @@ typedef void *THD_T;
#ifndef MTX_STRUCTURE_DEFINED
#define MTX_STRUCTURE_DEFINED
typedef struct mtx
struct mtx
{
SSHORT mtx_event_count[3];
SCHAR mtx_use_count;
SCHAR mtx_wait;
} MTX_T, *MTX;
};
typedef mtx MTX_T;
typedef mtx *MTX;
#endif
#undef MTX_STRUCTURE_DEFINED
#ifndef SH_MEM_STRUCTURE_DEFINED
#define SH_MEM_STRUCTURE_DEFINED
typedef struct sh_mem
struct sh_mem
{
UCHAR* sh_mem_address;
SLONG sh_mem_length_mapped;
SLONG sh_mem_mutex_arg;
SLONG sh_mem_handle;
} SH_MEM_T, *SH_MEM;
};
typedef sh_mem SH_MEM_T;
typedef sh_mem *SH_MEM;
#endif
#undef SH_MEM_STRUCTURE_DEFINED
@ -209,14 +231,16 @@ typedef ULONG THD_T;
/* Interprocess communication configuration structure */
typedef struct ipccfg
struct ipccfg
{
const char* ipccfg_keyword;
SCHAR ipccfg_key;
SLONG* ipccfg_variable;
SSHORT ipccfg_parent_offset; /* Relative offset of parent keyword */
USHORT ipccfg_found; /* TRUE when keyword has been set */
} *IPCCFG;
};
typedef ipccfg *IPCCFG;
/* AST actions taken by SCH_ast() */

View File

@ -91,12 +91,13 @@ const char* LOGICAL_NAME_TABLE = "LNM$FILE_DEV";
const char* DEFAULT_FILE_NAME = ".fdb";
const char INET_FLAG = '^';
typedef struct itm {
struct itm {
SSHORT itm_length;
SSHORT itm_code;
SCHAR *itm_buffer;
SSHORT *itm_return_length;
} ITM;
};
typedef itm ITM;
#else /* of ifdef VMS */
const char INET_FLAG = ':';
@ -161,11 +162,12 @@ const char* MTAB = "/etc/mtab";
#endif
typedef struct mnt {
struct mnt {
TEXT *mnt_node;
TEXT *mnt_mount;
TEXT *mnt_path;
} MNT;
};
typedef mnt MNT;
#ifndef MAXHOSTLEN

View File

@ -285,7 +285,7 @@ void Jrd::Trigger::release(thread_db* tdbb)
/* Option block for database parameter block */
typedef struct dpb
struct dpb
{
const TEXT* dpb_sys_user_name;
const TEXT* dpb_user_name;
@ -340,7 +340,9 @@ typedef struct dpb
USHORT dpb_sql_dialect;
USHORT dpb_set_db_sql_dialect;
TEXT* dpb_set_db_charset;
} DPB;
};
typedef dpb DPB;
static blb* check_blob(thread_db*, ISC_STATUS*, blb**);
static ISC_STATUS check_database(thread_db*, Attachment*, ISC_STATUS*);

View File

@ -585,19 +585,23 @@ class Parameter : public pool_alloc_rpt<SCHAR, type_prm>
/* Primary dependencies from all foreign references to relation's
primary/unique keys */
typedef struct prim {
struct prim {
vec* prim_reference_ids;
vec* prim_relations;
vec* prim_indexes;
} *PRIM;
};
typedef prim *PRIM;
/* Foreign references to other relations' primary/unique keys */
typedef struct frgn {
struct frgn {
vec* frgn_reference_ids;
vec* frgn_relations;
vec* frgn_indexes;
} *FRGN;
};
typedef frgn *FRGN;
// Relation trigger definition
class Trigger {
@ -843,11 +847,13 @@ typedef vcl* VCL;
//
// Transaction element block
//
typedef struct teb {
struct teb {
Attachment** teb_database;
int teb_tpb_length;
UCHAR* teb_tpb;
} TEB;
};
typedef teb TEB;
/* Blocking Thread Block */
@ -863,7 +869,7 @@ class BlockingThread : public pool_alloc<type_btb>
// and reside in ods.h, although I watched a place with 1 and others with members
// of a struct.
typedef struct win {
struct win {
SLONG win_page;
Ods::pag* win_buffer;
exp_index_buf* win_expanded_buffer;
@ -871,7 +877,9 @@ typedef struct win {
SSHORT win_scans;
USHORT win_flags;
explicit win(SLONG wp) : win_page(wp), win_flags(0) {}
} WIN;
};
typedef win WIN;
// This is a compilation artifact: I wanted to be sure I would pick all old "win"
// declarations at the top, so "win" was built with a mandatory argument in
@ -1041,7 +1049,7 @@ inline void SET_TDBB(Jrd::thread_db* &tdbb) {
}
CHECK_TDBB(tdbb);
}
inline void SET_DBB(Jrd::Database* &dbb) {
inline void SET_DBB(Jrd::Database* &dbb) {
if (dbb == NULL) {
dbb = GET_DBB();
}

View File

@ -26,7 +26,7 @@
/* Record types for record summary blob records */
typedef enum rsr_t {
enum rsr_t {
RSR_field_id,
RSR_field_name,
RSR_view_context,
@ -50,7 +50,9 @@ typedef enum rsr_t {
RSR_field_length,
RSR_field_sub_type,
RSR_field_not_null
} RSR_T;
};
typedef rsr_t RSR_T;
/* Temporary field block */

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: msg.h,v 1.5 2004-05-06 18:07:02 brodsom Exp $
$Id: msg.h,v 1.6 2004-05-24 17:28:33 brodsom Exp $
*/
#ifndef JRD_MSG_H
@ -34,30 +34,36 @@ const UCHAR MSG_MINOR_VERSION = 0;
/* Message file header block */
typedef struct isc_msghdr {
struct isc_msghdr {
UCHAR msghdr_major_version; // Version number
UCHAR msghdr_minor_version; // Version number
USHORT msghdr_bucket_size; // Bucket size of B-tree
ULONG msghdr_top_tree; // Start address of first index bucket
ULONG msghdr_origin; // Origin for data records, unused.
USHORT msghdr_levels; // Levels in tree
} ISC_MSGHDR;
};
typedef isc_msghdr ISC_MSGHDR;
/* Index node */
typedef struct msgnod {
struct msgnod {
ULONG msgnod_code; /* Message code */
ULONG msgnod_seek; /* Offset of next bucket or message */
} *MSGNOD;
};
typedef msgnod *MSGNOD;
/* Leaf node */
typedef struct msgrec {
struct msgrec {
ULONG msgrec_code; /* Message code */
USHORT msgrec_length; /* Length of message text */
USHORT msgrec_flags; /* Misc flags */
TEXT msgrec_text[1]; /* Text of message */
} *MSGREC;
};
typedef msgrec *MSGREC;
#define NEXT_LEAF(leaf) (MSGREC) \
((SCHAR*) leaf + FB_ALIGN(OFFSETA (MSGREC, msgrec_text) + leaf->msgrec_length, sizeof (SLONG)))

View File

@ -159,7 +159,7 @@ namespace Ods {
/* Basic page header */
typedef struct pag
struct pag
{
SCHAR pag_type;
SCHAR pag_flags;
@ -168,7 +168,9 @@ typedef struct pag
// We renamed pag_seqno for SCN number usage to avoid major ODS version bump
ULONG pag_scn; /* WAL seqno of last update */
ULONG reserved; /* Was used for WAL */
} *PAG;
};
typedef pag *PAG;
/* Blob page */
@ -304,9 +306,11 @@ struct irtd_ods10 {
USHORT irtd_itype;
};
typedef struct irtd : public irtd_ods10 {
struct irtd : public irtd_ods10 {
float irtd_selectivity;
} IRTD;
};
typedef irtd IRTD;
const USHORT irt_unique = 1;
const USHORT irt_descending = 2;
@ -396,12 +400,13 @@ const USHORT hdr_shutdown_full = 0x1000;
const USHORT hdr_shutdown_single = 0x1080;
/*
typedef struct sfd {
struct sfd {
SLONG sfd_min_page; // Minimum page number
SLONG sfd_max_page; // Maximum page number
UCHAR sfd_index; // Sequence of secondary file
UCHAR sfd_file[1]; // Given file name
} SFD;
};
typedef sfd SFD;
*/
/* Page Inventory Page */
@ -458,20 +463,22 @@ struct generator_page : public pag
/* Record header */
typedef struct rhd {
struct rhd {
SLONG rhd_transaction; /* transaction id */
SLONG rhd_b_page; /* back pointer */
USHORT rhd_b_line; /* back line */
USHORT rhd_flags; /* flags, etc */
UCHAR rhd_format; /* format version */
UCHAR rhd_data[1];
} *RHD;
};
typedef rhd *RHD;
#define RHD_SIZE OFFSETA (Ods::rhd*, rhd_data)
/* Record header for fragmented record */
typedef struct rhdf {
struct rhdf {
SLONG rhdf_transaction; /* transaction id */
SLONG rhdf_b_page; /* back pointer */
USHORT rhdf_b_line; /* back line */
@ -480,13 +487,15 @@ typedef struct rhdf {
SLONG rhdf_f_page; /* next fragment page */
USHORT rhdf_f_line; /* next fragment line */
UCHAR rhdf_data[1]; /* Blob data */
} *RHDF;
};
typedef rhdf *RHDF;
#define RHDF_SIZE OFFSETA (Ods::rhdf*, rhdf_data)
/* Record header for blob header */
typedef struct blh {
struct blh {
SLONG blh_lead_page; /* First data page number */
SLONG blh_max_sequence; /* Number of data pages */
USHORT blh_max_segment; /* Longest segment */
@ -497,7 +506,9 @@ typedef struct blh {
USHORT blh_sub_type; /* Blob sub-type */
USHORT blh_unused;
SLONG blh_page[1]; /* Page vector for blob pages */
} *BLH;
};
typedef blh *BLH;
#define BLH_SIZE OFFSETA (Ods::blh*, blh_page)

View File

@ -36,7 +36,7 @@
*
*/
/* $Id: isc_ipc.cpp,v 1.13 2004-05-13 23:19:50 brodsom Exp $ */
/* $Id: isc_ipc.cpp,v 1.14 2004-05-24 17:30:00 brodsom Exp $ */
#include "firebird.h"
#include <stdio.h>
@ -86,7 +86,7 @@
//#define LOCAL_SEMAPHORES 4
typedef struct sig {
struct sig {
struct sig* sig_next;
int sig_signal;
union {
@ -97,7 +97,9 @@ typedef struct sig {
} sig_routine;
void* sig_arg;
USHORT sig_flags;
} *SIG;
};
typedef sig *SIG;
// flags
const USHORT SIG_user = 0; /* Our routine */

View File

@ -43,13 +43,15 @@ const int IN_INDEX = 2;
const int IN_RELATION = 3;
const int IN_VIEW = 4;
typedef struct met {
struct met {
UCHAR met_op;
UCHAR *met_mblr;
UCHAR *met_dyn;
USHORT met_mblr_length;
USHORT met_dyn_length;
} *MET;
};
typedef met *MET;
static int global_area, global_level, global_duplicates;

View File

@ -41,24 +41,32 @@ const USHORT DBTYPE_ISC = 37;
/* Transaction element block */
typedef struct teb {
struct teb {
int *teb_database;
int teb_tpb_length;
SCHAR *teb_tpb;
} TEB;
};
typedef enum {
typedef teb TEB;
enum IMPL {
impl_rdb = 1,
impl_gds
} IMPL;
};
typedef struct handle {
struct handle {
IMPL implementation;
int *handle;
int *messages;
struct handle *parent;
struct handle *next;
} *HANDLE, *REQ, *DBB, *HND_TRA, *HND_BLB;
};
typedef handle *HANDLE;
typedef handle *REQ;
typedef handle *DBB;
typedef handle *HND_TRA;
typedef handle *HND_BLB;
static HND_TRA* dyn_tra_handle;
static ISC_STATUS_ARRAY status_vector;

View File

@ -29,11 +29,13 @@
/* Transaction element block */
typedef struct teb {
struct teb {
int *teb_database;
int teb_tpb_length;
SCHAR *teb_tpb;
} TEB;
};
typedef teb TEB;
int RDB$MSG_VECTOR[20];

View File

@ -36,18 +36,26 @@ const char* RDB_IMAGE = "RDBVMSSHR";
//#define rdb$bad_req_handle 20480058
typedef struct handle {
struct handle {
int *handle;
int *messages;
struct handle *parent;
struct handle *next;
} *HANDLE, *REQ, *DBB, *HND_TRA, *HND_BLB;
};
typedef struct teb {
typedef handle *HANDLE;
typedef handle *REQ;
typedef handle *DBB;
typedef handle *HND_TRA;
typedef handle *HND_BLB;
struct teb {
DBB* teb_database;
int teb_tpb_length;
UCHAR *teb_tpb;
} TEB;
};
typedef teb TEB;
static USHORT debug_flags;
static UCHAR *temp_buffer;

View File

@ -68,7 +68,7 @@ const SSHORT DVI$_DEVLOCKNAM = 240;
/* ACP File Information block */
typedef struct fib$ {
struct fib$ {
SLONG fib$l_acctl;
SSHORT fib$w_fid[3];
SSHORT fib$w_did[3];
@ -77,7 +77,9 @@ typedef struct fib$ {
SSHORT fib$w_exctl;
SLONG fib$l_exsz;
SLONG fib$l_exvbn;
} FIB$;
};
typedef fib$ FIB$;
// fib$w_exclt
const SSHORT FIB$M_EXTEND = 128;
@ -88,19 +90,21 @@ const SLONG FIB$M_WRITETHRU = 524288;
// fib$w_nmctl
const SSHORT FIB$M_FINDFID = 2048;
typedef struct atr$ {
struct atr$ {
SSHORT atr$w_size;
SSHORT atr$w_type;
SCHAR *atr$l_addr;
SLONG atr$l_zero;
} ATR$;
};
typedef atr$ ATR$;
// atr$w_size
const SSHORT ATR$S_RECATTR = 32;
// atr$w_type
const SSHORT ATR$C_RECATTR = 4;
typedef struct fab$ {
struct fab$ {
SCHAR fat$b_rtype;
SCHAR fat$b_rattrib;
SSHORT fat$w_rsize;
@ -115,7 +119,9 @@ typedef struct fab$ {
SSHORT fat$w_reserved[3];
SSHORT fat$w_not_used;
SSHORT fat$w_versions;
} FAT$;
};
typedef fab$ FAT$;
int PIO_add_file(Database* dbb, jrd_file* main_file, const TEXT* file_name, SLONG start)

View File

@ -35,7 +35,7 @@ const SSHORT DVI$_DEVLOCKNAM = 240;
/* ACP File Information block */
typedef struct fib$ {
struct fib$ {
SLONG fib$l_acctl;
SSHORT fib$w_fid[3];
SSHORT fib$w_did[3];
@ -44,7 +44,9 @@ typedef struct fib$ {
SSHORT fib$w_exctl;
SLONG fib$l_exsz;
SLONG fib$l_exvbn;
} FIB$;
};
typedef fib$ FIB$;
// fib$w_exclt
const SSHORT FIB$M_EXTEND = 128;
@ -55,19 +57,21 @@ const SLONG FIB$M_WRITETHRU = 524288;
// fib$w_nmctl
const SSHORT FIB$M_FINDFID = 2048;
typedef struct atr$ {
struct atr$ {
SSHORT atr$w_size;
SSHORT atr$w_type;
SCHAR *atr$l_addr;
SLONG atr$l_zero;
} ATR$;
};
typedef atr$ ATR$;
// atr$w_size
const SSHORT ATR$S_RECATTR = 32;
// atr$w_type
const SSHORT ATR$C_RECATTR = 4;
typedef struct fab$ {
struct fab$ {
SCHAR fat$b_rtype;
SCHAR fat$b_rattrib;
SSHORT fat$w_rsize;
@ -82,6 +86,8 @@ typedef struct fab$ {
SSHORT fat$w_reserved[3];
SSHORT fat$w_not_used;
SSHORT fat$w_versions;
} FAT$;
};
typedef fab$ FAT$;
#endif /* JRD_VMS_H */

View File

@ -40,21 +40,25 @@ const int MAX_EVENT_BUFFER = 65500;
/* Dummy global section header */
typedef struct evh {
struct evh {
SLONG evh_length;
} *EVH;
};
typedef evh *EVH;
/* Session block */
typedef struct ses {
struct ses {
struct ses *ses_next; /* Next active session */
struct vms_req *ses_requests; /* Outstanding requests in session */
struct rint *ses_interests; /* Historical interests */
} *SES;
};
typedef ses *SES;
/* Event block */
typedef struct evnt {
struct evnt {
struct evnt *evnt_next; /* Next lock */
struct evnt *evnt_parent; /* Parent lock, if any */
struct evnt *evnt_offspring; /* Offspring locks, if any */
@ -63,28 +67,32 @@ typedef struct evnt {
SLONG evnt_count; /* Last know lock count */
USHORT evnt_length; /* Length of event string */
TEXT evnt_name[1];
} *EVNT;
};
typedef evnt *EVNT;
/* Request block */
typedef struct vms_req {
struct vms_req {
struct vms_req *req_next; /* Next request in session */
struct ses *req_session; /* Parent session */
struct rint *req_interests; /* Request interests */
FPTR_EVENT_CALLBACK req_ast; /* Associated AST (zero is fired) */
void* req_ast_arg; /* Argument for ast */
SLONG req_request_id; /* Request id */
} *VMS_REQ;
};
typedef vms_req *VMS_REQ;
/* Request interest block */
typedef struct rint {
struct rint {
VMS_REQ rint_request; /* Parent request block */
EVNT rint_event; /* Parent event block */
struct rint *rint_req_interests; /* Other interests of request */
struct rint *rint_evnt_interests; /* Other interests for event */
SLONG rint_count; /* Threadhold count */
} *RINT;
};
typedef rint *RINT;
static SES global_sessions;

View File

@ -30,7 +30,7 @@ const size_t TCB_STACKSIZE = 65536;
/* Thread control block */
typedef struct tcb {
struct tcb {
struct tcb *tcb_next;
int (*tcb_routine) ();
long tcb_routine_arg;
@ -39,7 +39,9 @@ typedef struct tcb {
pthread_cond_t tcb_cond_wait;
pthread_t tcb_tid;
char tcb_flags;
} *TCB;
};
typedef tcb *TCB;
// tcb_flags
const char TCB_active = 1; /* Thread control block is active. */

View File

@ -36,7 +36,7 @@
*
*/
/* $Id: isc_ipc.cpp,v 1.11 2004-05-13 23:20:26 brodsom Exp $ */
/* $Id: isc_ipc.cpp,v 1.12 2004-05-24 17:31:47 brodsom Exp $ */
#include <windows.h>
#include <process.h>
@ -78,12 +78,14 @@ static int process_id = 0;
const USHORT MAX_OPN_EVENTS = 40;
typedef struct opn_event {
struct opn_event {
SLONG opn_event_pid;
SLONG opn_event_signal; /* pseudo-signal number */
HANDLE opn_event_lhandle; /* local handle to foreign event */
ULONG opn_event_age;
} *OPN_EVENT;
};
typedef opn_event *OPN_EVENT;
static struct opn_event opn_events[MAX_OPN_EVENTS];
static USHORT opn_event_count;

View File

@ -73,10 +73,12 @@
//
namespace Jrd {
typedef struct que {
struct que {
struct que* que_forward;
struct que* que_backward;
} *QUE;
};
typedef que *QUE;
}
// Self-relative queue BASE should be defined in the source which includes this
@ -97,10 +99,12 @@ typedef struct que {
/* Self-relative que block. Offsets are from the block itself. */
typedef struct srq {
struct srq {
SRQ_PTR srq_forward; /* Forward offset */
SRQ_PTR srq_backward; /* Backward offset */
} *SRQ;
};
typedef srq *SRQ;
#endif /* JRD_QUE_H */

View File

@ -152,42 +152,54 @@ const ULONG MERGE_BLOCK_SIZE = 65536;
// Impure area formats for the various RecordSource types
typedef struct irsb {
struct irsb {
ULONG irsb_flags;
USHORT irsb_count;
} *IRSB;
};
typedef struct irsb_first_n {
typedef irsb *IRSB;
struct irsb_first_n {
ULONG irsb_flags;
SLONG irsb_number;
SINT64 irsb_count;
} *IRSB_FIRST;
};
typedef struct irsb_skip_n {
typedef irsb_first_n *IRSB_FIRST;
struct irsb_skip_n {
ULONG irsb_flags;
SLONG irsb_number;
SINT64 irsb_count;
} *IRSB_SKIP;
};
typedef struct irsb_index {
typedef irsb_skip_n *IRSB_SKIP;
struct irsb_index {
ULONG irsb_flags;
SLONG irsb_number;
SLONG irsb_prefetch_number;
SparseBitmap** irsb_bitmap;
} *IRSB_INDEX;
};
typedef struct irsb_sort {
typedef irsb_index *IRSB_INDEX;
struct irsb_sort {
ULONG irsb_flags;
sort_context* irsb_sort_handle;
} *IRSB_SORT;
};
typedef struct irsb_procedure {
typedef irsb_sort *IRSB_SORT;
struct irsb_procedure {
ULONG irsb_flags;
jrd_req* irsb_req_handle;
str* irsb_message;
} *IRSB_PROCEDURE;
};
typedef struct irsb_mrg {
typedef irsb_procedure *IRSB_PROCEDURE;
struct irsb_mrg {
ULONG irsb_flags;
USHORT irsb_mrg_count; // next stream in group
struct irsb_mrg_repeat {
@ -198,15 +210,19 @@ typedef struct irsb_mrg {
SSHORT irsb_mrg_order; // logical merge order by substream
merge_file irsb_mrg_file; // merge equivalence file
} irsb_mrg_rpt[1];
} *IRSB_MRG;
};
typedef struct irsb_sim {
typedef irsb_mrg *IRSB_MRG;
struct irsb_sim {
ULONG irsb_flags;
USHORT irsb_sim_rid; // next relation id
USHORT irsb_sim_fid; // next field id
jrd_req *irsb_sim_req1; // request handle #1
jrd_req *irsb_sim_req2; // request handle #2
} *IRSB_SIM;
};
typedef irsb_sim *IRSB_SIM;
const ULONG irsb_sim_alias = 32; // duplicate relation but w/o user name
const ULONG irsb_sim_eos = 64; // encountered end of stream
@ -217,7 +233,7 @@ const ULONG irsb_sim_active = 128; // remote simulated stream request is active
// which holds information used to get back to
// the current location within an index
typedef struct irsb_nav {
struct irsb_nav {
ULONG irsb_flags;
SLONG irsb_nav_expanded_offset; // page offset of current index node on expanded index page
SLONG irsb_nav_number; // last record number
@ -231,7 +247,9 @@ typedef struct irsb_nav {
USHORT irsb_nav_upper_length; // length of upper key value
USHORT irsb_nav_length; // length of expanded key
UCHAR irsb_nav_data[1]; // expanded key, upper bound, and index desc
} *IRSB_NAV;
};
typedef irsb_nav *IRSB_NAV;
// flags for the irsb_flags field
@ -417,14 +435,16 @@ const USHORT bkm_forced_crack = 8;
// types for navigating through a stream
typedef enum rse_get_mode {
enum rse_get_mode {
RSE_get_forward,
RSE_get_backward,
RSE_get_current,
RSE_get_first,
RSE_get_last,
RSE_get_next
} RSE_GET_MODE;
};
typedef rse_get_mode RSE_GET_MODE;
} //namespace Jrd

View File

@ -50,14 +50,16 @@
/* must be careful with alignment on structures like this that are
not run through the ALL routine */
typedef struct thread {
struct thread {
struct thread *thread_next; /* Next thread to be scheduled */
struct thread *thread_prior; /* Prior thread */
event_t thread_stall[1]; /* Generic event to stall thread */
FB_THREAD_ID thread_id; /* Current thread id */
USHORT thread_count; /* AST disable count */
USHORT thread_flags; /* Flags */
} *THREAD;
};
typedef thread *THREAD;
// thread_flags

View File

@ -99,11 +99,11 @@ static inline void check_and_move(UCHAR*& to, UCHAR from, UCharBuffer& start, UL
*to++ = from;
}
typedef struct {
struct P_NAMES {
USHORT p_names_priv;
USHORT p_names_acl;
const TEXT* p_names_string;
} P_NAMES;
};
static const P_NAMES p_names[] =
{

View File

@ -33,7 +33,7 @@ private:
Symbol* sym_collision; /* collision pointer */
public:
typedef enum sym_t {
enum sym_t {
rel, /* relation block */
fld, /* field block */
fun, /* UDF function block */
@ -41,7 +41,8 @@ public:
sql, /* SQL request cache block */
blr, /* BLR request cache block */
label /* CVC: I need to track labels if LEAVE is implemented. */
} SYM_T;
};
typedef sym_t SYM_T;
Firebird::string sym_string; // symbol value
SYM_T sym_type; /* symbol type */
BLK sym_object; /* general pointer to object */

View File

@ -26,7 +26,7 @@
*
*/
/*
$Id: thd.h,v 1.28 2004-05-22 02:11:34 brodsom Exp $
$Id: thd.h,v 1.29 2004-05-24 17:28:33 brodsom Exp $
*/
#ifndef JRD_THD_H
@ -119,10 +119,12 @@ const int SWEEP_QUANTUM = 10; /* Make sweeps less disruptive */
/* Thread specific data */
typedef struct thdd {
struct thdd {
void *thdd_prior_context;
ULONG thdd_type; /* what kind of structure this is */
} *THDD;
};
typedef thdd *THDD;
/* Thread structure types */
@ -137,36 +139,47 @@ const USHORT THDD_TYPE_TSEC = 8; /* used by gsec */
/* General purpose in use object structure */
typedef struct iuo {
struct iuo {
struct iuo *iuo_next;
void *iuo_object[10];
USHORT iuo_in_use_count;
} *IUO;
};
typedef iuo *IUO;
/* Mutex structure */
typedef struct mutx_t {
struct mutx_t {
THD_MUTEX_STRUCT mutx_mutex;
} MUTX_T, *MUTX;
};
typedef mutx_t MUTX_T;
typedef mutx_t* MUTX;
/* Recursive mutex structure */
typedef struct rec_mutx_t {
struct rec_mutx_t {
MUTX_T rec_mutx_mtx[1];
FB_THREAD_ID rec_mutx_id;
SLONG rec_mutx_count;
} REC_MUTX_T, *REC_MUTX;
};
typedef rec_mutx_t REC_MUTX_T;
typedef rec_mutx_t *REC_MUTX;
/* Combined mutex and condition variable structure */
#ifndef SOLARIS
typedef struct cond_t {
struct cond_t {
THD_MUTEX_STRUCT cond_mutex;
THD_COND_STRUCT cond_cond;
} COND_T, *COND;
};
typedef cond_t COND_T;
typedef cond_t *COND;
#endif
/* Read/write lock structure */
typedef struct wlck_t {
struct wlck_t {
#ifdef THD_RWLOCK_STRUCT
THD_RWLOCK_STRUCT wlck_wlock;
#else
@ -174,7 +187,10 @@ typedef struct wlck_t {
int wlck_count;
int wlck_waiters;
#endif
} WLCK_T, *WLCK;
};
typedef wlck_t WLCK_T;
typedef wlck_t *WLCK;
const int WLCK_read = 1;
const int WLCK_write = 2;

View File

@ -588,7 +588,7 @@ using namespace Ods;
/* Validation/garbage collection/repair control block */
typedef struct vdr
struct vdr
{
SparseBitmap* vdr_page_bitmap;
SLONG vdr_max_page;
@ -599,7 +599,9 @@ typedef struct vdr
ULONG vdr_rel_chain_counter; /* Counts chains w/rdr_chain */
SparseBitmap* vdr_rel_records; /* 1 bit per valid record */
SparseBitmap* vdr_idx_records; /* 1 bit per index item */
} *VDR;
};
typedef vdr *VDR;
// vdr_flags
@ -607,18 +609,18 @@ const USHORT vdr_update = 2; /* fix simple things */
const USHORT vdr_repair = 4; /* fix non-simple things (-mend) */
const USHORT vdr_records = 8; /* Walk all records */
typedef enum {
enum FETCH_CODE{
fetch_ok,
fetch_checksum,
fetch_type,
fetch_duplicate
} FETCH_CODE;
};
typedef enum {
enum RTN {
rtn_ok,
rtn_corrupt,
rtn_eof
} RTN;
};
static const TEXT msg_table[][52] = {
"Page %ld wrong type (expected %d encountered %d)", /* 0 */

View File

@ -89,13 +89,13 @@ const ULONG MAX_FORMAT_SIZE = 65535;
#ifndef REQUESTER
/* Function definition block */
typedef enum {
enum FUN_T {
FUN_value,
FUN_reference,
FUN_descriptor,
FUN_blob_struct,
FUN_scalar_array
} FUN_T;
};
struct fun_repeat {
DSC fun_desc; /* Datatype info */

View File

@ -42,7 +42,7 @@
*
*/
/*
$Id: why.cpp,v 1.73 2004-05-23 23:26:31 brodsom Exp $
$Id: why.cpp,v 1.74 2004-05-24 17:28:33 brodsom Exp $
*/
#include "firebird.h"
@ -166,7 +166,7 @@ typedef ISC_STATUS(*PTR) (ISC_STATUS* user_status, ...);
/* Database cleanup handlers */
typedef struct clean
struct clean
{
struct clean* clean_next;
union {
@ -174,16 +174,20 @@ typedef struct clean
TransactionCleanupRoutine *TransactionRoutine;
};
void* clean_arg;
} *CLEAN;
};
typedef clean *CLEAN;
/* Transaction element block */
typedef struct teb
struct teb
{
FB_API_HANDLE *teb_database;
int teb_tpb_length;
UCHAR *teb_tpb;
} TEB;
};
typedef teb TEB;
#ifdef DEBUG_GDS_ALLOC
#define alloc(x) alloc_debug(x, __FILE__, __LINE__)
@ -551,17 +555,17 @@ const int PROC_CANCEL_OPERATION = 53;
const int PROC_count = 54;
typedef struct
struct ENTRY
{
TEXT *name;
PTR address;
} ENTRY;
};
typedef struct
struct IMAGE
{
TEXT *name;
TEXT *path;
} IMAGE;
};
/* Define complicated table for multi-subsystem world */

View File

@ -49,7 +49,7 @@ union any_handle {
Jrd::jrd_tra* h_tra;
};
typedef struct why_hndl
struct why_hndl
{
UCHAR type;
UCHAR flags;
@ -67,8 +67,16 @@ typedef struct why_hndl
FB_API_HANDLE* user_handle;
struct clean* cleanup;
TEXT* db_path;
} *WHY_HNDL, *WHY_REQ, *WHY_DBB, *WHY_TRA,
*WHY_BLB, *WHY_ATT, *WHY_STMT, *WHY_SVC;
};
typedef why_hndl *WHY_HNDL;
typedef why_hndl *WHY_REQ;
typedef why_hndl *WHY_DBB;
typedef why_hndl *WHY_TRA;
typedef why_hndl *WHY_BLB;
typedef why_hndl *WHY_ATT;
typedef why_hndl *WHY_STMT;
typedef why_hndl *WHY_SVC;
const int HANDLE_invalid = 0;
const int HANDLE_database = 1;