diff options
-rw-r--r-- | include/ndbm.h | 13 | ||||
-rw-r--r-- | lib/libc/db/hash/ndbm.c | 12 | ||||
-rw-r--r-- | lib/libc/db/man/dbm.3 | 6 | ||||
-rw-r--r-- | lib/libc/db/man/ndbm.3 | 9 |
4 files changed, 21 insertions, 19 deletions
diff --git a/include/ndbm.h b/include/ndbm.h index 67ba56b379b..4c1efa9f189 100644 --- a/include/ndbm.h +++ b/include/ndbm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ndbm.h,v 1.5 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: ndbm.h,v 1.6 2004/05/03 17:27:50 millert Exp $ */ /* $NetBSD: ndbm.h,v 1.6 1995/07/20 23:31:11 jtc Exp $ */ /*- @@ -54,25 +54,24 @@ #define DBM_SUFFIX ".db" typedef struct { - char *dptr; - int dsize; + void *dptr; + size_t dsize; } datum; typedef DB DBM; #define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE __BEGIN_DECLS +int dbm_clearerr(DBM *); void dbm_close(DBM *); int dbm_delete(DBM *, datum); +int dbm_error(DBM *); datum dbm_fetch(DBM *, datum); datum dbm_firstkey(DBM *); -long dbm_forder(DBM *, datum); 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 *); -int dbm_error(DBM *); -int dbm_clearerr(DBM *); int dbm_rdonly(DBM *); __END_DECLS diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c index 6187996e97f..f8c5242d8f9 100644 --- a/lib/libc/db/hash/ndbm.c +++ b/lib/libc/db/hash/ndbm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndbm.c,v 1.17 2003/06/25 21:15:05 deraadt Exp $ */ +/* $OpenBSD: ndbm.c,v 1.18 2004/05/03 17:27:50 millert Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)dbm.c 8.6 (Berkeley) 11/7/95"; #else -static const char rcsid[] = "$OpenBSD: ndbm.c,v 1.17 2003/06/25 21:15:05 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: ndbm.c,v 1.18 2004/05/03 17:27:50 millert Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -59,7 +59,7 @@ static const char rcsid[] = "$OpenBSD: ndbm.c,v 1.17 2003/06/25 21:15:05 deraadt */ static DBM *__cur_db; -static DBM *_dbm_open(const char *, const char *, int, int); +static DBM *_dbm_open(const char *, const char *, int, mode_t); /* * Returns: @@ -192,7 +192,8 @@ static DBM * _dbm_open(file, suff, flags, mode) const char *file; const char *suff; - int flags, mode; + int flags; + mode_t mode; { HASHINFO info; char path[MAXPATHLEN]; @@ -224,7 +225,8 @@ _dbm_open(file, suff, flags, mode) DBM * dbm_open(file, flags, mode) const char *file; - int flags, mode; + int flags; + mode_t mode; { return(_dbm_open(file, DBM_SUFFIX, flags, mode)); diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3 index 654f981a82c..c2df560ab5b 100644 --- a/lib/libc/db/man/dbm.3 +++ b/lib/libc/db/man/dbm.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: dbm.3,v 1.8 2003/06/17 21:56:23 millert Exp $ +.\" $OpenBSD: dbm.3,v 1.9 2004/05/03 17:27:50 millert Exp $ .\" .\" Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com> .\" @@ -53,8 +53,8 @@ The key and the content data are described by the data structure: .Bd -literal -offset indent typedef struct { - char *dptr; - int dsize; + void *dptr; + size_t dsize; } datum .Ed .Pp diff --git a/lib/libc/db/man/ndbm.3 b/lib/libc/db/man/ndbm.3 index 7fa96e6032c..5eb62fb810a 100644 --- a/lib/libc/db/man/ndbm.3 +++ b/lib/libc/db/man/ndbm.3 @@ -1,5 +1,5 @@ .\" David Leonard, 1998. Placed in the public domain. -.\" $OpenBSD: ndbm.3,v 1.13 2003/10/21 20:30:16 jmc Exp $ +.\" $OpenBSD: ndbm.3,v 1.14 2004/05/03 17:27:50 millert Exp $ .Dd May 13, 1998 .Dt NDBM 3 .Os @@ -35,7 +35,7 @@ .Ft datum .Fn dbm_nextkey "DBM *db" .Ft "DBM *" -.Fn dbm_open "const char *file" "int flags" "int mode" +.Fn dbm_open "const char *file" "int flags" "mode_t mode" .Ft int .Fn dbm_pagfno "DBM *db" .Ft int @@ -51,8 +51,8 @@ The key and the content data are described by the data structure: .Bd -literal -offset indent typedef struct { - char *dptr; - int dsize; + void *dptr; + size_t dsize; } datum .Ed .Pp @@ -198,4 +198,5 @@ and corresponds to those errors described in .Sh SEE ALSO .Xr open 2 , .Xr db 3 , +.Xr dbm 3 , .Xr hash 3 |