Prusa MINI Firmware overview
|
|
int gz_load | OF ((gz_statep, unsigned char *, unsigned, unsigned *)) |
|
int gz_avail | OF ((gz_statep)) |
|
int gz_skip | OF ((gz_statep, z_off64_t)) |
|
z_size_t gz_read | OF ((gz_statep, voidp, z_size_t)) |
|
int | gz_load (gz_statep state, unsigned char *buf, unsigned len, unsigned *have) |
|
int | gz_avail (gz_statep state) |
|
int | gz_look (gz_statep state) |
|
int | gz_decomp (gz_statep state) |
|
int | gz_fetch (gz_statep state) |
|
int | gz_skip (gz_statep state, z_off64_t len) |
|
z_size_t | gz_read (gz_statep state, voidp buf, z_size_t len) |
|
int ZEXPORT | gzread (gzFile file, voidp buf, unsigned len) |
|
z_size_t ZEXPORT | gzfread (voidp buf, z_size_t size, z_size_t nitems, gzFile file) |
|
int ZEXPORT | gzgetc (gzFile file) |
|
int ZEXPORT | gzgetc_ (gzFile file) |
|
int ZEXPORT | gzungetc (int c, gzFile file) |
|
char *ZEXPORT | gzgets (gzFile file, char *buf, int len) |
|
int ZEXPORT | gzdirect (gzFile file) |
|
int ZEXPORT | gzclose_r (gzFile file) |
|
◆ OF() [1/4]
◆ OF() [2/4]
◆ OF() [3/4]
◆ OF() [4/4]
◆ gz_load()
int gz_load |
( |
gz_statep |
state, |
|
|
unsigned char * |
buf, |
|
|
unsigned |
len, |
|
|
unsigned * |
have |
|
) |
| |
28 unsigned get,
max = ((unsigned)-1 >> 2) + 1;
38 *have += (unsigned)ret;
39 }
while (*have < len);
◆ gz_avail()
64 if (
state->eof == 0) {
66 unsigned char *p =
state->in;
67 unsigned const char *q =
strm->next_in;
68 unsigned n =
strm->avail_in;
74 state->size -
strm->avail_in, &got) == -1)
76 strm->avail_in += got;
◆ gz_look()
97 if (
state->size == 0) {
99 state->in = (
unsigned char *)malloc(
state->want);
100 state->out = (
unsigned char *)malloc(
state->want << 1);
113 state->strm.avail_in = 0;
125 if (
strm->avail_in < 2) {
128 if (
strm->avail_in == 0)
139 if (
strm->avail_in > 1 &&
140 strm->next_in[0] == 31 &&
strm->next_in[1] == 139) {
149 if (
state->direct == 0) {
160 if (
strm->avail_in) {
◆ gz_decomp()
183 had =
strm->avail_out;
188 if (
strm->avail_in == 0) {
197 "internal error: inflate stream corrupt");
206 strm->msg ==
NULL ?
"compressed data error" :
strm->msg);
◆ gz_fetch()
◆ gz_skip()
270 (
unsigned)len :
state->x.have;
278 else if (
state->eof &&
state->strm.avail_in == 0)
◆ gz_read()
323 if (
state->x.have < n)
325 memcpy(buf,
state->x.next, n);
331 else if (
state->eof &&
state->strm.avail_in == 0) {
355 state->strm.avail_out = n;
356 state->strm.next_out = (
unsigned char *)buf;
365 buf = (
char *)buf + n;
◆ gzread()
◆ gzfread()
◆ gzgetc()
451 unsigned char buf[1];
468 return *(
state->x.next)++;
473 return ret < 1 ? -1 : buf[0];
◆ gzgetc_()
◆ gzungetc()
511 if (
state->x.have == 0) {
514 state->x.next[0] = (
unsigned char)c;
528 unsigned char *src =
state->out +
state->x.have;
529 unsigned char *dest =
state->out + (
state->size << 1);
530 while (src >
state->out)
532 state->x.next = dest;
536 state->x.next[0] = (
unsigned char)c;
◆ gzgets()
554 if (file ==
NULL || buf ==
NULL || len < 1)
574 left = (unsigned)len - 1;
579 if (
state->x.have == 0) {
585 n =
state->x.have > left ? left :
state->x.have;
586 eol = (
unsigned char *)memchr(
state->x.next,
'\n', n);
588 n = (unsigned)(eol -
state->x.next) + 1;
591 memcpy(buf,
state->x.next, n);
597 }
while (left && eol ==
NULL);
◆ gzdirect()
623 return state->direct;
◆ gzclose_r()
#define Z_MEM_ERROR
Definition: zlib.h:183
#define GT_OFF(x)
Definition: gzguts.h:218
#define Z_ERRNO
Definition: zlib.h:180
#define Z_BUF_ERROR
Definition: zlib.h:184
#define GZ_READ
Definition: gzguts.h:161
unsigned long z_size_t
Definition: zconf.h:250
#define Z_DATA_ERROR
Definition: zlib.h:182
#define Z_STREAM_ERROR
Definition: zlib.h:181
#define Z_NEED_DICT
Definition: zlib.h:179
#define max(a, b)
Definition: wiring_constants.h:40
static volatile fsensor_t state
Definition: filament_sensor.c:23
int ZEXPORT gzgetc(gzFile file)
Definition: gzread.c:447
z_streamp strm
Definition: deflate.h:101
#define NULL
Definition: usbd_def.h:53
int gz_fetch(gz_statep state)
Definition: gzread.c:229
int gz_avail(gz_statep state)
Definition: gzread.c:56
#define zstrerror()
Definition: gzguts.h:134
#define Z_NULL
Definition: zlib.h:212
#define inflateInit2(strm, windowBits)
Definition: zlib.h:1800
static int close(struct _reent *_r, void *pv)
Definition: gcode_file.cpp:21
#define Z_NO_FLUSH
Definition: zlib.h:168
int gz_decomp(gz_statep state)
Definition: gzread.c:175
z_size_t gz_read(gz_statep state, voidp buf, z_size_t len)
Definition: gzread.c:294
z_stream FAR * z_streamp
Definition: zlib.h:108
#define z_off64_t
Definition: zconf.h:513
void
Definition: png.h:1083
#define Z_OK
Definition: zlib.h:177
#define Z_STREAM_END
Definition: zlib.h:178
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition: gzlib.c:579
static int read(struct _reent *_r, void *pv, char *pc, int n)
Definition: gcode_file.cpp:9
int gz_skip(gz_statep state, z_off64_t len)
Definition: gzread.c:259
#define LOOK
Definition: gzguts.h:166
gz_state FAR * gz_statep
Definition: gzguts.h:203
int gz_load(gz_statep state, unsigned char *buf, unsigned len, unsigned *have)
Definition: gzread.c:21
int ZEXPORT inflateEnd(z_streamp strm)
Definition: inflate.c:1277
int ZEXPORT inflate(z_streamp strm, int flush)
Definition: inflate.c:622
#define GZIP
Definition: deflate.h:23
int ZEXPORT inflateReset(z_streamp strm)
Definition: inflate.c:144
int gz_look(gz_statep state)
Definition: gzread.c:91
static png_bytep size_t size
Definition: pngwrite.c:2170