summaryrefslogtreecommitdiff
path: root/db/test
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-11-11 16:25:25 +0000
committerjbj <devnull@localhost>2004-11-11 16:25:25 +0000
commitfbbbddcd7e7b80152be34332e113c867e513673f (patch)
tree39b8bd78b8620a7accb82d9e3bfeab15a70d7bad /db/test
parentacf19af1ab27ad071c1614f9610ae29eb5c902c1 (diff)
downloadrpm-fbbbddcd7e7b80152be34332e113c867e513673f.tar.gz
rpm-fbbbddcd7e7b80152be34332e113c867e513673f.tar.bz2
rpm-fbbbddcd7e7b80152be34332e113c867e513673f.zip
Add new db-4.3.21 files.
CVS patchset: 7579 CVS date: 2004/11/11 16:25:25
Diffstat (limited to 'db/test')
-rw-r--r--db/test/scr021/t.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/db/test/scr021/t.c b/db/test/scr021/t.c
new file mode 100644
index 000000000..a45865cfe
--- /dev/null
+++ b/db/test/scr021/t.c
@@ -0,0 +1,69 @@
+#include <sys/types.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <strings.h>
+
+void
+chk(f, str)
+ char *f, *str;
+{
+ char *s;
+ int ch, l, ok, pc;
+
+ if (freopen(f, "r", stdin) == NULL) {
+ fprintf(stderr, "%s: %s\n", f, strerror(errno));
+ exit (1);
+ }
+
+ for (l = 1, ok = 1, s = str; (ch = getchar()) != EOF;) {
+ if (ch == '\n')
+ ++l;
+ if (!ok || ch != *s) {
+ s = str;
+ ok = !isalpha(ch) && !isdigit(ch) && ch != '_';
+ continue;
+ }
+ if (*++s != '\0')
+ continue;
+
+ /* Match. */
+ printf("%s: %d: %s", f, l, str);
+ for (pc = 1; (ch = getchar()) != EOF;) {
+ switch (ch) {
+ case '(':
+ ++pc;
+ break;
+ case ')':
+ --pc;
+ break;
+ case '\n':
+ ++l;
+ break;
+ }
+ if (ch == '\n')
+ putchar(' ');
+ else
+ putchar(ch);
+ if (pc <= 0) {
+ putchar('\n');
+ break;
+ }
+ }
+ s = str;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ int r;
+
+ for (r = 0; *++argv != NULL;) {
+ chk(*argv, "F_ISSET(");
+ chk(*argv, "F_CLR(");
+ chk(*argv, "F_SET(");
+ }
+ return (0);
+}