add buffer_tosa (buffer writing to auto-growing stralloc)

This commit is contained in:
leitner
2009-02-28 00:07:55 +00:00
parent 1d76baf2ef
commit 02818883df
10 changed files with 56 additions and 13 deletions

View File

@@ -1,10 +1,10 @@
#include "buffer.h"
extern int buffer_stubborn(ssize_t (*op)(),int fd,const char* buf, size_t len);
extern int buffer_stubborn(ssize_t (*op)(),int fd,const char* buf, size_t len,void* cookie);
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);
return buffer_stubborn(b->op,b->fd,b->x,p,b);
}