ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/syscalls.c
Revision: 1.5
Committed: Fri Jun 9 15:25:49 2023 UTC (10 months, 4 weeks ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, HEAD
Changes since 1.4: +10 -11 lines
Log Message:
fix: updated a few declarations

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id: syscalls.c,v 1.4 2003/08/01 14:14:24 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( /* open a file, report errors */
15 const char *fname,
16 const char *mode
17 )
18 {
19 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( /* open a program metafile */
34 const char *fname,
35 const char *mode
36 )
37 {
38 char *mdir, stemp[MAXFNAME];
39 char *getenv();
40
41 if ((mdir = getenv("MDIR")) == NULL)
42 mdir = MDIR;
43 sprintf(stemp, "%s%s", mdir, fname);
44
45 return(efopen(stemp, mode));
46 }
47
48