summaryrefslogtreecommitdiff
path: root/src/input.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-06-23 11:59:58 +0700
committerAdrian Thurston <thurston@colm.net>2018-06-23 11:59:58 +0700
commit58fe99bfaa90bd59cc28a69d36407b06cbaac560 (patch)
tree9b04941f282ec32b6eb58623e02b52f6264ad36b /src/input.h
parentd8d7272e58f7eeb23d6393e4372c4ad710ac50cc (diff)
downloadcolm-58fe99bfaa90bd59cc28a69d36407b06cbaac560.tar.gz
split the run_buf into two structs, one for seq, one for data
Detangling the different types of stream.
Diffstat (limited to 'src/input.h')
-rw-r--r--src/input.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/input.h b/src/input.h
index d559c508..0cf77566 100644
--- a/src/input.h
+++ b/src/input.h
@@ -59,13 +59,26 @@ enum run_buf_type {
RUN_BUF_SOURCE_TYPE
};
-struct run_buf
+struct seq_buf
{
enum run_buf_type type;
long length;
struct colm_tree *tree;
struct stream_impl *si;
long offset;
+ struct seq_buf *next, *prev;
+
+ /* Must be at the end. We will grow this struct to add data if the input
+ * demands it. */
+ char data[FSM_BUFSIZE];
+};
+
+struct run_buf
+{
+ enum run_buf_type type;
+ long length;
+ struct colm_tree *tree;
+ long offset;
struct run_buf *next, *prev;
/* Must be at the end. We will grow this struct to add data if the input
@@ -129,8 +142,8 @@ struct stream_impl_seq
char eof;
char eos_sent;
- struct run_buf *queue;
- struct run_buf *queue_tail;
+ struct seq_buf *queue;
+ struct seq_buf *queue_tail;
long line;
long column;