Imported Upstream version 1.1.3
[platform/upstream/libzip.git] / TODO.md
1 # API Plans
2
3 ## Encryption
4
5 ````c
6 struct zip *zip_open_encrypted(const char *path, int flags, const char *password, int *errorp);
7 int zip_set_encryption(struct zip *archive, zip_uint64_t idx, zip_uint16_t method, const char *password);
8 void zip_set_archive_encryption(struct zip *archive, zip_uint16_t method, const char *password);
9 ````
10
11 ## Prefixes
12
13 For example for adding extractors for self-extracting zip archives.
14 ````c
15 zip_set_archive_prefix(struct zip *za, const zip_uint8_t *data, zip_uint64_t length);
16 const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp);
17 ````
18
19 ## Progress Callback
20
21 Register callback; will be called from `zip_close()` after each file has been processed.
22
23 ````c
24 typedef void (*zip_progress_callback_t)(double);
25 void zip_register_progress_callback(zip_t *, zip_progress_callback_t);
26 ````
27
28 # API Issues
29
30 * `zip_get_archive_comment` has `int *lenp` argument.  Cleaner would be `zip_uint32_t *`.
31   rename and fix.  which other functions for naming consistency?
32 * rename remaining `zip_XXX_{file,archive}_*` to `zip_{file,archive}_XXX_*`?
33 * compression/crypt implementations: how to set error code on failure
34 * compression/crypt error messages a la `ZIP_ER_ZLIB` (no detailed info passing)
35 * check arguments for every entry point into libzip
36
37 # Features
38
39 * support setting extra fields from zip_source
40   * introduce layers of extra fields:
41     * original
42     * from zip_source
43     * manually set
44   * when querying extra fields, search all of them in reverse order
45   * add whiteout (deleted) flag
46   * allow invalid data flag, used when computing extra field size before writing data
47   * new command `ZIP_SOURCE_EXTRA_FIELDS`
48   * no support for multiple copies of same extra field
49 * delete all extra fields during `zip_replace()`
50 * function to copy file from one archive to another
51 * set `O_CLOEXEC` flag after fopen and mkstemp
52 * add append-only mode writing file to disk incrementally to keep memory usage low
53 * `zip_file_set_mtime()`: support InfoZIP time stamps
54
55 * support streaming output (creating new archive to e.g. stdout)
56 * add functions to:
57   * read/set ASCII file flag? (more general options?)
58 * `zip_commit()` (to finish changes without closing archive)
59 * add custom compression function support
60 * `zip_fseek()`
61 * `zip_source_zip()`: allow rewinding
62 * zipcmp: add option for file content comparison
63 * zipcmp: compare bit flags if paranoid
64 * zipcmp: compare external attributes/opsys if paranoid
65 * zipcmp: compare last_mod if paranoid (or with separate flag?)
66 * consistency
67   . for stored files, test compressed = uncompressed
68   . data descriptor
69   . local headers come before central dir
70
71 * support for old compression methods?????
72
73 # Bugs
74
75 * support InfoZIP encryption header extension (copy data descriptor for encrypted files)
76 * ensure that nentries is small enough not to cause overflow (size_t for entry, uint64 for CD on disk)
77 * fix OpenSUSE i686 regression failures
78 * check for limits imposed by format (central dir size, file size, extra fields, ...)
79 * `_zip_u2d_time()`: handle `localtime(3)` failure
80 * POSIX: `zip_open()`: check whether file can be created and fail if not
81 * fix inconsistent usage of valid flags (not checked in many places)
82 * `cdr == NULL` -> `ER_NOENT` vs. `idx > cdir->nentry` -> `ER_INVAL` inconsistent (still there?)
83
84
85 # Cleanup
86
87 * use bool
88 * use `ZIP_SOURCE_SUPPORTS_{READABLE,SEEKABLE,WRITABLE}`
89 * use `zip_source_seek_compute_offset()`
90 * move compat refs from `zipint.h` to own file, and include that in `zipint.h` and `src`
91 * get rid of `zip_get_{compression,encryption}_implementation()`
92 * use `zip_*int*_t` internally
93
94 # Analysis
95
96 * pass through coverity
97
98 # Infrastructure
99
100 * create CMakefile.txt man page linking from links file
101
102 # Test Case Issues
103
104 * unchange on added file
105 * test seek in `zip_source_crc()`
106 * test cases for `set_extra*`, `delete_extra*`, `*extra_field*`
107 * test cases for in memory archives
108   * add
109   * delete
110   * delete all
111   * modify
112 * use gcov output to increase test coverage
113 * merge most tools into ziptool
114 * add test case to change values for newly added files (name, compression method, comment, mtime, . . .)
115 * `zip_open()` file less than `EOCDLEN` bytes long
116 * test calls against old API
117 * run regression tests also from CMake framework
118 * rename file to dir/ and vice versa (fails)
119 * fix comment test to be newline insensitive
120 * check if http://bugs.python.org/issue20078 provides ideas for new tests
121
122 * (add, replace)
123   * add to empty zip
124   * add to existing zip
125   * add w/ existing file name [E]
126   * replace ok
127   * replace w/ illegal index [E]
128   * replace w/ deleted name [E]
129   * unchange added/replaced file
130 * (close)
131   * copy zip file
132   * open copy
133   * rename, delete, replace, add w/ new name, add w/ deleted name
134   * close
135   * zipcmp copy expected
136   * remove copy
137 * (error_get)
138 * (error_get_sys_type)
139 * (error_to_str)
140 * (extra_fields)
141 * (file_error_get)
142 * (file_strerror)
143 * (replace)
144 * (source_buffer)
145 * (source_file)
146 * (source_filep)
147 * (source_free)
148 * (source_function)
149 * (source_zip)
150 * (strerror)
151 * (unchange)
152 * (unchange_all)
153 * open(ZIP_RDONLY)
154 * I/O abstraction layer
155   * zip_open_from_source
156 * read two zip entries interleaved
157
158 # Unsorted
159
160 * `zip_source_file()`: don't allow write if start/len specify a part of the file
161 * script to check if all exported symbols are marked with `ZIP_EXTERN`, add to make distcheck
162
163 * re-implement fix for OS X sandboxing (`zip_archive_set_tempdir()`).
164
165 * document: `zip_source_write()`: length can't be > `ZIP_INT64_MAX`
166 * document: `ZIP_SOURCE_CLOSE` implementation can't return error
167 * keep error codes in man pages in sync
168 * document error codes in new man pages