The following header files are used by the Future Lab database modules:
This header contains defines for the database command codes. These command codes are not used by the database engine but are used by database applications that use command keywords.
This header contains function prototypes for the database module dbcs.c.
This header contains function prototypes for the database module dbcscfg.c.
This is the main database engine header. It contains various defines including the maximum record/field size and database delimiters.
Function prototypes for the database module dbeng.c are also contained in this header.
The definition of the table structure dbeng_table is also contained in this header.
struct dbeng_table { struct dbeng_table *next; /* pointer to next table */ FILE *handle; /* file handle */ char *rec; /* current record contents */ char *name; /* physical file name */ int tid; /* assigned table ID */ int change_rec_flag; /* has current record changed? */ int enforce_change_rec_flag; /* enforce 'change_rec_flag'? */ int process_deleted; /* retrieve recs marked for del? */ int is_table_locked; /* is the table read/write locked? */ int is_systable; /* is this a system table? */ int sort_max_open_bin; /* max allowable open bins in sort */ long sort_max_mem; /* max alloc mem for sort records */ long record_number; /* current record number */ long active_record_count; /* current active record count */ long deleted_record_count; /* current deleted record count */ long orig_position; /* original (start) pos of record */ long current_position; /* current file position */ int record_status; /* 1=active,0=deleted */ int autopack; /* autopack threshold (0=off) */ #ifdef MULTIUSER struct dbeng_rep *rep_list; /* link list of desired replication */ #endif };
Here is an explanation of each of the dbeng_table structure members:
This is a pointer to the next member in the link list. The Bbuuzzb database engine maintains a list of all accessed table using this single link list.
This is the actual file/stream handle used to access the table. In the client/server version and if the session table is active, most of the files will be closed. In the stand-alone version or if the session table is not active, most files will be open.
This is the record buffer. As fields are deleted/added or modified, the contents of this record buffer are changed. This buffer contains the current active record.
This member is the actual OS name of the file including a drive designation, path and file name.
This is the table ID assigned when the table was first opened. Each tid is unique even if the engine has the same table opened many times.
This member indicates whether the contents of the current record have changed. If the record contents have changed and the enforce_change_rec_flag is also on, all function calls that would empty the record buffer or change the file pointer will not be allowed.
This flag instructs the Bbuuzzb database engine whether to enforce the change_rec_flag.
This structure member instructs the Bbuuzzb database engine whether to include records marked for deletion in record processing like reading records, counting records etc.
This member indicates whether the table involved is currently locked. Note that this flag is currently not completely enforced.
This member indicates whether the table involved is a system table.
This member holds the maximum allowable number of bin tables that may be open at once during a sort.
This member contains the maximum allowable memory allocation for record contents in memory during a sort.
This member represents the sequential record number within the current table. A zero record number usually indicates that there is no current record.
This member contains the number of active records currently in the table.
This member contains the number of records currently in the table that are marked for deletion.
This member contains the file pointer position to the beginning of the current record. A minus one (-1) value indicates the file pointer is at the top of the table and there is no current record.
This member contains the current file pointer position.
This member contains the status of the current record (one for active and zero for deleted).
This member is a pointer to the replication detail list. This link list is of type dbeng_rep. Here is the structure definition:
struct dbeng_rep { struct dbeng_rep *next; int port; char *tname; };
Note that the rep_list is only present in multiuser situations (Bbuuzzb database server).
This header contains the database engine configuration defaults based on the platform along with the name of the database configuration file and function prototypes for the database module dbengcfg.c.
This header contains a single define which is the database engine version.
This header contains function prototypes for the database module dbiocode.c.
This header contains function prototypes for the database module dblocal.c.
This header contains function prototypes for the database module dblocfg.c.
This header is not tied to any specific database module. It contains defines of:
The definition of the server send structure dbeng_send_message is also in this header along with the engine list delimiter (DBENG_LIST_DELIM).
This header contains the defines and function prototypes for the database server module dbengses.c.
This header contains the defines and function prototypes for the database server module dbengcat.c. This header also contains the catalog field definitions and the structure returned by the function dbeng_catalog_table_details. The current defintion of this structure called dbengcat_details is:
struct dbengcat_details { char *logical_name; // logical table name char *physical_name; // OS path/file name int systable_flag; // is it a system table? int apack; // autopack threshold #ifdef MULTIUSER char *rep_list; // replication list #endif };
This header contains the defines and function prototypes for the database server module dbengrep.c and also contains the definition of the dbengrep_servers structure. Here is the current definition:
struct dbengrep_servers { char *host; int port; struct dbengrep_servers *next; };
This header contains the function prototypes for the fixed-point database module dbfxp.c.
This header contains database sort definitions such as:
This structure is used to hold record contents in memory just prior to sorting. A collection of these structures is used in a link list of all records in memory. Here is the current definition:
struct dbeng_sort_node { char *arec; struct dbeng_sort_node *next; };
This structure is used to hold all details regarding the sort specifications. A collection of these structures is used in a link list of all sort specifications. Here is the current definition:
struct dbeng_sort_spec { int order; int field_num; struct dbeng_sort_spec *next; };
This structure is used to hold bin tables in use. A collection of these structures is used in a link list of all bin tables in use. Here is the current definition:
struct dbeng_sort_bin { struct dbeng_table *abin; struct dbeng_sort_bin *next; };
Notice that the bin table is reference by a dbeng_table pointer. A bin table is a temporary system table.
This header also contains the defines:
This header contains the definitions for the import API/library including:
This structure is used to hold the import specifications from the template table. The current definition is:
struct iex_spec { int source; int source_add1; int source_add2; int conversion; int conversion_parm; int dest; int dest_add1; int dest_add2; struct iex_spec *next; };