File: buffer_flush.c

package info (click to toggle)
fnord 1.10-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 356 kB
  • ctags: 169
  • sloc: ansic: 1,894; makefile: 101; sh: 71; perl: 36
file content (10 lines) | stat: -rw-r--r-- 271 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
#include "buffer.h"

extern int buffer_stubborn(int (*op)(),int fd,const char* buf, unsigned int len);

extern int buffer_flush(buffer* b) {
  register int p;
  if (!(p=b->p)) return 0; /* buffer already empty */
  b->p=0;
  return buffer_stubborn(b->op,b->fd,b->x,p);
}