X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Fconsole.h;h=60540da04c26d1908f04f48165b4fd7a6a0a1101;hp=f7cd469ca19de6918be232e4d1dd902805fd5af1;hb=e1cd84473da2da0d23f4cea1d4143f17a8fb5a2c;hpb=654bb0a0f8583b7cbc47b32f7e9b6921dffc4e03 diff --git a/lib/base/console.h b/lib/base/console.h index f7cd469..60540da 100644 --- a/lib/base/console.h +++ b/lib/base/console.h @@ -1,13 +1,11 @@ #ifndef __LIB_BASE_CONSOLE_H__ #define __LIB_BASE_CONSOLE_H__ -#include "Python.h" #include #include #include #include -#ifndef SWIG struct queue_data { queue_data( char *data, int len ) @@ -18,37 +16,33 @@ struct queue_data int len; int dataSent; }; -#endif -class eConsoleAppContainer: public Object +class eConsoleAppContainer: public Object, public iObject { -#ifndef SWIG + DECLARE_REF(eConsoleAppContainer); int fd[3]; int filefd[3]; int pid; int killstate; std::string m_cwd; std::queue outbuf; - eSocketNotifier *in, *out, *err; + ePtr in, out, err; void readyRead(int what); void readyErrRead(int what); void readyWrite(int what); void closePipes(); -#endif public: eConsoleAppContainer(); + ~eConsoleAppContainer(); int setCWD( const char *path ); int execute( const char *str ); int execute( const char *cmdline, const char *const argv[] ); - int execute( PyObject *cmdline, PyObject *args ); - ~eConsoleAppContainer(); int getPID() { return pid; } void kill(); void sendCtrlC(); + void sendEOF(); void write( const char *data, int len ); - void write( PyObject *data ); - void readFromFile( PyObject *py_filename ); - void dumpToFile( PyObject *py_filename ); + void setFileFD(int num, int fd) { if (num >= 0 && num <= 2) filefd[num] = fd; } bool running() { return (fd[0]!=-1) && (fd[1]!=-1) && (fd[2]!=-1); } PSignal1 dataAvail; PSignal1 stdoutAvail;