| 5 |
|
* System calls for meta-file routines |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
< |
#ifdef _WIN32 |
| 9 |
< |
#include <process.h> /* getpid() */ |
| 10 |
< |
#endif |
| 11 |
< |
|
| 8 |
> |
#include "rtprocess.h" /* getpid() */ |
| 9 |
> |
#include "rterror.h" |
| 10 |
|
#include "meta.h" |
| 11 |
|
|
| 12 |
|
|
| 15 |
– |
|
| 16 |
– |
|
| 17 |
– |
|
| 13 |
|
FILE * |
| 14 |
< |
efopen(fname, mode) /* open a file, report errors */ |
| 15 |
< |
|
| 16 |
< |
char *fname, *mode; |
| 17 |
< |
|
| 14 |
> |
efopen( /* open a file, report errors */ |
| 15 |
> |
const char *fname, |
| 16 |
> |
const char *mode |
| 17 |
> |
) |
| 18 |
|
{ |
| 19 |
< |
register FILE *fp; |
| 19 |
> |
FILE *fp; |
| 20 |
|
FILE *fopen(); |
| 21 |
|
|
| 22 |
|
if ((fp = fopen(fname, mode)) == NULL) { |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
FILE * |
| 33 |
< |
mfopen(fname, mode) /* open a program metafile */ |
| 34 |
< |
|
| 35 |
< |
char *fname; |
| 36 |
< |
char *mode; |
| 42 |
< |
|
| 33 |
> |
mfopen( /* open a program metafile */ |
| 34 |
> |
const char *fname, |
| 35 |
> |
const char *mode |
| 36 |
> |
) |
| 37 |
|
{ |
| 38 |
|
char *mdir, stemp[MAXFNAME]; |
| 45 |
– |
#if UNIX || MAC || _WIN32 |
| 39 |
|
char *getenv(); |
| 40 |
|
|
| 41 |
|
if ((mdir = getenv("MDIR")) == NULL) |
| 49 |
– |
#endif |
| 42 |
|
mdir = MDIR; |
| 43 |
|
sprintf(stemp, "%s%s", mdir, fname); |
| 44 |
|
|
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
|
| 57 |
– |
|
| 58 |
– |
#ifdef CPM |
| 59 |
– |
getpid() /* for CP/M, get user number */ |
| 60 |
– |
|
| 61 |
– |
{ |
| 62 |
– |
|
| 63 |
– |
return(getusr()); |
| 64 |
– |
} |
| 65 |
– |
#endif |
| 66 |
– |
|
| 67 |
– |
|
| 68 |
– |
|
| 69 |
– |
#ifdef MAC |
| 70 |
– |
getpid() /* dummy value for MacIntosh */ |
| 71 |
– |
|
| 72 |
– |
{ |
| 73 |
– |
|
| 74 |
– |
return(0); |
| 75 |
– |
} |
| 76 |
– |
#endif |