From fa3d47eb688c9209a93a5bb958aab7b6e027a6f8 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Sat, 5 Sep 2015 11:28:36 +0000 Subject: Use new framework for wrapping dbopen() Move internal declarations from to libc's hidden/db.h ok kettenis@ --- include/db.h | 11 +---------- lib/libc/db/db/db.c | 3 ++- lib/libc/hidden/db.h | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 lib/libc/hidden/db.h diff --git a/include/db.h b/include/db.h index 2f1dbe5723e..90fe790aa71 100644 --- a/include/db.h +++ b/include/db.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db.h,v 1.10 2015/08/27 04:37:09 guenther Exp $ */ +/* $OpenBSD: db.h,v 1.11 2015/09/05 11:28:35 guenther Exp $ */ /* $NetBSD: db.h,v 1.13 1994/10/26 00:55:48 cgd Exp $ */ /*- @@ -208,13 +208,4 @@ typedef struct { __BEGIN_DECLS DB *dbopen(const char *, int, int, DBTYPE, const void *); __END_DECLS - -#ifdef __DBINTERFACE_PRIVATE -__BEGIN_HIDDEN_DECLS -DB *__bt_open(const char *, int, int, const BTREEINFO *, int); -DB *__hash_open(const char *, int, int, const HASHINFO *, int); -DB *__rec_open(const char *, int, int, const RECNOINFO *, int); -void __dbpanic(DB *dbp); -__END_HIDDEN_DECLS -#endif #endif /* !_DB_H_ */ diff --git a/lib/libc/db/db/db.c b/lib/libc/db/db/db.c index 8f54ccf451d..116f7bd4c3f 100644 --- a/lib/libc/db/db/db.c +++ b/lib/libc/db/db/db.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db.c,v 1.12 2015/05/11 06:31:17 guenther Exp $ */ +/* $OpenBSD: db.c,v 1.13 2015/09/05 11:28:35 guenther Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -66,6 +66,7 @@ dbopen(const char *fname, int flags, int mode, DBTYPE type, errno = EINVAL; return (NULL); } +DEF_WEAK(dbopen); static int __dberr(void) diff --git a/lib/libc/hidden/db.h b/lib/libc/hidden/db.h new file mode 100644 index 00000000000..ba3d1e72d54 --- /dev/null +++ b/lib/libc/hidden/db.h @@ -0,0 +1,33 @@ +/* $OpenBSD: db.h,v 1.1 2015/09/05 11:28:35 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_DB_H_ +#define _LIBC_DB_H_ + +#include_next +#include "namespace.h" + +__BEGIN_HIDDEN_DECLS +DB *__bt_open(const char *, int, int, const BTREEINFO *, int); +DB *__hash_open(const char *, int, int, const HASHINFO *, int); +DB *__rec_open(const char *, int, int, const RECNOINFO *, int); +void __dbpanic(DB *dbp); +__END_HIDDEN_DECLS + +PROTO_NORMAL(dbopen); + +#endif /* !_LIBC_DB_H_ */ -- cgit v1.2.3