ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/syscalls.c
Revision: 1.4
Committed: Fri Aug 1 14:14:24 2003 UTC (20 years, 8 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3
Changes since 1.3: +1 -23 lines
Log Message:
Eliminated CPM, MAC, and UNIX conditional compiles.

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id: syscalls.c,v 1.3 2003/07/14 20:02:29 schorsch Exp $";
3 #endif
4 /*
5 * System calls for meta-file routines
6 */
7
8 #include "rtprocess.h" /* getpid() */
9 #include "rterror.h"
10 #include "meta.h"
11
12
13 FILE *
14 efopen(fname, mode) /* open a file, report errors */
15
16 char *fname, *mode;
17
18 {
19 register FILE *fp;
20 FILE *fopen();
21
22 if ((fp = fopen(fname, mode)) == NULL) {
23 sprintf(errmsg, "cannot open file \"%s\", mode \"%s\"", fname, mode);
24 error(USER, errmsg);
25 }
26
27 return(fp);
28 }
29
30
31
32 FILE *
33 mfopen(fname, mode) /* open a program metafile */
34
35 char *fname;
36 char *mode;
37
38 {
39 char *mdir, stemp[MAXFNAME];
40 char *getenv();
41
42 if ((mdir = getenv("MDIR")) == NULL)
43 mdir = MDIR;
44 sprintf(stemp, "%s%s", mdir, fname);
45
46 return(efopen(stemp, mode));
47 }
48
49