aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--conform/conformtest.pl3
-rw-r--r--conform/data/monetary.h-data8
-rw-r--r--conform/data/mqueue.h-data28
-rw-r--r--conform/data/ndbm.h-data26
-rw-r--r--conform/data/nl_types.h-data13
-rw-r--r--conform/data/poll.h-data23
-rw-r--r--stdio-common/tst-cookie.c92
8 files changed, 200 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 61b60d8..ea210bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
1999-08-24 Ulrich Drepper <drepper@cygnus.com>
+ * conform/conformtest.pl (@headers): Add monetary.h-data,
+ mqueue.h-data, ndbm.h-data, nl_types.h-data, and poll.h-data.
+ * conform/data/monetary.h-data: New file.
+ * conform/data/mqueue.h-data: New file.
+ * conform/data/ndbm.h-data: New file.
+ * conform/data/nl_types.h.h-data: New file.
+ * conform/data/poll.h-data: New file.
+
* stdio-common/Makefile (test): Add tst-cookie.
* stdio-common/tst-cookie.c: New file.
diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index 1d83d0d..80114dd 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -4,7 +4,8 @@ $CC = "gcc";
$CFLAGS = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=500";
# List of the headers we are testing.
-@headers = ("math.h", "locale.h", "libgen.h", "langinfo.h", "iso646.h",
+@headers = ("poll.h", "nl_types.h", "ndbm.h", "mqueue.h", "monetary.h",
+ "math.h", "locale.h", "libgen.h", "langinfo.h", "iso646.h",
"inttypes.h", "iconv.h", "grp.h", "glob.h", "ftw.h", "fnmatch.h",
"fmtmsg.h", "float.h", "fcntl.h", "errno.h", "dlfcn.h", "dirent.h",
"ctype.h", "cpio.h", "assert.h", "aio.h");
diff --git a/conform/data/monetary.h-data b/conform/data/monetary.h-data
new file mode 100644
index 0000000..eab8384
--- /dev/null
+++ b/conform/data/monetary.h-data
@@ -0,0 +1,8 @@
+#if !defined ISO && !defined POSIX
+type size_t
+type ssize_t
+
+function ssize_t strfmon (char*, size_t, const char*, ...)
+
+allow *_t
+#endif
diff --git a/conform/data/mqueue.h-data b/conform/data/mqueue.h-data
new file mode 100644
index 0000000..2b02455
--- /dev/null
+++ b/conform/data/mqueue.h-data
@@ -0,0 +1,28 @@
+#ifndef ISO
+# should test for not an array type.
+type mqd_t
+
+type {struct sigevent}
+
+type {struct mq_attr}
+element {struct mq_attr} long mq_flags
+element {struct mq_attr} long mq_maxmsg
+element {struct mq_attr} long mq_msgsize
+element {struct mq_attr} long mq_curmsg
+
+function int mq_close (mqd_t)
+function int mq_getattr (mqd_t, struct mq_attr*)
+function int mq_notify (mqd_t, const struct sigevent*)
+function mqd_t mq_open (const char*, int, ...)
+function ssize_t mq_receive (mqd_t, char*, size_t, unsigned int*)
+function int mq_send (mqd_t, const char*, size_t, unsigned int)
+function int mq_setattr (mqd_t, const struct mq_attr*, struct mq_attr*)
+function int mq_unlink (const char*)
+
+allow-header fcntl.h
+allow-header signal.h
+allow-header sys/types.h
+allow-header time.h
+
+allow *_t
+#endif
diff --git a/conform/data/ndbm.h-data b/conform/data/ndbm.h-data
new file mode 100644
index 0000000..7843941
--- /dev/null
+++ b/conform/data/ndbm.h-data
@@ -0,0 +1,26 @@
+#if !defined ISO && !defined POSIX
+type datum
+element datum {void*} dptr
+element datum size_t dsize
+
+type size_t
+
+type DBM
+
+type mode_t
+
+constant DBM_INSERT
+constant DBM_REPLACE
+
+function int dbm_clearerr (DBM*)
+function void dbm_close (DBM*)
+function int dbm_delete (DBM*, datum)
+function int dbm_error (DBM*)
+function datum dbm_fetch (DBM*, datum)
+function datum dbm_firstkey (DBM*)
+function datum dbm_nextkey (DBM*)
+function {DBM*} dbm_open (const char*, int, mode_t)
+function int dbm_store (DBM*, datum, datum, int)
+
+allow *_t
+#endif
diff --git a/conform/data/nl_types.h-data b/conform/data/nl_types.h-data
new file mode 100644
index 0000000..91eacaf
--- /dev/null
+++ b/conform/data/nl_types.h-data
@@ -0,0 +1,13 @@
+#if !defined ISO && !defined POSIX
+type nl_catd
+type nl_item
+
+constant NL_SETD
+constant NL_CAT_LOCALE
+
+function int catclose (nl_catd)
+function {char*} catgets (nl_catd, int, int, char char*)
+function nl_catd catopen (const char*, int)
+
+allow *_t
+#endif
diff --git a/conform/data/poll.h-data b/conform/data/poll.h-data
new file mode 100644
index 0000000..fdc7b2f
--- /dev/null
+++ b/conform/data/poll.h-data
@@ -0,0 +1,23 @@
+#if !defined ISO && !defined POSIX
+type {struct pollfd}
+element {struct pollfd} int fd
+element {struct pollfd} {short int} events
+element {struct pollfd} {short int} revents
+
+type nfds_t
+
+constant POLLIN
+constant POLLRDNORM
+constant POLLRDBAND
+constant POLLPRI
+constant POLLOUT
+constant POLLWRNORM
+constant POLLWRBAND
+constant POLLERR
+constant POLLHUP
+constant POLLNVAL
+
+function int poll (struct pollfd[], nfsd_t, int)
+
+allow *_t
+#endif
diff --git a/stdio-common/tst-cookie.c b/stdio-common/tst-cookie.c
new file mode 100644
index 0000000..004ef23
--- /dev/null
+++ b/stdio-common/tst-cookie.c
@@ -0,0 +1,92 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include <stdio.h>
+
+
+#define THE_COOKIE ((void *) 0xdeadbeeful)
+
+static int errors;
+
+
+static int cookieread_called;
+static ssize_t
+cookieread (void *cookie, char *buf, size_t count)
+{
+ printf ("`%s' called with cookie %#lx\n", __FUNCTION__,
+ (unsigned long int) cookie);
+ if (cookie != THE_COOKIE)
+ ++errors;
+ cookieread_called = 1;
+ return 42;
+}
+
+
+static int cookiewrite_called;
+static ssize_t
+cookiewrite (void *cookie, const char *buf, size_t count)
+{
+ printf ("`%s' called with cookie %#lx\n", __FUNCTION__,
+ (unsigned long int) cookie);
+ if (cookie != THE_COOKIE)
+ ++errors;
+ cookiewrite_called = 1;
+ return 43;
+}
+
+
+static int cookieseek_called;
+static int
+cookieseek (void *cookie, off_t offset, int whence)
+{
+ printf ("`%s' called with cookie %#lx\n", __FUNCTION__,
+ (unsigned long int) cookie);
+ if (cookie != THE_COOKIE)
+ ++errors;
+ cookieseek_called = 1;
+ return 44;
+}
+
+
+static int cookieclose_called;
+static int
+cookieclose (void *cookie)
+{
+ printf ("`%s' called with cookie %#lx\n", __FUNCTION__,
+ (unsigned long int) cookie);
+ if (cookie != THE_COOKIE)
+ ++errors;
+ cookieclose_called = 1;
+ return 45;
+}
+
+
+int
+main (void)
+{
+ cookie_io_functions_t fcts;
+ char buf[1];
+ FILE *f;
+
+ fcts.read = cookieread;
+ fcts.seek = cookieseek;
+ fcts.close = cookieclose;
+ fcts.write = cookiewrite;
+
+ f = fopencookie (THE_COOKIE, "r+", fcts);
+
+ fread (buf, 1, 1, f);
+ fwrite (buf, 1, 1, f);
+ fseek (f, 0, SEEK_CUR);
+ fclose (f);
+
+ if (cookieread_called == 0
+ || cookiewrite_called == 0
+ || cookieseek_called == 0
+ || cookieclose_called == 0)
+ ++errors;
+
+ return errors != 0;
+}