Lines Matching refs:thunk
53 struct fopencookie_thunk *thunk; in fopencookie() local
60 thunk = malloc(sizeof(*thunk)); in fopencookie()
61 if (thunk == NULL) in fopencookie()
64 thunk->foc_cookie = cookie; in fopencookie()
65 thunk->foc_io = io_funcs; in fopencookie()
74 fp = funopen(thunk, readfn, writefn, _fopencookie_seek, in fopencookie()
77 free(thunk); in fopencookie()
90 struct fopencookie_thunk *thunk; in _fopencookie_read() local
92 thunk = cookie; in _fopencookie_read()
95 if (thunk->foc_io.read == NULL) in _fopencookie_read()
98 return ((int)thunk->foc_io.read(thunk->foc_cookie, buf, (size_t)size)); in _fopencookie_read()
104 struct fopencookie_thunk *thunk; in _fopencookie_write() local
106 thunk = cookie; in _fopencookie_write()
109 if (thunk->foc_io.write == NULL) in _fopencookie_write()
112 return ((int)thunk->foc_io.write(thunk->foc_cookie, buf, in _fopencookie_write()
119 struct fopencookie_thunk *thunk; in _fopencookie_seek() local
134 thunk = cookie; in _fopencookie_seek()
140 if (thunk->foc_io.seek == NULL) { in _fopencookie_seek()
146 res = thunk->foc_io.seek(thunk->foc_cookie, &off64, whence); in _fopencookie_seek()
156 struct fopencookie_thunk *thunk; in _fopencookie_close() local
160 thunk = cookie; in _fopencookie_close()
161 if (thunk->foc_io.close != NULL) in _fopencookie_close()
162 ret = thunk->foc_io.close(thunk->foc_cookie); in _fopencookie_close()
165 free(thunk); in _fopencookie_close()