blob: b155d3922b048ceea5a71ffe6451991919179ae9 [file] [log] [blame]
Thomas Klausner88d5df22012-10-06 12:43:48 +02001* libzip API changes
Thomas Klausner87777a42012-07-21 12:10:08 +02002
Thomas Klausner88d5df22012-10-06 12:43:48 +02003This file describes changes in the libzip API and how to adapt your
4code for them.
Thomas Klausner87777a42012-07-21 12:10:08 +02005
Thomas Klausner88d5df22012-10-06 12:43:48 +02006You can define ZIP_DISABLE_DEPRECATED before including <zip.h> to hide
7prototypes for deprecated functions, to find out about functions that
8might be removed at some point.
9
10* 0.11
11
12** new type zip_flags_t
13
14The functions which have flags now use the zip_flags_t type for this.
15All old flags fit; you need code only to adapt if you were saving flags in a
Thomas Klausner87777a42012-07-21 12:10:08 +020016local variable. Use zip_flags_t for such a variable.
Thomas Klausner88d5df22012-10-06 12:43:48 +020017This affects:
18zip_fopen()
19zip_fopen_encrypted()
20zip_fopen_index()
21zip_fopen_index_encrypted()
22zip_get_archive_comment()
23zip_get_archive_flag()
24zip_get_num_entries()
25zip_get_name()
26zip_name_locate()
27zip_set_archive_flag()
28zip_source_zip()
29zip_stat()
30zip_stat_index()
Thomas Klausner87777a42012-07-21 12:10:08 +020031
Thomas Klausner88d5df22012-10-06 12:43:48 +020032*** ZIP_FL_*, ZIP_AFL_*, ZIP_STAT_* are now unsigned constants
Dieter Baronabc6fd72012-07-22 15:49:45 +020033
Thomas Klausner88d5df22012-10-06 12:43:48 +020034To match the new zip_flags_t type.
Thomas Klausner87777a42012-07-21 12:10:08 +020035
Thomas Klausner88d5df22012-10-06 12:43:48 +020036*** zip_add(), zip_add_dir()
Thomas Klausner87777a42012-07-21 12:10:08 +020037
Thomas Klausner88d5df22012-10-06 12:43:48 +020038These functions were replaced with zip_file_add() and zip_dir_add(), respectively,
39to add a flags argument.
Thomas Klausner87777a42012-07-21 12:10:08 +020040
Thomas Klausner88d5df22012-10-06 12:43:48 +020041*** zip_rename(), zip_replace()
Thomas Klausner87777a42012-07-21 12:10:08 +020042
Thomas Klausner88d5df22012-10-06 12:43:48 +020043These functions were replaced with zip_file_rename() and zip_file_replace(),
44respectively, to add a flags argument.
45
46*** zip_get_file_comment()
47
48This function was replaced with zip_file_get_comment(); one argument was promoted from
49int to zip_uint32_t, the other is now a zip_flags_t.
50
51*** zip_set_file_comment()
52
53This function was replaced with zip_file_set_comment(); an argument was promoted from
54int to zip_uint16_t, and a zip_flags_t argument was added.
55
56** integer type size changes
57
58Some argument and return values were not the right size or sign.
59
60*** zip_name_locate()
61
62The return value was int, which can be too small. The function now returns zip_int64_t.
63
64
65*** zip_get_num_entries()
66
67The return type is now signed, to allow signaling errors.
68
69*** zip_set_archive_comment()
70
71The last argument changed from int to zip_uint16_t.
72
73** extra field handling rewritten
74
75The zip_get_file_extra() and zip_set_file_extra() functions were removed.
76They only worked on the whole extra field set.
77
78Instead, you can now set, get, count, and delete each extra field separately,
79using the functions:
80zip_file_extra_field_delete()
81zip_file_extra_field_delete_by_id()
82zip_file_extra_field_get()
83zip_file_extra_field_get_by_id()
84zip_file_extra_fields_count()
85zip_file_extra_fields_count_by_id()
86zip_file_extra_field_set()
87Please read the corresponding man pages for details.
88
89** new functions
90
91*** zip_discard()
92
93The new zip_discard() function closes an archive without committing the
94scheduled changes.
95
96*** zip_set_file_compression()
97
98The new zip_set_file_compression() function allows setting compression
99levels for files.
100
101** argument changes
102
103*** file names
104
105File names arguments are now allowed to be NULL to have an empty file name.
106This mostly affects zip_file_add(), zip_dir_add(), and zip_file_rename().
107
108For zip_get_name(), zip_file_get_comment(), and zip_get_archive_comment(), if
109the file name or comment is empty, a string of length 0 is returned.
110NULL is returned for errors only.
111
112Previously, NULL was returned for empty/unset file names and comments and
113errors, leaving no way to differentiate between the two.
114
115/* Local Variables: */
116/* mode: org */
117/* End: */
Dieter Baronabc6fd72012-07-22 15:49:45 +0200118