Release calc version 2.11.5t1.0

This commit is contained in:
Landon Curt Noll
2001-03-17 19:35:52 -08:00
parent fc85ac3791
commit 63d9b22067
28 changed files with 1179 additions and 699 deletions

229
calc.h
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.5 $
* @(#) $Id: calc.h,v 29.5 2000/12/04 19:32:33 chongo Exp $
* @(#) $Revision: 29.6 $
* @(#) $Id: calc.h,v 29.6 2001/03/17 21:31:47 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $
*
* Under source code control: 1990/02/15 01:48:31
@@ -32,9 +32,8 @@
#define __CALC_H__
#include <setjmp.h>
#include "win32dll.h"
#include "value.h"
#include "have_const.h"
@@ -94,134 +93,140 @@
/*
* File I/O routines.
*/
extern FILEID openid(char *name, char *mode);
extern FILEID indexid(long index);
extern BOOL validid(FILEID id);
extern BOOL errorid(FILEID id);
extern BOOL eofid(FILEID id);
extern int closeid(FILEID id);
extern int getcharid(FILEID id);
extern int idprintf(FILEID id, char *fmt, int count, VALUE **vals);
extern int idfputc(FILEID id, int ch);
extern int idfputs(FILEID id, char *str);
extern int printid(FILEID id, int flags);
extern int flushid(FILEID id);
extern int readid(FILEID id, int flags, char **retptr);
extern int getloc(FILEID id, ZVALUE *loc);
extern int setloc(FILEID id, ZVALUE zpos);
extern int getsize(FILEID id, ZVALUE *size);
extern int get_device(FILEID id, ZVALUE *dev);
extern int get_inode(FILEID id, ZVALUE *ino);
extern FILEID reopenid(FILEID id, char *mode, char *name);
extern int closeall(void);
extern int flushall(void);
extern int idfputstr(FILEID id, char *str);
extern int rewindid(FILEID id);
extern void rewindall(void);
extern ZVALUE zfilesize(FILEID id);
extern void showfiles(void);
extern int fscanfid(FILEID id, char *fmt, int count, VALUE **vals);
extern int scanfstr(char *str, char *fmt, int count, VALUE **vals);
extern int ftellid(FILEID id, ZVALUE *res);
extern int fseekid(FILEID id, ZVALUE offset, int whence);
extern int isattyid(FILEID id);
extern int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res);
extern int frsearch(FILEID id, char *str, ZVALUE first, ZVALUE last, ZVALUE *res);
extern void showconstants(void);
extern void freeconstant(unsigned long);
extern void freestringconstant(long);
extern void trimconstants(void);
extern DLL FILEID openid(char *name, char *mode);
extern DLL FILEID indexid(long index);
extern DLL BOOL validid(FILEID id);
extern DLL BOOL errorid(FILEID id);
extern DLL BOOL eofid(FILEID id);
extern DLL int closeid(FILEID id);
extern DLL int getcharid(FILEID id);
extern DLL int idprintf(FILEID id, char *fmt, int count, VALUE **vals);
extern DLL int idfputc(FILEID id, int ch);
extern DLL int idfputs(FILEID id, char *str);
extern DLL int printid(FILEID id, int flags);
extern DLL int flushid(FILEID id);
extern DLL int readid(FILEID id, int flags, char **retptr);
extern DLL int getloc(FILEID id, ZVALUE *loc);
extern DLL int setloc(FILEID id, ZVALUE zpos);
extern DLL int getsize(FILEID id, ZVALUE *size);
extern DLL int get_device(FILEID id, ZVALUE *dev);
extern DLL int get_inode(FILEID id, ZVALUE *ino);
extern DLL FILEID reopenid(FILEID id, char *mode, char *name);
extern DLL int closeall(void);
#if !defined(_WIN32)
extern DLL int flushall(void);
#endif
extern DLL int idfputstr(FILEID id, char *str);
extern DLL int rewindid(FILEID id);
extern DLL void rewindall(void);
extern DLL ZVALUE zfilesize(FILEID id);
extern DLL void showfiles(void);
extern DLL int fscanfid(FILEID id, char *fmt, int count, VALUE **vals);
extern DLL int scanfstr(char *str, char *fmt, int count, VALUE **vals);
extern DLL int ftellid(FILEID id, ZVALUE *res);
extern DLL int fseekid(FILEID id, ZVALUE offset, int whence);
extern DLL int isattyid(FILEID id);
extern DLL int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res);
extern DLL int frsearch(FILEID id, char *str, ZVALUE first, ZVALUE last, ZVALUE *res);
extern DLL void showconstants(void);
extern DLL void freeconstant(unsigned long);
extern DLL void freestringconstant(long);
extern DLL void trimconstants(void);
/*
* Input routines.
*/
extern int openstring(char *str, long num);
extern int openterminal(void);
extern int opensearchfile(char *name, char *pathlist, char *exten, int reopen_ok);
extern char *nextline(void);
extern int nextchar(void);
extern void reread(void);
extern void resetinput(void);
extern void setprompt(char *);
extern BOOL inputisterminal(void);
extern int inputlevel(void);
extern long calclevel(void);
extern char *inputname(void);
extern long linenumber(void);
extern void runrcfiles(void);
extern void closeinput(void);
extern DLL int openstring(char *str, long num);
extern DLL int openterminal(void);
extern DLL int opensearchfile(char *name, char *pathlist, char *exten, int reopen_ok);
extern DLL char *nextline(void);
extern DLL int nextchar(void);
extern DLL void reread(void);
extern DLL void resetinput(void);
extern DLL void setprompt(char *);
extern DLL BOOL inputisterminal(void);
extern DLL int inputlevel(void);
extern DLL long calclevel(void);
extern DLL char *inputname(void);
extern DLL long linenumber(void);
extern DLL void runrcfiles(void);
extern DLL void closeinput(void);
/*
* Other routines.
*/
extern NUMBER *constvalue(unsigned long index);
extern long addnumber(char *str);
extern long addqconstant(NUMBER *q);
extern void initstack(void);
extern void getcommands(BOOL toplevel);
extern void givehelp(char *type);
extern void libcalc_call_me_first(void);
extern void libcalc_call_me_last(void);
extern BOOL calc_tty(int fd);
extern BOOL orig_tty(int fd);
extern void showerrors(void);
extern char *calc_strdup(CONST char *);
extern DLL NUMBER *constvalue(unsigned long index);
extern DLL long addnumber(char *str);
extern DLL long addqconstant(NUMBER *q);
extern DLL void initstack(void);
extern DLL void getcommands(BOOL toplevel);
extern DLL void givehelp(char *type);
extern DLL void libcalc_call_me_first(void);
extern DLL void libcalc_call_me_last(void);
extern DLL BOOL calc_tty(int fd);
extern DLL BOOL orig_tty(int fd);
extern DLL void showerrors(void);
extern DLL char *calc_strdup(CONST char *);
/*
* Initialization
*/
extern void initialize(void);
extern void reinitialize(void);
extern int isatty(int tty); /* TRUE if fd is a tty */
extern char *version(void); /* return version string */
extern int post_init; /* TRUE => setjmp for math_error is ready */
extern DLL void initialize(void);
extern DLL void reinitialize(void);
#if !defined (_WIN32)
extern DLL int isatty(int tty); /* TRUE if fd is a tty */
#endif
extern DLL char *version(void); /* return version string */
extern DLL int post_init; /* TRUE => math_error setjmp is ready */
/*
* global flags and definitions
*/
extern int abortlevel; /* current level of aborts */
extern BOOL inputwait; /* TRUE if in a terminal input wait */
extern jmp_buf jmpbuf; /* for errors */
extern DLL int abortlevel; /* current level of aborts */
extern DLL BOOL inputwait; /* TRUE if in a terminal input wait */
extern DLL jmp_buf jmpbuf; /* for errors */
extern int p_flag; /* TRUE => pipe mode */
extern int q_flag; /* TRUE => don't execute rc files */
extern int u_flag; /* TRUE => unbuffer stdin and stdout */
extern int d_flag; /* TRUE => disable heading, resource_debug */
extern int c_flag; /* TRUE => continue after error if permitted */
extern int i_flag; /* TRUE => try to go interactive after error */
extern int s_flag; /* TRUE => keep args as strings for argv() */
extern int stoponerror; /* >0 => stop, <0 => continue, ==0 => use -c */
extern BOOL abort_now; /* TRUE => try to go interactive */
extern DLL int p_flag; /* TRUE => pipe mode */
extern DLL int q_flag; /* TRUE => don't execute rc files */
extern DLL int u_flag; /* TRUE => unbuffer stdin and stdout */
extern DLL int d_flag; /* TRUE => disable heading, resource_debug */
extern DLL int c_flag; /* TRUE => continue after error if permitted */
extern DLL int i_flag; /* TRUE => try to go interactive after error */
extern DLL int s_flag; /* TRUE => keep args as strings for argv() */
extern DLL int stoponerror; /* >0 => stop, <0 => continue, ==0 => use -c */
extern DLL BOOL abort_now; /* TRUE => try to go interactive */
extern int argc_value; /* count of argv[] strings for argv() builtin */
extern char **argv_value; /* argv[] strings for argv() builtin */
extern DLL int argc_value; /* count of argv[] strings for argv() builtin */
extern DLL char **argv_value; /* argv[] strings for argv() builtin */
extern char *pager; /* $PAGER or default */
extern int stdin_tty; /* TRUE if stdin is a tty */
extern int havecommands; /* TRUE if have cmd args) */
extern char *program; /* our name */
extern char *base_name; /* basename of our name */
extern char cmdbuf[]; /* command line expression */
extern DLL char *pager; /* $PAGER or default */
extern DLL int stdin_tty; /* TRUE if stdin is a tty */
extern DLL int havecommands; /* TRUE if have cmd args) */
extern DLL char *program; /* our name */
extern DLL char *base_name; /* basename of our name */
extern DLL char cmdbuf[]; /* command line expression */
extern int abortlevel; /* current level of aborts */
extern BOOL inputwait; /* TRUE if in a terminal input wait */
extern VALUE *stack; /* execution stack */
extern int dumpnames; /* TRUE => dump names rather than indices */
extern DLL int abortlevel; /* current level of aborts */
extern DLL BOOL inputwait; /* TRUE if in a terminal input wait */
extern DLL VALUE *stack; /* execution stack */
extern DLL int dumpnames; /* TRUE => dump names rather than indices */
extern char *calcpath; /* $CALCPATH or default */
extern char *calcrc; /* $CALCRC or default */
extern char *calcbindings; /* $CALCBINDINGS or default */
extern char *home; /* $HOME or default */
extern char *shell; /* $SHELL or default */
extern char *program; /* our name (argv[0]) */
extern DLL char *calcpath; /* $CALCPATH or default */
extern DLL char *calcrc; /* $CALCRC or default */
extern DLL char *calcbindings; /* $CALCBINDINGS or default */
extern DLL char *home; /* $HOME or default */
extern DLL char *shell; /* $SHELL or default */
extern DLL char *program; /* our name (argv[0]) */
extern int no_env; /* TRUE (-e) => ignore env vars on startup */
extern int errmax; /* if >= 0, error when errcount exceeds errmax */
extern int new_std; /* TRUE (-n) => use newstd configuration */
extern DLL int no_env; /* TRUE (-e) => ignore env vars on startup */
extern DLL int errmax; /* if >= 0, error when errcount exceeds errmax */
extern DLL int new_std; /* TRUE (-n) => use newstd configuration */
extern int allow_read; /* FALSE => may not open any files for reading */
extern int allow_write; /* FALSE => may not open any files for writing */
extern int allow_exec; /* FALSE => may not execute any commands */
extern DLL int allow_read; /* FALSE => dont open any files for reading */
extern DLL int allow_write; /* FALSE => dont open any files for writing */
extern DLL int allow_exec; /* FALSE => may not execute any commands */
/*
* calc startup and run state
@@ -237,8 +242,8 @@ typedef enum {
RUN_EXIT, /* normal exit from calc */
RUN_EXIT_WITH_ERROR /* exit with error */
} run;
extern run run_state;
extern char *run_state_name(run state);
extern DLL run run_state;
extern DLL char *run_state_name(run state);
/*
* calc version information
@@ -249,7 +254,7 @@ extern int calc_minor_ver;
extern int calc_major_patch;
extern char *calc_minor_patch;
extern char *Copyright;
extern char *version(void);
extern DLL char *version(void);
#endif /* !__CALC_H__ */