summaryrefslogtreecommitdiff
path: root/src/input.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-06-18 15:56:46 +0700
committerAdrian Thurston <thurston@colm.net>2018-06-18 15:56:46 +0700
commit7b0c27ec89c0fd72ac76e05bd6ae27a674599fed (patch)
treebc2c4b169167a2fcaa339c3a66faaeea3aac40c8 /src/input.h
parent622efddde25cbcaa82e6ac2b2d533e41987d07fb (diff)
downloadcolm-7b0c27ec89c0fd72ac76e05bd6ae27a674599fed.tar.gz
added location information to stream interfaces
Last of the interface making, allows us to strip down stream_impl into just funcs pointer, making it entirely abstract.
Diffstat (limited to 'src/input.h')
-rw-r--r--src/input.h31
1 files changed, 3 insertions, 28 deletions
diff --git a/src/input.h b/src/input.h
index 849dbeca..081105e7 100644
--- a/src/input.h
+++ b/src/input.h
@@ -107,8 +107,9 @@ struct stream_funcs \
void (*close_stream)( struct stream_impl *si ); \
void (*print_tree)( struct colm_program *prg, struct colm_tree **sp, \
struct stream_impl *impl, struct colm_tree *tree, int trim ); \
- char (*get_eof_sent)( struct stream_impl *impl ); \
- void (*set_eof_sent)( struct stream_impl *impl, char eof_sent ); \
+ char (*get_eof_sent)( struct stream_impl *si ); \
+ void (*set_eof_sent)( struct stream_impl *si, char eof_sent ); \
+ void (*transfer_loc)( struct colm_location *loc, struct stream_impl *si ); \
}
DEF_STREAM_FUNCS( stream_funcs, stream_impl );
@@ -117,32 +118,6 @@ DEF_STREAM_FUNCS( stream_funcs, stream_impl );
struct stream_impl
{
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 colm_str_collect *collect;
-
- int consumed;
-
- /* Indentation. */
- int level;
- int indent;
};
/* List of source streams. Enables streams to be pushed/popped. */