lib/uzlib: Add a source_read_data var to pass to source_read_cb.
For better abstraction for users of this API. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
7f16bfca9f
commit
e6c290c3d1
@@ -185,7 +185,7 @@ unsigned char uzlib_get_byte(uzlib_uncomp_t *d)
|
||||
read next byte using it. (Note: the callback can also update ->source
|
||||
and ->source_limit). */
|
||||
if (d->source_read_cb && !d->eof) {
|
||||
int val = d->source_read_cb(d);
|
||||
int val = d->source_read_cb(d->source_read_data);
|
||||
if (val >= 0) {
|
||||
return (unsigned char)val;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,8 @@ typedef struct _uzlib_uncomp_t {
|
||||
also return -1 in case of EOF (or irrecoverable error). Note that
|
||||
besides returning the next byte, it may also update source and
|
||||
source_limit fields, thus allowing for buffered operation. */
|
||||
int (*source_read_cb)(struct _uzlib_uncomp_t *uncomp);
|
||||
void *source_read_data;
|
||||
int (*source_read_cb)(void *);
|
||||
|
||||
unsigned int tag;
|
||||
unsigned int bitcount;
|
||||
|
||||
Reference in New Issue
Block a user