home *** CD-ROM | disk | FTP | other *** search
- /* ==( hdr/bench.h )== */
- /* ----------------------------------------------- */
- /* Pro-C Copyright (C) 1988 - 1990 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written Geo 26-Aug-88 */
- /* Modified Geo 24-Apr-90 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Function declarations for the Pro-C Workbench Library
- * 24-Apr-90 Geo - V2.2 Merge
- */
-
- #ifndef H_BENCH
- # define H_BENCH
-
- /*
- * Compiler dependent includes
- */
- /* Some compilers define ansi way */
- #ifdef __MSDOS__
- # ifndef MSDOS
- # define MSDOS
- # endif
- #endif
-
- # ifdef MSDOS
-
- # define ANSI
- # define CDECL
- # define UNKNOWNCC
-
- # define DIRSLASH '\\'
- # define DIRSLASHES "\\"
-
- # include <stdlib.h>
- # include <dos.h>
- # ifdef __TURBOC__
- # undef UNKNOWNCC
- # include <dir.h>
- # include <io.h>
- # include <mem.h>
- # include <string.h>
- # include <dir.h>
- # include <fcntl.h>
- # include <process.h>
- # include <sys/stat.h>
- # endif
- # ifdef LATTICE
- # undef UNKNOWNCC
- # include <stdarg.h>
- # include <string.h>
- # include <fcntl.h>
- # include <types.h>
- # include <stat.h>
- # endif
- # ifdef __TSC__
- # undef UNKNOWNCC
- # include <string.h>
- # include <fcntl.h>
- # include <sys/stat.h>
- # endif
- # ifdef __WATCOMC__
- # undef UNKNOWNCC
- # include <io.h>
- # include <direct.h>
- # include <string.h>
- # include <fcntl.h>
- # include <process.h>
- # include <sys/stat.h>
- # endif
- # ifdef __ZTC__
- # undef UNKNOWNCC
- # include <io.h>
- # include <string.h>
- # include <stdarg.h>
- # include <process.h>
- # include <sys/stat.h>
- # define P_WAIT 0 /* Needs this for spawn() */
- # endif
- # ifdef UNKNOWNCC
- # undef UNKNOWNCC
- # define MSC /* Pro-C kinda expects this for Microsoft C */
- # ifdef _MSC_VER /* Currently only C6 defines this (600) */
- # undef CDECL
- # define CDECL cdecl
- # else
- /* Schmolie for stat.h case on msc 5.1 (Geo) */
- # undef CDECL
- # endif
- # include <io.h>
- # include <direct.h>
- # include <string.h>
- # include <stdarg.h>
- # include <memory.h>
- # include <fcntl.h>
- # include <process.h>
- # include <sys/types.h>
- # include <sys/stat.h>
- # endif
- # endif
-
- # ifdef UNIX
- # include <unistd.h> /* For SEEK_SET values */
- # include <string.h>
- # include <fcntl.h>
- # include <varargs.h>
- # include <string.h>
- # include <sys/types.h>
- # include <sys/stat.h>
-
- # define DIRSLASH '/'
- # define DIRSLASHES "/"
-
- /* Auxillary prototypes - GEO Mar-89 */
- double atof();
-
- # ifdef S_IFLNK
- # define STAT(fd, ptr) lstat(fd, ptr)
- # else
- # define STAT(fd, ptr) stat(fd, ptr)
- # endif
- # else
- # define STAT(fd, ptr) stat(fd, ptr)
- # endif
-
- # ifdef NCR /* NCR Tower */
- # define SEEK_SET 0
- # define SEEK_CUR 1
- # define SEEK_END 2
- # endif
-
- # include <window.h> /* Always needed */
- # include <ctype.h> /* Owing to strlwr() & strupr() macros, see below */
-
- /*
- * Option select structure
- * - dsp_option(array of optab, &choice)
- */
- struct optab
- {
- int row, col;
- char *text;
- };
-
- /* Date input formats */
- #define YMD 0
- #define MDY 1
- #define DMY 2
-
- /*
- * Macros
- */
-
- # define bytecpy(s1, s2, n) memcpy( (char *)(s1), (char *)(s2), (int)(n))
- # define bytecmp(s1, s2, n) memcmp( (char *)(s1), (char *)(s2), (int)(n))
- # define byteset(s1, c, n) memset( (char *)(s1), (char)(c), (int)(n))
- # define zerorec(s1, n) memset( (char *)(s1), '\0', (int)(n))
-
- #define lswap(class, a, b) { class tmp; tmp = a; a = b; b = tmp; }
-
- # ifdef UNIX
- /* Basic upper and lower routines : Note these don't return pointers */
- # define strupr(s) {char *_p_; for(_p_=s;*_p_;_p_++) if(islower(*_p_)) *_p_=toupper(*_p_);}
- # define strlwr(s) {char *_p_; for(_p_=s;*_p_;_p_++) if(isupper(*_p_)) *_p_=tolower(*_p_);}
- # define min(a,b) ((a)>(b)?(b):(a))
- # define max(a,b) ((a)>(b)?(a):(b))
- # endif
-
- /* Memory checking routines */
- /* # define MDEBUG */
- # ifdef MDEBUG
- # define alloc(z) ck_alloc(__FILE__,__LINE__,z)
- # define strsave(z) ck_strsav(__FILE__,__LINE__,z)
- # define free(z) ck_free(__FILE__,__LINE__,(char *)z)
- # define Chk(z) ck_mem(__FILE__,__LINE__,z)
- # define Minfo(z) ck_info(__FILE__,__LINE__,z)
- # ifdef ANSI
- char *ck_alloc(char *, int, unsigned);
- void ck_free(char *, int, char *);
- void ck_mem(char *, int, char *);
- void ck_info(char *, int, char *);
- char *ck_strsav(char *, int, char *);
- # else
- char *ck_alloc();
- void ck_free();
- void ck_mem();
- void ck_info();
- char *ck_strsav();
- # endif
- # else
- # ifdef ANSI
- char *alloc(unsigned int);
- char *strsave(char *);
- # else
- char *alloc();
- char *strsave();
- # endif
- # define Chk(z) /* Chk(z) */
- # define Minfo(z) /* Minfo(z) */
- # endif
-
- /* macro to give number of options in an option structure */
- #define NOPTS(name) ((sizeof(name) / sizeof(struct optab)) - 1)
-
- #define TRUE 1
- #define FALSE 0
- #define ON 1
- #define OFF 0
-
-
- #define CHAT_ROW 1
- #define MENU_ROW 2
- #define CHAT_ATTR REVVID
- #define MENU_ATTR NORMAL
-
- #define loop for(;;)
- #define macalloc(a) (a *)alloc(sizeof(a))
-
- /* These two are very preliminary */
- typedef struct genstructure {
- char *a;
- double *b;
- double c;
- struct genstructure *s;
- } genstr;
-
- struct genlst {
- struct genlst *nxt_lst;
- struct genlst *prv_lst;
- genstr *info;
- int deleted; /* TRUE if it has been deleted */
- int tagged; /* TRUE if it has been tagged */
- };
-
- /* menu struct for slide rule type menu provided by dsp_menu */
- struct smnu_tab
- {
- struct optab option;
- struct smnu_tab * sub;
- # ifdef UNIX
- void (* func) ();
- # else
- void (* func) (void);
- # endif
- int hnum;
- };
-
- # ifdef ANSI
- char *basename(char *);
- char *cvt_lower(char *);
- char *cvt_str(char *, int);
- char *cvt_upper(char *);
- char *envfind(char *);
- char *fcopy(char *, char *, int);
- char *fmt_date(char *, char *);
- char *fmt_dbl(double, char *);
- char *fmt_flt(double, char *);
- char *fmt_int(int, char *);
- char *fmt_lng(long, char *);
- char *fmt_mny(long, char *);
- char *forceupper(char *);
- char *fstrcpy(char *, char *, int);
- char *get_date(char *, int);
- char *get_dir(char *, int);
- char *ltocon(unsigned long, char *, int);
- char *repchr(char, int);
- char *strleft(char *, char *, int);
- char *strmid(char *, char *, int, int);
- int antoi(char *, int);
- int CDECL do_cmd(char *, ...);
- int do_options(struct optab *, int, int);
- int CDECL errmsg(char *, ...);
- int fstrlen(char *, int);
- int is_date(char *);
- int itona(char *, int, int);
- int legal_fname(char *);
- int lok_rec(int, int, int);
- int openf(char *, int, int, int *);
- int open_help(char *);
- int prt_init(void);
- int CDECL prt_string(char *, ...);
- int CDECL query(int, char *, ...);
- int readlock(int *, char *);
- int rioerr_handle(int);
- int selectkey(char **, int, char *, int, int *);
- int sioerr_handle(int);
- int trylock(int *, char *);
- int uioerr_handle(int);
- int CDECL warning(int, char *, ...);
- unsigned long contol(char *);
- unsigned long dstrtol(char *, char *);
- unsigned long today(void);
- void abs_get_rec(int, long, int, char *);
- void abs_put_rec(int, long, int, char *);
- void CDECL abort_mess(char *, ...);
- void align_report(int, int);
- void bin_to_text(int [], unsigned char *);
- void CDECL chain(char *, ...);
- void chainv(char **);
- void closef(int);
- void closefall(void);
- void close_help(void);
- void decrypt(char *, char *);
- void do_bell(void);
- void dsp_opt(struct optab *, int *);
- void encrypt(char *, char *);
- void fill_rec(char *, int);
- void f_to_a(char *, double, int);
- void get_rec(int, int, char *);
- void help_msg(int);
- void i_to_a(char *, int, int);
- void keywait(int);
- void locked_file(char *, int);
- void l_to_a(char *, long, int);
- void movetext(char *, char *, int);
- void no_access(char *);
- void prt_field(char *, int);
- void prt_ln(int);
- void prt_page(void);
- void prt_shut(void);
- void prt_space(int);
- void prt_tab(int);
- void put_rec(int, int, char *);
- void range_char(int, int, char *, char *, char *, int *);
- void range_date(int, int, long *, long *, char *, int *);
- void range_dbl(int, int, double *, double *, char *, int *);
- void range_flt(int, int, float *, float *, char *, int *);
- void range_int(int, int, int *, int *, char *, int *);
- void range_lng(int, int, long *, long *, char *, int *);
- void range_sdate(int, int, char *, char *, char *, int *);
- void search_path(char *, char *, char *);
- void spooler(char *);
- void CDECL statmsg(char *, ...);
- void stripext(char *);
- void text_to_bin(unsigned char *, int *);
- void todaystr(char *);
- # else
- char *basename();
- char *cvt_lower();
- char *cvt_str();
- char *cvt_upper();
- char *envfind();
- char *fcopy();
- char *fmt_date();
- char *fmt_dbl();
- char *fmt_flt();
- char *fmt_int();
- char *fmt_lng();
- char *fmt_mny();
- char *forceupper();
- char *fstrcpy();
- char *get_date();
- char *get_dir();
- char *ltocon();
- char *repchr();
- char *strleft();
- char *strmid();
- int antoi();
- int do_cmd();
- int do_options();
- int errmsg();
- int fstrlen();
- int is_date();
- int itona();
- int legal_fname();
- int lok_rec();
- int openf();
- int open_help();
- int prt_init();
- int prt_string();
- int query();
- int readlock();
- int rioerr_handle();
- int selectkey();
- int sioerr_handle();
- int trylock();
- int uioerr_handle();
- int warning();
- unsigned long contol();
- unsigned long dstrtol();
- unsigned long today();
- void abs_get_rec();
- void abs_put_rec();
- void abort_mess();
- void align_report();
- void bin_to_text();
- void chain();
- void chainv();
- void closef();
- void closefall();
- void close_help();
- void decrypt();
- void do_bell();
- void dsp_opt();
- void encrypt();
- void fill_rec();
- void f_to_a();
- void get_rec();
- void help_msg();
- void i_to_a();
- void keywait();
- void locked_file();
- void l_to_a();
- void movetext();
- void no_access();
- void prt_field();
- void prt_ln();
- void prt_page();
- void prt_shut();
- void prt_space();
- void prt_tab();
- void put_rec();
- void range_char();
- void range_date();
- void range_dbl();
- void range_flt();
- void range_int();
- void range_lng();
- void range_sdate();
- void search_path();
- void spooler();
- void statmsg();
- void stripext();
- void text_to_bin();
- void todaystr();
-
- /* UNIX should define these */
- char *calloc();
- char *getenv();
- void free();
- # endif
-
- # endif
-
-