Lines Matching defs:state

85 	struct private_b64encode *state;
90 state = (struct private_b64encode *)calloc(1, sizeof(*state));
91 if (state == NULL) {
96 archive_strcpy(&state->name, "-");
97 state->mode = 0644;
99 f->data = state;
118 struct private_b64encode *state = (struct private_b64encode *)f->data;
126 state->mode = (int)atol8(value, strlen(value)) & 0777;
134 archive_strcpy(&state->name, value);
150 struct private_b64encode *state = (struct private_b64encode *)f->data;
163 state->bs = bs;
164 if (archive_string_ensure(&state->encoded_buff, bs + 512) == NULL) {
170 archive_string_sprintf(&state->encoded_buff, "begin-base64 %o %s\n",
171 state->mode, state->name.s);
173 f->data = state;
218 struct private_b64encode *state = (struct private_b64encode *)f->data;
225 if (state->hold_len) {
226 while (state->hold_len < LBYTES && length > 0) {
227 state->hold[state->hold_len++] = *p++;
230 if (state->hold_len < LBYTES)
232 la_b64_encode(&state->encoded_buff, state->hold, LBYTES);
233 state->hold_len = 0;
237 la_b64_encode(&state->encoded_buff, p, LBYTES);
241 memcpy(state->hold, p, length);
242 state->hold_len = length;
244 while (archive_strlen(&state->encoded_buff) >= state->bs) {
246 state->encoded_buff.s, state->bs);
247 memmove(state->encoded_buff.s,
248 state->encoded_buff.s + state->bs,
249 state->encoded_buff.length - state->bs);
250 state->encoded_buff.length -= state->bs;
263 struct private_b64encode *state = (struct private_b64encode *)f->data;
266 if (state->hold_len != 0)
267 la_b64_encode(&state->encoded_buff, state->hold, state->hold_len);
268 archive_string_sprintf(&state->encoded_buff, "====\n");
272 state->encoded_buff.s, archive_strlen(&state->encoded_buff));
278 struct private_b64encode *state = (struct private_b64encode *)f->data;
280 archive_string_free(&state->name);
281 archive_string_free(&state->encoded_buff);
282 free(state);