rllib  1
rlspawn.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                           rlspawn.h  -  description
00003                              -------------------
00004     begin                : Tue Jan 02 2001
00005     copyright            : (C) 2001 by Rainer Lehrig
00006     email                : lehrig@t-online.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as        *
00013  *   published by the Free Software Foundation                             *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef _RL_SPAWN_H_
00017 #define _RL_SPAWN_H_
00018 
00019 #include "rldefine.h"
00020 
00021 #ifndef RLUNIX
00022 //#warning This Functionality is only available under Linux/Unix
00023 #endif
00024 
00032 class rlSpawn
00033 {
00034 public:
00035   rlSpawn();
00036   virtual ~rlSpawn();
00037 
00044   int spawn(const char *command);
00045 
00050   const char *readLine();
00051 
00056   int getchar();
00057 
00063   int select(int timeout=50);
00064 
00071   int writeString(const char *buf);
00072 
00078   int write(const char *buf, int len);
00079 
00085   int printf(const char *format, ...);
00086 
00090   void printAll();
00091 
00092   int pid;
00093 
00094 private:
00095   void *toChild,*fromChild;
00096   char line[4096]; // adjust this if the buffer is not big enough
00097 };
00098 
00099 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines