00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _BDB_RES_H_
00030 #define _BDB_RES_H_
00031
00032 typedef struct _bdb_con {
00033 DB_ENV *dbenvp;
00034 DB *dbp;
00035 int col_num;
00036 } bdb_con_t, *bdb_con_p;
00037
00038 #define BDB_CON_DBENV(db_con) (((bdb_con_p)((db_con)->tail))->dbenvp)
00039 #define BDB_CON_DB(db_con) (((bdb_con_p)((db_con)->tail))->dbp)
00040 #define BDB_CON_COL_NUM(db_con) (((bdb_con_p)((db_con)->tail))->col_num)
00041
00042
00043
00044 typedef struct _bdb_val_t
00045 {
00046 db_val_t v;
00047 struct _bdb_val_t *next;
00048 } bdb_val_t, *bdb_val_p;
00049
00050 typedef struct _bdb_row
00051 {
00052 DBT key;
00053 DBT data;
00054 str tail;
00055 bdb_val_p fields;
00056 struct _bdb_row *next;
00057
00058 } bdb_row_t, *bdb_row_p;
00059
00060
00061
00062 typedef struct _bdb_uval_t
00063 {
00064 int c_idx;
00065 db_val_t v;
00066 struct _bdb_uval_t *next;
00067 } bdb_uval_t, *bdb_uval_p;
00068
00069 typedef struct _bdb_urow
00070 {
00071 bdb_uval_p fields;
00072 } bdb_urow_t, *bdb_urow_p;
00073
00074
00075
00076 typedef struct _bdb_sval_t
00077 {
00078 int c_idx;
00079 db_val_t v;
00080 int op;
00081 #define BDB_OP_EQ 0
00082 #define BDB_OP_LT 1
00083 #define BDB_OP_GT 2
00084 #define BDB_OP_LEQ 3
00085 #define BDB_OP_GEQ 4
00086 struct _bdb_sval_t *next;
00087 } bdb_sval_t, *bdb_sval_p;
00088
00089 typedef struct _bdb_srow
00090 {
00091 DBT key;
00092 bdb_sval_p fields;
00093 } bdb_srow_t, *bdb_srow_p;
00094
00095
00096
00097 typedef int bdb_rrow_t, *bdb_rrow_p;
00098
00099
00100
00101 typedef struct _bdb_column {
00102 str name;
00103 int type;
00104 struct _bdb_column *next;
00105
00106 } bdb_column_t, *bdb_column_p;
00107
00108 typedef struct _bdb_table {
00109 str name;
00110 int col_num;
00111 bdb_column_p cols;
00112 struct _bdb_table *next;
00113 } bdb_table_t, *bdb_table_p;
00114
00115 #endif