| Revision: | 1.1 |
| Committed: | Sat Feb 22 02:07:20 2003 UTC (22 years, 8 months ago) by greg |
| Content type: | text/plain |
| Branch: | MAIN |
| CVS Tags: | rad3R5 |
| Log Message: | Changes and check-in for 3.5 release Includes new source files and modifications not recorded for many years See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | greg | 1.1 | #ifndef lint |
| 2 | static const char RCSid[] = "$Id$"; | ||
| 3 | #endif | ||
| 4 | /* | ||
| 5 | * ev.c - program to evaluate expression arguments | ||
| 6 | * | ||
| 7 | * 1/29/87 | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <stdio.h> | ||
| 11 | |||
| 12 | #include "calcomp.h" | ||
| 13 | |||
| 14 | |||
| 15 | main(argc, argv) | ||
| 16 | int argc; | ||
| 17 | char *argv[]; | ||
| 18 | { | ||
| 19 | extern int errno; | ||
| 20 | int i; | ||
| 21 | |||
| 22 | esupport |= E_FUNCTION; | ||
| 23 | esupport &= ~(E_VARIABLE|E_INCHAN|E_OUTCHAN|E_RCONST); | ||
| 24 | |||
| 25 | #ifdef BIGGERLIB | ||
| 26 | biggerlib(); | ||
| 27 | #endif | ||
| 28 | |||
| 29 | errno = 0; | ||
| 30 | for (i = 1; i < argc; i++) | ||
| 31 | printf("%.9g\n", eval(argv[i])); | ||
| 32 | |||
| 33 | quit(errno ? 2 : 0); | ||
| 34 | } | ||
| 35 | |||
| 36 | |||
| 37 | void | ||
| 38 | eputs(msg) | ||
| 39 | char *msg; | ||
| 40 | { | ||
| 41 | fputs(msg, stderr); | ||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | void | ||
| 46 | wputs(msg) | ||
| 47 | char *msg; | ||
| 48 | { | ||
| 49 | eputs(msg); | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | void | ||
| 54 | quit(code) | ||
| 55 | int code; | ||
| 56 | { | ||
| 57 | exit(code); | ||
| 58 | } |