Lines Matching refs:za

64 zip_close(zip_t *za)  in zip_close()  argument
72 if (za == NULL) in zip_close()
75 changed = _zip_changed(za, &survivors); in zip_close()
79 if ((za->open_flags & ZIP_TRUNCATE) || changed) { in zip_close()
80 if (zip_source_remove(za->src) < 0) { in zip_close()
81 _zip_error_set_from_source(&za->error, za->src); in zip_close()
85 zip_discard(za); in zip_close()
90 zip_discard(za); in zip_close()
94 if (survivors > za->nentry) { in zip_close()
95 zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); in zip_close()
103 for (i=j=0; i<za->nentry; i++) { in zip_close()
104 if (za->entry[i].deleted) in zip_close()
109 zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); in zip_close()
118 zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); in zip_close()
122 if (zip_source_begin_write(za->src) < 0) { in zip_close()
123 _zip_error_set_from_source(&za->error, za->src); in zip_close()
135 entry = za->entry+i; in zip_close()
142 zip_error_set(&za->error, ZIP_ER_MEMORY, 0); in zip_close()
149 if (_zip_read_local_ef(za, i) < 0) { in zip_close()
154 if ((off = zip_source_tell_write(za->src)) < 0) { in zip_close()
165 if ((zs=_zip_source_zip_new(za, za, i, ZIP_FL_UNCHANGED, 0, 0, NULL)) == NULL) { in zip_close()
172 if (add_data(za, zs ? zs : entry->source, de) < 0) { in zip_close()
186 if (_zip_dirent_write(za, de, ZIP_FL_LOCAL) < 0) { in zip_close()
190 if ((offset=_zip_file_get_offset(za, i, &za->error)) == 0) { in zip_close()
194 if (zip_source_seek(za->src, (zip_int64_t)offset, SEEK_SET) < 0) { in zip_close()
195 _zip_error_set_from_source(&za->error, za->src); in zip_close()
199 if (copy_data(za, de->comp_size) < 0) { in zip_close()
207 if (write_cdir(za, filelist, survivors) < 0) in zip_close()
214 if (zip_source_commit_write(za->src) != 0) { in zip_close()
215 _zip_error_set_from_source(&za->error, za->src); in zip_close()
221 zip_source_rollback_write(za->src); in zip_close()
225 zip_discard(za); in zip_close()
232 add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de) in add_data() argument
242 _zip_error_set_from_source(&za->error, src); in add_data()
279 if ((offstart = zip_source_tell_write(za->src)) < 0) { in add_data()
285 if ((is_zip64=_zip_dirent_write(za, de, flags)) < 0) in add_data()
295 zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); in add_data()
298 if ((s_store=comp_impl(za, src, st.comp_method, ZIP_CODEC_DECODE)) == NULL) { in add_data()
309 s_crc = zip_source_crc(za, s_store, 0); in add_data()
317 zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); in add_data()
321 s2 = comp_impl(za, s_crc, de->comp_method, ZIP_CODEC_ENCODE); in add_data()
336 if ((offdata = zip_source_tell_write(za->src)) < 0) { in add_data()
340 ret = copy_source(za, s2); in add_data()
350 if ((offend = zip_source_tell_write(za->src)) < 0) { in add_data()
354 if (zip_source_seek_write(za->src, offstart, SEEK_SET) < 0) { in add_data()
355 _zip_error_set_from_source(&za->error, za->src); in add_data()
360 zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); in add_data()
375 if ((ret=_zip_dirent_write(za, de, flags)) < 0) in add_data()
380 zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); in add_data()
385 if (zip_source_seek_write(za->src, offend, SEEK_SET) < 0) { in add_data()
386 _zip_error_set_from_source(&za->error, za->src); in add_data()
395 copy_data(zip_t *za, zip_uint64_t len) in copy_data() argument
402 if (_zip_read(za->src, buf, n, &za->error) < 0) { in copy_data()
406 if (_zip_write(za, buf, n) < 0) { in copy_data()
418 copy_source(zip_t *za, zip_source_t *src) in copy_source() argument
425 _zip_error_set_from_source(&za->error, src); in copy_source()
431 if (_zip_write(za, buf, (zip_uint64_t)n) < 0) { in copy_source()
438 _zip_error_set_from_source(&za->error, src); in copy_source()
449 write_cdir(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors) in write_cdir() argument
453 if ((cd_start = zip_source_tell_write(za->src)) < 0) { in write_cdir()
457 if ((size=_zip_cdir_write(za, filelist, survivors)) < 0) { in write_cdir()
461 if ((end = zip_source_tell_write(za->src)) < 0) { in write_cdir()
470 _zip_changed(const zip_t *za, zip_uint64_t *survivorsp) in _zip_changed() argument
478 if (za->comment_changed || za->ch_flags != za->flags) in _zip_changed()
481 for (i=0; i<za->nentry; i++) { in _zip_changed()
482 …if (za->entry[i].deleted || za->entry[i].source || (za->entry[i].changes && za->entry[i].changes->… in _zip_changed()
484 if (!za->entry[i].deleted) in _zip_changed()