summaryrefslogtreecommitdiff
path: root/nonstd/FILE.h
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-01-26 22:41:05 -0500
committerJakob Kaivo <jkk@ung.org>2019-01-26 22:41:05 -0500
commit8c6d4505329f94446084ca93eae10cd796d79a8d (patch)
treec00c6a990c81bd771ebcac72b38fd3ce2382c42e /nonstd/FILE.h
new framework for building sources after gitlab migration
Diffstat (limited to 'nonstd/FILE.h')
-rw-r--r--nonstd/FILE.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/nonstd/FILE.h b/nonstd/FILE.h
new file mode 100644
index 00000000..263fe1ab
--- /dev/null
+++ b/nonstd/FILE.h
@@ -0,0 +1,46 @@
+#ifndef __NONSTD_FILE_H__
+#define __NONSTD_FILE_H__
+
+#include "stdio.h" /* for fpos_t */
+#include "sys/types.h" /* for pid_t */
+
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199309L
+# define flockfile(x)
+# define ftrylockfile(x)
+# define funlockfile(x)
+#endif
+
+struct __FILE {
+ fpos_t pos;
+ char *buf;
+ enum { SUPPLIED, ALLOCED, UNSET } buftype;
+ int buffering;
+ int bsize;
+ int isopen;
+ int flags;
+ int lastop;
+
+ /* verified necessary */
+ int fd;
+ int oflag;
+ int orientation;
+ int eof;
+ int err;
+ int nlocks;
+ int thread;
+ pid_t pipe_pid;
+
+ struct {
+ char *buf;
+ size_t size;
+ int allocated;
+ } mem;
+
+ struct __FILE *prev;
+ struct __FILE *next;
+};
+
+int getc_unlocked(FILE *);
+int putc_unlocked(FILE *, int);
+
+#endif