]> git.ipfire.org Git - thirdparty/glibc.git/blob - nss/nss_db/nss_db.h
Update.
[thirdparty/glibc.git] / nss / nss_db / nss_db.h
1 /* Common database open/close routines for nss_db.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library 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.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19
20 #ifndef _NSS_DB_H
21 #define _NSS_DB_H 1
22
23 #include <stdint.h>
24
25 /* The error values kept the same values though new values were added.
26 Define only those which we need. */
27 #define DB_NOTFOUND ( -7)
28
29 /* This is the wrapper we put around the `DB' structures to provide a
30 uniform interface to the higher-level functions. */
31 typedef struct
32 {
33 void *db;
34 int (*close) (void *, uint32_t);
35 int (*fd) (void *, int *);
36 int (*get) (void *, void *, void *, void *, uint32_t);
37
38 } NSS_DB;
39
40
41 /* The `DBT' type is the same in all versions we support. */
42 typedef struct {
43 void *data;
44 uint32_t size;
45 uint32_t ulen;
46 uint32_t dlen;
47 uint32_t doff;
48 uint32_t flags;
49 } DBT;
50
51
52 /* Private routines to nss_db.
53 You must have included nsswitch.h and db.h before this file. */
54
55 extern enum nss_status internal_setent (const char *file, NSS_DB **dbp);
56 extern void internal_endent (NSS_DB **dbp);
57
58 #endif /* nss_db.h */