add buffer_fromsa (make virtual buffer from stralloc)

This commit is contained in:
leitner
2003-06-08 22:10:10 +00:00
parent 558c6128fe
commit a327b75831
5 changed files with 62 additions and 0 deletions

15
buffer/buffer_fromsa.c Normal file
View File

@@ -0,0 +1,15 @@
#include "stralloc.h"
#include "buffer.h"
static int dummyreadwrite(int fd,char* buf,unsigned long int len) {
return 0;
}
void buffer_fromsa(buffer* b,stralloc* sa) {
b->x=sa->s;
b->p=0;
b->n=sa->len;
b->a=sa->a;
b->fd=0;
b->op=dummyreadwrite;
}