File: buffer_getc.c

package info (click to toggle)
libowfat 0.27-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,412 kB
  • ctags: 1,147
  • sloc: ansic: 12,294; makefile: 42
file content (12 lines) | stat: -rw-r--r-- 211 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
#include "byte.h"
#include "buffer.h"

int buffer_getc(buffer* b,char* x) {
  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;
}