summaryrefslogtreecommitdiff
path: root/src/input.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-06-18 09:30:53 +0700
committerAdrian Thurston <thurston@colm.net>2018-06-18 09:32:27 +0700
commit03b8cafb389ae61e6895140024f9c261d9d074fc (patch)
treecee2d293a0d2e4a9ea26a87084553714b5641161 /src/input.h
parente1bcbb75a7b6ce2a9455dc9921ff52be1082e737 (diff)
downloadcolm-03b8cafb389ae61e6895140024f9c261d9d074fc.tar.gz
starting to separate run time stream impls from the base
Can't yet make it fully abstract since there are a number of instances direct access inside stream_impl. Need to put those behind some abstract functions.
Diffstat (limited to 'src/input.h')
-rw-r--r--src/input.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/input.h b/src/input.h
index dce29416..3f6e254c 100644
--- a/src/input.h
+++ b/src/input.h
@@ -197,6 +197,70 @@ struct stream_impl
int indent;
};
+/* List of source streams. Enables streams to be pushed/popped. */
+struct stream_impl_seq
+{
+ struct stream_funcs *funcs;
+
+ char eof_sent;
+ char eof;
+ char eos_sent;
+
+ struct run_buf *queue;
+ struct run_buf *queue_tail;
+
+ const char *data;
+ long dlen;
+ int offset;
+
+ long line;
+ long column;
+ long byte;
+
+ char *name;
+ FILE *file;
+
+ struct _StrCollect *collect;
+
+ int consumed;
+
+ /* Indentation. */
+ int level;
+ int indent;
+};
+
+/* List of source streams. Enables streams to be pushed/popped. */
+struct stream_impl_data
+{
+ struct stream_funcs *funcs;
+
+ char eof_sent;
+ char eof;
+ char eos_sent;
+
+ struct run_buf *queue;
+ struct run_buf *queue_tail;
+
+ const char *data;
+ long dlen;
+ int offset;
+
+ long line;
+ long column;
+ long byte;
+
+ char *name;
+ FILE *file;
+
+ struct _StrCollect *collect;
+
+ int consumed;
+
+ /* Indentation. */
+ int level;
+ int indent;
+};
+
struct stream_impl *colm_impl_new_generic( char *name );