home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 June
/
VPR0106A.BIN
/
OLS
/
BZ2L003
/
bz2l003.lzh
/
BZ2LIB
/
STRINGQ.H
< prev
Wrap
C/C++ Source or Header
|
1998-06-02
|
982b
|
44 lines
/*
stringq
process char buffer as queue like pipe
by Yoshioka Tsuneo(QWF00133@niftyserve.or.jp)
This File is Copy,Edit,Re-Distribute,etc.. FREE!
Welcome any e-mail!!
*/
#ifndef __STRINGQ_H
#define __STRINGQ_H
#define STRINGQ_BUFSIZ 0x10000 /* fixed size for the time beging */
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
struct STRINGQ_{
unsigned char *buf;
int bufsize;
int start_ptr;
int end_ptr;
int exist_eof;
int len;
};
#ifndef TYPEDEF_STRINGQ
#define TYPEDEF_STRINGQ
typedef struct STRINGQ_ STRINGQ;
#endif
STRINGQ *STRINGQ_open(int size);
int STRINGQ_getc(STRINGQ *b);
int STRINGQ_ungetc(int c,STRINGQ *b);
int STRINGQ_putc(int c,STRINGQ *b);
void STRINGQ_puteof(STRINGQ *b);
void STRINGQ_close(STRINGQ *b);
int STRINGQ_write(STRINGQ *b,char *buff,int len);
int STRINGQ_read(STRINGQ *b,char *buff,int len);
#endif /* __STRINGQ */