Lines Matching refs:error
49 static zip_t *_zip_allocate_new(zip_source_t *src, unsigned int flags, zip_error_t *error);
50 static zip_int64_t _zip_checkcons(zip_t *za, zip_cdir_t *cdir, zip_error_t *error);
52 static exists_t _zip_file_exists(zip_source_t *src, zip_error_t *error);
55 …ir_t *_zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error);
56 …p_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error);
57 …rce_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error);
65 struct zip_error error; in zip_open() local
67 zip_error_init(&error); in zip_open()
68 if ((src = zip_source_file_create(fn, 0, -1, &error)) == NULL) { in zip_open()
69 _zip_set_open_error(zep, &error, 0); in zip_open()
70 zip_error_fini(&error); in zip_open()
74 if ((za = zip_open_from_source(src, _flags, &error)) == NULL) { in zip_open()
76 _zip_set_open_error(zep, &error, 0); in zip_open()
77 zip_error_fini(&error); in zip_open()
81 zip_error_fini(&error); in zip_open()
87 zip_open_from_source(zip_source_t *src, int _flags, zip_error_t *error) in zip_open_from_source() argument
97 zip_error_set(error, ZIP_ER_INVAL, 0); in zip_open_from_source()
108 zip_error_set(error, ZIP_ER_OPNOTSUPP, 0); in zip_open_from_source()
116 zip_error_set(error, ZIP_ER_RDONLY, 0); in zip_open_from_source()
120 exists = _zip_file_exists(src, error); in zip_open_from_source()
127 zip_error_set(error, ZIP_ER_NOENT, 0); in zip_open_from_source()
130 return _zip_allocate_new(src, flags, error); in zip_open_from_source()
135 zip_error_set(error, ZIP_ER_EXISTS, 0); in zip_open_from_source()
139 _zip_error_set_from_source(error, src); in zip_open_from_source()
144 za = _zip_allocate_new(src, flags, error); in zip_open_from_source()
148 za = _zip_open(src, flags, error); in zip_open_from_source()
167 zip_error_set(&za->error, ZIP_ER_MEMORY, errno); in zip_archive_set_tempdir()
181 _zip_open(zip_source_t *src, unsigned int flags, zip_error_t *error) in _zip_open() argument
190 _zip_error_set_from_source(error, src); in _zip_open()
194 zip_error_set(error, ZIP_ER_SEEK, EOPNOTSUPP); in _zip_open()
201 if ((za=_zip_allocate_new(src, flags, error)) == NULL) { in _zip_open()
209 if ((za=_zip_allocate_new(src, flags, error)) == NULL) { in _zip_open()
214 _zip_error_copy(error, &za->error); in _zip_open()
229 const zip_uint8_t *name = _zip_string_get(za->entry[idx].orig->filename, NULL, 0, error); in _zip_open()
237 if (_zip_hash_add(za->names, name, idx, ZIP_FL_UNCHANGED, &za->error) == false) { in _zip_open()
238 if (za->error.zip_err != ZIP_ER_EXISTS || (flags & ZIP_CHECKCONS)) { in _zip_open()
239 _zip_error_copy(error, &za->error); in _zip_open()
276 _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error) in _zip_read_cdir() argument
286 zip_error_set(error, ZIP_ER_NOZIP, 0); in _zip_read_cdir()
292 zip_error_set(error, ZIP_ER_NOZIP, 0); in _zip_read_cdir()
298 cd = _zip_read_eocd64(za->src, buffer, buf_offset, za->flags, error); in _zip_read_cdir()
302 cd = _zip_read_eocd(buffer, buf_offset, za->flags, error); in _zip_read_cdir()
313 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_cdir()
325 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_cdir()
331 …_string_new(_zip_buffer_get(buffer, comment_len), comment_len, ZIP_FL_ENC_GUESS, error)) == NULL) { in _zip_read_cdir()
344 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_cdir()
349 zip_error_set(error, ZIP_ER_MEMORY, 0); in _zip_read_cdir()
358 _zip_error_set_from_source(error, za->src); in _zip_read_cdir()
365 zip_error_set(error, ZIP_ER_NOZIP, 0); in _zip_read_cdir()
375 …NULL || (entry_size = _zip_dirent_read(cd->entry[i].orig, za->src, cd_buffer, false, error)) < 0) { in _zip_read_cdir()
385 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_cdir()
401 _zip_error_set_from_source(error, za->src); in _zip_read_cdir()
410 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_cdir()
429 _zip_checkcons(zip_t *za, zip_cdir_t *cd, zip_error_t *error) in _zip_checkcons() argument
447 zip_error_set(error, ZIP_ER_NOZIP, 0); in _zip_checkcons()
456 zip_error_set(error, ZIP_ER_NOZIP, 0); in _zip_checkcons()
461 _zip_error_set_from_source(error, za->src); in _zip_checkcons()
465 if (_zip_dirent_read(&temp, za->src, NULL, true, error) == -1) { in _zip_checkcons()
471 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_checkcons()
519 _zip_allocate_new(zip_source_t *src, unsigned int flags, zip_error_t *error) in _zip_allocate_new() argument
523 if ((za = _zip_new(error)) == NULL) { in _zip_allocate_new()
541 _zip_file_exists(zip_source_t *src, zip_error_t *error) in _zip_file_exists() argument
551 _zip_error_copy(error, src_error); in _zip_file_exists()
568 zip_error_t error; in _zip_find_central_dir() local
572 zip_error_set(&za->error, ZIP_ER_NOZIP, 0); in _zip_find_central_dir()
581 _zip_error_copy(&za->error, src_error); in _zip_find_central_dir()
586 _zip_error_set_from_source(&za->error, za->src); in _zip_find_central_dir()
590 if ((buffer = _zip_buffer_new_from_source(za->src, buflen, NULL, &za->error)) == NULL) { in _zip_find_central_dir()
600 zip_error_set(&error, ZIP_ER_NOZIP, 0); in _zip_find_central_dir()
605 if ((cdirnew = _zip_read_cdir(za, buffer, (zip_uint64_t)buf_offset, &error)) != NULL) { in _zip_find_central_dir()
608 best = _zip_checkcons(za, cdir, &error); in _zip_find_central_dir()
611 a = _zip_checkcons(za, cdirnew, &error); in _zip_find_central_dir()
624 best = _zip_checkcons(za, cdir, &error); in _zip_find_central_dir()
639 _zip_error_copy(&za->error, &error); in _zip_find_central_dir()
667 …ip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error) in _zip_read_eocd() argument
673 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd()
682 zip_error_set(error, ZIP_ER_MULTIDISK, 0); in _zip_read_eocd()
692 zip_error_set(error, ZIP_ER_NOZIP, 0); in _zip_read_eocd()
700 zip_error_set(error, ZIP_ER_SEEK, EFBIG); in _zip_read_eocd()
706 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd()
711 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd()
715 if ((cd=_zip_cdir_new(nentry, error)) == NULL) in _zip_read_eocd()
726 …urce_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error) in _zip_read_eocd64() argument
745 zip_error_set(error, ZIP_ER_SEEK, EFBIG); in _zip_read_eocd64()
750 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd64()
760 _zip_error_set_from_source(error, src); in _zip_read_eocd64()
763 if ((buffer = _zip_buffer_new_from_source(src, EOCD64LEN, eocd, error)) == NULL) { in _zip_read_eocd64()
770 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd64()
780 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd64()
802 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd64()
806 zip_error_set(error, ZIP_ER_MULTIDISK, 0); in _zip_read_eocd64()
814 zip_error_set(error, ZIP_ER_MULTIDISK, 0); in _zip_read_eocd64()
825 zip_error_set(error, ZIP_ER_INTERNAL, 0); in _zip_read_eocd64()
837 zip_error_set(error, ZIP_ER_SEEK, EFBIG); in _zip_read_eocd64()
842 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd64()
846 zip_error_set(error, ZIP_ER_INCONS, 0); in _zip_read_eocd64()
850 if ((cd=_zip_cdir_new(nentry, error)) == NULL) in _zip_read_eocd64()