| 1 |
/* RCSid $Id: rtio.h,v 3.1 2003/06/27 06:53:21 greg Exp $ */ |
| 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 |
|
| 25 |
/* <unistd.h> is missing on some systems */ |
| 26 |
extern off_t lseek(int, off_t, int); |
| 27 |
|
| 28 |
/* defined in badarg.c */ |
| 29 |
extern int badarg(int ac, char **av, char *fl); |
| 30 |
/* defined in expandarg.c */ |
| 31 |
extern int expandarg(int *acp, char ***avp, int n); |
| 32 |
/* defined in fdate.c */ |
| 33 |
extern time_t fdate(char *fname); |
| 34 |
extern int setfdate(char *fname, long ftim); |
| 35 |
/* defined in fgetline.c */ |
| 36 |
extern char *fgetline(char *s, int n, FILE *fp); |
| 37 |
/* defined in fgetval.c */ |
| 38 |
extern int fgetval(FILE *fp, int ty, char *vp); |
| 39 |
/* defined in fgetword.c */ |
| 40 |
extern char *fgetword(char *s, int n, FILE *fp); |
| 41 |
/* defined in fputword.c */ |
| 42 |
extern void fputword(char *s, FILE *fp); |
| 43 |
/* defined in fixargv0.c */ |
| 44 |
/*extern char *fixargv0(char *av0);*/ /* XXX include paths.h instead */ |
| 45 |
/* defined in fropen.c */ |
| 46 |
extern FILE *frlibopen(char *fname); |
| 47 |
/* defined in getlibpath.c */ |
| 48 |
extern char *getrlibpath(void); |
| 49 |
/* defined in getpath.c */ |
| 50 |
extern char *getpath(char *fname, char *searchpath, int mode); |
| 51 |
/* defined in portio.c */ |
| 52 |
extern void putstr(char *s, FILE *fp); |
| 53 |
extern void putint(long i, int siz, FILE *fp); |
| 54 |
extern void putflt(double f, FILE *fp); |
| 55 |
extern char *getstr(char *s, FILE *fp); |
| 56 |
extern long getint(int siz, FILE *fp); |
| 57 |
extern double getflt(FILE *fp); |
| 58 |
/* defined in rexpr.c */ |
| 59 |
extern int ecompile(char *sp, int iflg, int wflag); |
| 60 |
extern char *expsave(void); |
| 61 |
extern void expset(char *ep); |
| 62 |
extern char *eindex(char *sp); |
| 63 |
/* defined in savestr.c */ |
| 64 |
extern char *savestr(char *str); |
| 65 |
extern void freestr(char *s); |
| 66 |
extern int shash(char *s); |
| 67 |
/* defined in savqstr.c */ |
| 68 |
extern char *savqstr(char *s); |
| 69 |
extern void freeqstr(char *s); |
| 70 |
/* defined in wordfile.c */ |
| 71 |
extern int wordfile(char **words, char *fname); |
| 72 |
extern int wordstring(char **avl, char *str); |
| 73 |
/* defined in words.c */ |
| 74 |
extern char *atos(char *rs, int nb, char *s); |
| 75 |
extern char *nextword(char *cp, int nb, char *s); |
| 76 |
extern char *sskip(char *s); |
| 77 |
extern char *sskip2(char *s, int n); |
| 78 |
extern char *iskip(char *s); |
| 79 |
extern char *fskip(char *s); |
| 80 |
extern int isint(char *s); |
| 81 |
extern int isintd(char *s, char *ds); |
| 82 |
extern int isflt(char *s); |
| 83 |
extern int isfltd(char *s, char *ds); |
| 84 |
/* defined in lamp.c */ |
| 85 |
extern float * matchlamp(char *s); |
| 86 |
extern int loadlamps(char *file); |
| 87 |
extern void freelamps(void); |
| 88 |
|
| 89 |
#ifdef __cplusplus |
| 90 |
} |
| 91 |
#endif |
| 92 |
#endif /* _RAD_RTIO_H_ */ |
| 93 |
|