diff options
author | Adrian Thurston <thurston@complang.org> | 2010-04-14 02:16:37 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2010-04-14 02:16:37 +0000 |
commit | 8ec042b074ae9cdff5ab165927640c7469e6049e (patch) | |
tree | 35718641d65f6c4436154b450b52709b487b4eec /colm/ctinput.cpp | |
parent | af7e0d646408d211885a2ef3da665d9b448aa125 (diff) | |
download | colm-8ec042b074ae9cdff5ab165927640c7469e6049e.tar.gz |
More porting to C.
Diffstat (limited to 'colm/ctinput.cpp')
-rw-r--r-- | colm/ctinput.cpp | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/colm/ctinput.cpp b/colm/ctinput.cpp index 765bc3d6..1de8af7c 100644 --- a/colm/ctinput.cpp +++ b/colm/ctinput.cpp @@ -64,24 +64,15 @@ void initStaticFuncs() * Pattern */ -InputStream::InputStream( Pattern *pattern ) -: - hasData(0), - eofSent(false), - flush(false), - eof(false), - line(1), - column(1), - byte(0), - handlesLine(true), - later(false), - queue(0), - queueTail(0), - offset(0), - pattern(pattern), - patItem(pattern->list->head) +InputStream *newInputStreamPattern( Pattern *pattern ) { - funcs = &patternFuncs; + InputStream *is = (InputStream*)malloc(sizeof(InputStream)); + memset( is, 0, sizeof(InputStream) ); + is->handlesLine = true; + is->pattern = pattern; + is->patItem = pattern->list->head; + is->funcs = &patternFuncs; + return is; } bool inputStreamPatternIsLangEl( InputStream *is ) @@ -199,24 +190,15 @@ void initPatternFuncs() * Replacement */ -InputStream::InputStream( Replacement *replacement ) -: - hasData(0), - eofSent(false), - flush(false), - eof(false), - line(1), - column(1), - byte(0), - handlesLine(true), - later(false), - queue(0), - queueTail(0), - offset(0), - replacement(replacement), - replItem(replacement->list->head) +InputStream *newInputStreamRepl( Replacement *replacement ) { - funcs = &replFuncs; + InputStream *is = (InputStream*)malloc(sizeof(InputStream)); + memset( is, 0, sizeof(InputStream) ); + is->handlesLine = true; + is->replacement = replacement; + is->replItem = replacement->list->head; + is->funcs = &replFuncs; + return is; } bool inputStreamReplIsLangEl( InputStream *is ) |