File: dfltcc_inflate.h

package info (click to toggle)
node-yarnpkg 4.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,752 kB
  • sloc: javascript: 38,953; ansic: 26,035; cpp: 7,247; sh: 2,829; makefile: 724; perl: 493
file content (67 lines) | stat: -rw-r--r-- 2,496 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef DFLTCC_INFLATE_H
#define DFLTCC_INFLATE_H

#include "dfltcc_common.h"

void Z_INTERNAL PREFIX(dfltcc_reset_inflate_state)(PREFIX3(streamp) strm);
int Z_INTERNAL PREFIX(dfltcc_can_inflate)(PREFIX3(streamp) strm);
typedef enum {
    DFLTCC_INFLATE_CONTINUE,
    DFLTCC_INFLATE_BREAK,
    DFLTCC_INFLATE_SOFTWARE,
} dfltcc_inflate_action;
dfltcc_inflate_action Z_INTERNAL PREFIX(dfltcc_inflate)(PREFIX3(streamp) strm, int flush, int *ret);
int Z_INTERNAL PREFIX(dfltcc_was_inflate_used)(PREFIX3(streamp) strm);
int Z_INTERNAL PREFIX(dfltcc_inflate_disable)(PREFIX3(streamp) strm);
int Z_INTERNAL PREFIX(dfltcc_inflate_set_dictionary)(PREFIX3(streamp) strm,
                                                     const unsigned char *dictionary, uInt dict_length);
int Z_INTERNAL PREFIX(dfltcc_inflate_get_dictionary)(PREFIX3(streamp) strm,
                                                     unsigned char *dictionary, uInt* dict_length);

#define INFLATE_RESET_KEEP_HOOK PREFIX(dfltcc_reset_inflate_state)

#define INFLATE_PRIME_HOOK(strm, bits, value) \
    do { if (PREFIX(dfltcc_inflate_disable)((strm))) return Z_STREAM_ERROR; } while (0)

#define INFLATE_TYPEDO_HOOK(strm, flush) \
    if (PREFIX(dfltcc_can_inflate)((strm))) { \
        dfltcc_inflate_action action; \
\
        RESTORE(); \
        action = PREFIX(dfltcc_inflate)((strm), (flush), &ret); \
        LOAD(); \
        if (action == DFLTCC_INFLATE_CONTINUE) \
            break; \
        else if (action == DFLTCC_INFLATE_BREAK) \
            goto inf_leave; \
    }

#define INFLATE_NEED_CHECKSUM(strm) (!PREFIX(dfltcc_can_inflate)((strm)))

#define INFLATE_NEED_UPDATEWINDOW(strm) (!PREFIX(dfltcc_can_inflate)((strm)))

#define INFLATE_MARK_HOOK(strm) \
    do { \
        if (PREFIX(dfltcc_was_inflate_used)((strm))) return -(1L << 16); \
    } while (0)

#define INFLATE_SYNC_POINT_HOOK(strm) \
    do { \
        if (PREFIX(dfltcc_was_inflate_used)((strm))) return Z_STREAM_ERROR; \
    } while (0)

#define INFLATE_SET_DICTIONARY_HOOK(strm, dict, dict_len) \
    do { \
        if (PREFIX(dfltcc_can_inflate)((strm))) \
            return PREFIX(dfltcc_inflate_set_dictionary)((strm), (dict), (dict_len)); \
    } while (0)

#define INFLATE_GET_DICTIONARY_HOOK(strm, dict, dict_len) \
    do { \
        if (PREFIX(dfltcc_can_inflate)((strm))) \
            return PREFIX(dfltcc_inflate_get_dictionary)((strm), (dict), (dict_len)); \
    } while (0)

#define INFLATE_ADJUST_WINDOW_SIZE(n) MAX(n, HB_SIZE)

#endif