/* * Writer.h * Author: Hannah C. Tang (hctang@cs) * * Specification of public functions for Writer struct * (the code gen module) * * $Id: Writer.h,v 1.3 2001/12/19 06:56:42 cse466_t Exp $ * */ #include "Sequence.h" #include "common.h" #ifndef WRITER_H #define WRITER_H struct Writer; /* Dynamically allocate and free Writer structs */ struct Writer* Writer_malloc( void ); void Writer_free( struct Writer *pW ); /* Append a sequence to the current Writer */ Bool Writer_appendSequence( struct Writer *pW, const struct Sequence *pS ); /* Repeatedly append the Sequences between 'start' and 'end' (inclusive) * to the end of the Writer. Append them numTimes */ Bool Writer_appendSequencesBetween( struct Writer *pW, unsigned int start, unsigned int end, unsigned int numTimes ); /* Append a >>Mode<< Sequence to the current buffer */ Bool Writer_appendModeSequence( struct Writer *pW, unsigned int modeSequence ); /* Clear the Writer's current buffer */ void Writer_clearBuffer( struct Writer *pW ); /* Get the number of Sequences in the buffer */ unsigned int Writer_getNumSequences( const struct Writer *pW ); /* Get the size of the Writer's buffer */ size_t Writer_getBufferSize( const struct Writer *pW ); /* Get the Writer's buffer */ struct Sequence* Writer_getBuffer( struct Writer *pW, size_t *bufferSize ); #endif /* WRITER_H */