]> wimlib.net Git - wimlib/commitdiff
wim_root_dentry() => wim_get_current_root_dentry()
authorEric Biggers <ebiggers3@gmail.com>
Tue, 13 May 2014 16:17:03 +0000 (11:17 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 13 May 2014 16:18:07 +0000 (11:18 -0500)
Likewise for wim_security_data().

include/wimlib/metadata.h
src/dentry.c
src/extract.c
src/iterate_dir.c
src/update_image.c
src/wildcard.c

index 7f1c7c0248b74bcac1ca782376540a274be9b32a..6e4212044d5f730a52e868702ebf17538325dc43 100644 (file)
@@ -46,36 +46,30 @@ 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)
index 13f36ca645e1e20f7ebfb02169a4a544db54d02c..5435a6487e3e6254eced961ef8ad962997234f97 100644 (file)
@@ -649,7 +649,7 @@ get_dentry_utf16le(WIMStruct *wim, const utf16lechar *path,
        /* 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 (;;) {
index 422cd9ccaf4a6ea8298dca84ccd44a4271f722f7..36b6583cae60233f1975bcb34aa6fea36ea321da 100644 (file)
@@ -658,11 +658,11 @@ extract_security(const tchar *path, struct apply_ctx *ctx,
        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];
 
@@ -2472,7 +2472,7 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
                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.
index db43f502d12cb4dbd900ba9f6264cb83db294595..693245e56c03ce2c5543280c4f23fed600d663e8 100644 (file)
 #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;
@@ -70,7 +68,9 @@ init_wimlib_dentry(struct wimlib_dir_entry *wdentry,
                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];
        }
index df0ab99049721bc62d4fa327da33e18d00c1d7b7..a88ccd92a5652e6cacba0360492e8d190fbb7f0a 100644 (file)
@@ -1106,7 +1106,7 @@ execute_update_commands(WIMStruct *wim,
                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;
 
index 234ee91ce72d3eadb6fefc68caf4d654741116c4..958829a2d7e679c3aa0f1b43dc4b16b662e47b7d 100644 (file)
@@ -326,7 +326,7 @@ expand_wildcard(WIMStruct *wim,
        struct wim_dentry *root;
        int ret;
 
-       root = wim_root_dentry(wim);
+       root = wim_get_current_root_dentry(wim);
        if (root == NULL)
                goto no_match;