summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/myndbm.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-08-20 23:46:10 +0000
committerpeter <peter@FreeBSD.org>1996-08-20 23:46:10 +0000
commit8982e501c77217c860f79bba431f46a62b607a21 (patch)
tree70187fdf5be4cbefd0baf46bddac7e5e32c13c24 /contrib/cvs/src/myndbm.h
parent01ee40fd6a76f6ff7ef247fc1b2cf6e337f216c5 (diff)
downloadFreeBSD-src-8982e501c77217c860f79bba431f46a62b607a21.zip
FreeBSD-src-8982e501c77217c860f79bba431f46a62b607a21.tar.gz
Import of slightly trimmed cvs-1.8 distribution. Generated files
and non-unix code has been left out.
Diffstat (limited to 'contrib/cvs/src/myndbm.h')
-rw-r--r--contrib/cvs/src/myndbm.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/contrib/cvs/src/myndbm.h b/contrib/cvs/src/myndbm.h
new file mode 100644
index 0000000..0431e15
--- /dev/null
+++ b/contrib/cvs/src/myndbm.h
@@ -0,0 +1,47 @@
+/* $CVSid: @(#)myndbm.h 1.4 94/09/21 $ */
+
+#ifdef MY_NDBM
+
+#define DBLKSIZ 4096
+
+typedef struct
+{
+ List *dbm_list; /* cached database */
+ Node *dbm_next; /* next key to return for nextkey() */
+
+ /* Name of the file to write to if modified is set. malloc'd. */
+ char *name;
+
+ /* Nonzero if the database has been modified and dbm_close needs to
+ write it out to disk. */
+ int modified;
+} DBM;
+
+typedef struct
+{
+ char *dptr;
+ int dsize;
+} datum;
+
+/*
+ * So as not to conflict with other dbm_open, etc., routines that may
+ * be included by someone's libc, all of my emulation routines are prefixed
+ * by "my" and we define the "standard" ones to be "my" ones here.
+ */
+#define dbm_open mydbm_open
+#define dbm_close mydbm_close
+#define dbm_fetch mydbm_fetch
+#define dbm_firstkey mydbm_firstkey
+#define dbm_nextkey mydbm_nextkey
+#define dbm_store mydbm_store
+#define DBM_INSERT 0
+#define DBM_REPLACE 1
+
+DBM *mydbm_open PROTO((char *file, int flags, int mode));
+void mydbm_close PROTO((DBM * db));
+datum mydbm_fetch PROTO((DBM * db, datum key));
+datum mydbm_firstkey PROTO((DBM * db));
+datum mydbm_nextkey PROTO((DBM * db));
+extern int mydbm_store PROTO ((DBM *, datum, datum, int));
+
+#endif /* MY_NDBM */
OpenPOWER on IntegriCloud