catbuf_ch - get next byte from a data buffer
#include <cat.h>
int catbuf_ch(cat_buffer *b);
catbuf_ch() (macro) returns the next byte from the buffer and increments the offset
counter.
This function, together with catbuf_index(), cabuf_len(), and
catbuf_pos() are the low-level selectors and modifiers for data buffers.
Returns the next byte in the buffer. When the end of the buffer is reached,
-1 is returned and the index is not incremented.
To print the contents of buffer b to the standard output, do the following:
int c;
catbuf_index(b, 0);
while ((c = catbuf_ch(b)) > -1) {
putchar(c);
}
cat, catbuf catbuf_index, catbuf_len, catbuf_pos