summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-07-10 11:21:05 +0800
committerAdrian Thurston <thurston@colm.net>2018-07-10 11:21:05 +0800
commit723b9790f920360fe7947e4c9bf87db1729d20bb (patch)
tree8c4a9035900ba0fb50acb2684fe9ee4b41a39ad2 /src/input.c
parenta1202027828211d6f4c58709b8059c958b4dc83b (diff)
downloadcolm-723b9790f920360fe7947e4c9bf87db1729d20bb.tar.gz
some cleanup of eof interface
Still have two bools concerning eof. Can't unify these yet ... need break down the two concepts to try to unify.
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/input.c b/src/input.c
index d7d69345..20f52f66 100644
--- a/src/input.c
+++ b/src/input.c
@@ -634,14 +634,9 @@ static void input_stream_seq_prepend( struct input_impl_seq *is, struct seq_buf
}
}
-void stream_set_eof( struct colm_program *prg, struct input_impl_seq *si )
+void stream_set_eof_mark( struct colm_program *prg, struct input_impl_seq *si, char eof_mark )
{
- si->eof = true;
-}
-
-void stream_unset_eof( struct colm_program *prg, struct input_impl_seq *si )
-{
- si->eof = false;
+ si->eof_mark = eof_mark;
}
static void stream_destructor( program_t *prg, tree_t **sp, struct input_impl_seq *si )
@@ -678,7 +673,7 @@ static int stream_get_parse_block( struct colm_program *prg, struct input_impl_s
while ( true ) {
if ( buf == 0 ) {
/* Got through the in-mem buffers without copying anything. */
- ret = is->eof ? INPUT_EOF : INPUT_EOD;
+ ret = is->eof_mark ? INPUT_EOF : INPUT_EOD;
break;
}
@@ -1099,8 +1094,7 @@ struct input_funcs_seq input_funcs =
&stream_undo_append_stream,
/* EOF */
- &stream_set_eof,
- &stream_unset_eof,
+ &stream_set_eof_mark,
&stream_get_eof_sent,
&stream_set_eof_sent,