From 50db84abd37e97f7cbbfbed00f9ab3f3240ee0e3 Mon Sep 17 00:00:00 2001 From: Matthew Hunt Date: Sun, 26 Apr 1998 03:25:11 +0000 Subject: Import of Eval v113, a command-line based floating-point calculator. PR: 4979 Submitted by: Slaven Rezic --- math/eval/Makefile | 31 +++++++++ math/eval/distinfo | 1 + math/eval/files/patch-aa | 27 ++++++++ math/eval/files/patch-ab | 33 ++++++++++ math/eval/files/patch-ac | 166 +++++++++++++++++++++++++++++++++++++++++++++++ math/eval/files/patch-ad | 28 ++++++++ math/eval/pkg-comment | 1 + math/eval/pkg-descr | 8 +++ math/eval/pkg-plist | 1 + 9 files changed, 296 insertions(+) create mode 100644 math/eval/Makefile create mode 100644 math/eval/distinfo create mode 100644 math/eval/files/patch-aa create mode 100644 math/eval/files/patch-ab create mode 100644 math/eval/files/patch-ac create mode 100644 math/eval/files/patch-ad create mode 100644 math/eval/pkg-comment create mode 100644 math/eval/pkg-descr create mode 100644 math/eval/pkg-plist (limited to 'math/eval') diff --git a/math/eval/Makefile b/math/eval/Makefile new file mode 100644 index 000000000000..9837567373fb --- /dev/null +++ b/math/eval/Makefile @@ -0,0 +1,31 @@ +# New ports collection makefile for: eval +# Version required: 113 +# Date created: 24 Sep 1997 +# Whom: eserte +# +# $Id$ +# + +DISTNAME= Eval113 +PKGNAME= eval-113 +CATEGORIES= math +MASTER_SITES= ftp://ftp.doc.ic.ac.uk/Mirrors/wuarchive.wustl.edu/pub/aminet/util/cli/ \ + ftp://ftp.uni-paderborn.de/ftp/aminet/pub/util/cli/ \ + ftp://ftp.demon.net/pub/mirrors/aminet/util/cli/ +EXTRACT_SUFX= .lha + +MAINTAINER= eserte@cs.tu-berlin.de + +BUILD_DEPENDS= lha:${PORTSDIR}/archivers/lha + +EXTRACT_CMD= lha + +WRKSRC= ${WRKDIR}/Eval/source + +post-extract: + -ln -s Makefile.unx ${WRKSRC}/Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/Eval ${PREFIX}/bin + +.include diff --git a/math/eval/distinfo b/math/eval/distinfo new file mode 100644 index 000000000000..3e0c574d8ce8 --- /dev/null +++ b/math/eval/distinfo @@ -0,0 +1 @@ +MD5 (Eval113.lha) = 271123630e3efaf8298b4600a6b01f9d diff --git a/math/eval/files/patch-aa b/math/eval/files/patch-aa new file mode 100644 index 000000000000..465076c00b62 --- /dev/null +++ b/math/eval/files/patch-aa @@ -0,0 +1,27 @@ +--- /tmp/Eval/source/Makefile.unx Tue Apr 13 21:04:14 1993 ++++ Makefile Sat Nov 8 11:50:35 1997 +@@ -11,13 +11,14 @@ + # in order to get the string space high enough. I haven't had any + # trouble with any of the other source modules. + # +-CCFLAGS=-c ++CCFLAGS=-c -fwritable-strings $(CFLAGS) + # + # On some systems, you can use LIBC=-lc_s to make the program smaller by + # linking to a shared library. + # + LIBC=-lc + LIBM=-lm ++LIBREADLINE=-lreadline -ltermcap + EXE= + OBJ=.o + HEADER=eval.h +@@ -30,7 +31,7 @@ + $(OBJFILES): $(HEADER) + + Eval$(EXE): $(OBJFILES) +- $(CC) -o Eval $(OBJFILES) $(LIBM) $(LIBC) ++ $(CC) -o Eval $(OBJFILES) $(LIBM) $(LIBC) $(LIBREADLINE) + chmod 755 Eval + + eval: Eval$(EXE) diff --git a/math/eval/files/patch-ab b/math/eval/files/patch-ab new file mode 100644 index 000000000000..84b35dd51993 --- /dev/null +++ b/math/eval/files/patch-ab @@ -0,0 +1,33 @@ +--- /tmp/Eval/source/eval.h Tue Apr 13 21:04:44 1993 ++++ eval.h Wed Mar 16 04:26:57 1994 +@@ -55,6 +55,8 @@ + #define MAXINPUT 160 + #define NUMFUNCS 30 + #define MAXFLEN 6 ++#define MAXALEN 3 ++#define MAXDLEN 80 + #define SCRWIDTH 80 + #define MAXARGS 10 + #define EOS '\0' +@@ -115,6 +117,12 @@ + char type; + int code; + } TOKEN, *TOKENPTR; ++typedef struct { ++ int id; ++ char name[MAXFLEN+1]; ++ char argspec[MAXALEN+1]; ++ char desc[MAXDLEN+1]; ++ } FUNC, *FUNCPTR; + + /* Function definitions */ + +@@ -131,6 +139,8 @@ + char *func_name (int); + int func_nargs (int); + int print_funclist (FILE *s,char *input,int d); ++ ++extern FUNC flist[]; + + /* ----- PARSE.C functions -------------------------------------------- */ + diff --git a/math/eval/files/patch-ac b/math/eval/files/patch-ac new file mode 100644 index 000000000000..50dd1635f5b0 --- /dev/null +++ b/math/eval/files/patch-ac @@ -0,0 +1,166 @@ +--- /tmp/Eval/source/eval.c Tue Apr 13 21:04:42 1993 ++++ eval.c Wed Sep 24 12:25:27 1997 +@@ -44,6 +44,9 @@ + */ + + #include "eval.h" ++#include ++#include ++#include + + static char tempname[80]; + static char wdir[100]; +@@ -122,6 +125,7 @@ + static BOOLEAN process_line(FILE *stream,int showinp,int showout,VARPTR vlist, + VARPTR clist,char *pinput); + static void init_varlist(VARPTR vlist); ++static void init_sig(void); + static void var_copy(VARPTR dest,VARPTR source); + static int print_help(FILE *stream,int extended,int page,char *s); + static int more(char *text,char *input,int pause); +@@ -143,6 +147,8 @@ + + + init_varlist(vlist); ++ initialize_readline(); ++ init_sig(); + wdir[0]=EOS; + rpath[0]=EOS; + setobase(10); +@@ -462,6 +468,7 @@ + if (input[m0]!='?') + { + evaluate(&input[m0],showout,vlist,clist); ++ init_sig(); + break; + } + if (!strcmp(&input[m0],"?")) +@@ -565,6 +572,24 @@ + vlist[i].name[0]=EOS; + } + ++static void ignore_fpe(void) ++{ ++ printf("Floating point exception... ignore result!\n"); ++ signal(SIGFPE, SIG_IGN); ++} ++ ++/* ++** init_sig() ++** ++** initialize signal handler for floating point exceptions ++** ++*/ ++ ++static void init_sig(void) ++{ ++ signal(SIGFPE, ignore_fpe); ++} ++ + /* + ** var_copy(VARPTR dest,VARPTR source) + ** +@@ -839,24 +864,89 @@ + s[j+1]=EOS; + } + ++char * ++complete_consts (char *text, int state) ++{ ++ static int i = 0, j = 0; ++ ++ if (state == 0) { ++ i = 0; ++ j = 0; ++ } ++ ++ while (i