/* Header for module newci, generated by p2c */
#ifndef NEWCI_H
#define NEWCI_H



#ifdef NEWCI_G
# define vextern
#else
# define vextern extern
#endif



#define timers_userphase 0

/*must be zero*/
#define timers_idlephase 1
#define timers_sysphase 2
#define timers_diskphase 3



/*user defined*/

typedef Char *newci_argarr[100001L];

typedef struct newci_parserec {
    Char switch_[4];
    uchar used;
    Char kind;
    union {
	long i;
	double r;
	Char *s;
	_PROCEDURE p;
	_PROCEDURE p1;
    } UU;
} newci_parserec;

typedef newci_parserec newci_parsetab[1000000L];

typedef struct newci_fshandle {
    long a, b;
} newci_fshandle;

typedef enum {
    im_normal, im_keep, im_default, im_key, im_grab
} newci_imode;

typedef struct timers_desc {
    long rate;
    _PROCEDURE proc;
    long count;
    boolean perm;
    struct timers_desc *next;
    Anyptr *user;
} timers_desc;



#define newci_exitescapecode 18346



vextern _PROCEDURE newci_progentryhook;
vextern _PROCEDURE newci_progexithook;
extern int P_argc;
extern Char **P_argv;
vextern Char *newci_programname;
vextern Char *newci_programargs;
vextern boolean newci_rediroutput, newci_redirinput;
vextern Char newci_inputhighlight;
vextern boolean newci_markuserflag, newci_ucfilenames, newci_verbose;
vextern short newci_errorcode;
vextern Char *newci_shellname;
vextern boolean newci_shellflag, respond_flag, respond_enable;
vextern long newci_exitcode;
vextern _PROCEDURE newci_checkrespondhook;
vextern short timers_phase, timers_permphase;
vextern long timers_clocks[16];
vextern FILE **newci_stdterm;



extern FILE **newci_stdin PV();
extern FILE **newci_stdout PV();
extern FILE **newci_stderr PV();
extern Void newci_parseargs PP((Char *s));
extern Void newci_parseswitch PP((newci_parserec *tab, long size, Char *bad));
extern Void newci_eatargument PV();
extern Void newci_fixfname PP((Char *s, Char *ext, Char *home));
extern Void newci_forcefname PP((Char *s, Char *ext, Char *home));
extern Void newci_chainprogram PP((Char *name));
extern Void newci_markprogram PP((long *id));
extern Void newci_loadprogram PP((Char *name));
extern Void newci_reloadprogram PP((Char *name));
extern Void newci_releaseprogram PP((long *id));
extern Void newci_runprogram PP((Char *name));
extern Void newci_shellrunprogram PP((Char *name, int debugging));
extern Void newci_basicrunprogram PP((Char *name, int debugging));
extern Void newci_shellescape PP((Char *args));
extern Void newci_fullshellescape PP((Char *args, Char *opts));
extern Void newci_fulleditescape PP((Char *fn, Char *opts, long ln, long pos));
extern Void newci_permanentprogram PV();
extern Void newci_unpermanentprogram PV();
extern Void newci_recursiveprogram PV();
extern Void newci_flushexecutionbits PV();
extern Void newci_getenv PP((Char *variable, Char *value, boolean *exists));
extern boolean newci_canreleaseprogram PP((long id));
extern Void newci_exit PP((long code));
extern Void newci_assert PP((int flag, Char *msg));
extern Void newci_ferror PP((Char *msg));
extern Void newci_merror PP((Char *s, Char *msg));
extern Char *newci_showerror PP((Char *newci_Result, Char *msg));
extern Void newci_fescape PP((long esc, long ior, Char *msg));
extern Void newci_mescape PP((Char *s, long esc, long ior, Char *msg));
extern Char *newci_showescape PP((Char *newci_Result, long esc, long ior,
				  Char *msg));
extern Void newci_nullrecover PV();
extern Void newci_reescape PV();
extern Void newci_checkior PV();
extern Void newci_iorecover PV();
extern Anyptr *newci_findsymbol PP((Char *name));

/*case sensitive*/
extern Void newci_initfindsymbol2 PP((newci_fshandle *handle));
extern Anyptr *newci_findsymbol2 PP((Char *suffix, newci_fshandle *handle,
				     Char *name));
extern boolean newci_findprogram PP((Char *name));
extern boolean newci_findprocedure PP((Char *name, _PROCEDURE *start));
extern boolean newci_findprocedure2 PP((Char *name, _PROCEDURE *start));
extern Anyptr *newci_findglobal PP((Char *name, long offset));
extern Void newci_findabove PP((long *addr, Char *name));
extern Void newci_findbelow PP((long *addr, Char *name));
extern Void push_var PP((long *v));

/*also records, arrays*/
extern Void push_varstr PP((Char *s));
extern Void push_boolean PP((int b));
extern Void push_char PP((int c));
extern Void push_shortint PP((long i));

/*also enumerated types, with ord()*/
extern Void push_ptr PP((Anyptr *p));
extern Void push_integer PP((long i));
extern Void push_real PP((double r));
extern Void push_string PP((Char *s));
extern Void newci_callfunction PP((_PROCEDURE start, long *ret, long retsize));
extern boolean newci_callboolean PP((_PROCEDURE start));
extern Void newci_inputbegin PV();
extern Void newci_inputmap PV();
extern Void newci_inputunmap PV();
extern Void newci_inputstring PP((Char *s, int mode, Char *possterm,
				  Char *term, int echoterm, long *pos));
extern Void newci_addrecallstr PP((Char *s));
extern Void interrupt_input PP((int ch));
extern Void newci_streamopen PP((Char *sfile, int report));
extern Void newci_streamclose PV();
extern Void check_respond PV();
extern Void timers_add PP((timers_desc *t));
extern Void timers_addperm PP((timers_desc *t));
extern Void timers_remove PP((timers_desc *t));
extern long timers_sysclock PV();
extern Void timers_refreshclock PV();
extern Void timers_clockon PV();
extern Void timers_clockoff PV();
extern Void timers_setalarm PP((long hour, long min));
extern long newci_fullseconds PV();
extern Void newci_fulltime PP((long *sec, long *csec));
extern long newci_dayofweek PV();



#undef vextern

#endif /*NEWCI_H*/

/* End. */

