added transactions, cleanup of finalizers, addition of pget, in process of adding many other API calls
This commit is contained in:
parent
612e248d08
commit
c9bc7ae17f
36
bdb.h
36
bdb.h
|
@ -22,21 +22,34 @@
|
||||||
#define filename_dup(fpd,fps) \
|
#define filename_dup(fpd,fps) \
|
||||||
strncpy(fpd,fps,FNLEN);
|
strncpy(fpd,fps,FNLEN);
|
||||||
|
|
||||||
|
typedef struct s_envh {
|
||||||
|
VALUE self;
|
||||||
|
DB_ENV *env;
|
||||||
|
VALUE adb; /* Ruby array holding opened databases */
|
||||||
|
VALUE atxn; /* Ruby array holding open transactions */
|
||||||
|
} t_envh;
|
||||||
|
|
||||||
typedef struct s_dbh {
|
typedef struct s_dbh {
|
||||||
VALUE dbinst;
|
VALUE self;
|
||||||
DB *dbp;
|
DB *db;
|
||||||
VALUE aproc;
|
VALUE aproc;
|
||||||
|
t_envh *env; /* Parent environment, NULL if not opened from one */
|
||||||
|
VALUE adbc; /* Ruby array holding opened cursor */
|
||||||
char filename[FNLEN+1];
|
char filename[FNLEN+1];
|
||||||
} t_dbh;
|
} t_dbh;
|
||||||
|
|
||||||
typedef struct s_dbch {
|
typedef struct s_dbch {
|
||||||
|
VALUE self;
|
||||||
DBC *dbc;
|
DBC *dbc;
|
||||||
|
t_dbh *db;
|
||||||
char filename[FNLEN+1];
|
char filename[FNLEN+1];
|
||||||
} t_dbch;
|
} t_dbch;
|
||||||
|
|
||||||
typedef struct s_envh {
|
typedef struct s_txnh {
|
||||||
DB_ENV *env;
|
VALUE self;
|
||||||
} t_envh;
|
DB_TXN *txn;
|
||||||
|
t_envh *env;
|
||||||
|
} t_txnh;
|
||||||
|
|
||||||
#define ci(b,m) \
|
#define ci(b,m) \
|
||||||
rb_define_const(b,#m,INT2FIX(m))
|
rb_define_const(b,#m,INT2FIX(m))
|
||||||
|
@ -51,4 +64,17 @@ VALUE db_ ## fname ## _eq(VALUE obj, VALUE v) \
|
||||||
return obj; \
|
return obj; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define attr_writer(fname) \
|
||||||
|
VALUE fname ## _writer(VALUE obj, VALUE v) \
|
||||||
|
{ \
|
||||||
|
rb_ivar_set(obj,fv_ ## fname,v); \
|
||||||
|
return obj; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define attr_reader(fname) \
|
||||||
|
VALUE fname ## _reader(VALUE obj) \
|
||||||
|
{ \
|
||||||
|
return rb_ivar_get(obj,fv_ ## fname); \
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue