File: buffer_0.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-- 315 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
#include <unistd.h>
#include "buffer.h"

static int b0read(int fd,char* buf, unsigned int len) {
  if (buffer_flush(buffer_1)<0) return -1;
  return read(fd,buf,len);
}

char buffer_0_space[BUFFER_INSIZE];
static buffer it = BUFFER_INIT_READ(b0read,0,buffer_0_space,sizeof buffer_0_space);
buffer *buffer_0 = &it;