summaryrefslogtreecommitdiff
path: root/upb/bindings/stdc/io.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2018-08-21 14:47:50 -0700
committerJosh Haberman <jhaberman@gmail.com>2018-08-21 14:47:50 -0700
commitc0a50de92300080a1cf11bf4ff0ec3b2d6240c10 (patch)
tree84736c4563940dd81aa5d2269e3ba638b5355edb /upb/bindings/stdc/io.h
parente3eae33fb5840dbec3c2bc9109fa164f6066baa8 (diff)
Removed a bunch of obsolete code.
A lot of this code was experimental or temporarily useful, but is no longer needed.
Diffstat (limited to 'upb/bindings/stdc/io.h')
-rw-r--r--upb/bindings/stdc/io.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/upb/bindings/stdc/io.h b/upb/bindings/stdc/io.h
deleted file mode 100644
index b131500..0000000
--- a/upb/bindings/stdc/io.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-** ANSI C file I/O.
-*/
-
-#ifndef UPB_STDC_IO_H_
-#define UPB_STDC_IO_H_
-
-#include <stdio.h>
-#include "upb/bytestream.h"
-
-UPB_BEGIN_EXTERN_C
-
-/* upb_stdio ******************************************************************/
-
-// bytesrc/bytesink for ANSI C stdio, which is less efficient than posixfd, but
-// more portable.
-//
-// Specifically, stdio functions acquire locks on every operation (unless you
-// use the f{read,write,...}_unlocked variants, which are not standard) and
-// performs redundant buffering (unless you disable it with setvbuf(), but we
-// can only do this on newly-opened filehandles).
-
-typedef struct {
- uint64_t ofs;
- size_t len;
- uint32_t refcount;
- char data[];
-} upb_stdio_buf;
-
-// We use a single object for both bytesrc and bytesink for simplicity.
-// The object is still not thread-safe, and may only be used by one reader
-// and one writer at a time.
-typedef struct {
- upb_bytesrc src;
- upb_bytesink sink;
- FILE *file;
- bool should_close;
- upb_stdio_buf **bufs;
- int nbuf;
- uint32_t szbuf;
-} upb_stdio;
-
-void upb_stdio_init(upb_stdio *stdio);
-// Caller should call upb_stdio_flush prior to calling this to ensure that
-// all data is flushed, otherwise data can be silently dropped if an error
-// occurs flushing the remaining buffers.
-void upb_stdio_uninit(upb_stdio *stdio);
-
-// Resets the object to read/write to the given "file." The caller is
-// responsible for closing the file, which must outlive this object.
-void upb_stdio_reset(upb_stdio *stdio, FILE *file);
-
-// As an alternative to upb_stdio_reset(), initializes the object by opening a
-// file, and will handle closing it. This may result in more efficient I/O
-// than the previous since we can call setvbuf() to disable buffering.
-void upb_stdio_open(upb_stdio *stdio, const char *filename, const char *mode,
- upb_status *s);
-
-upb_bytesrc *upb_stdio_bytesrc(upb_stdio *stdio);
-upb_bytesink *upb_stdio_bytesink(upb_stdio *stdio);
-
-UPB_END_EXTERN_C
-
-#endif /* UPB_STDC_IO_H_ */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback