summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-09-12 15:20:53 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-09-12 15:20:53 +0000
commit6c1af174a3bd95d30e6cae2b2e49024248169ff4 (patch)
treedb54006c9d95a4740dd03fcc6ed6e7adafef8db5
parentd2542f192cb5097a45c36b7148efa3136dc5d76c (diff)
Wrap <dbm.h> and <ndbm.h> so that calls go direct and the symbols are all weak
-rw-r--r--lib/libc/db/hash/ndbm.c9
-rw-r--r--lib/libc/hidden/dbm.h31
-rw-r--r--lib/libc/hidden/ndbm.h35
3 files changed, 74 insertions, 1 deletions
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 2235286b1b3..9e44fb99276 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndbm.c,v 1.23 2013/09/30 12:02:31 millert Exp $ */
+/* $OpenBSD: ndbm.c,v 1.24 2015/09/12 15:20:52 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -235,6 +235,7 @@ dbm_close(db)
(void)(db->close)(db);
}
+DEF_WEAK(dbm_close);
/*
* Returns:
@@ -261,6 +262,7 @@ dbm_fetch(db, key)
retdata.dsize = dbtretdata.size;
return (retdata);
}
+DEF_WEAK(dbm_fetch);
/*
* Returns:
@@ -282,6 +284,7 @@ dbm_firstkey(db)
retkey.dsize = dbtretkey.size;
return (retkey);
}
+DEF_WEAK(dbm_firstkey);
/*
* Returns:
@@ -303,6 +306,7 @@ dbm_nextkey(db)
retkey.dsize = dbtretkey.size;
return (retkey);
}
+DEF_WEAK(dbm_nextkey);
/*
* Returns:
@@ -325,6 +329,7 @@ dbm_delete(db, key)
else
return (0);
}
+DEF_WEAK(dbm_delete);
/*
* Returns:
@@ -347,6 +352,7 @@ dbm_store(db, key, data, flags)
return ((db->put)(db, &dbtkey, &dbtdata,
(flags == DBM_INSERT) ? R_NOOVERWRITE : 0));
}
+DEF_WEAK(dbm_store);
int
dbm_error(db)
@@ -386,3 +392,4 @@ dbm_rdonly(dbp)
/* Could use DBM_RDONLY instead if we wanted... */
return ((hashp->flags & O_ACCMODE) == O_RDONLY);
}
+DEF_WEAK(dbm_rdonly);
diff --git a/lib/libc/hidden/dbm.h b/lib/libc/hidden/dbm.h
new file mode 100644
index 00000000000..44a431c03ff
--- /dev/null
+++ b/lib/libc/hidden/dbm.h
@@ -0,0 +1,31 @@
+/* $OpenBSD: dbm.h,v 1.1 2015/09/12 15:20:52 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_DBM_H_
+#define _LIBC_DBM_H_
+
+#include_next <dbm.h>
+
+PROTO_DEPRECATED(dbmclose);
+PROTO_DEPRECATED(dbminit);
+PROTO_DEPRECATED(delete);
+PROTO_DEPRECATED(fetch);
+PROTO_DEPRECATED(firstkey);
+PROTO_DEPRECATED(nextkey);
+PROTO_DEPRECATED(store);
+
+#endif /* _LIBC_DBM_H_ */
diff --git a/lib/libc/hidden/ndbm.h b/lib/libc/hidden/ndbm.h
new file mode 100644
index 00000000000..3a2b0f5ddde
--- /dev/null
+++ b/lib/libc/hidden/ndbm.h
@@ -0,0 +1,35 @@
+/* $OpenBSD: ndbm.h,v 1.1 2015/09/12 15:20:52 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_NDBM_H_
+#define _LIBC_NDBM_H_
+
+#include_next <ndbm.h>
+
+PROTO_DEPRECATED(dbm_clearerr);
+PROTO_NORMAL(dbm_close);
+PROTO_NORMAL(dbm_delete);
+PROTO_DEPRECATED(dbm_dirfno);
+PROTO_DEPRECATED(dbm_error);
+PROTO_NORMAL(dbm_fetch);
+PROTO_NORMAL(dbm_firstkey);
+PROTO_NORMAL(dbm_nextkey);
+PROTO_DEPRECATED(dbm_open);
+PROTO_NORMAL(dbm_rdonly);
+PROTO_NORMAL(dbm_store);
+
+#endif /* !_LIBC_NDBM_H_ */