file: WishIntfc.hxx
/*--
Description:
Class WishIntfc is used to interface to a 'wish' shell
It has functions that 'spawn' a wish shell and establish
pipes that communicate with the wish shell
Last Modified: 18 Jan, 1999 by Prakash Gopalakrishnan (prakashg@ece.cmu.edu)
--*/
#ifndef WISH_INTFC_HXX___
#define WISH_INTFC_HXX___
#include "SystemStuff.hxx"
#include <iostream.h>
#include <fstream.h>
#include <assert.h>
#include <string.h>
#define MAX_TCL_COMMAND_LENGTH 300
class WishIntfc
{
public:
WishIntfc(void) { Initialize(); } //OVERLOAD CALL: Initialize: WishIntfc.cxx(WishIntfc), wishGui.cxx(wishGui)
~WishIntfc(void) {}
void SetPath(const char* aPath) { strcpy(path,aPath);}
// set the path to run wish from
int Start(char* tcl_fname); //OVERLOAD CALL: Start: WishIntfc.cxx(WishIntfc), wishGui.cxx(wishGui)
// spawns wish shell &
// source TCL script from tcl_fname
int End(void); //OVERLOAD CALL: End: WishIntfc.cxx(WishIntfc), wishGui.cxx(wishGui)
// runs exit from wish
int Kill(void);
// kills the process
int SendCommand(const char* cmd);
// sends a wish command
void Print(ostream& out) const {;}
void Read(istream& in) {;}
protected:
char TCLcommand[MAX_TCL_COMMAND_LENGTH];
char path[50]; // wish's path
int toWish, fromWish; // used for communicating with wish
pid_t childPid; // used for spawning wish process
//void Free(void) {;}
void Initialize(void); //OVERLOAD CALL: Initialize: WishIntfc.cxx(WishIntfc), wishGui.cxx(wishGui)
friend ostream& operator<<(ostream& out, const WishIntfc& x) {
x.Print(out);
return out;
}
friend istream& operator>>(istream& in, WishIntfc& x) {
x.Read(in);
return in;
}
};
// function that catches the SIGALRM
void wish_catch_sig_alrm(int Signal);
void wish_catch_sig_pipe(int Signal);
#endif
C++ to HTML Conversion by ctoohtml