ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/ev.c
Revision: 1.3
Committed: Sun Jul 27 22:12:01 2003 UTC (20 years, 8 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 1.2: +2 -1 lines
Log Message:
Added grouping parens to reduce ambiguity warnings.

File Contents

# User Rev Content
1 greg 1.1 #ifndef lint
2 schorsch 1.3 static const char RCSid[] = "$Id: ev.c,v 1.2 2003/06/08 12:03:09 schorsch Exp $";
3 greg 1.1 #endif
4     /*
5     * ev.c - program to evaluate expression arguments
6     *
7     * 1/29/87
8     */
9    
10 schorsch 1.2 #include <stdlib.h>
11 greg 1.1 #include <stdio.h>
12    
13     #include "calcomp.h"
14 schorsch 1.3 #include "rterror.h"
15 greg 1.1
16    
17     main(argc, argv)
18     int argc;
19     char *argv[];
20     {
21     extern int errno;
22     int i;
23    
24     esupport |= E_FUNCTION;
25     esupport &= ~(E_VARIABLE|E_INCHAN|E_OUTCHAN|E_RCONST);
26    
27     #ifdef BIGGERLIB
28     biggerlib();
29     #endif
30    
31     errno = 0;
32     for (i = 1; i < argc; i++)
33     printf("%.9g\n", eval(argv[i]));
34    
35     quit(errno ? 2 : 0);
36     }
37    
38    
39     void
40     eputs(msg)
41     char *msg;
42     {
43     fputs(msg, stderr);
44     }
45    
46    
47     void
48     wputs(msg)
49     char *msg;
50     {
51     eputs(msg);
52     }
53    
54    
55     void
56     quit(code)
57     int code;
58     {
59     exit(code);
60     }