X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/51631861ddb16afcfcf748cee26c14481549065e..HEAD:/include/ndbm.h diff --git a/include/ndbm.h b/include/ndbm.h index f71cfce..b400c62 100644 --- a/include/ndbm.h +++ b/include/ndbm.h @@ -61,41 +61,60 @@ #ifndef _NDBM_H_ #define _NDBM_H_ -#include +#include <_types.h> +#include +#include +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) /* Map dbm interface onto db(3). */ +#include #define DBM_RDONLY O_RDONLY +#endif /* Flags to dbm_store(). */ #define DBM_INSERT 0 #define DBM_REPLACE 1 +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) /* * The db(3) support for ndbm(3) always appends this suffix to the * file name to avoid overwriting the user's original database. */ #define DBM_SUFFIX ".db" +#endif typedef struct { - char *dptr; - int dsize; + void *dptr; + size_t dsize; } datum; -typedef DB DBM; +#ifndef _DBM +#define _DBM +typedef struct { + char __opaque[sizeof(int) + 8 * sizeof(void *)]; +} DBM; +#endif /* _DBM */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) #define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE +#endif __BEGIN_DECLS -void dbm_close(DBM *); int dbm_clearerr( DBM *); +void dbm_close(DBM *); int dbm_delete(DBM *, datum); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int dbm_dirfno(DBM *); +#endif int dbm_error( DBM *); datum dbm_fetch(DBM *, datum); datum dbm_firstkey(DBM *); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) long dbm_forder(DBM *, datum); +#endif datum dbm_nextkey(DBM *); -DBM *dbm_open(const char *, int, int); +DBM *dbm_open(const char *, int, mode_t); int dbm_store(DBM *, datum, datum, int); -int dbm_dirfno(DBM *); __END_DECLS #endif /* !_NDBM_H_ */