--- ray/src/common/rtio.h 2003/06/30 14:59:11 3.2 +++ ray/src/common/rtio.h 2016/03/03 22:09:59 3.11 @@ -1,30 +1,26 @@ -/* RCSid $Id: rtio.h,v 3.2 2003/06/30 14:59:11 schorsch Exp $ */ +/* RCSid $Id: rtio.h,v 3.11 2016/03/03 22:09:59 greg Exp $ */ /* * Radiance i/o and string routines */ #ifndef _RAD_RTIO_H_ #define _RAD_RTIO_H_ -#ifdef __cplusplus -extern "C" { -#endif #include #include #include #include -/* XXX include paths.h instead */ -#ifndef F_OK /* mode bits for access(2) call */ -#define R_OK 4 /* readable */ -#define W_OK 2 /* writable */ -#define X_OK 1 /* executable */ -#define F_OK 0 /* exists */ +#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ +#undef getc +#undef putc +#define getc getc_unlocked +#define putc putc_unlocked #endif - /* is missing on some systems */ -extern off_t lseek(int, off_t, int); - +#ifdef __cplusplus +extern "C" { +#endif /* defined in badarg.c */ extern int badarg(int ac, char **av, char *fl); /* defined in expandarg.c */ @@ -35,26 +31,32 @@ extern int setfdate(char *fname, long ftim); /* defined in fgetline.c */ extern char *fgetline(char *s, int n, FILE *fp); /* defined in fgetval.c */ -extern int fgetval(FILE *fp, int ty, char *vp); +extern int fgetval(FILE *fp, int ty, void *vp); /* defined in fgetword.c */ extern char *fgetword(char *s, int n, FILE *fp); /* defined in fputword.c */ extern void fputword(char *s, FILE *fp); - /* defined in fixargv0.c */ -/*extern char *fixargv0(char *av0);*/ /* XXX include paths.h instead */ /* defined in fropen.c */ extern FILE *frlibopen(char *fname); /* defined in getlibpath.c */ extern char *getrlibpath(void); + /* defined in gethomedir.c */ +extern char *gethomedir(char *uname, char *path, int plen); /* defined in getpath.c */ extern char *getpath(char *fname, char *searchpath, int mode); + /* defined in byteswap.c */ +extern void swap16(char *wp, int n); +extern void swap32(char *wp, int n); +extern void swap64(char *wp, int n); /* defined in portio.c */ extern void putstr(char *s, FILE *fp); extern void putint(long i, int siz, FILE *fp); extern void putflt(double f, FILE *fp); +extern int putbinary(char *s, int elsiz, int nel, FILE *fp); extern char *getstr(char *s, FILE *fp); extern long getint(int siz, FILE *fp); extern double getflt(FILE *fp); +extern int getbinary(char *s, int elsiz, int nel, FILE *fp); /* defined in rexpr.c */ extern int ecompile(char *sp, int iflg, int wflag); extern char *expsave(void);