]> wimlib.net Git - wimlib/blobdiff - src/wimlib_internal.h
imagex unmount --rebuild
[wimlib] / src / wimlib_internal.h
index 9d25e1e9c34e4b5c5087da5decedcab9ed4646d8..c2457b9ac51e254ce72fdff8f25e4b89a935c55f 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. */
@@ -526,9 +544,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;
 }