db.star.h

来自「db.* (pronounced dee-be star) is an adva」· C头文件 代码 · 共 414 行 · 第 1/2 页

H
414
字号
#define SYS_BADFREE        -9008 /* attempt to free empty table */#define SYS_BADOPTKEY      -9009 /* calculating optkey index *//* -9010 */#define SYS_IXNOTCLEAR     -9011 /* ix-cache not reset after trans */#define SYS_INVLOGPAGE     -9012 /* invalid page in log file */#define SYS_INVFLDTYPE     -9013 /* illegal field type */#define SYS_INVSORT        -9014 /* illegal sort ordering *//* -9015 */#define SYS_INVPGTAG       -9016 /* invalid page tag */#define SYS_INVHOLD        -9017 /* bad hold count */#define SYS_HASHCYCLE      -9018 /* cycle detected in hash chain */#define SYS_INVLRU         -9019 /* invalid lru page */#define SYS_INVPAGE        -9020 /* invalid cache page */#define SYS_INVPGCOUNT     -9021 /* bad page tag page count */#define SYS_INVPGSIZE      -9022 /* invalid cache page size */#define SYS_PZACCESS       -9023 /* invalid access to page zero */#define SYS_BADPAGE        -9024 /* wrong page */#define SYS_INVEXTEND      -9025 /* illegal attempt to extend file *//* -9026 */#define SYS_PZNEXT         -9027 /* bad pznext */#define SYS_DCHAIN         -9028 /* bad dchain */#define SYS_EOF            -9029 /* attempt to write past EOF */#define SYS_FILEMODIFIED   -9030 /* locked file was modified by another user */#define S_INTERNAL_LAST    -9030 /* last internal error *//*    Function statuses*/#define S_FUNCTION_FIRST   0     /* first function status */#define S_OKAY             0     /* normal return, okay */#define S_EOS              1     /* end of set */#define S_NOTFOUND         2     /* record not found */#define S_DUPLICATE        3     /* duplicate key */#define S_KEYSEQ           4     /* field type used out of sequence in d_keynext */#define S_UNAVAIL          5     /* database file currently unavailable */#define S_DELETED          6     /* record/set deleted since last accessed */#define S_UPDATED          7     /* record/set updated since last accessed */#define S_LOCKED           8     /* current record's lock bit is set */#define S_UNLOCKED         9     /* current record's lock bit is clear */#define S_SETCLASH         10    /* set ptrs invalidated by another user */#define S_FUNCTION_LAST    10    /* last function status *//* ------------------------------------------------------------------------ */typedef short           FILE_NO;    /* db.* file number */typedef DB_ULONG        DB_ADDR;     /* 3 bytes for slot, 1 byte for file */typedef long            F_ADDR;      /* file address: page or slot number */#define MAXRECORDS      0x00FFFFFFL#define NULL_DBA        0L/* field number indicator = rec * FLDMARK + fld_in_rec */#define FLDMARK 1000L/* record number indicator */#define RECMARK 10000/* set number indicator -- must be greater than RECMARK */#define SETMARK 20000/* runtime option flags *//* hi-order byte reserved for specifying option sets */#define DCHAINUSE       0x00000001L    /* use the dchain for new records */#define TRLOGGING       0x00000002L    /* use transaction logging/recovery */#define ARCLOGGING      0x00000004L    /* use transaction archiving */#define IGNORECASE      0x00000008L    /* use caseblind compares for strings */#define DELETELOG       0x00000080L    /* have d_close() delete the log file */#define SYNCFILES       0x00000100L    /* bypass any system cache */#define PORTABLE        0x00000200L    /* use guard files instead of locking */#define IGNOREENV       0x00000400L    /* ignore environment variables */#define READONLY        0x00000800L    /* open database for readonly access */#define TXTEST          0x00001000L    /* test transaction recovery */#define NORECOVER       0x00002000L    /* For internal use only, will corrupt databases */#define TRUNCATELOG     0x00008000L    /* truncate log file at each d_trbegin */#define PREALLOC_CACHE  0x00020000L    /* allocate cache pages during d_open */#define MULTITAF        0x00100000L    /* use multiple taf files */#define READNAMES       0x00200000L    /* read rec/fld/set names on db open */#define MBSSORT         0x00400000L    /* string sort using mbs functions *//* DEBUG_OPT cannot be or'd together in one d_on/off_opt() call with non-DEBUG_OPTs*/#define DEBUG_OPT   (DB_ULONG) 0x40000000#define PZVERIFY    (DEBUG_OPT | 0x00000001L)  /* verify pz_next against the file length */#define PAGE_CHECK  (DEBUG_OPT | 0x00000002L)  /* track page id from dio_in until dio_out */#define LOCK_CHECK  (DEBUG_OPT | 0x00000004L)  /* check file and page for illegal change by another process */#define CACHE_CHECK (DEBUG_OPT | 0x00000008L)  /* check for cache corruption after each d_ call *//*    Note that PAGE_CHECK and LOCK_CHECK are mutually exclusive.    WARNING! LOCK_CHECK will cause disk I/O on each cache access !!!*//* TRACE_OPT cannot be or'd together in one d_on/off_opt() call with non-TRACE_OPTs*/#define TRACE_OPT     (DB_ULONG) 0x20000000#define TRACE_DBERR   (TRACE_OPT | 0x00000001L)  /* trace errors if any trace flag set */#define TRACE_API     (TRACE_OPT | 0x00000002L)  /* trace api functions */#define TRACE_LOCKS   (TRACE_OPT | 0x00000004L)  /* trace file locks */#define TRACE_UNICODE (TRACE_OPT | 0x00000008L)  /* output to trace file in Unicode text *//* option tags for d_set_options*/#define OPT_MEM_HOOK 1/* ------------------------------------------------------------------------ */#ifndef max#define min(a, b)    ((a) < (b) ? (a) : (b))#define max(a, b)    ((a) > (b) ? (a) : (b))#endif/* function is referenced internally only */#define INTERNAL_FCN    /**//* function may be exposed in shared library or DLL */#define EXTERNAL_FCN    /**//* Version number string at start of DBD file must match one of these: */#define dbd_VERSION_300  "V3.00\032"#define dbd_VERSION_301  "V3.01\032"#define dbd_VERSION_500  "V5.00\032"#define dbd_VERSION_u500 "U5.00\032"/* Numeric values representing DBD version strings: */#define dbd_V300  300#define dbd_V301  301#define dbd_V500  500#define dbd_U500 -500/* ------------------------------------------------------------------------ */typedef struct lock_request{    unsigned int item;                  /* record or set number */    int type;                           /* lock type: 'r', 'w', 'x', 'k' */}  LOCK_REQUEST;#define TRANS_ID_LEN 21typedef void (EXTERNAL_FCN * ERRORPROC) (int, DB_TCHAR *);#ifndef TASK_DEFNtypedef void DB_TASK;typedef struct  DB_SCHEMA_S DB_SCHEMA;#else#include "dbtype.h"#endif#define  CURR_DB        -1#define  ALL_DBS        -2#define  VOID_DB        -3struct DB_SCHEMA_S{	DB_TCHAR * sc_dbname;#ifdef TASK_DEFN	short sc_version;	short sc_page_size;	short sc_nfiles;	short sc_nrecords;	short sc_nfields;	short sc_nsets;	short sc_nmembers;	short sc_nsorts;	short sc_nkeys;	short sc_nsgdata;		FILE_ENTRY   * sc_files;	RECORD_ENTRY * sc_records;	FIELD_ENTRY  * sc_fields;	SET_ENTRY    * sc_sets;	MEMBER_ENTRY * sc_members;	SORT_ENTRY   * sc_sorts;	KEY_ENTRY    * sc_keys;	char         * sc_names;	DB_BYTE      * sc_sgdata;#endif};#ifdef __cplusplusextern "C"{#endif/*   The runtime must not recursively invoke db_enter/db_exit, which means   it should not call any d_ external api functions.  Define RUNTIME   in the runtime build, and enable warning for use of non-prototyped    function: e.g.  gcc -Wimplicit-function-declaration*/#ifndef RUNTIME#include "dproto.h"#endif#ifdef __cplusplus}#endif#endif /* DB.STAR_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?