25 #include <tqcstring.h>
28 void dcopidlParse(
const char *_code );
36 int main(
int argc,
char** argv )
40 fprintf(stderr,
"Usage : dcopidl input_file\n");
43 TQFile file( argv[1] );
44 if ( !file.open( IO_ReadOnly ) )
46 fprintf(stderr,
"Can't open input file\n");
50 TQByteArray arr = TQByteArray(file.readAll());
51 uint len = arr.size();
53 for (uint i = 1; i<len; i++, j++) {
54 if (arr[ i-1 ] ==
'\r' && ((i+1)==len || arr[ i ] !=
'\n')) {
60 else if (arr[ i-1 ] ==
'\r' && arr[ i ] ==
'\n') {
66 arr[ j-1 ] = arr[ i-1 ];
70 arr.resize( len + 1 );
74 char *debug = getenv(
"DEBUG");
80 printf(
"<!DOCTYPE DCOP-IDL><DCOP-IDL>\n");
81 printf(
"<SOURCE>%s</SOURCE>\n", argv[1] );
82 dcopidlParse( arr.data() );
83 printf(
"</DCOP-IDL>\n");