Lines Matching refs:thunk
50 struct fopencookie_thunk *thunk; in fopencookie() local
57 thunk = malloc(sizeof(*thunk)); in fopencookie()
58 if (thunk == NULL) in fopencookie()
61 thunk->foc_cookie = cookie; in fopencookie()
62 thunk->foc_io = io_funcs; in fopencookie()
71 fp = funopen(thunk, readfn, writefn, _fopencookie_seek, in fopencookie()
74 free(thunk); in fopencookie()
87 struct fopencookie_thunk *thunk; in _fopencookie_read() local
89 thunk = cookie; in _fopencookie_read()
92 if (thunk->foc_io.read == NULL) in _fopencookie_read()
95 return ((int)thunk->foc_io.read(thunk->foc_cookie, buf, (size_t)size)); in _fopencookie_read()
101 struct fopencookie_thunk *thunk; in _fopencookie_write() local
103 thunk = cookie; in _fopencookie_write()
106 if (thunk->foc_io.write == NULL) in _fopencookie_write()
109 return ((int)thunk->foc_io.write(thunk->foc_cookie, buf, in _fopencookie_write()
116 struct fopencookie_thunk *thunk; in _fopencookie_seek() local
131 thunk = cookie; in _fopencookie_seek()
137 if (thunk->foc_io.seek == NULL) { in _fopencookie_seek()
143 res = thunk->foc_io.seek(thunk->foc_cookie, &off64, whence); in _fopencookie_seek()
153 struct fopencookie_thunk *thunk; in _fopencookie_close() local
157 thunk = cookie; in _fopencookie_close()
158 if (thunk->foc_io.close != NULL) in _fopencookie_close()
159 ret = thunk->foc_io.close(thunk->foc_cookie); in _fopencookie_close()
162 free(thunk); in _fopencookie_close()