File: buffer_get.c

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

int buffer_get(buffer* b,unsigned char* x,unsigned long int len) {
  int blen;
  if ((blen=buffer_feed(b))>=len)
    blen=len;
  if (blen<=0) return blen;
  byte_copy(x,blen,b->x+b->p);
  b->p+=blen;
  return blen;
}