1 |
/* RCSid $Id$ */ |
2 |
/* |
3 |
* Radiance i/o and string routines |
4 |
*/ |
5 |
|
6 |
#ifndef _RAD_RTIO_H_ |
7 |
#define _RAD_RTIO_H_ |
8 |
#ifdef __cplusplus |
9 |
extern "C" { |
10 |
#endif |
11 |
|
12 |
#include <stdio.h> |
13 |
#include <sys/types.h> |
14 |
#include <fcntl.h> |
15 |
#include <string.h> |
16 |
|
17 |
/* XXX include paths.h instead */ |
18 |
#ifndef F_OK /* mode bits for access(2) call */ |
19 |
#define R_OK 4 /* readable */ |
20 |
#define W_OK 2 /* writable */ |
21 |
#define X_OK 1 /* executable */ |
22 |
#define F_OK 0 /* exists */ |
23 |
#endif |
24 |
/* string.h equivalents */ |
25 |
#ifndef BSD |
26 |
#define index strchr |
27 |
#define rindex strrchr |
28 |
#endif |
29 |
/* <unistd.h> is missing on some systems */ |
30 |
extern off_t lseek(int, off_t, int); |
31 |
|
32 |
/* defined in badarg.c */ |
33 |
extern int badarg(int ac, char **av, char *fl); |
34 |
/* defined in expandarg.c */ |
35 |
extern int expandarg(int *acp, char ***avp, int n); |
36 |
/* defined in fdate.c */ |
37 |
extern time_t fdate(char *fname); |
38 |
extern int setfdate(char *fname, long ftim); |
39 |
/* defined in fgetline.c */ |
40 |
extern char *fgetline(char *s, int n, FILE *fp); |
41 |
/* defined in fgetval.c */ |
42 |
extern int fgetval(FILE *fp, int ty, char *vp); |
43 |
/* defined in fgetword.c */ |
44 |
extern char *fgetword(char *s, int n, FILE *fp); |
45 |
/* defined in fputword.c */ |
46 |
extern void fputword(char *s, FILE *fp); |
47 |
/* defined in fixargv0.c */ |
48 |
/*extern char *fixargv0(char *av0);*/ /* XXX include paths.h instead */ |
49 |
/* defined in fropen.c */ |
50 |
extern FILE *frlibopen(char *fname); |
51 |
/* defined in getlibpath.c */ |
52 |
extern char *getrlibpath(void); |
53 |
/* defined in getpath.c */ |
54 |
extern char *getpath(char *fname, char *searchpath, int mode); |
55 |
/* defined in portio.c */ |
56 |
extern void putstr(char *s, FILE *fp); |
57 |
extern void putint(long i, int siz, FILE *fp); |
58 |
extern void putflt(double f, FILE *fp); |
59 |
extern char *getstr(char *s, FILE *fp); |
60 |
extern long getint(int siz, FILE *fp); |
61 |
extern double getflt(FILE *fp); |
62 |
/* defined in rexpr.c */ |
63 |
extern int ecompile(char *sp, int iflg, int wflag); |
64 |
extern char *expsave(void); |
65 |
extern void expset(char *ep); |
66 |
extern char *eindex(char *sp); |
67 |
/* defined in savestr.c */ |
68 |
extern char *savestr(char *str); |
69 |
extern void freestr(char *s); |
70 |
extern int shash(char *s); |
71 |
/* defined in savqstr.c */ |
72 |
extern char *savqstr(char *s); |
73 |
extern void freeqstr(char *s); |
74 |
/* defined in wordfile.c */ |
75 |
extern int wordfile(char **words, char *fname); |
76 |
extern int wordstring(char **avl, char *str); |
77 |
/* defined in words.c */ |
78 |
extern char *atos(char *rs, int nb, char *s); |
79 |
extern char *nextword(char *cp, int nb, char *s); |
80 |
extern char *sskip(char *s); |
81 |
extern char *sskip2(char *s, int n); |
82 |
extern char *iskip(char *s); |
83 |
extern char *fskip(char *s); |
84 |
extern int isint(char *s); |
85 |
extern int isintd(char *s, char *ds); |
86 |
extern int isflt(char *s); |
87 |
extern int isfltd(char *s, char *ds); |
88 |
/* defined in lamp.c */ |
89 |
extern float * matchlamp(char *s); |
90 |
extern int loadlamps(char *file); |
91 |
extern void freelamps(void); |
92 |
|
93 |
#ifdef __cplusplus |
94 |
} |
95 |
#endif |
96 |
#endif /* _RAD_RTIO_H_ */ |
97 |
|