Latest of libtest.
[m6w6/libmemcached] / libtest / cmdline.h
index 7b0afc5ffc27310374ac7e3457d1c5e7d8df7536..a387bcf5b5834583792b3e7a5f393b10ac387a45 100644 (file)
@@ -39,29 +39,28 @@ public:
 
   class Pipe {
   public:
-    Pipe();
+    Pipe(int);
     ~Pipe();
 
-    int* fd()
-    {
-      return _fd;
-    }
+    int fd();
 
     enum close_t {
-      READ,
-      WRITE
+      READ= 0,
+      WRITE= 1
     };
 
     void reset();
     void close(const close_t& arg);
     void dup_for_spawn(const close_t& arg,
-                       posix_spawn_file_actions_t& file_actions,
-                       const int newfildes);
+                       posix_spawn_file_actions_t& file_actions);
 
     void nonblock();
+    void cloexec();
+    bool read(libtest::vchar_t&);
 
   private:
-    int _fd[2];
+    const int _std_fd;
+    int _pipe_fd[2];
     bool _open[2];
   };