/* ===========================================================================

 INSTALL.H    Global variables and functions for INSTALL 

=============================================================================*/

#ifdef INSTALL_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

//#define DEBUG_PRINTF
#define MAX_NUM_ARGS 30


/*****************************************
** Global Legacy Variables
** Set these variables in install.C
****************************************/
EXTERN Widget       UxTopLevel;
EXTERN Display      *UxDisplay;
EXTERN int          UxScreen;
EXTERN XtAppContext UxAppContext;

/****************************************
** Globlal User Created Variables
** Set these variables in install.C
****************************************/
EXTERN Display      *applDisplay;
EXTERN int          applScreen;
EXTERN XtAppContext appContext;

class Install 
{
 private:
 public:
    void  init(UINT2 llocal_only);
    void  cmdLineOpts(UINT2 lstart_install_a);
    void  setAllSensitive(UINT2 lsensitive_a);
};
EXTERN Install install;

class InstallStat
{
  private:
  public:
     void create(swidget parent);
     void popup(void);
     void popdown(void);
     void write(char *info);
     void writeStartMessage(void);
     void writeFinishMessage(UINT2 lnormal_termination_a);
     void writeErrorMessage(char *msg_a);
     void writeCmdLineOpt(char *copy_from_dir_a, char *args_ptr_a[]);

};
EXTERN InstallStat installStat;

class InstallErr
{
  private:
  public:
     void create(swidget parent);
     void popup(void);
     void popdown(void);
     void write(const char *err_type_a, char *info_a);
};
EXTERN InstallErr installErr;


class InstallFunc
{
 private:
    pid_t  iInstirisShellPID;
    char   instirisPath[160];
    char   origDir[100];
 public:
    InstallFunc(void);
    void  pipeExec(char *args_ptr[]);
    void  cleanupPipes(void);
    UINT2 lCheckEnvirVariables(void);
    char  *getInstirisPath(void);
    UINT2 lCheckForErrorInData(const char *buf_a);

};
EXTERN InstallFunc installFunc;

#undef EXTERN
