#define STANDALONE 1
/*
* Database functions
* Copyright (C) Andrew Tridgell 1999
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms AND provided that this software or
* any derived work is only used as part of the PPP daemon (pppd)
* and related utilities.
* The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Note: this software is also available under the Gnu Public License
* version 2 or later.
*/
/* this is stored at the front of every database */
struct tdb_header {
char magic_food[32]; /* for /etc/magic */
unsigned version; /* version of the code */
unsigned hash_size; /* number of hash entries */
};
/* this is the context structure that is returned from a db open */
typedef struct {
char *name; /* the name of the database */
void *map_ptr; /* where it is currently mapped */
int fd; /* open file descriptor for the database */
tdb_len map_size; /* how much space has been mapped */
int read_only; /* opened read-only */
int *locked; /* set if we have a chain locked */
int ecode; /* error code for last tdb error */
struct tdb_header header; /* a cached copy of the header */
} TDB_CONTEXT;