#ifndef _EXTERNALAPP_H
#define _EXTERNALAPP_H
#include <sys/types.h>

/*
ExternalApp represents an application that is "launched" from the current
one.
*/
class ExternalApp 
{
  public:
  ExternalApp(const char *name);
  ~ExternalApp();

  // Run the application. Returns pid, or -1 on error  
  virtual int run(char **argv, 
		  char *errorBuf,        // Error message if non-zero return
		  int redirectedFd = -1, /* Re-direct from this descriptor to 
					    pipe[1] */
		  int *pipe = NULL);

  pid_t pid();
  
  protected:
  pid_t _pid;
  
};



#endif
