home *** CD-ROM | disk | FTP | other *** search
- #ifndef _BUFUTIL_INCLUDED_
- #define _BUFUTIL_INCLUDED_
-
-
- #ifndef BYTE
- #define BYTE unsigned char
- #endif
-
- enum BUFERRS {
- BUF_NONE=0,
- BUF_BADBUFF,
- BUF_NOMEM,
- BUF_FULL,
- BUF_EMPTY,
- BUF_LASTERR
- };
-
-
- typedef struct {
- int siz; /*size of buffer*/
- int cnt; /*count of chars now in buffer*/
- int hed; /*head pointer*/
- int tal; /*tail pointer*/
- BYTE *buf; /*pointer to buffer*/
- BYTE trm; /*termination character*/
- } BUFF;
-
-
- BUFF *bufopen(int size);
- int bufclose(BUFF *b);
- int bufputc(BUFF *b,int c);
- int bufgetc(BUFF *b);
- int bufputs(BUFF *b,char *s);
- int bufgets(BUFF *b,char *s,int n);
- int bufputns(BUFF *b,char *s,int n);
- int bufgetns(BUFF *b,char *s,int n);
- int bufempty(BUFF *b);
- int buffull(BUFF *b);
- int bufflush(BUFF *b);
- #define bufreset(x) bufflush(x)
-
- extern int buferr;
-
-
- #endif /*if bufutil.h not yet included*/