diff options
author | Adrian Thurston <thurston@colm.net> | 2018-07-13 16:02:08 +0800 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2018-07-13 16:02:08 +0800 |
commit | 1c97b4e09f0b509ff69c8eb04339f754e73e02df (patch) | |
tree | c26004922c1f57eabb4703c0d3dd1346b29c9c0f /src/input.h | |
parent | 7dac7ff4de3a0ada2e57a26880752e438ccbe871 (diff) | |
download | colm-1c97b4e09f0b509ff69c8eb04339f754e73e02df.tar.gz |
fix for optimized append wherby we were not respecting run_buf->offset
Diffstat (limited to 'src/input.h')
-rw-r--r-- | src/input.h | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/src/input.h b/src/input.h index 9d53b2ca..fc100313 100644 --- a/src/input.h +++ b/src/input.h @@ -53,35 +53,6 @@ struct colm_stream; struct input_impl; struct stream_impl; -enum seq_buf_type { - SB_TOKEN = 1, - SB_IGNORE, - SB_SOURCE, - SB_ACCUM -}; - -struct seq_buf -{ - enum seq_buf_type type; - char own_si; - struct colm_tree *tree; - struct stream_impl *si; - struct seq_buf *next, *prev; -}; - -struct run_buf -{ - long length; - long offset; - struct run_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 *new_run_buf( int sz ); - #define DEF_INPUT_FUNCS( input_funcs, _input_impl ) \ struct input_funcs \ { \ @@ -145,6 +116,22 @@ struct stream_impl struct stream_funcs *funcs; }; +enum seq_buf_type { + SB_TOKEN = 1, + SB_IGNORE, + SB_SOURCE, + SB_ACCUM +}; + +struct seq_buf +{ + enum seq_buf_type type; + char own_si; + struct colm_tree *tree; + struct stream_impl *si; + struct seq_buf *next, *prev; +}; + /* List of source streams. Enables streams to be pushed/popped. */ struct input_impl_seq { @@ -164,7 +151,19 @@ struct input_impl_seq int consumed; }; -/* List of source streams. Enables streams to be pushed/popped. */ +struct run_buf +{ + long length; + long offset; + struct run_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 *new_run_buf( int sz ); + struct stream_impl_data { struct stream_funcs *funcs; |