2 * cdb, cdb-wr - Tcl bindings for tinycdb and a journalling write extension
3 * Copyright 2006-2012 Ian Jackson
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 #ifndef CHIARK_TCL_CDB_H
22 #define CHIARK_TCL_CDB_H
24 #include <sys/types.h>
35 #include "cdb+tcmdif.h"
37 #define RWSCF_OKJUNK 002
39 extern const IdDataSpec cdbtcl_databases, cdbtcl_rwdatabases;
41 /*---------- from lookup.c ----------*/
43 int cht_cdb_donesomelookup(Tcl_Interp *ip, void *db_v,
44 Tcl_Obj *def, Tcl_Obj **result,
45 const Byte *data, int dlen,
46 int (*storeanswer)(Tcl_Interp *ip, Tcl_Obj **result,
47 const Byte *data, int len));
48 int cht_cdb_storeanswer_string(Tcl_Interp *ip, Tcl_Obj **result,
49 const Byte *data, int len);
50 int cht_cdb_storeanswer_hb(Tcl_Interp *ip, Tcl_Obj **result,
51 const Byte *data, int len);
52 int cht_cdb_lookup_cdb(Tcl_Interp *ip, struct cdb *cdb,
53 const Byte *key, int klen,
54 const Byte **data_r, int *dlen_r);
56 /*---------- macros ----------*/
59 rc= cht_posixerr(ip, errno, "failed to " m); goto x_rc; \
62 #endif /*CHIARK_TCL_CDB_H*/