summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-01-19 02:27:11 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-01-19 02:27:11 +0000
commit2054de60b00ce5af960f170c19dd9577ca2bf646 (patch)
tree1b271837fb065cc01e78dafb21bf7f2d2fdb2108 /regress
parente0b65c48358d6c439aeb3ffb370d3abe075f3022 (diff)
test taken from /usr/include/db.h
ok millert@
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/grep/Makefile9
-rw-r--r--regress/usr.bin/grep/t14.in51
2 files changed, 57 insertions, 3 deletions
diff --git a/regress/usr.bin/grep/Makefile b/regress/usr.bin/grep/Makefile
index 34afaebd963..665b88a3cbd 100644
--- a/regress/usr.bin/grep/Makefile
+++ b/regress/usr.bin/grep/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.5 2003/12/06 20:19:12 otto Exp $
+# $OpenBSD: Makefile,v 1.6 2004/01/19 02:27:10 espie Exp $
-REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
+REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14
t1:
grep t.s ${.CURDIR}/in | diff - ${.CURDIR}/t1.out
@@ -41,6 +41,9 @@ t12:
t13:
grep 'abcd. abcd.' ${.CURDIR}/t13.in | diff - ${.CURDIR}/t13.out
-.PHONY: t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
+t14:
+ test X`grep -w -l u_int ${.CURDIR}/t14.in` = X${.CURDIR}/t14.in
+
+.PHONY: t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/grep/t14.in b/regress/usr.bin/grep/t14.in
new file mode 100644
index 00000000000..b752bdc39e9
--- /dev/null
+++ b/regress/usr.bin/grep/t14.in
@@ -0,0 +1,51 @@
+typedef u_int32_t recno_t;
+
+/* Key/data structure -- a Data-Base Thang. */
+typedef struct {
+ void *data; /* data */
+ size_t size; /* data length */
+} DBT;
+
+/* Routine flags. */
+#define R_CURSOR 1 /* del, put, seq */
+#define __R_UNUSED 2 /* UNUSED */
+#define R_FIRST 3 /* seq */
+#define R_IAFTER 4 /* put (RECNO) */
+#define R_IBEFORE 5 /* put (RECNO) */
+#define R_LAST 6 /* seq (BTREE, RECNO) */
+#define R_NEXT 7 /* seq */
+#define R_NOOVERWRITE 8 /* put */
+#define R_PREV 9 /* seq (BTREE, RECNO) */
+#define R_SETCURSOR 10 /* put (RECNO) */
+#define R_RECNOSYNC 11 /* sync (RECNO) */
+
+typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
+
+/*
+ * !!!
+ * The following flags are included in the dbopen(3) call as part of the
+ * open(2) flags. In order to avoid conflicts with the open flags, start
+ * at the top of the 16 or 32-bit number space and work our way down. If
+ * the open flags were significantly expanded in the future, it could be
+ * a problem. Wish I'd left another flags word in the dbopen call.
+ *
+ * !!!
+ * None of this stuff is implemented yet. The only reason that it's here
+ * is so that the access methods can skip copying the key/data pair when
+ * the DB_LOCK flag isn't set.
+ */
+#if UINT_MAX > 65535
+#define DB_LOCK 0x20000000 /* Do locking. */
+#define DB_SHMEM 0x40000000 /* Use shared memory. */
+#define DB_TXN 0x80000000 /* Do transactions. */
+#else
+#define DB_LOCK 0x2000 /* Do locking. */
+#define DB_SHMEM 0x4000 /* Use shared memory. */
+#define DB_TXN 0x8000 /* Do transactions. */
+#endif
+
+/* Access method description structure. */
+typedef struct __db {
+ DBTYPE type; /* Underlying db type. */
+ int (*close)(struct __db *);
+ int (*del)(const struct __db *, const DBT *, u_int);