summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-07-07 08:41:27 +0800
committerAdrian Thurston <thurston@colm.net>2018-07-07 08:41:27 +0800
commit13627232094ba6b31937448f011553f44b1f8519 (patch)
tree72f6c378dc99f386ffc7d70e6be2deae776facba /src/input.c
parent975d403f75b2dfa2b8de57021614759ce5ae9d3f (diff)
downloadcolm-13627232094ba6b31937448f011553f44b1f8519.tar.gz
some improvements to the the stream funcs
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c80
1 files changed, 37 insertions, 43 deletions
diff --git a/src/input.c b/src/input.c
index a52f7233..a20cd8f2 100644
--- a/src/input.c
+++ b/src/input.c
@@ -565,7 +565,6 @@ static int text_get_data_source( struct colm_program *prg, struct stream_impl_da
return take;
}
-
/*
* StreamImpl struct, this wraps the list of input streams.
*/
@@ -1126,59 +1125,54 @@ static tree_t *stream_undo_append_stream( struct colm_program *prg, struct strea
struct stream_funcs_seq stream_funcs =
{
- .get_parse_block = &stream_get_parse_block,
- .get_data = &stream_get_data,
-
- /*
- * Consume.
- */
- .consume_data = &stream_consume_data,
- .undo_consume_data = &stream_undo_consume_data,
+ &stream_get_parse_block,
+ &stream_get_data,
+ 0 /* get_data_source */,
- .consume_tree = &stream_consume_tree,
- .undo_consume_tree = &stream_undo_consume_tree,
+ /* Consume. */
+ &stream_consume_data,
+ &stream_undo_consume_data,
- .consume_lang_el = &stream_consume_lang_el,
- .undo_consume_lang_el = &stream_undo_consume_lang_el,
+ &stream_consume_tree,
+ &stream_undo_consume_tree,
+ &stream_consume_lang_el,
+ &stream_undo_consume_lang_el,
- /*
- * Prepend
- */
- .prepend_data = &stream_prepend_data,
- .undo_prepend_data = &stream_undo_prepend_data,
+ /* Prepend */
+ &stream_prepend_data,
+ &stream_undo_prepend_data,
- .prepend_tree = &stream_prepend_tree,
- .undo_prepend_tree = &stream_undo_prepend_tree,
+ &stream_prepend_tree,
+ &stream_undo_prepend_tree,
- .prepend_stream = &stream_prepend_stream,
- .undo_prepend_stream = &stream_undo_prepend_stream,
+ &stream_prepend_stream,
+ &stream_undo_prepend_stream,
- /*
- * Append
- */
- .append_data = &stream_append_data,
- .undo_append_data = &stream_undo_append_data,
+ /* Append */
+ &stream_append_data,
+ &stream_undo_append_data,
- .append_tree = &stream_append_tree,
- .undo_append_tree = &stream_undo_append_tree,
+ &stream_append_tree,
+ &stream_undo_append_tree,
- .append_stream = &stream_append_stream,
- .undo_append_stream = &stream_undo_append_stream,
-
- .destructor = &stream_destructor,
- .get_collect = &stream_get_collect,
- .flush_stream = &stream_flush_stream,
- .close_stream = &stream_close_stream,
- .print_tree = &stream_print_tree,
+ &stream_append_stream,
+ &stream_undo_append_stream,
/* EOF */
- .set_eof = &stream_set_eof,
- .unset_eof = &stream_unset_eof,
- .get_eof_sent = &stream_get_eof_sent,
- .set_eof_sent = &stream_set_eof_sent,
-
- .transfer_loc = &transfer_loc_seq,
+ &stream_set_eof,
+ &stream_unset_eof,
+ &stream_get_eof_sent,
+ &stream_set_eof_sent,
+
+ /* Util. */
+ &transfer_loc_seq,
+ &stream_get_collect,
+ &stream_flush_stream,
+ &stream_close_stream,
+ &stream_print_tree,
+
+ &stream_destructor,
};
struct stream_funcs_data file_funcs =