Lines Matching refs:state
58 #define HASH(state, x) state->hash = (state->hash << 4) ^ (x)
67 compress(struct pred1_state *state, u_char *source, u_char *dest, int len)
77 if (state->dict[state->hash] == *source) {
80 state->dict[state->hash] = *source;
83 HASH(state, *source++);
92 SyncTable(struct pred1_state *state, u_char *source, u_char *dest, int len)
95 *dest++ = state->dict[state->hash] = *source;
96 HASH(state, *source++);
101 decompress(struct pred1_state *state, u_char *source, u_char *dest, int len)
112 *dest = state->dict[state->hash]; /* Guess correct */
116 state->dict[state->hash] = *source; /* Guess wrong */
120 HASH(state, *dest++);
129 struct pred1_state *state = (struct pred1_state *)v;
130 free(state);
136 struct pred1_state *state = (struct pred1_state *)v;
137 state->hash = 0;
138 memset(state->dict, '\0', sizeof state->dict);
145 struct pred1_state *state = (struct pred1_state *)v;
146 state->hash = 0;
147 memset(state->dict, '\0', sizeof state->dict);
156 struct pred1_state *state;
157 state = (struct pred1_state *)malloc(sizeof(struct pred1_state));
158 if (state != NULL)
159 Pred1ResetInput(state);
160 return state;
166 struct pred1_state *state;
167 state = (struct pred1_state *)malloc(sizeof(struct pred1_state));
168 if (state != NULL)
169 Pred1ResetOutput(state);
170 return state;
177 struct pred1_state *state = (struct pred1_state *)v;
196 len = compress(state, bufp + 2, wp, orglen);
219 struct pred1_state *state = (struct pred1_state *)v;
236 len1 = decompress(state, cp, pp, olen - 4);
256 SyncTable(state, cp, pp, len);