memzap

replay memory writes
git clone git://git.2f30.org/memzap
Log | Files | Refs | README | LICENSE

memstream.h (426B)


      1 #ifndef MEMSTREAM_H
      2 #define MEMSTREAM_H
      3 
      4 #include <stddef.h>
      5 #include <stdio.h>
      6 
      7 struct memstream {
      8 	size_t  pos;
      9 	size_t capa;
     10 	int file;
     11 	unsigned char* data;
     12 };
     13 
     14 void memstream_init(struct memstream *s, int fd, void* buffer, size_t len);
     15 void memstream_flush(struct memstream *s);
     16 void memstream_write(struct memstream *s, const void* source, size_t len);
     17 void memstream_puts(struct memstream *s, const char* str);
     18 
     19 #endif