⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pipe.h

📁 Unix下的MUD客户端程序
💻 H
字号:
// Wrapper for pipe()class Pipe : public Selectable {public:    // Create a pipe. If fd1/2 are non-NULL, the pipe is dup2'ed there    Pipe(int fd1 = -1, int fd2 = -1);    ~Pipe();    int read(char *buf, int count);    int readLine(char *buf, int count);    int write(const char *buf, int count);    virtual void check_fdset(fd_set *, fd_set*);    virtual int init_fdset(fd_set *, fd_set*);    virtual void inputReady() = 0;    typedef enum {Read, Write} End;    int getFile(End e);        private:    int fds[2];};class InterpreterPipe : public Pipe {public:    InterpreterPipe();    virtual void inputReady();private:    char line_buf[4096];    int pos;};class OutputPipe : public Pipe {public:    OutputPipe();    virtual void inputReady();};extern InterpreterPipe *interpreterPipe;extern OutputPipe *outputPine;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -