From fbe3d840c25d637dbcadd9925a30293f52a46e96 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 13 Feb 1998 19:42:12 +0000 Subject: [PATCH] * hash/hash.c (__kdb2_hash_open): Rename to avoid potential collision with NetBSD libc. * hash/dbm.c: Rename lots of functions to avoid colliding with native dbm implementations. * db/db.c (kdb2_dbopen): Rename to avoid colliding with NetBSD libc. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10431 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/db2/ChangeLog | 11 +++++++++ src/util/db2/db/db.c | 2 +- src/util/db2/hash/dbm.c | 48 ++++++++++++++++++++-------------------- src/util/db2/hash/hash.c | 2 +- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/util/db2/ChangeLog b/src/util/db2/ChangeLog index d3581d7c2..db69fcde1 100644 --- a/src/util/db2/ChangeLog +++ b/src/util/db2/ChangeLog @@ -1,3 +1,14 @@ +Fri Feb 13 14:37:47 1998 Tom Yu + + * hash/hash.c (__kdb2_hash_open): Rename to avoid potential + collision with NetBSD libc. + + * hash/dbm.c: Rename lots of functions to avoid colliding with + native dbm implementations. + + * db/db.c (kdb2_dbopen): Rename to avoid colliding with NetBSD + libc. + Wed Jan 21 10:17:34 1998 Ezra Peisach * btree/bt_open.c: Added O_BINARY for __CYGWIN32__. diff --git a/src/util/db2/db/db.c b/src/util/db2/db/db.c index e236afbd0..fba779534 100644 --- a/src/util/db2/db/db.c +++ b/src/util/db2/db/db.c @@ -45,7 +45,7 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94"; #include "db-int.h" DB * -dbopen(fname, flags, mode, type, openinfo) +kdb2_dbopen(fname, flags, mode, type, openinfo) const char *fname; int flags, mode; DBTYPE type; diff --git a/src/util/db2/hash/dbm.c b/src/util/db2/hash/dbm.c index 7b83da09d..50921de84 100644 --- a/src/util/db2/hash/dbm.c +++ b/src/util/db2/hash/dbm.c @@ -68,20 +68,20 @@ static DBM *__cur_db; static void no_open_db __P((void)); int -dbminit(file) +kdb2_dbminit(file) char *file; { if (__cur_db != NULL) - (void)dbm_close(__cur_db); - if ((__cur_db = dbm_open(file, O_RDWR|O_BINARY, 0)) != NULL) + (void)kdb2_dbm_close(__cur_db); + if ((__cur_db = kdb2_dbm_open(file, O_RDWR|O_BINARY, 0)) != NULL) return (0); - if ((__cur_db = dbm_open(file, O_RDONLY|O_BINARY, 0)) != NULL) + if ((__cur_db = kdb2_dbm_open(file, O_RDONLY|O_BINARY, 0)) != NULL) return (0); return (-1); } datum -fetch(key) +kdb2_fetch(key) datum key; { datum item; @@ -91,11 +91,11 @@ fetch(key) item.dptr = 0; return (item); } - return (dbm_fetch(__cur_db, key)); + return (kdb2_dbm_fetch(__cur_db, key)); } datum -firstkey() +kdb2_firstkey() { datum item; @@ -104,11 +104,11 @@ firstkey() item.dptr = 0; return (item); } - return (dbm_firstkey(__cur_db)); + return (kdb2_dbm_firstkey(__cur_db)); } datum -nextkey(key) +kdb2_nextkey(key) datum key; { datum item; @@ -118,29 +118,29 @@ nextkey(key) item.dptr = 0; return (item); } - return (dbm_nextkey(__cur_db)); + return (kdb2_dbm_nextkey(__cur_db)); } int -delete(key) +kdb2_delete(key) datum key; { if (__cur_db == NULL) { no_open_db(); return (-1); } - return (dbm_delete(__cur_db, key)); + return (kdb2_dbm_delete(__cur_db, key)); } int -store(key, dat) +kdb2_store(key, dat) datum key, dat; { if (__cur_db == NULL) { no_open_db(); return (-1); } - return (dbm_store(__cur_db, key, dat, DBM_REPLACE)); + return (kdb2_dbm_store(__cur_db, key, dat, DBM_REPLACE)); } static void @@ -155,7 +155,7 @@ no_open_db() * NULL on failure */ DBM * -dbm_open(file, flags, mode) +kdb2_dbm_open(file, flags, mode) const char *file; int flags, mode; { @@ -178,7 +178,7 @@ dbm_open(file, flags, mode) * Nothing. */ void -dbm_close(db) +kdb2_dbm_close(db) DBM *db; { (void)(db->close)(db); @@ -190,7 +190,7 @@ dbm_close(db) * NULL on failure */ datum -dbm_fetch(db, key) +kdb2_dbm_fetch(db, key) DBM *db; datum key; { @@ -221,7 +221,7 @@ dbm_fetch(db, key) * NULL on failure */ datum -dbm_firstkey(db) +kdb2_dbm_firstkey(db) DBM *db; { int status; @@ -247,7 +247,7 @@ dbm_firstkey(db) * NULL on failure */ datum -dbm_nextkey(db) +kdb2_dbm_nextkey(db) DBM *db; { int status; @@ -273,7 +273,7 @@ dbm_nextkey(db) * <0 failure */ int -dbm_delete(db, key) +kdb2_dbm_delete(db, key) DBM *db; datum key; { @@ -301,7 +301,7 @@ dbm_delete(db, key) * 1 if DBM_INSERT and entry exists */ int -dbm_store(db, key, content, flags) +kdb2_dbm_store(db, key, content, flags) DBM *db; datum key, content; int flags; @@ -322,7 +322,7 @@ dbm_store(db, key, content, flags) } int -dbm_error(db) +kdb2_dbm_error(db) DBM *db; { HTAB *hp; @@ -332,7 +332,7 @@ dbm_error(db) } int -dbm_clearerr(db) +kdb2_dbm_clearerr(db) DBM *db; { HTAB *hp; @@ -343,7 +343,7 @@ dbm_clearerr(db) } int -dbm_dirfno(db) +kdb2_dbm_dirfno(db) DBM *db; { return(((HTAB *)db->internal)->fp); diff --git a/src/util/db2/hash/hash.c b/src/util/db2/hash/hash.c index 8e9f7f073..0f51d6c9f 100644 --- a/src/util/db2/hash/hash.c +++ b/src/util/db2/hash/hash.c @@ -94,7 +94,7 @@ u_int32_t hash_accesses, hash_collisions, hash_expansions, hash_overflows, /* OPEN/CLOSE */ extern DB * -__hash_open(file, flags, mode, info, dflags) +__kdb2_hash_open(file, flags, mode, info, dflags) const char *file; int32_t flags, mode, dflags; const HASHINFO *info; /* Special directives for create */ -- 2.26.2