2001-02-05 21:27:55 +00:00
|
|
|
#include "byte.h"
|
|
|
|
#include "buffer.h"
|
|
|
|
|
2005-04-23 15:50:16 +00:00
|
|
|
int buffer_getc(buffer* b,char* x) {
|
2001-02-05 21:27:55 +00:00
|
|
|
if (b->p==b->n) {
|
|
|
|
register int blen;
|
|
|
|
if ((blen=buffer_feed(b))<=0) return blen;
|
|
|
|
}
|
|
|
|
*x=b->x[b->p];
|
|
|
|
++b->p;
|
|
|
|
return 1;
|
|
|
|
}
|