summaryrefslogtreecommitdiff
path: root/src/libfsm/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libfsm/common.h')
-rw-r--r--src/libfsm/common.h94
1 files changed, 1 insertions, 93 deletions
diff --git a/src/libfsm/common.h b/src/libfsm/common.h
index 964a3908..3739db3c 100644
--- a/src/libfsm/common.h
+++ b/src/libfsm/common.h
@@ -217,12 +217,7 @@ struct HostType
unsigned int size;
};
-typedef void (*GenLineDirectiveT)( std::ostream &out, bool nld, int line, const char *file );
-typedef const char *(*DefaultOutFnT)( const char *inputFileName );
-
-void genLineDirectiveC( std::ostream &out, bool nld, int line, const char *file );
-void genLineDirectiveAsm( std::ostream &out, bool nld, int line, const char *file );
-void genLineDirectiveTrans( std::ostream &out, bool nld, int line, const char *file );
+typedef void (*GenLineDirectiveT)( std::ostream &out, bool nld, int line, const char *fileName );
/* An abstraction of the key operators that manages key operations such as
* comparison and increment according the signedness of the key. */
@@ -360,93 +355,6 @@ inline void CondKey::increment()
key = key + 1;
}
-
-/* Filter on the output stream that keeps track of the number of lines
- * output. */
-class output_filter
-:
- public std::filebuf
-{
-public:
- output_filter( const char *fileName )
- :
- fileName(fileName),
- line(1),
- level(0),
- indent(false),
- singleIndent(false)
- {}
-
- virtual int sync();
- virtual std::streamsize xsputn( const char* s, std::streamsize n );
-
- std::streamsize countAndWrite( const char* s, std::streamsize n );
-
- const char *fileName;
- int line;
- int level;
- bool indent;
- bool singleIndent;
-};
-
-class nullbuf
-:
- public std::streambuf
-{
-public:
- virtual std::streamsize xsputn( const char * s, std::streamsize n )
- { return n; }
-
- virtual int overflow( int c )
- { return 1; }
-};
-
-class cfilebuf : public std::streambuf
-{
-public:
- cfilebuf( char *fileName, FILE* file ) : fileName(fileName), file(file) { }
- char *fileName;
- FILE *file;
-
- int sync()
- {
- fflush( file );
- return 0;
- }
-
- int overflow( int c )
- {
- if ( c != EOF )
- fputc( c, file );
- return 0;
- }
-
- std::streamsize xsputn( const char* s, std::streamsize n )
- {
- std::streamsize written = fwrite( s, 1, n, file );
- return written;
- }
-};
-
-class costream : public std::ostream
-{
-public:
- costream( cfilebuf *b ) :
- std::ostream(b), b(b) {}
-
- ~costream()
- { delete b; }
-
- void fclose()
- { ::fclose( b->file ); }
-
- cfilebuf *b;
-};
-
-
-const char *findFileExtension( const char *stemFile );
-const char *fileNameFromStem( const char *stemFile, const char *suffix );
-
struct Export
{
Export( std::string name, Key key )