summaryrefslogtreecommitdiff
path: root/colm/input.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2013-01-07 08:14:10 -0500
committerAdrian Thurston <thurston@complang.org>2013-01-07 08:14:10 -0500
commitad15ebcb3326f7a63516618383aae3f24ee2c7be (patch)
treec60f66ca9bde7bd3c42761ed5b001bad733c7b64 /colm/input.h
parent205da42c6f7f9aef3caa4acda774249e58dd7c20 (diff)
downloadcolm-ad15ebcb3326f7a63516618383aae3f24ee2c7be.tar.gz
added support for pushing streams
Still need to properly handle EOF on non-accum streams that have other streams pushed.
Diffstat (limited to 'colm/input.h')
-rw-r--r--colm/input.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/colm/input.h b/colm/input.h
index 2bbcdae6..3bfc43c5 100644
--- a/colm/input.h
+++ b/colm/input.h
@@ -106,18 +106,21 @@ struct StreamFuncs
void (*setEof)( StreamImpl *is );
void (*unsetEof)( StreamImpl *is );
+ /* Prepending to a stream. */
void (*prependData)( StreamImpl *in, const char *data, long len );
- int (*undoPrependData)( StreamImpl *is, int length );
-
void (*prependTree)( StreamImpl *is, struct ColmTree *tree, int ignore );
+ void (*prependStream)( StreamImpl *in, struct ColmTree *tree );
+ int (*undoPrependData)( StreamImpl *is, int length );
struct ColmTree *(*undoPrependTree)( StreamImpl *is );
+ struct ColmTree *(*undoPrependStream)( StreamImpl *in );
+ /* Appending to a stream. */
void (*appendData)( StreamImpl *in, const char *data, long len );
void (*appendTree)( StreamImpl *in, struct ColmTree *tree );
void (*appendStream)( StreamImpl *in, struct ColmTree *tree );
struct ColmTree *(*undoAppendData)( StreamImpl *in, int length );
- struct ColmTree *(*undoAppendStream)( StreamImpl *in );
struct ColmTree *(*undoAppendTree)( StreamImpl *in );
+ struct ColmTree *(*undoAppendStream)( StreamImpl *in );
};
/* List of source streams. Enables streams to be pushed/popped. */
@@ -177,17 +180,18 @@ void _setEof( StreamImpl *is );
void _unsetEof( StreamImpl *is );
void _prependData( StreamImpl *in, const char *data, long len );
-int _undoPrependData( StreamImpl *is, int length );
-
void _prependTree( StreamImpl *is, struct ColmTree *tree, int ignore );
+void _prependStream( StreamImpl *in, struct ColmTree *tree );
+int _undoPrependData( StreamImpl *is, int length );
struct ColmTree *_undoPrependTree( StreamImpl *is );
+struct ColmTree *_undoPrependStream( StreamImpl *in );
void _appendData( StreamImpl *in, const char *data, long len );
void _appendTree( StreamImpl *in, struct ColmTree *tree );
void _appendStream( StreamImpl *in, struct ColmTree *tree );
struct ColmTree *_undoAppendData( StreamImpl *in, int length );
-struct ColmTree *_undoAppendStream( StreamImpl *in );
struct ColmTree *_undoAppendTree( StreamImpl *in );
+struct ColmTree *_undoAppendStream( StreamImpl *in );
#ifdef __cplusplus
}