Go to the source code of this file.
|
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) |
|
◆ gz_avail()
Definition at line 56 of file gzread.c.
58{
59 unsigned got;
61
63 return -1;
64 if (
state->eof == 0) {
65 if (strm->avail_in) {
66 unsigned char *
p =
state->in;
67 unsigned const char *
q = strm->next_in;
68 unsigned n = strm->avail_in;
69 do {
72 }
74 state->size - strm->avail_in, &got) == -1)
75 return -1;
76 strm->avail_in += got;
77 strm->next_in =
state->in;
78 }
79 return 0;
80}
GLdouble GLdouble GLdouble GLdouble q
int gz_load(gz_statep state, unsigned char *buf, unsigned len, unsigned *have)
Referenced by gz_decomp(), and gz_look().
◆ gz_decomp()
Definition at line 173 of file gzread.c.
175{
177 unsigned had;
179
180
181 had = strm->avail_out;
182 do {
183
185 return -1;
186 if (strm->avail_in == 0) {
188 break;
189 }
190
191
195 "internal error: inflate stream corrupt");
196 return -1;
197 }
200 return -1;
201 }
204 strm->msg ==
NULL ?
"compressed data error" : strm->msg);
205 return -1;
206 }
208
209
210 state->x.have = had - strm->avail_out;
211 state->x.next = strm->next_out -
state->x.have;
212
213
216
217
218 return 0;
219}
int inflate(z_streamp strm, int flush)
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
int gz_avail(gz_statep state)
Referenced by gz_fetch(), and gz_read().
◆ gz_fetch()
Definition at line 227 of file gzread.c.
229{
231
232 do {
236 return -1;
238 return 0;
239 break;
242 == -1)
243 return -1;
245 return 0;
247 strm->avail_out =
state->size << 1;
248 strm->next_out =
state->out;
250 return -1;
251 }
252 }
while (
state->x.have == 0 && (!
state->eof || strm->avail_in));
253 return 0;
254}
int gz_decomp(gz_statep state)
int gz_look(gz_statep state)
Referenced by gz_read(), gz_skip(), and gzgets().
◆ gz_load()
Definition at line 21 of file gzread.c.
26{
29
30 *have = 0;
31 do {
37 break;
39 }
while (*have <
len);
42 return -1;
43 }
46 return 0;
47}
void get(int argc, const char *argv[])
#define zstrerror(errnum)
GLenum GLuint GLenum GLsizei const GLchar * buf
static unsigned(__cdecl *hash_bstr)(bstr_t s)
Referenced by gz_avail(), gz_fetch(), and gz_read().
◆ gz_look()
Definition at line 91 of file gzread.c.
93{
95
96
97 if (
state->size == 0) {
98
105 return -1;
106 }
108
109
113 state->strm.avail_in = 0;
120 return -1;
121 }
122 }
123
124
125 if (strm->avail_in < 2) {
127 return -1;
128 if (strm->avail_in == 0)
129 return 0;
130 }
131
132
133
134
135
136
137
138
139 if (strm->avail_in > 1 &&
140 strm->next_in[0] == 31 && strm->next_in[1] == 139) {
144 return 0;
145 }
146
147
148
149 if (
state->direct == 0) {
150 strm->avail_in = 0;
153 return 0;
154 }
155
156
157
158
160 memcpy(
state->x.next, strm->next_in, strm->avail_in);
161 state->x.have = strm->avail_in;
162 strm->avail_in = 0;
165 return 0;
166}
static int inflateReset(z_streamp strm)
#define memcpy(s1, s2, n)
#define inflateInit2(strm, windowBits)
Referenced by gz_fetch(), and gzdirect().
◆ gz_read()
Definition at line 292 of file gzread.c.
296{
299
300
302 return 0;
303
304
308 return 0;
309 }
310
311
312 got = 0;
313 do {
314
318
319
326 }
327
328
329 else if (
state->eof &&
state->strm.avail_in == 0) {
331 break;
332 }
333
334
335
337
339 return 0;
340 continue;
341
342
343 }
344
345
348 return 0;
349 }
350
351
352 else {
353 state->strm.avail_out =
n;
354 state->strm.next_out = (
unsigned char *)
buf;
356 return 0;
359 }
360
361
367
368
369 return got;
370}
int gz_skip(gz_statep state, z_off64_t len)
int gz_fetch(gz_statep state)
Referenced by gzfread(), gzgetc(), and gzread().
◆ gz_skip()
Definition at line 257 of file gzread.c.
260{
262
263
265
273 }
274
275
276 else if (
state->eof &&
state->strm.avail_in == 0)
277 break;
278
279
280 else {
281
283 return -1;
284 }
285 return 0;
286}
Referenced by gz_read(), gzgets(), and gzungetc().
◆ gzclose_r()
Definition at line 623 of file gzread.c.
625{
628
629
633
634
637
638
643 }
650}
int inflateEnd(z_streamp strm)
Referenced by gzclose().
◆ gzdirect()
Definition at line 603 of file gzread.c.
605{
607
608
610 return 0;
612
613
614
617
618
619 return state->direct;
620}
◆ gzfread()
Definition at line 409 of file gzread.c.
414{
417
418
420 return 0;
422
423
426 return 0;
427
428
432 return 0;
433 }
434
435
437}
z_size_t gz_read(gz_statep state, voidp buf, z_size_t len)
◆ gzgetc()
Definition at line 445 of file gzread.c.
447{
448 unsigned char buf[1];
450
451
453 return -1;
455
456
459 return -1;
460
461
465 return *(
state->x.next)++;
466 }
467
468
470}
◆ gzgetc_()
◆ gzgets()
Definition at line 539 of file gzread.c.
543{
546 unsigned char *eol;
548
549
553
554
558
559
564 }
565
566
567
568
572
575 if (
state->x.have == 0) {
577 break;
578 }
579
580
585
586
594
595
600}
◆ gzread()
Definition at line 373 of file gzread.c.
377{
379
380
382 return -1;
384
385
388 return -1;
389
390
391
394 return -1;
395 }
396
397
399
400
402 return -1;
403
404
406}
◆ gzungetc()
Definition at line 479 of file gzread.c.
482{
484
485
487 return -1;
489
490
493 return -1;
494
495
499 return -1;
500 }
501
502
504 return -1;
505
506
507 if (
state->x.have == 0) {
514 }
515
516
519 return -1;
520 }
521
522
529 }
536}
◆ OF() [1/4]
◆ OF() [2/4]
◆ OF() [3/4]
◆ OF() [4/4]