-#if __STDC__ || c_plusplus
-DB *btree_open(const char *file, int flags, int mode, const BTREEINFO *private);
-DB *hash_open(const char *file, int flags, int mode, const HASHINFO *private);
-DB *recno_open(const char *file, int flags, int mode, const RECNOINFO *private);
-#else
-DB *btree_open();
-DB *hash_open();
-DB *recno_open();
-#endif
+/* Little endian <--> big endian long swap macros. */
+#define BLSWAP(a) { \
+ u_long _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[3]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[2]; \
+ ((char *)&a)[2] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[3] = ((char *)&_tmp)[0]; \
+}
+#define BLSWAP_COPY(a,b) { \
+ ((char *)&(b))[0] = ((char *)&(a))[3]; \
+ ((char *)&(b))[1] = ((char *)&(a))[2]; \
+ ((char *)&(b))[2] = ((char *)&(a))[1]; \
+ ((char *)&(b))[3] = ((char *)&(a))[0]; \
+}
+
+
+/* Little endian <--> big endian short swap macros. */
+#define BSSWAP(a) { \
+ u_short _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[0]; \
+}
+#define BSSWAP_COPY(a,b) { \
+ ((char *)&(b))[0] = ((char *)&(a))[1]; \
+ ((char *)&(b))[1] = ((char *)&(a))[0]; \
+}
+
+#include <sys/cdefs.h>
+__BEGIN_DECLS
+DB *btree_open
+ __P((const char *, int, int, const BTREEINFO *));
+DB *hash_open
+ __P((const char *, int, int, const HASHINFO *));
+DB *recno_open
+ __P((const char *, int, int, const RECNOINFO *));
+__END_DECLS
+
+#endif /* !_DB_H_ */