mirror of
https://github.com/vivier/EMILE.git
synced 2025-02-26 15:29:12 +00:00
change prototype of uncompress(): caller provide function to feed the inflate procedure
This commit is contained in:
parent
da403aff9f
commit
406f252a78
@ -27,13 +27,13 @@ typedef unsigned long ulg;
|
||||
|
||||
static long bytes_out = 0;
|
||||
|
||||
static uch *inbuf; /* input buffer */
|
||||
static uch window[WSIZE]; /* Sliding window buffer */
|
||||
|
||||
static unsigned inptr; /* index of next byte to be processed in inbuf */
|
||||
static unsigned outcnt = 0; /* bytes in output buffer */
|
||||
|
||||
#define get_byte() (inbuf[inptr++])
|
||||
uncompress_get_byte_t load_byte;
|
||||
#define get_byte() (load_byte(inptr++))
|
||||
|
||||
static uch *output_data;
|
||||
static unsigned long output_ptr = 0;
|
||||
@ -80,12 +80,12 @@ static void flush_window(void)
|
||||
console_putchar('.');
|
||||
}
|
||||
|
||||
unsigned long uncompress(char* buf, char* image)
|
||||
unsigned long uncompress(char* buf, uncompress_get_byte_t feeder)
|
||||
{
|
||||
output_data = buf;
|
||||
inbuf = (uch*)image;
|
||||
inptr = 0;
|
||||
|
||||
load_byte = feeder;
|
||||
makecrc();
|
||||
printf("Uncompressing kernel to %p", buf);
|
||||
|
||||
|
@ -4,4 +4,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
extern unsigned long uncompress(char* buf, char* image);
|
||||
typedef unsigned char (*uncompress_get_byte_t)(unsigned long offset);
|
||||
|
||||
extern unsigned long uncompress(char* buf, uncompress_get_byte_t feeder);
|
||||
|
Loading…
x
Reference in New Issue
Block a user