4 |
|
/* |
5 |
|
* Find and open a Radiance library file. |
6 |
|
* |
7 |
< |
* External symbols declared in standard.h |
7 |
> |
* External symbols declared in rtio.h |
8 |
|
*/ |
9 |
|
|
10 |
|
#include "copyright.h" |
11 |
|
|
12 |
|
#include <stdio.h> |
13 |
|
|
14 |
+ |
#include "rtio.h" |
15 |
|
#include "paths.h" |
16 |
|
|
17 |
|
|
18 |
|
FILE * |
19 |
< |
frlibopen(fname) /* find file and open for reading */ |
20 |
< |
register char *fname; |
19 |
> |
frlibopen( /* find file and open for reading */ |
20 |
> |
char *fname |
21 |
> |
) |
22 |
|
{ |
21 |
– |
extern char *strcpy(), *getlibpath(); |
23 |
|
FILE *fp; |
24 |
< |
char pname[MAXPATH]; |
25 |
< |
register char *sp, *cp; |
24 |
> |
char pname[PATH_MAX]; |
25 |
> |
char *sp, *cp; |
26 |
|
|
27 |
|
if (fname == NULL) |
28 |
|
return(NULL); |
29 |
|
|
30 |
< |
if (ISDIRSEP(fname[0]) || fname[0] == '.') /* absolute path */ |
30 |
> |
if (ISABS(fname) || fname[0] == '.') /* absolute path */ |
31 |
|
return(fopen(fname, "r")); |
32 |
|
/* check search path */ |
33 |
< |
sp = getlibpath(); |
33 |
> |
sp = getrlibpath(); |
34 |
|
do { |
35 |
|
cp = pname; |
36 |
|
while (*sp && (*cp = *sp++) != PATHSEP) |