X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Fmetadata.h;h=680de0c93e6289637cbd1e54c5606b1fc549a0c9;hb=629719b7d5cad7fc6f2eca7ca11cb99100ed8764;hp=31b95cef045f41ddf027fe85f0974f6d2359d08d;hpb=00a775dc256d1fc8254d4f055e362e67f25b66d8;p=wimlib diff --git a/include/wimlib/metadata.h b/include/wimlib/metadata.h index 31b95cef..680de0c9 100644 --- a/include/wimlib/metadata.h +++ b/include/wimlib/metadata.h @@ -9,7 +9,7 @@ struct _ntfs_volume; #endif -/* Metadata for a WIM image */ +/* Metadata for a WIM image */ struct wim_image_metadata { /* Number of WIMStruct's that are sharing this image metadata (from @@ -46,53 +46,42 @@ struct wim_image_metadata { #endif }; +/* Retrieve the metadata of the image in @wim currently selected with + * select_wim_image(). */ static inline struct wim_image_metadata * wim_get_current_image_metadata(WIMStruct *wim) { return wim->image_metadata[wim->current_image - 1]; } -static inline const struct wim_image_metadata * -wim_get_const_current_image_metadata(const WIMStruct *wim) -{ - return wim->image_metadata[wim->current_image - 1]; -} - +/* Retrieve the root dentry of the image in @wim currently selected with + * select_wim_image(). */ static inline struct wim_dentry * -wim_root_dentry(WIMStruct *wim) +wim_get_current_root_dentry(WIMStruct *wim) { return wim_get_current_image_metadata(wim)->root_dentry; } +/* Retrieve the security data of the image in @wim currently selected with + * select_wim_image(). */ static inline struct wim_security_data * -wim_security_data(WIMStruct *wim) +wim_get_current_security_data(WIMStruct *wim) { return wim_get_current_image_metadata(wim)->security_data; } -static inline const struct wim_security_data * -wim_const_security_data(const WIMStruct *wim) -{ - return wim_get_const_current_image_metadata(wim)->security_data; -} - /* Iterate over each inode in a WIM image that has not yet been hashed */ #define image_for_each_inode(inode, imd) \ - list_for_each_entry(inode, &imd->inode_list, i_list) + list_for_each_entry(inode, &(imd)->inode_list, i_list) /* Iterate over each stream in a WIM image that has not yet been hashed */ #define image_for_each_unhashed_stream(lte, imd) \ - list_for_each_entry(lte, &imd->unhashed_streams, unhashed_list) + list_for_each_entry(lte, &(imd)->unhashed_streams, unhashed_list) /* Iterate over each stream in a WIM image that has not yet been hashed (safe * against stream removal) */ #define image_for_each_unhashed_stream_safe(lte, tmp, imd) \ - list_for_each_entry_safe(lte, tmp, &imd->unhashed_streams, unhashed_list) - -extern void -destroy_image_metadata(struct wim_image_metadata *imd, - struct wim_lookup_table *table, - bool free_metadata_lte); + list_for_each_entry_safe(lte, tmp, &(imd)->unhashed_streams, unhashed_list) extern void put_image_metadata(struct wim_image_metadata *imd, @@ -102,10 +91,6 @@ extern int append_image_metadata(WIMStruct *wim, struct wim_image_metadata *imd); extern struct wim_image_metadata * -new_image_metadata(void); - -extern struct wim_image_metadata ** -new_image_metadata_array(unsigned num_images); - +new_image_metadata(void) _malloc_attribute; #endif /* _WIMLIB_METADATA_H */