add iob_free and man page for iob_reset.
check in some windoze compat crap (still does not compile through for windoze)
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
#include <buffer.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef __MINGW32__
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
void buffer_close(buffer* b) {
|
||||
if (b->fd != -1) close(b->fd);
|
||||
switch (b->todo) {
|
||||
case FREE: free(b->x); break;
|
||||
case MUNMAP: munmap(b->x,b->a); break;
|
||||
case MUNMAP:
|
||||
#ifdef __MINGW32__
|
||||
UnmapViewOfFile(b->x);
|
||||
#else
|
||||
munmap(b->x,b->a); break;
|
||||
#endif
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user