5 |
|
|
6 |
|
#ifndef _RAD_RTIO_H_ |
7 |
|
#define _RAD_RTIO_H_ |
8 |
– |
#ifdef __cplusplus |
9 |
– |
extern "C" { |
10 |
– |
#endif |
8 |
|
|
9 |
|
#include <stdio.h> |
10 |
|
#include <sys/types.h> |
11 |
|
#include <fcntl.h> |
12 |
|
#include <string.h> |
13 |
|
|
14 |
< |
/* XXX include paths.h instead */ |
15 |
< |
#ifndef F_OK /* mode bits for access(2) call */ |
16 |
< |
#define R_OK 4 /* readable */ |
17 |
< |
#define W_OK 2 /* writable */ |
18 |
< |
#define X_OK 1 /* executable */ |
22 |
< |
#define F_OK 0 /* exists */ |
14 |
> |
#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ |
15 |
> |
#undef getc |
16 |
> |
#undef putc |
17 |
> |
#define getc getc_unlocked |
18 |
> |
#define putc putc_unlocked |
19 |
|
#endif |
20 |
|
|
21 |
< |
/* <unistd.h> is missing on some systems */ |
22 |
< |
extern off_t lseek(int, off_t, int); |
23 |
< |
|
21 |
> |
#ifdef __cplusplus |
22 |
> |
extern "C" { |
23 |
> |
#endif |
24 |
|
/* defined in badarg.c */ |
25 |
|
extern int badarg(int ac, char **av, char *fl); |
26 |
|
/* defined in expandarg.c */ |
31 |
|
/* defined in fgetline.c */ |
32 |
|
extern char *fgetline(char *s, int n, FILE *fp); |
33 |
|
/* defined in fgetval.c */ |
34 |
< |
extern int fgetval(FILE *fp, int ty, char *vp); |
34 |
> |
extern int fgetval(FILE *fp, int ty, void *vp); |
35 |
|
/* defined in fgetword.c */ |
36 |
|
extern char *fgetword(char *s, int n, FILE *fp); |
37 |
|
/* defined in fputword.c */ |
38 |
|
extern void fputword(char *s, FILE *fp); |
43 |
– |
/* defined in fixargv0.c */ |
44 |
– |
/*extern char *fixargv0(char *av0);*/ /* XXX include paths.h instead */ |
39 |
|
/* defined in fropen.c */ |
40 |
|
extern FILE *frlibopen(char *fname); |
41 |
|
/* defined in getlibpath.c */ |
42 |
|
extern char *getrlibpath(void); |
43 |
+ |
/* defined in gethomedir.c */ |
44 |
+ |
extern char *gethomedir(char *uname, char *path, int plen); |
45 |
|
/* defined in getpath.c */ |
46 |
|
extern char *getpath(char *fname, char *searchpath, int mode); |
47 |
+ |
/* defined in byteswap.c */ |
48 |
+ |
extern void swap16(char *wp, int n); |
49 |
+ |
extern void swap32(char *wp, int n); |
50 |
+ |
extern void swap64(char *wp, int n); |
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 int putbinary(char *s, int elsiz, int nel, FILE *fp); |
56 |
|
extern char *getstr(char *s, FILE *fp); |
57 |
|
extern long getint(int siz, FILE *fp); |
58 |
|
extern double getflt(FILE *fp); |
59 |
+ |
extern int getbinary(char *s, int elsiz, int nel, FILE *fp); |
60 |
|
/* defined in rexpr.c */ |
61 |
|
extern int ecompile(char *sp, int iflg, int wflag); |
62 |
|
extern char *expsave(void); |