about summary refs log tree commit diff
path: root/nss/nss_db/dummy-db.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-02 04:20:21 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-02 04:20:21 +0000
commit9a6450d578556c11e7c173d2f28362345b8f1258 (patch)
tree327614f7bd913eb2de638df4001e533e933ee691 /nss/nss_db/dummy-db.h
parenta673fbcb1f42cd17f54ddeab03e85716ccf15c51 (diff)
downloadglibc-9a6450d578556c11e7c173d2f28362345b8f1258.tar.gz
glibc-9a6450d578556c11e7c173d2f28362345b8f1258.tar.xz
glibc-9a6450d578556c11e7c173d2f28362345b8f1258.zip
Update.
	* nss/nss_db/db-XXX.c: Move internal_setent and internal_endent
	functions from here...
	* nss/db-alias.c: ...and here...
	* nss/db-netgrp.c: ...and here...
	* nss/nss_db/db-open.c: ...to here.  New file.
	* nss/nss_db/dummy-db.h: New file.
	* nss/nss_db/nss_db.h: New file.
	* nss/Depend: Depend in dlfcn, not db2.
	* nss/Makefile (libnss_db-routines): Add db-open.
	(distribute): Add nss_db.h dummy-db.h.
	(libnss_db.so): Replace libdb dependency by $(libdl).
	Based on a patch by Zack Weinberg.
Diffstat (limited to 'nss/nss_db/dummy-db.h')
-rw-r--r--nss/nss_db/dummy-db.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/nss/nss_db/dummy-db.h b/nss/nss_db/dummy-db.h
new file mode 100644
index 0000000000..4414a1c9ae
--- /dev/null
+++ b/nss/nss_db/dummy-db.h
@@ -0,0 +1,111 @@
+#include <stdint.h>
+
+#include "nss_db.h"
+
+/* This file contains dummy definitions of the DB structure of the
+   Berkeley DB.  We are only interested in the function pointers since
+   this is the interface to the database.  Unfortunately the structure
+   changed over time and we have to take this into account.  */
+
+/* The values to select the database type are unchanged over the version.
+   Define only what we really need.  */
+#define DB_BTREE	(1)
+
+/* Permission flags are also not changed.  */
+#define DB_RDONLY	0x010000
+
+
+/* This is for the db-2.x version up to 2.x.y.  We use the name `db24' since
+   this is the version which was shipped with glibc 2.1.  */
+struct db24
+{
+  void	*mutexp;
+  enum { dummy24 } type;
+  void *dbenv;
+  void *mp_dbenv;
+  void *master;
+  void *internal;
+  void *mp;
+  void *mpf;
+  struct
+  {
+    void *tqh_first;
+    void **tqh_last;
+  } curs_queue;
+  struct {
+    void *lh_first;
+  } handleq;
+  struct {
+    void *le_next;
+    void **le_prev;
+  } links;
+  uint32_t log_fileid;
+  void *txn;
+  uint32_t locker;
+  struct db24_dbt {
+    void *data;
+    uint32_t size;
+    uint32_t ulen;
+    uint32_t dlen;
+    uint32_t doff;
+    uint32_t flags;
+  } lock_dbt;
+  struct{
+    uint32_t pgno;
+    uint8_t fileid[20];
+  } lock;
+  size_t pgsize;
+  void *db_malloc;
+  /* Functions. */
+  int (*close) (void *, uint32_t);
+  int (*cursor) (void *, void *, void **);
+  int (*del) (void *, void *, DBT *, uint32_t);
+  int (*fd) (void *, int *);
+  int (*get) (void *, void *, DBT *, DBT *, uint32_t);
+  int (*put) (void *, void *, DBT *, DBT *, uint32_t);
+  int (*stat) (void *, void *, void *(*)(size_t), uint32_t);
+  int (*sync) (void *, uint32_t);
+};
+
+
+/* Version 2.7, slightly incompatible with version 2.4.  */
+struct db27
+{
+  void	*mutexp;
+  enum { dummy27 } type;
+  int byteswapped;
+  void *dbenv;
+  void *mp_dbenv;
+  void *internal;
+  void *mp;
+  void *mpf;
+  struct
+  {
+    void *tqh_first;
+    void **tqh_last;
+  } free_queue;
+  struct
+  {
+    void *tqh_first;
+    void **tqh_last;
+  } active_queue;
+  struct {
+    void *lh_first;
+  } handleq;
+  uint8_t fileid[20];
+  uint32_t log_fileid;
+  size_t pgsize;
+  void *db_malloc;
+  void *dup_compare;
+  void *h_hash;
+  /* Functions. */
+  int (*am_close) (void *);
+  int (*close) (void *, uint32_t);
+  int (*cursor) (void *, void *, void **, uint32_t);
+  int (*del) (void *, void *, DBT *, uint32_t);
+  int (*fd) (void *, int *);
+  int (*get) (void *, void *, DBT *, DBT *, uint32_t);
+  int (*put) (void *, void *, DBT *, DBT *, uint32_t);
+  int (*stat) (void *, void *, void *(*)(size_t), uint32_t);
+  int (*sync) (void *, uint32_t);
+};