1 /* Common database open/close routines for nss_db.
2 Copyright (C) 1999-2014 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
24 #include <bits/libc-lock.h>
27 /* String table index type. */
28 typedef uint32_t stridx_t
;
30 /* Database file header. */
34 #define NSS_DB_MAGIC 0xdd110601
36 uint64_t valstroffset
;
42 char pad
[sizeof (uint32_t) - 1];
45 uint64_t keyidxoffset
;
46 uint64_t keystroffset
;
51 /* Information about mapped database. */
54 struct nss_db_header
*header
;
59 /* Open the database stored in FILE. If succesful, store the database
60 handle in *MAPPINGP or a file descriptor for the file in *FDP and
61 return NSS_STATUS_SUCCESS. On failure, return the appropriate
63 enum nss_status
internal_setent (const char *file
,
64 struct nss_db_map
*mappingp
);
66 /* Close the database FD. */
67 extern void internal_endent (struct nss_db_map
*mapping
);