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