cleanup file.h
This commit is contained in:
@@ -25,10 +25,6 @@ typedef struct {
|
||||
int flag; /* mode of the file access */
|
||||
} xFILE;
|
||||
|
||||
#define xstdin (&pic->files[0])
|
||||
#define xstdout (&pic->files[1])
|
||||
#define xstderr (&pic->files[2])
|
||||
|
||||
enum {
|
||||
X_READ = 01,
|
||||
X_WRITE = 02,
|
||||
@@ -38,31 +34,28 @@ enum {
|
||||
X_LNBUF = 040
|
||||
};
|
||||
|
||||
#define xclearerr(p) ((p)->flag &= ~(X_EOF | X_ERR))
|
||||
#define xfeof(p) (((p)->flag & X_EOF) != 0)
|
||||
#define xferror(p) (((p)->flag & X_ERR) != 0)
|
||||
#define xstdin (&pic->files[0])
|
||||
#define xstdout (&pic->files[1])
|
||||
#define xstderr (&pic->files[2])
|
||||
|
||||
xFILE *xfunopen(pic_state *, void *cookie, int (*read)(pic_state *, void *, char *, int), int (*write)(pic_state *, void *, const char *, int), long (*seek)(pic_state *, void *, long, int), int (*close)(pic_state *, void *));
|
||||
size_t xfread(pic_state *, void *ptr, size_t size, size_t count, xFILE *fp);
|
||||
size_t xfwrite(pic_state *, const void *ptr, size_t size, size_t count, xFILE *fp);
|
||||
long xfseek(pic_state *, xFILE *fp, long offset, int whence); /* 0:cur, 1:end, 2:set */
|
||||
int xfclose(pic_state *, xFILE *fp);
|
||||
|
||||
enum {
|
||||
XSEEK_CUR,
|
||||
XSEEK_END,
|
||||
XSEEK_SET
|
||||
};
|
||||
void xclearerr(pic_state *, xFILE *fp);
|
||||
int xfeof(pic_state *, xFILE *fp);
|
||||
int xferror(pic_state *, xFILE *fp);
|
||||
|
||||
size_t xfread(pic_state *, void *, size_t, size_t, xFILE *);
|
||||
size_t xfwrite(pic_state *, const void *, size_t, size_t, xFILE *);
|
||||
long xfseek(pic_state *, xFILE *, long, int);
|
||||
int xfflush(pic_state *, xFILE *);
|
||||
int xfclose(pic_state *, xFILE *);
|
||||
|
||||
int xfputc(pic_state *, int, xFILE *);
|
||||
int xfgetc(pic_state *, xFILE *);
|
||||
int xfputs(pic_state *, const char *, xFILE *);
|
||||
char *xfgets(pic_state *, char *, int, xFILE *);
|
||||
int xungetc(int, xFILE *);
|
||||
int xfprintf(pic_state *, xFILE *, const char *, ...);
|
||||
int xvfprintf(pic_state *, xFILE *, const char *, va_list);
|
||||
int xfputc(pic_state *, int c, xFILE *fp);
|
||||
int xfgetc(pic_state *, xFILE *fp);
|
||||
int xfputs(pic_state *, const char *s, xFILE *fp);
|
||||
char *xfgets(pic_state *, char *s, int size, xFILE *fp);
|
||||
int xungetc(pic_state *, int c, xFILE *fp);
|
||||
int xfflush(pic_state *, xFILE *fp);
|
||||
int xfprintf(pic_state *, xFILE *fp, const char *fmt, ...);
|
||||
int xvfprintf(pic_state *, xFILE *fp, const char *fmt, va_list);
|
||||
|
||||
#if PIC_ENABLE_STDIO
|
||||
xFILE *xfopen_file(pic_state *, FILE *, const char *mode);
|
||||
|
||||
Reference in New Issue
Block a user