summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-09-05 11:28:36 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-09-05 11:28:36 +0000
commitfa3d47eb688c9209a93a5bb958aab7b6e027a6f8 (patch)
treea78fb27fce231618357b9582c0a56fca63dab49a
parent06c89ea3c3bae55b3208d9227f38cf29eae76b5f (diff)
Use new framework for wrapping dbopen()
Move internal declarations from <db.h> to libc's hidden/db.h ok kettenis@
-rw-r--r--include/db.h11
-rw-r--r--lib/libc/db/db/db.c3
-rw-r--r--lib/libc/hidden/db.h33
3 files changed, 36 insertions, 11 deletions
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 <guenther@openbsd.org>
+ *
+ * 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 <db.h>
+#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_ */