|
|
|
@ -77,7 +77,7 @@ void io_engine::Start( const int side )
|
|
|
|
|
/* Stop accidents */
|
|
|
|
|
if( engine != NULL )
|
|
|
|
|
return;
|
|
|
|
|
engine = new KProcess();
|
|
|
|
|
engine = new TDEProcess();
|
|
|
|
|
|
|
|
|
|
/* Convert 'side' to 'ID' */
|
|
|
|
|
if( side == WHITE )
|
|
|
|
@ -151,14 +151,14 @@ void io_engine::Start( const int side )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Showtime */
|
|
|
|
|
if( !engine->start( KProcess::NotifyOnExit, KProcess::All ) )
|
|
|
|
|
if( !engine->start( TDEProcess::NotifyOnExit, TDEProcess::All ) )
|
|
|
|
|
{
|
|
|
|
|
kdError() << "io_engine::Start: Can not run the engine: " << (*IT).Filename << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
connect( engine, TQT_SIGNAL( wroteStdin( KProcess* ) ), this, TQT_SLOT( SendClear( KProcess* ) ) );
|
|
|
|
|
connect( engine, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, TQT_SLOT( Recv( KProcess*, char*, int ) ) );
|
|
|
|
|
connect( engine, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), this, TQT_SLOT( Recv( KProcess*, char*, int ) ) );
|
|
|
|
|
connect( engine, TQT_SIGNAL( wroteStdin( TDEProcess* ) ), this, TQT_SLOT( SendClear( TDEProcess* ) ) );
|
|
|
|
|
connect( engine, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ), this, TQT_SLOT( Recv( TDEProcess*, char*, int ) ) );
|
|
|
|
|
connect( engine, TQT_SIGNAL( receivedStderr( TDEProcess*, char*, int ) ), this, TQT_SLOT( Recv( TDEProcess*, char*, int ) ) );
|
|
|
|
|
|
|
|
|
|
proto->parse( Command( myID, CMD_Init ) );
|
|
|
|
|
|
|
|
|
@ -223,7 +223,7 @@ void io_engine::sendToChild( void )
|
|
|
|
|
// io_engine::Recv
|
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
void io_engine::Recv( KProcess*, char *buffer, int bufLen )
|
|
|
|
|
void io_engine::Recv( TDEProcess*, char *buffer, int bufLen )
|
|
|
|
|
{
|
|
|
|
|
char *newBuff = new char[bufLen + 1];
|
|
|
|
|
strncpy( newBuff, buffer, bufLen );
|
|
|
|
@ -303,7 +303,7 @@ void io_engine::recvProtoCMD( const Command &command )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void io_engine::SendClear( KProcess* )
|
|
|
|
|
void io_engine::SendClear( TDEProcess* )
|
|
|
|
|
{
|
|
|
|
|
SafeToSend = TRUE;
|
|
|
|
|
if( !FIFO_Out.isEmpty() )
|
|
|
|
|