Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
275 B

  1. #include <buffer.h>
  2. #include <mmap.h>
  3. static ssize_t op() {
  4. return 0;
  5. }
  6. int buffer_mmapread(buffer* b,const char* filename) {
  7. if (!(b->x=(char*)mmap_read(filename,&b->n))) return -1;
  8. b->p=0; b->a=b->n;
  9. b->fd=-1;
  10. b->op=op;
  11. b->deinit=buffer_munmap;
  12. return 0;
  13. }