summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hedenfal <martinh@cvs.openbsd.org>2010-06-13 06:55:34 +0000
committerMartin Hedenfal <martinh@cvs.openbsd.org>2010-06-13 06:55:34 +0000
commitbff7a14a030e2d02fa542c760143530a445daa65 (patch)
tree126b5126c26f6d1aa9060b0e4928382104d18509
parentc28274dcbc845f78f16c3941169314504517ed88 (diff)
Don't expose typedefs of pgno_t and indx_t in the public header file, move
them to btree.c. Also don't use exact-width integer types in public btree api.
-rw-r--r--usr.sbin/ldapd/btree.c9
-rw-r--r--usr.sbin/ldapd/btree.h9
2 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/ldapd/btree.c b/usr.sbin/ldapd/btree.c
index 2bb488a6e70..4cdd1a70d96 100644
--- a/usr.sbin/ldapd/btree.c
+++ b/usr.sbin/ldapd/btree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btree.c,v 1.9 2010/06/13 06:49:51 martinh Exp $ */
+/* $OpenBSD: btree.c,v 1.10 2010/06/13 06:55:33 martinh Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -56,6 +56,9 @@
#define F_ISSET(w, f) (((w) & (f)) == (f))
+typedef uint32_t pgno_t;
+typedef uint16_t indx_t;
+
/* There are four page types: meta, index, leaf and overflow.
* They all share the same page header.
*/
@@ -957,7 +960,7 @@ fail:
}
struct btree *
-btree_open_fd(int fd, uint32_t flags)
+btree_open_fd(int fd, unsigned int flags)
{
int fl, rc;
struct btree *bt;
@@ -1021,7 +1024,7 @@ fail:
}
struct btree *
-btree_open(const char *path, uint32_t flags, mode_t mode)
+btree_open(const char *path, unsigned int flags, mode_t mode)
{
int fd, oflags;
struct btree *bt;
diff --git a/usr.sbin/ldapd/btree.h b/usr.sbin/ldapd/btree.h
index 6bf6ca26997..c65f57ab15e 100644
--- a/usr.sbin/ldapd/btree.h
+++ b/usr.sbin/ldapd/btree.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: btree.h,v 1.3 2010/06/13 06:46:03 martinh Exp $ */
+/* $OpenBSD: btree.h,v 1.4 2010/06/13 06:55:33 martinh Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -20,7 +20,6 @@
#define _btree_h_
#include <openssl/sha.h>
-#include <stdint.h>
struct mpage;
struct cursor;
@@ -33,8 +32,6 @@ struct btval {
struct mpage *mp; /* ref'd memory page */
};
-typedef uint32_t pgno_t;
-typedef uint16_t indx_t;
typedef int (*bt_cmp_func)(const struct btval *a,
const struct btval *b);
typedef void (*bt_prefix_func)(const struct btval *a,
@@ -78,8 +75,8 @@ struct btree_stat {
time_t created_at;
};
-struct btree *btree_open_fd(int fd, uint32_t flags);
-struct btree *btree_open(const char *path, uint32_t flags,
+struct btree *btree_open_fd(int fd, unsigned int flags);
+struct btree *btree_open(const char *path, unsigned int flags,
mode_t mode);
void btree_close(struct btree *bt);
const struct btree_stat *btree_stat(struct btree *bt);