mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
591 B
27 lines
591 B
#ifndef _BUF_
|
|
#define _BUF_
|
|
|
|
//
|
|
// Extern declarations and so forth for buffer-management routines.
|
|
//
|
|
|
|
typedef struct _BUF {
|
|
char data[512]; // tar depends on this 512
|
|
int offset; // offset into data
|
|
int count; // how many bytes available?
|
|
int fd;
|
|
int mode;
|
|
} BUF, *PBUF;
|
|
|
|
PBUF bopen(const char *file, int mode);
|
|
PBUF bfdopen(int fd, int mode);
|
|
void bclose(PBUF pb);
|
|
int bread(PBUF pb, void *buf, int len);
|
|
int bwrite(PBUF pb, void *buf, int len);
|
|
void bfill(PBUF pb);
|
|
void bflush(PBUF pb);
|
|
void brewind(PBUF pb);
|
|
int bgetc(PBUF pb);
|
|
void bputc(PBUF pb, int c);
|
|
|
|
#endif // _BUF_
|