Lines Matching refs:reader
174 avifIOCtxReader *reader = (avifIOCtxReader *) io; in readFromCtx() local
190 if (size > reader->rodata.size) { in readFromCtx()
191 reader->rodata.data = gdRealloc((void *) reader->rodata.data, size); in readFromCtx()
192 reader->rodata.size = size; in readFromCtx()
194 if (!reader->rodata.data) { in readFromCtx()
201 int charsRead = ctx->getBuf(ctx, (void *) reader->rodata.data, (int) size); in readFromCtx()
206 out->data = reader->rodata.data; in readFromCtx()
213 avifIOCtxReader *reader = (avifIOCtxReader *) io; in destroyAvifIO() local
214 if (reader->rodata.data != NULL) { in destroyAvifIO()
215 gdFree((void *) reader->rodata.data); in destroyAvifIO()
217 gdFree(reader); in destroyAvifIO()
231 struct avifIOCtxReader *reader; in createAvifIOFromCtx() local
233 reader = gdMalloc(sizeof(*reader)); in createAvifIOFromCtx()
234 if (reader == NULL) in createAvifIOFromCtx()
238 reader->io.persistent = AVIF_FALSE; in createAvifIOFromCtx()
239 reader->io.read = readFromCtx; in createAvifIOFromCtx()
240 reader->io.write = NULL; // this function is currently unused; see avif.h in createAvifIOFromCtx()
241 reader->io.destroy = destroyAvifIO; in createAvifIOFromCtx()
242 reader->io.sizeHint = 0; // sadly, we don't get this information from the gdIOCtx. in createAvifIOFromCtx()
243 reader->io.data = ctx; in createAvifIOFromCtx()
244 reader->rodata.data = NULL; in createAvifIOFromCtx()
245 reader->rodata.size = 0; in createAvifIOFromCtx()
247 return (avifIO *) reader; in createAvifIOFromCtx()