]> wimlib.net Git - wimlib/blobdiff - src/wimlib_internal.h
Refactor some code into maybe_apply_dentry()
[wimlib] / src / wimlib_internal.h
index 9d25e1e9c34e4b5c5087da5decedcab9ed4646d8..99b2a5aabb0646b6bb98bfeea189970fabaf77cb 100644 (file)
 #include <pthread.h>
 #endif
 
+#define WIMLIB_MAKEVERSION(major, minor, patch) \
+       ((major << 20) | (minor << 10) | patch)
+
+
+#define WIMLIB_VERSION_CODE \
+               WIMLIB_MAKEVERSION(WIMLIB_MAJOR_VERSION,\
+                                  WIMLIB_MINOR_VERSION,\
+                                  WIMLIB_PATCH_VERSION)
+
+#define WIMLIB_GET_PATCH_VERSION(version) \
+       ((version >> 0) & ((1 << 10) - 1))
+#define WIMLIB_GET_MINOR_VERSION(version) \
+       ((version >> 10) & ((1 << 10) - 1))
+#define WIMLIB_GET_MAJOR_VERSION(version) \
+       ((version >> 20) & ((1 << 10) - 1))
+
+
 struct stat;
 struct dentry;
 struct inode;
@@ -300,6 +317,7 @@ struct WIMStruct {
        u8 deletion_occurred : 1;
        u8 all_images_verified : 1;
        u8 full_verification_in_progress : 1;
+       u8 wim_locked : 1;
 };
 
 /* Inline utility functions for WIMStructs. */
@@ -416,6 +434,7 @@ struct apply_args {
 #endif
        struct list_head empty_files;
        wimlib_progress_func_t progress_func;
+       int (*apply_dentry)(struct dentry *, void *);
 };
 
 extern int apply_dentry_ntfs(struct dentry *dentry, void *arg);
@@ -526,9 +545,9 @@ extern int finish_write(WIMStruct *w, int image, int write_flags,
                        wimlib_progress_func_t progress_func);
 
 #if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK)
-extern int lock_wim(FILE *fp, const char *path);
+extern int lock_wim(WIMStruct *w, FILE *fp);
 #else
-static inline int lock_wim(FILE *fp, const char *path)
+static inline int lock_wim(WIMStruct *w, FILE *fp)
 {
        return 0;
 }