Logo
Explore Help
Sign In
mirror/libowfat
1
0
Fork 0
You've already forked libowfat
Code Issues Pull Requests Packages Projects Releases Wiki Activity
libowfat/io/iob_addbuf_free.c

14 lines
270 B
C
Raw Normal View History

use callback based infrastructure to reset iob's
2007-10-17 13:25:44 +00:00
#include <stdlib.h>
remove superfluous #includes make it possibly to specify that a buffer should be freed
2003-10-31 23:34:40 +00:00
#include "iob_internal.h"
use callback based infrastructure to reset iob's
2007-10-17 13:25:44 +00:00
static void cleanup(struct iob_entry* x) {
free((char*)x->buf);
}
make iob_reset actually free the buffers
2003-10-31 23:42:04 +00:00
int iob_addbuf_free(io_batch* b,const void* buf,uint64 n) {
document the return value expected from the callback given to iob_write remove unused #include in iob_reset if iob_addfile_close fails, it now closes the fd if iob_addbuf_munmap fails, it now munmaps the buf if iob_addbuf_free fails, it now frees the buf some win32 cross-compile fixes for iarray
2012-02-24 02:00:52 +00:00
int r=iob_addbuf_internal(b,buf,n,cleanup);
if (r==0)
free((char*)buf);
return r;
remove superfluous #includes make it possibly to specify that a buffer should be freed
2003-10-31 23:34:40 +00:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.3 Page: 29ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API