X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fxml.c;h=9b161c2838616f0d5261e18a0e69fd5eca345f82;hb=fd17faf910041fb68e3e025c7f45712d05a23533;hp=65e34a2114db281b4f1af4f97fffb73177ec5f3d;hpb=6461b7e0a98286fa4dca4ede22cdbd07c6240e5d;p=wimlib diff --git a/src/xml.c b/src/xml.c index 65e34a21..9b161c28 100644 --- a/src/xml.c +++ b/src/xml.c @@ -79,7 +79,7 @@ struct image_info { char *display_description; union { char *flags; - struct lookup_table *lookup_table; + struct wim_lookup_table *lookup_table; }; }; @@ -952,9 +952,9 @@ void xml_delete_image(struct wim_info **wim_info_p, int image) destroy_image_info(&wim_info->images[image - 1]); - memcpy(&wim_info->images[image - 1], - &wim_info->images[image], - (wim_info->num_images - image) * sizeof(struct image_info)); + memmove(&wim_info->images[image - 1], + &wim_info->images[image], + (wim_info->num_images - image) * sizeof(struct image_info)); if (--wim_info->num_images == 0) { free_wim_info(wim_info); @@ -988,12 +988,12 @@ void xml_set_memory_allocator(void *(*malloc_func)(size_t), } #endif -static int calculate_dentry_statistics(struct dentry *dentry, void *arg) +static int calculate_dentry_statistics(struct wim_dentry *dentry, void *arg) { struct image_info *info = arg; - struct lookup_table *lookup_table = info->lookup_table; - const struct inode *inode = dentry->d_inode; - struct lookup_table_entry *lte; + struct wim_lookup_table *lookup_table = info->lookup_table; + const struct wim_inode *inode = dentry->d_inode; + struct wim_lookup_table_entry *lte; /* Update directory count and file count. * @@ -1045,12 +1045,12 @@ static int calculate_dentry_statistics(struct dentry *dentry, void *arg) info->hard_link_bytes += wim_resource_size(lte); } - if (inode->link_count >= 2 && dentry_is_first_in_inode(dentry)) { - for (unsigned i = 0; i < inode->num_ads; i++) { - if (inode->ads_entries[i].stream_name_len) { + if (inode->i_nlink >= 2 && dentry_is_first_in_inode(dentry)) { + for (unsigned i = 0; i < inode->i_num_ads; i++) { + if (inode->i_ads_entries[i].stream_name_len) { lte = inode_stream_lte(inode, i + 1, lookup_table); if (lte) { - info->hard_link_bytes += inode->link_count * + info->hard_link_bytes += inode->i_nlink * wim_resource_size(lte); } } @@ -1322,7 +1322,7 @@ int write_xml_data(const struct wim_info *wim_info, int image, FILE *out, encoding_handler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_UTF16LE); if (!encoding_handler) { ERROR("Failed to get XML character encoding handler for UTF-16LE"); - ret = WIMLIB_ERR_CHAR_CONVERSION; + ret = WIMLIB_ERR_LIBXML_UTF16_HANDLER_NOT_AVAILABLE; goto out_cleanup_char_encoding_handlers; }