Likewise for wim_security_data().
#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)
/* Start with the root directory of the image. Note: this will be NULL
* if an image has been added directly with wimlib_add_empty_image() but
* no files have been added yet; in that case we fail with ENOENT. */
- cur_dentry = wim_root_dentry(wim);
+ cur_dentry = wim_get_current_root_dentry(wim);
name_start = path;
for (;;) {
if (ctx->supported_features.security_descriptors &&
inode->i_security_id != -1)
{
- const struct wim_security_data *sd;
+ struct wim_security_data *sd;
const u8 *desc;
size_t desc_size;
- sd = wim_const_security_data(ctx->wim);
+ sd = wim_get_current_security_data(ctx->wim);
desc = sd->descriptors[inode->i_security_id];
desc_size = sd->sizes[inode->i_security_id];
ctx.progress.extract.target = target;
}
- ctx.target_dentry = wim_root_dentry(wim);
+ ctx.target_dentry = wim_get_current_root_dentry(wim);
/* Note: ctx.target_dentry represents the dentry that gets extracted to
* @target. There may be none, in which case it gets set to the image
* root and never matches any of the dentries actually being extracted.
#include "wimlib/wim.h"
static int
-init_wimlib_dentry(struct wimlib_dir_entry *wdentry,
- struct wim_dentry *dentry,
- const WIMStruct *wim,
- int flags)
+init_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry,
+ WIMStruct *wim, int flags)
{
int ret;
size_t dummy;
wdentry->depth++;
if (inode->i_security_id >= 0) {
- const struct wim_security_data *sd = wim_const_security_data(wim);
+ struct wim_security_data *sd;
+
+ sd = wim_get_current_security_data(wim);
wdentry->security_descriptor = sd->descriptors[inode->i_security_id];
wdentry->security_descriptor_size = sd->sizes[inode->i_security_id];
}
if (ret)
goto out;
- ret = init_sd_set(sd_set, wim_security_data(wim));
+ ret = init_sd_set(sd_set, wim_get_current_security_data(wim));
if (ret)
goto out_destroy_inode_table;
struct wim_dentry *root;
int ret;
- root = wim_root_dentry(wim);
+ root = wim_get_current_root_dentry(wim);
if (root == NULL)
goto no_match;