summary refs log tree commit diff
path: root/nss/nss_db/nss_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/nss_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/nss_db.h')
-rw-r--r--nss/nss_db/nss_db.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/nss/nss_db/nss_db.h b/nss/nss_db/nss_db.h
new file mode 100644
index 0000000000..8dc2a36416
--- /dev/null
+++ b/nss/nss_db/nss_db.h
@@ -0,0 +1,58 @@
+/* Common database open/close routines for nss_db.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _NSS_DB_H
+#define _NSS_DB_H	1
+
+#include <stdint.h>
+
+/* The error values kept the same values though new values were added.
+   Define only those which we need.  */
+#define DB_NOTFOUND	( -7)
+
+/* This is the wrapper we put around the `DB' structures to provide a
+   uniform interface to the higher-level functions.  */
+typedef struct
+{
+  void *db;
+  int (*close) (void *, uint32_t);
+  int (*fd) (void *, int *);
+  int (*get) (void *, void *, void *, void *, uint32_t);
+
+} NSS_DB;
+
+
+/* The `DBT' type is the same in all versions we support.  */
+typedef struct {
+  void *data;
+  uint32_t size;
+  uint32_t ulen;
+  uint32_t dlen;
+  uint32_t doff;
+  uint32_t flags;
+} DBT;
+
+
+/* Private routines to nss_db.
+   You must have included nsswitch.h and db.h before this file.  */
+
+extern enum nss_status internal_setent (const char *file, NSS_DB **dbp);
+extern void internal_endent (NSS_DB **dbp);
+
+#endif	/* nss_db.h */