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