/* [<][>][^][v][top][bottom][index][help] */
DEFINITIONS
This source file includes following definitions.
- ScmBsdDb
1 /*
2 * bsddb.h - BSD DB interface
3 *
4 * Copyright(C) 2001-2002 by Shiro Kawai (shiro@acm.org)
5 *
6 * Permission to use, copy, modify, distribute this software and
7 * accompanying documentation for any purpose is hereby granted,
8 * provided that existing copyright notices are retained in all
9 * copies and that this notice is included verbatim in all
10 * distributions.
11 * This software is provided as is, without express or implied
12 * warranty. In no circumstances the author(s) shall be liable
13 * for any damages arising out of the use of this software.
14 *
15 * $Id: bsddb.h,v 1.4 2002/12/31 09:36:51 shirok Exp $
16 */
17
18 #ifndef GAUCHE_BSDDB_H
19 #define GAUCHE_BSDDB_H
20
21 #include <gauche.h>
22 #include <gauche/class.h>
23 #include "dbmconfig.h"
24 #include <db.h>
25
26 /* I try to expose as many features of BSD DB as possible, but
27 had to drop a few features from Scheme interface. */
28
29 typedef struct ScmBsdDbRec {
30 SCM_HEADER;
31 ScmObj name;
32 DB *db;
33 void *info;
34 } ScmBsdDb;
35
36 extern ScmClass Scm_BsdDbClass;
37 #define SCM_CLASS_BSD_DB (&Scm_BsdDbClass)
38 #define SCM_BSD_DB(obj) ((ScmBsdDb*)obj)
39 #define SCM_BSD_DB_P(obj) SCM_XTYPEP(obj, SCM_CLASS_BSD_DB)
40
41 extern ScmClass Scm_BsdBtreeClass;
42 #define SCM_CLASS_BSD_BTREE (&Scm_BsdBtreeClass)
43 #define SCM_BSD_BTREE(obj) ((ScmBsdBtree*)obj)
44 #define SCM_BSD_BTREE_P(obj) SCM_XTYPEP(obj, SCM_CLASS_BSD_BTREE)
45
46 extern ScmClass Scm_BsdHashClass;
47 #define SCM_CLASS_BSD_HASH (&Scm_BsdHashClass)
48 #define SCM_BSD_HASH(obj) ((ScmBsdHash*)obj)
49 #define SCM_BSD_HASH_P(obj) SCM_XTYPEP(obj, SCM_CLASS_BSD_HASH)
50
51 extern ScmClass Scm_BsdRecnoClass;
52 #define SCM_CLASS_BSD_RECNO (&Scm_BsdRecnoClass)
53 #define SCM_BSD_RECNO(obj) ((ScmBsdRecno*)obj)
54 #define SCM_BSD_RECNO_P(obj) SCM_XTYPEP(obj, SCM_CLASS_BSD_RECNO)
55
56 extern void Scm_Init_bsddb(ScmModule *mod);
57
58 #endif /*GAUCHE_BSDDB_H*/