]> wimlib.net Git - wimlib/blobdiff - src/iterate_dir.c
lzx_compress: optimize storing information in lzx_sequence
[wimlib] / src / iterate_dir.c
index c5f5dad7d7946e7e8b1aa465670ec52c6bde84fc..e4eb87d7875d0c92dcbf02bdb064997df19f4240 100644 (file)
@@ -50,12 +50,11 @@ stream_to_wimlib_stream_entry(const struct wim_inode *inode,
        const u8 *hash;
 
        if (stream_is_named(strm)) {
-               size_t dummy;
                int ret;
 
                ret = utf16le_get_tstr(strm->stream_name,
                                       utf16le_len_bytes(strm->stream_name),
-                                      &wstream->stream_name, &dummy);
+                                      &wstream->stream_name, NULL);
                if (ret)
                        return ret;
        }
@@ -87,7 +86,6 @@ init_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry,
                   WIMStruct *wim, int flags)
 {
        int ret;
-       size_t dummy;
        const struct wim_inode *inode = dentry->d_inode;
        const struct wim_inode_stream *strm;
        struct wimlib_unix_data unix_data;
@@ -95,12 +93,12 @@ init_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry,
        u32 object_id_len;
 
        ret = utf16le_get_tstr(dentry->d_name, dentry->d_name_nbytes,
-                              &wdentry->filename, &dummy);
+                              &wdentry->filename, NULL);
        if (ret)
                return ret;
 
        ret = utf16le_get_tstr(dentry->d_short_name, dentry->d_short_name_nbytes,
-                              &wdentry->dos_name, &dummy);
+                              &wdentry->dos_name, NULL);
        if (ret)
                return ret;
 
@@ -123,9 +121,19 @@ init_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry,
        wdentry->num_links = inode->i_nlink;
        wdentry->attributes = inode->i_attributes;
        wdentry->hard_link_group_id = inode->i_ino;
+
+       /* For Windows builds, to maintain ABI compatibility with previous
+        * versions of the DLLs, double-check that we're using the expected size
+        * for 'struct timespec'. */
+#ifdef _WIN64
+       STATIC_ASSERT(sizeof(struct timespec) == 16);
+#elif defined(_WIN32)
+       STATIC_ASSERT(sizeof(struct timespec) == 8);
+#endif
        wdentry->creation_time = wim_timestamp_to_timespec(inode->i_creation_time);
        wdentry->last_write_time = wim_timestamp_to_timespec(inode->i_last_write_time);
        wdentry->last_access_time = wim_timestamp_to_timespec(inode->i_last_access_time);
+
        if (inode_get_unix_data(inode, &unix_data)) {
                wdentry->unix_uid = unix_data.uid;
                wdentry->unix_gid = unix_data.gid;
@@ -208,22 +216,12 @@ do_iterate_dir_tree(WIMStruct *wim,
                struct wim_dentry *child;
 
                ret = 0;
-               if (default_ignore_case) {
-                       for_dentry_child_case_insensitive(child, dentry) {
-                               ret = do_iterate_dir_tree(wim, child,
-                                                         flags & ~WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN,
-                                                         cb, user_ctx);
-                               if (ret)
-                                       break;
-                       }
-               } else {
-                       for_dentry_child(child, dentry) {
-                               ret = do_iterate_dir_tree(wim, child,
-                                                         flags & ~WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN,
-                                                         cb, user_ctx);
-                               if (ret)
-                                       break;
-                       }
+               for_dentry_child(child, dentry) {
+                       ret = do_iterate_dir_tree(wim, child,
+                                                 flags & ~WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN,
+                                                 cb, user_ctx);
+                       if (ret)
+                               break;
                }
        }
 out_free_wimlib_dentry: