]> wimlib.net Git - wimlib/blobdiff - include/wimlib.h
Allow retrieving PACKAGE_VERSION from the library
[wimlib] / include / wimlib.h
index ac55fd2c982f939314b85371994c49d0bb862d8a..047716c0338ea9887ca58f5b52127204b70457d1 100644 (file)
 /**
  * @mainpage
  *
- * This is the documentation for the library interface of wimlib 1.10.0, a C
+ * This is the documentation for the library interface of wimlib 1.12.0, a C
  * library for creating, modifying, extracting, and mounting files in the
- * Windows Imaging Format.  This documentation is intended for developers only.
- * If you have installed wimlib and want to know how to use the @b wimlib-imagex
- * program, please see the manual pages and also the <a
+ * Windows Imaging (WIM) format.  This documentation is intended for developers
+ * only.  If you have installed wimlib and want to know how to use the @b
+ * wimlib-imagex program, please see the manual pages and also the <a
  * href="https://wimlib.net/git/?p=wimlib;a=blob;f=README">README file</a>.
  *
  * @section sec_installing Installing
 #define WIMLIB_MAJOR_VERSION 1
 
 /** Minor version of the library (for example, the 2 in 1.2.5). */
-#define WIMLIB_MINOR_VERSION 10
+#define WIMLIB_MINOR_VERSION 12
 
 /** Patch version of the library (for example, the 5 in 1.2.5). */
 #define WIMLIB_PATCH_VERSION 0
@@ -418,15 +418,18 @@ extern "C" {
 #endif
 
 /*
- * To represent file timestamps, wimlib's API uses the POSIX 'struct timespec'.
- * This was probably a mistake because it doesn't play well with Visual Studio.
- * In old VS versions it isn't present at all; in newer VS versions it is
- * supposedly present, but I wouldn't trust it to be the same size as the one
- * MinGW uses.  The solution is to define a compatible structure ourselves when
- * this header is included on Windows and the compiler is not MinGW.
- */
-#if defined(_WIN32) && !defined(__GNUC__)
-typedef struct {
+ * To represent file timestamps, wimlib's API originally used the POSIX 'struct
+ * timespec'.  This was a mistake because when building wimlib for 32-bit
+ * Windows with MinGW we ended up originally using 32-bit time_t which isn't
+ * year 2038-safe, and therefore we had to later add fields like
+ * 'creation_time_high' to hold the high 32 bits of each timestamp.  Moreover,
+ * old Visual Studio versions did not define struct timespec, while newer ones
+ * define it but with 64-bit tv_sec.  So to at least avoid a missing or
+ * incompatible 'struct timespec' definition, define the correct struct
+ * ourselves when this header is included on Windows.
+ */
+#ifdef _WIN32
+struct wimlib_timespec {
        /* Seconds since start of UNIX epoch (January 1, 1970) */
 #ifdef _WIN64
        int64_t tv_sec;
@@ -435,9 +438,9 @@ typedef struct {
 #endif
        /* Nanoseconds (0-999999999) */
        int32_t tv_nsec;
-} wimlib_timespec;
+};
 #else
-#  define wimlib_timespec  struct timespec  /* standard definition */
+#  define wimlib_timespec  timespec  /* standard definition */
 #endif
 
 /**
@@ -1591,13 +1594,13 @@ struct wimlib_dir_entry {
        uint64_t hard_link_group_id;
 
        /** Time this file was created.  */
-       wimlib_timespec creation_time;
+       struct wimlib_timespec creation_time;
 
        /** Time this file was last written to.  */
-       wimlib_timespec last_write_time;
+       struct wimlib_timespec last_write_time;
 
        /** Time this file was last accessed.  */
-       wimlib_timespec last_access_time;
+       struct wimlib_timespec last_access_time;
 
        /** The UNIX user ID of this file.  This is a wimlib extension.
         *
@@ -1626,7 +1629,21 @@ struct wimlib_dir_entry {
         * object_id.object_id is not all zeroes.  */
        struct wimlib_object_id object_id;
 
-       uint64_t reserved[6];
+       /** High 32 bits of the seconds portion of the creation timestamp,
+        * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */
+       int32_t creation_time_high;
+
+       /** High 32 bits of the seconds portion of the last write timestamp,
+        * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */
+       int32_t last_write_time_high;
+
+       /** High 32 bits of the seconds portion of the last access timestamp,
+        * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */
+       int32_t last_access_time_high;
+
+       int32_t reserved2;
+
+       uint64_t reserved[4];
 
        /**
         * Variable-length array of streams that make up this file.
@@ -1711,8 +1728,9 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour
 
 /** UNIX-like systems only: Store the UNIX owner, group, mode, and device ID
  * (major and minor number) of each file.  In addition, capture special files
- * such as device nodes and FIFOs.  See the documentation for the
- * <b>--unix-data</b> option to <b>wimcapture</b> for more information.  */
+ * such as device nodes and FIFOs.  Since wimlib v1.11.0, on Linux also capture
+ * extended attributes.  See the documentation for the <b>--unix-data</b> option
+ * to <b>wimcapture</b> for more information.  */
 #define WIMLIB_ADD_FLAG_UNIX_DATA              0x00000010
 
 /** Do not capture security descriptors.  Only has an effect in NTFS-3G capture
@@ -1904,9 +1922,8 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour
  * wimlib_extract_paths() when passed multiple paths.  */
 #define WIMLIB_EXTRACT_FLAG_NTFS                       0x00000001
 
-/** UNIX-like systems only:  Extract special UNIX data captured with
- * ::WIMLIB_ADD_FLAG_UNIX_DATA.  This flag cannot be combined with
- * ::WIMLIB_EXTRACT_FLAG_NTFS.  */
+/** UNIX-like systems only:  Extract UNIX-specific metadata captured with
+ * ::WIMLIB_ADD_FLAG_UNIX_DATA.  */
 #define WIMLIB_EXTRACT_FLAG_UNIX_DATA                  0x00000020
 
 /** Do not extract security descriptors.  This flag cannot be combined with
@@ -2066,8 +2083,7 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour
  * name, a colon, then the name of the data stream.  */
 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS     0x00000010
 
-/** Use UNIX metadata if available in the WIM image.  See
- * ::WIMLIB_ADD_FLAG_UNIX_DATA.  */
+/** Support UNIX owners, groups, modes, and special files.  */
 #define WIMLIB_MOUNT_FLAG_UNIX_DATA                    0x00000020
 
 /** Allow other users to see the mounted filesystem.  This passes the @c
@@ -2567,6 +2583,8 @@ enum wimlib_error_code {
        WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE           = 87,
        WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED   = 88,
        WIMLIB_ERR_SNAPSHOT_FAILURE                   = 89,
+       WIMLIB_ERR_INVALID_XATTR                      = 90,
+       WIMLIB_ERR_SET_XATTR                          = 91,
 };
 
 
@@ -3255,6 +3273,16 @@ wimlib_get_image_property(const WIMStruct *wim, int image,
 extern uint32_t
 wimlib_get_version(void);
 
+/**
+ * @ingroup G_general
+ *
+ * Since wimlib v1.13.0: like wimlib_get_version(), but returns the full
+ * PACKAGE_VERSION string that was set at build time.  (This allows a beta
+ * release to be distinguished from an official release.)
+ */
+extern const wimlib_tchar *
+wimlib_get_version_string(void);
+
 /**
  * @ingroup G_wim_information
  *