wimlib
wimlib.h
Go to the documentation of this file.
1 
389 #ifndef _WIMLIB_H
390 #define _WIMLIB_H
391 
392 #include <stdio.h>
393 #include <stddef.h>
394 #ifndef __cplusplus
395 # if defined(_MSC_VER) && _MSC_VER < 1800 /* VS pre-2013? */
396  typedef unsigned char bool;
397 # else
398 # include <stdbool.h>
399 # endif
400 #endif
401 #include <stdint.h>
402 #include <time.h>
403 
408 #define WIMLIB_MAJOR_VERSION 1
409 
411 #define WIMLIB_MINOR_VERSION 11
412 
414 #define WIMLIB_PATCH_VERSION 0
415 
416 #ifdef __cplusplus
417 extern "C" {
418 #endif
419 
420 /*
421  * To represent file timestamps, wimlib's API uses the POSIX 'struct timespec'.
422  * This was probably a mistake because it doesn't play well with Visual Studio.
423  * In old VS versions it isn't present at all; in newer VS versions it is
424  * supposedly present, but I wouldn't trust it to be the same size as the one
425  * MinGW uses. The solution is to define a compatible structure ourselves when
426  * this header is included on Windows and the compiler is not MinGW.
427  */
428 #if defined(_WIN32) && !defined(__GNUC__)
429 typedef struct {
430  /* Seconds since start of UNIX epoch (January 1, 1970) */
431 #ifdef _WIN64
432  int64_t tv_sec;
433 #else
434  int32_t tv_sec;
435 #endif
436  /* Nanoseconds (0-999999999) */
437  int32_t tv_nsec;
439 #else
440 # define wimlib_timespec struct timespec /* standard definition */
441 #endif
442 
447 #ifndef WIMLIB_WIMSTRUCT_DECLARED
448 typedef struct WIMStruct WIMStruct;
449 #define WIMLIB_WIMSTRUCT_DECLARED
450 #endif
451 
452 #ifdef _WIN32
453 typedef wchar_t wimlib_tchar;
454 #else
455 
456 typedef char wimlib_tchar;
457 #endif
458 
459 #ifdef _WIN32
460 
462 # define WIMLIB_WIM_PATH_SEPARATOR '\\'
463 # define WIMLIB_WIM_PATH_SEPARATOR_STRING L"\\"
464 #else
465 
467 # define WIMLIB_WIM_PATH_SEPARATOR '/'
468 # define WIMLIB_WIM_PATH_SEPARATOR_STRING "/"
469 #endif
470 
473 #define WIMLIB_WIM_ROOT_PATH WIMLIB_WIM_PATH_SEPARATOR_STRING
474 
477 #define WIMLIB_IS_WIM_ROOT_PATH(path) \
478  ((path)[0] == WIMLIB_WIM_PATH_SEPARATOR && \
479  (path)[1] == 0)
480 
482 #define WIMLIB_GUID_LEN 16
483 
503 
523 
545 
568 };
569 
577 
583 
590 
598 
603 
607 
615 
620 
625 
632 
638 
644 
651 
655 
660 
667 
674 
680 
685 
689 
695 
701 
708 
716 
720 
726 
730 
735 
739 
753 
775 };
776 
784 
788 
792 };
793 
801 
806 
812  uint64_t total_bytes;
813 
820  uint64_t total_streams;
821 
826  uint64_t completed_bytes;
827 
832 
835  uint32_t num_threads;
836 
840 
844  uint32_t total_parts;
845 
847  uint32_t completed_parts;
848  } write_streams;
849 
854 
859  const wimlib_tchar *source;
860 
865  const wimlib_tchar *cur_path;
866 
869  enum {
871  WIMLIB_SCAN_DENTRY_OK = 0,
872 
875  WIMLIB_SCAN_DENTRY_EXCLUDED = 1,
876 
879  WIMLIB_SCAN_DENTRY_UNSUPPORTED = 2,
880 
887  WIMLIB_SCAN_DENTRY_FIXED_SYMLINK = 3,
888 
893  WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK = 4,
894  } status;
895 
896  union {
900  const wimlib_tchar *wim_target_path;
901 
906  const wimlib_tchar *symlink_target;
907  };
908 
912 
916 
920  } scan;
921 
942 
945  uint32_t image;
946 
948  uint32_t extract_flags;
949 
953  const wimlib_tchar *wimfile_name;
954 
957  const wimlib_tchar *image_name;
958 
961  const wimlib_tchar *target;
962 
964  const wimlib_tchar *reserved;
965 
967  uint64_t total_bytes;
968 
971  uint64_t completed_bytes;
972 
977  uint64_t total_streams;
978 
982 
985  uint32_t part_number;
986 
989  uint32_t total_parts;
990 
993  uint8_t guid[WIMLIB_GUID_LEN];
994 
1001 
1018  uint64_t end_file_count;
1019  } extract;
1020 
1024  const wimlib_tchar *from;
1025 
1028  const wimlib_tchar *to;
1029  } rename;
1030 
1037 
1041 
1045  } update;
1046 
1050 
1053  uint64_t total_bytes;
1054 
1058 
1061  uint32_t total_chunks;
1062 
1066 
1069  uint32_t chunk_size;
1070 
1073  const wimlib_tchar *filename;
1074  } integrity;
1075 
1081  uint64_t total_bytes;
1082 
1087 
1092 
1094  unsigned total_parts;
1095 
1103  wimlib_tchar *part_name;
1104  } split;
1105 
1109  const wimlib_tchar *path_in_wim;
1110  } replace;
1111 
1115  const wimlib_tchar *path_in_wim;
1116 
1118  const wimlib_tchar *extraction_path;
1119  } wimboot_exclude;
1120 
1124  const wimlib_tchar *mountpoint;
1125 
1127  const wimlib_tchar *mounted_wim;
1128 
1130  uint32_t mounted_image;
1131 
1134  uint32_t mount_flags;
1135 
1137  uint32_t unmount_flags;
1138  } unmount;
1139 
1160  const wimlib_tchar *path_to_file;
1161  } done_with_file;
1162 
1166  const wimlib_tchar *wimfile;
1167  uint32_t total_images;
1168  uint32_t current_image;
1169  } verify_image;
1170 
1173  const wimlib_tchar *wimfile;
1174  uint64_t total_streams;
1175  uint64_t total_bytes;
1178  } verify_streams;
1179 
1182 
1195  const wimlib_tchar *path;
1196 
1205 
1208 
1211  const wimlib_tchar *path;
1212 
1215 
1222  } handle_error;
1223 };
1224 
1243 typedef enum wimlib_progress_status
1245  union wimlib_progress_info *info,
1246  void *progctx);
1247 
1257  wimlib_tchar *fs_source_path;
1258 
1261  wimlib_tchar *wim_target_path;
1262 
1264  long reserved;
1265 };
1266 
1277 #define WIMLIB_CHANGE_READONLY_FLAG 0x00000001
1278 
1281 #define WIMLIB_CHANGE_GUID 0x00000002
1282 
1285 #define WIMLIB_CHANGE_BOOT_INDEX 0x00000004
1286 
1293 #define WIMLIB_CHANGE_RPFIX_FLAG 0x00000008
1294 
1309 
1312  uint8_t guid[WIMLIB_GUID_LEN];
1313 
1315  uint32_t image_count;
1316 
1319  uint32_t boot_index;
1320 
1322  uint32_t wim_version;
1323 
1326  uint32_t chunk_size;
1327 
1330  uint16_t part_number;
1331 
1334  uint16_t total_parts;
1335 
1339 
1342  uint64_t total_bytes;
1343 
1345  uint32_t has_integrity_table : 1;
1346 
1349  uint32_t opened_from_file : 1;
1350 
1354  uint32_t is_readonly : 1;
1355 
1357  uint32_t has_rpfix : 1;
1358 
1360  uint32_t is_marked_readonly : 1;
1361 
1363  uint32_t spanned : 1;
1364 
1366  uint32_t write_in_progress : 1;
1367 
1369  uint32_t metadata_only : 1;
1370 
1372  uint32_t resource_only : 1;
1373 
1375  uint32_t pipable : 1;
1376  uint32_t reserved_flags : 22;
1377  uint32_t reserved[9];
1378 };
1379 
1411 
1415 
1419 
1424  uint64_t offset;
1425 
1427  uint8_t sha1_hash[20];
1428 
1431  uint32_t part_number;
1432 
1437 
1440  uint32_t is_compressed : 1;
1441 
1443  uint32_t is_metadata : 1;
1444 
1445  uint32_t is_free : 1;
1446  uint32_t is_spanned : 1;
1447 
1451  uint32_t is_missing : 1;
1452 
1454  uint32_t packed : 1;
1455 
1456  uint32_t reserved_flags : 26;
1457 
1461 
1465 
1469 
1470  uint64_t reserved[1];
1471 };
1472 
1485 
1487  const wimlib_tchar *stream_name;
1488 
1490  struct wimlib_resource_entry resource;
1491 
1492  uint64_t reserved[4];
1493 };
1494 
1501  uint8_t object_id[WIMLIB_GUID_LEN];
1502  uint8_t birth_volume_id[WIMLIB_GUID_LEN];
1503  uint8_t birth_object_id[WIMLIB_GUID_LEN];
1504  uint8_t domain_id[WIMLIB_GUID_LEN];
1505 };
1506 
1514  const wimlib_tchar *filename;
1515 
1518  const wimlib_tchar *dos_name;
1519 
1522  const wimlib_tchar *full_path;
1523 
1526  size_t depth;
1527 
1531  const char *security_descriptor;
1532 
1535 
1536 #define WIMLIB_FILE_ATTRIBUTE_READONLY 0x00000001
1537 #define WIMLIB_FILE_ATTRIBUTE_HIDDEN 0x00000002
1538 #define WIMLIB_FILE_ATTRIBUTE_SYSTEM 0x00000004
1539 #define WIMLIB_FILE_ATTRIBUTE_DIRECTORY 0x00000010
1540 #define WIMLIB_FILE_ATTRIBUTE_ARCHIVE 0x00000020
1541 #define WIMLIB_FILE_ATTRIBUTE_DEVICE 0x00000040
1542 #define WIMLIB_FILE_ATTRIBUTE_NORMAL 0x00000080
1543 #define WIMLIB_FILE_ATTRIBUTE_TEMPORARY 0x00000100
1544 #define WIMLIB_FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
1545 #define WIMLIB_FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
1546 #define WIMLIB_FILE_ATTRIBUTE_COMPRESSED 0x00000800
1547 #define WIMLIB_FILE_ATTRIBUTE_OFFLINE 0x00001000
1548 #define WIMLIB_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
1549 #define WIMLIB_FILE_ATTRIBUTE_ENCRYPTED 0x00004000
1550 #define WIMLIB_FILE_ATTRIBUTE_VIRTUAL 0x00010000
1551 
1555  uint32_t attributes;
1556 
1557 #define WIMLIB_REPARSE_TAG_RESERVED_ZERO 0x00000000
1558 #define WIMLIB_REPARSE_TAG_RESERVED_ONE 0x00000001
1559 #define WIMLIB_REPARSE_TAG_MOUNT_POINT 0xA0000003
1560 #define WIMLIB_REPARSE_TAG_HSM 0xC0000004
1561 #define WIMLIB_REPARSE_TAG_HSM2 0x80000006
1562 #define WIMLIB_REPARSE_TAG_DRIVER_EXTENDER 0x80000005
1563 #define WIMLIB_REPARSE_TAG_SIS 0x80000007
1564 #define WIMLIB_REPARSE_TAG_DFS 0x8000000A
1565 #define WIMLIB_REPARSE_TAG_DFSR 0x80000012
1566 #define WIMLIB_REPARSE_TAG_FILTER_MANAGER 0x8000000B
1567 #define WIMLIB_REPARSE_TAG_WOF 0x80000017
1568 #define WIMLIB_REPARSE_TAG_SYMLINK 0xA000000C
1569 
1573  uint32_t reparse_tag;
1574 
1579  uint32_t num_links;
1580 
1583 
1592 
1595 
1598 
1601 
1605  uint32_t unix_uid;
1606 
1610  uint32_t unix_gid;
1611 
1617  uint32_t unix_mode;
1618 
1623  uint32_t unix_rdev;
1624 
1625  /* The object ID of this file, if any. Only valid if
1626  * object_id.object_id is not all zeroes. */
1628 
1629  uint64_t reserved[6];
1630 
1645  struct wimlib_stream_entry streams[];
1646 };
1647 
1652 typedef int (*wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry,
1653  void *user_ctx);
1654 
1660  void *user_ctx);
1661 
1664 #define WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE 0x00000001
1665 
1668 #define WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN 0x00000002
1669 
1675 #define WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED 0x00000004
1676 
1677 
1691 #define WIMLIB_ADD_FLAG_NTFS 0x00000001
1692 
1695 #define WIMLIB_ADD_FLAG_DEREFERENCE 0x00000002
1696 
1700 #define WIMLIB_ADD_FLAG_VERBOSE 0x00000004
1701 
1710 #define WIMLIB_ADD_FLAG_BOOT 0x00000008
1711 
1717 #define WIMLIB_ADD_FLAG_UNIX_DATA 0x00000010
1718 
1721 #define WIMLIB_ADD_FLAG_NO_ACLS 0x00000020
1722 
1728 #define WIMLIB_ADD_FLAG_STRICT_ACLS 0x00000040
1729 
1734 #define WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE 0x00000080
1735 
1743 #define WIMLIB_ADD_FLAG_RPFIX 0x00000100
1744 
1746 #define WIMLIB_ADD_FLAG_NORPFIX 0x00000200
1747 
1752 #define WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE 0x00000400
1753 
1769 #define WIMLIB_ADD_FLAG_WINCONFIG 0x00000800
1770 
1799 #define WIMLIB_ADD_FLAG_WIMBOOT 0x00001000
1800 
1807 #define WIMLIB_ADD_FLAG_NO_REPLACE 0x00002000
1808 
1816 #define WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION 0x00004000
1817 
1828 #define WIMLIB_ADD_FLAG_SNAPSHOT 0x00008000
1829 
1838 #define WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED 0x00010000
1839 
1845 #define WIMLIB_DELETE_FLAG_FORCE 0x00000001
1846 
1849 #define WIMLIB_DELETE_FLAG_RECURSIVE 0x00000002
1850 
1861 #define WIMLIB_EXPORT_FLAG_BOOT 0x00000001
1862 
1866 #define WIMLIB_EXPORT_FLAG_NO_NAMES 0x00000002
1867 
1869 #define WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS 0x00000004
1870 
1874 #define WIMLIB_EXPORT_FLAG_GIFT 0x00000008
1875 
1891 #define WIMLIB_EXPORT_FLAG_WIMBOOT 0x00000010
1892 
1906 #define WIMLIB_EXTRACT_FLAG_NTFS 0x00000001
1907 
1910 #define WIMLIB_EXTRACT_FLAG_UNIX_DATA 0x00000020
1911 
1914 #define WIMLIB_EXTRACT_FLAG_NO_ACLS 0x00000040
1915 
1925 #define WIMLIB_EXTRACT_FLAG_STRICT_ACLS 0x00000080
1926 
1935 #define WIMLIB_EXTRACT_FLAG_RPFIX 0x00000100
1936 
1940 #define WIMLIB_EXTRACT_FLAG_NORPFIX 0x00000200
1941 
1944 #define WIMLIB_EXTRACT_FLAG_TO_STDOUT 0x00000400
1945 
1955 #define WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES 0x00000800
1956 
1965 #define WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS 0x00001000
1966 
1970 #define WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS 0x00002000
1971 
1974 #define WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES 0x00004000
1975 
1980 #define WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS 0x00008000
1981 
1995 #define WIMLIB_EXTRACT_FLAG_GLOB_PATHS 0x00040000
1996 
2000 #define WIMLIB_EXTRACT_FLAG_STRICT_GLOB 0x00080000
2001 
2007 #define WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES 0x00100000
2008 
2015 #define WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE 0x00200000
2016 
2023 #define WIMLIB_EXTRACT_FLAG_WIMBOOT 0x00400000
2024 
2033 #define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K 0x01000000
2034 
2037 #define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K 0x02000000
2038 
2041 #define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K 0x04000000
2042 
2045 #define WIMLIB_EXTRACT_FLAG_COMPACT_LZX 0x08000000
2046 
2052 #define WIMLIB_MOUNT_FLAG_READWRITE 0x00000001
2053 
2055 #define WIMLIB_MOUNT_FLAG_DEBUG 0x00000002
2056 
2058 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE 0x00000004
2059 
2063 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR 0x00000008
2064 
2067 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS 0x00000010
2068 
2070 #define WIMLIB_MOUNT_FLAG_UNIX_DATA 0x00000020
2071 
2074 #define WIMLIB_MOUNT_FLAG_ALLOW_OTHER 0x00000040
2075 
2086 #define WIMLIB_OPEN_FLAG_CHECK_INTEGRITY 0x00000001
2087 
2091 #define WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT 0x00000002
2092 
2101 #define WIMLIB_OPEN_FLAG_WRITE_ACCESS 0x00000004
2102 
2109 #define WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY 0x00000001
2110 
2113 #define WIMLIB_UNMOUNT_FLAG_COMMIT 0x00000002
2114 
2117 #define WIMLIB_UNMOUNT_FLAG_REBUILD 0x00000004
2118 
2121 #define WIMLIB_UNMOUNT_FLAG_RECOMPRESS 0x00000008
2122 
2131 #define WIMLIB_UNMOUNT_FLAG_FORCE 0x00000010
2132 
2137 #define WIMLIB_UNMOUNT_FLAG_NEW_IMAGE 0x00000020
2138 
2145 #define WIMLIB_UPDATE_FLAG_SEND_PROGRESS 0x00000001
2146 
2159 #define WIMLIB_WRITE_FLAG_CHECK_INTEGRITY 0x00000001
2160 
2166 #define WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY 0x00000002
2167 
2180 #define WIMLIB_WRITE_FLAG_PIPABLE 0x00000004
2181 
2186 #define WIMLIB_WRITE_FLAG_NOT_PIPABLE 0x00000008
2187 
2213 #define WIMLIB_WRITE_FLAG_RECOMPRESS 0x00000010
2214 
2228 #define WIMLIB_WRITE_FLAG_FSYNC 0x00000020
2229 
2242 #define WIMLIB_WRITE_FLAG_REBUILD 0x00000040
2243 
2253 #define WIMLIB_WRITE_FLAG_SOFT_DELETE 0x00000080
2254 
2264 #define WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG 0x00000100
2265 
2272 #define WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS 0x00000200
2273 
2275 #define WIMLIB_WRITE_FLAG_STREAMS_OK 0x00000400
2276 
2283 #define WIMLIB_WRITE_FLAG_RETAIN_GUID 0x00000800
2284 
2320 #define WIMLIB_WRITE_FLAG_SOLID 0x00001000
2321 
2327 #define WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES 0x00002000
2328 
2334 #define WIMLIB_WRITE_FLAG_NO_SOLID_SORT 0x00004000
2335 
2352 #define WIMLIB_WRITE_FLAG_UNSAFE_COMPACT 0x00008000
2353 
2359 #define WIMLIB_INIT_FLAG_ASSUME_UTF8 0x00000001
2360 
2369 #define WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES 0x00000002
2370 
2376 #define WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES 0x00000004
2377 
2383 #define WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES 0x00000008
2384 
2387 #define WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE 0x00000010
2388 
2391 #define WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE 0x00000020
2392 
2399 #define WIMLIB_REF_FLAG_GLOB_ENABLE 0x00000001
2400 
2408 #define WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH 0x00000002
2409 
2418 
2421 
2424 };
2425 
2429  wimlib_tchar *fs_source_path;
2430 
2433  wimlib_tchar *wim_target_path;
2434 
2437  wimlib_tchar *config_file;
2438 
2441 };
2442 
2445 
2447  wimlib_tchar *wim_path;
2448 
2451 };
2452 
2455 
2457  wimlib_tchar *wim_source_path;
2458 
2460  wimlib_tchar *wim_target_path;
2461 
2464 };
2465 
2468 
2470 
2471  union {
2473  struct wimlib_delete_command delete_; /* Underscore is for C++
2474  compatibility. */
2476  };
2477 };
2478 
2571 };
2572 
2573 
2575 #define WIMLIB_NO_IMAGE 0
2576 
2578 #define WIMLIB_ALL_IMAGES (-1)
2579 
2610 extern int
2612  const wimlib_tchar *name,
2613  int *new_idx_ret);
2614 
2666 extern int
2668  const wimlib_tchar *source,
2669  const wimlib_tchar *name,
2670  const wimlib_tchar *config_file,
2671  int add_flags);
2672 
2683 extern int
2685  const struct wimlib_capture_source *sources,
2686  size_t num_sources,
2687  const wimlib_tchar *name,
2688  const wimlib_tchar *config_file,
2689  int add_flags);
2690 
2700 extern int
2701 wimlib_add_tree(WIMStruct *wim, int image,
2702  const wimlib_tchar *fs_source_path,
2703  const wimlib_tchar *wim_target_path, int add_flags);
2704 
2733 extern int
2735 
2764 extern int
2765 wimlib_delete_image(WIMStruct *wim, int image);
2766 
2775 extern int
2776 wimlib_delete_path(WIMStruct *wim, int image,
2777  const wimlib_tchar *path, int delete_flags);
2778 
2847 extern int
2848 wimlib_export_image(WIMStruct *src_wim, int src_image,
2849  WIMStruct *dest_wim,
2850  const wimlib_tchar *dest_name,
2851  const wimlib_tchar *dest_description,
2852  int export_flags);
2853 
2966 extern int
2967 wimlib_extract_image(WIMStruct *wim, int image,
2968  const wimlib_tchar *target, int extract_flags);
2969 
3008 extern int
3009 wimlib_extract_image_from_pipe(int pipe_fd,
3010  const wimlib_tchar *image_num_or_name,
3011  const wimlib_tchar *target, int extract_flags);
3012 
3022 extern int
3024  const wimlib_tchar *image_num_or_name,
3025  const wimlib_tchar *target,
3026  int extract_flags,
3027  wimlib_progress_func_t progfunc,
3028  void *progctx);
3029 
3046 extern int
3047 wimlib_extract_pathlist(WIMStruct *wim, int image,
3048  const wimlib_tchar *target,
3049  const wimlib_tchar *path_list_file,
3050  int extract_flags);
3051 
3121 extern int
3123  int image,
3124  const wimlib_tchar *target,
3125  const wimlib_tchar * const *paths,
3126  size_t num_paths,
3127  int extract_flags);
3128 
3143 extern int
3144 wimlib_extract_xml_data(WIMStruct *wim, FILE *fp);
3145 
3158 extern void
3159 wimlib_free(WIMStruct *wim);
3160 
3174 extern const wimlib_tchar *
3176 
3190 extern const wimlib_tchar *
3192 
3199 extern const wimlib_tchar *
3200 wimlib_get_image_description(const WIMStruct *wim, int image);
3201 
3210 extern const wimlib_tchar *
3211 wimlib_get_image_name(const WIMStruct *wim, int image);
3212 
3241 extern const wimlib_tchar *
3242 wimlib_get_image_property(const WIMStruct *wim, int image,
3243  const wimlib_tchar *property_name);
3244 
3256 extern uint32_t
3257 wimlib_get_version(void);
3258 
3273 extern int
3274 wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info);
3275 
3303 extern int
3304 wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret);
3305 
3324 extern int
3325 wimlib_global_init(int init_flags);
3326 
3333 extern void
3334 wimlib_global_cleanup(void);
3335 
3352 extern bool
3353 wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name);
3354 
3399 extern int
3400 wimlib_iterate_dir_tree(WIMStruct *wim, int image, const wimlib_tchar *path,
3401  int flags,
3402  wimlib_iterate_dir_tree_callback_t cb, void *user_ctx);
3403 
3433 extern int
3434 wimlib_iterate_lookup_table(WIMStruct *wim, int flags,
3436  void *user_ctx);
3437 
3474 extern int
3475 wimlib_join(const wimlib_tchar * const *swms,
3476  unsigned num_swms,
3477  const wimlib_tchar *output_path,
3478  int swm_open_flags,
3479  int wim_write_flags);
3480 
3492 extern int
3493 wimlib_join_with_progress(const wimlib_tchar * const *swms,
3494  unsigned num_swms,
3495  const wimlib_tchar *output_path,
3496  int swm_open_flags,
3497  int wim_write_flags,
3498  wimlib_progress_func_t progfunc,
3499  void *progctx);
3500 
3501 
3577 extern int
3579  int image,
3580  const wimlib_tchar *dir,
3581  int mount_flags,
3582  const wimlib_tchar *staging_dir);
3583 
3653 extern int
3654 wimlib_open_wim(const wimlib_tchar *wim_file,
3655  int open_flags,
3656  WIMStruct **wim_ret);
3657 
3669 extern int
3670 wimlib_open_wim_with_progress(const wimlib_tchar *wim_file,
3671  int open_flags,
3672  WIMStruct **wim_ret,
3673  wimlib_progress_func_t progfunc,
3674  void *progctx);
3675 
3735 extern int
3736 wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads);
3737 
3758 extern void
3759 wimlib_print_available_images(const WIMStruct *wim, int image);
3760 
3766 extern void
3767 wimlib_print_header(const WIMStruct *wim);
3768 
3810 extern int
3812  const wimlib_tchar * const *resource_wimfiles_or_globs,
3813  unsigned count,
3814  int ref_flags,
3815  int open_flags);
3816 
3837 extern int
3838 wimlib_reference_resources(WIMStruct *wim, WIMStruct **resource_wims,
3839  unsigned num_resource_wims, int ref_flags);
3840 
3903 extern int
3904 wimlib_reference_template_image(WIMStruct *wim, int new_image,
3905  WIMStruct *template_wim, int template_image,
3906  int flags);
3907 
3923 extern void
3925  wimlib_progress_func_t progfunc,
3926  void *progctx);
3927 
3937 extern int
3938 wimlib_rename_path(WIMStruct *wim, int image,
3939  const wimlib_tchar *source_path, const wimlib_tchar *dest_path);
3940 
3971 extern int
3973  const wimlib_tchar *image_name_or_num);
3974 
3992 extern int
3993 wimlib_set_error_file(FILE *fp);
3994 
4011 extern int
4012 wimlib_set_error_file_by_name(const wimlib_tchar *path);
4013 
4022 extern int
4023 wimlib_set_image_descripton(WIMStruct *wim, int image,
4024  const wimlib_tchar *description);
4025 
4033 extern int
4034 wimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags);
4035 
4042 extern int
4043 wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name);
4044 
4082 extern int
4083 wimlib_set_image_property(WIMStruct *wim, int image,
4084  const wimlib_tchar *property_name,
4085  const wimlib_tchar *property_value);
4086 
4115 extern int
4116 wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
4117  void (*free_func)(void *),
4118  void *(*realloc_func)(void *, size_t));
4119 
4145 extern int
4146 wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size);
4147 
4154 extern int
4155 wimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size);
4156 
4176 extern int
4178  enum wimlib_compression_type ctype);
4179 
4186 extern int
4188  enum wimlib_compression_type ctype);
4189 
4212 extern int
4213 wimlib_set_print_errors(bool show_messages);
4214 
4238 extern int
4239 wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info,
4240  int which);
4241 
4280 extern int
4281 wimlib_split(WIMStruct *wim,
4282  const wimlib_tchar *swm_name,
4283  uint64_t part_size,
4284  int write_flags);
4285 
4323 extern int
4324 wimlib_verify_wim(WIMStruct *wim, int verify_flags);
4325 
4359 extern int
4360 wimlib_unmount_image(const wimlib_tchar *dir, int unmount_flags);
4361 
4370 extern int
4371 wimlib_unmount_image_with_progress(const wimlib_tchar *dir,
4372  int unmount_flags,
4373  wimlib_progress_func_t progfunc,
4374  void *progctx);
4375 
4466 extern int
4468  int image,
4469  const struct wimlib_update_command *cmds,
4470  size_t num_cmds,
4471  int update_flags);
4472 
4534 extern int
4535 wimlib_write(WIMStruct *wim,
4536  const wimlib_tchar *path,
4537  int image,
4538  int write_flags,
4539  unsigned num_threads);
4540 
4561 extern int
4563  int fd,
4564  int image,
4565  int write_flags,
4566  unsigned num_threads);
4567 
4585 struct wimlib_compressor;
4586 
4588 struct wimlib_decompressor;
4589 
4619 extern int
4620 wimlib_set_default_compression_level(int ctype, unsigned int compression_level);
4621 
4630 extern uint64_t
4632  size_t max_block_size,
4633  unsigned int compression_level);
4634 
4635 #define WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE 0x80000000
4636 
4705 extern int
4707  size_t max_block_size,
4708  unsigned int compression_level,
4709  struct wimlib_compressor **compressor_ret);
4710 
4731 extern size_t
4732 wimlib_compress(const void *uncompressed_data, size_t uncompressed_size,
4733  void *compressed_data, size_t compressed_size_avail,
4734  struct wimlib_compressor *compressor);
4735 
4742 extern void
4743 wimlib_free_compressor(struct wimlib_compressor *compressor);
4744 
4778 extern int
4780  size_t max_block_size,
4781  struct wimlib_decompressor **decompressor_ret);
4782 
4810 extern int
4811 wimlib_decompress(const void *compressed_data, size_t compressed_size,
4812  void *uncompressed_data, size_t uncompressed_size,
4813  struct wimlib_decompressor *decompressor);
4814 
4821 extern void
4822 wimlib_free_decompressor(struct wimlib_decompressor *decompressor);
4823 
4824 
4830 #ifdef __cplusplus
4831 }
4832 #endif
4833 
4834 #endif /* _WIMLIB_H */
const wimlib_tchar * filename
Name of the file, or NULL if this file is unnamed.
Definition: wimlib.h:1514
const wimlib_tchar * stream_name
Name of the stream, or NULL if the stream is unnamed.
Definition: wimlib.h:1487
uint64_t raw_resource_offset_in_wim
If this blob is located in a solid WIM resource, then this is the offset of that solid resource withi...
Definition: wimlib.h:1460
Valid on messages WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and WIMLIB_PROGRESS_MSG_SPLIT_END_PART.
Definition: wimlib.h:1078
wimlib_tchar * wim_target_path
Destination path in the image.
Definition: wimlib.h:2433
A WIM image is about to be extracted.
Definition: wimlib.h:582
Definition: wimlib.h:2500
struct wimlib_progress_info::wimlib_progress_info_replace replace
unsigned total_parts
Total number of split WIM parts that are being written.
Definition: wimlib.h:1094
Valid on messages WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE.
Definition: wimlib.h:1113
uint32_t total_parts
The number of on-disk WIM files from which file data is being exported into the output WIM file...
Definition: wimlib.h:844
int wimlib_set_image_property(WIMStruct *wim, int image, const wimlib_tchar *property_name, const wimlib_tchar *property_value)
Since wimlib v1.8.3: add, modify, or remove a per-image property from the WIM&#39;s XML document...
const wimlib_tchar * cur_path
Path to the file (or directory) that has been scanned, valid on WIMLIB_PROGRESS_MSG_SCAN_DENTRY.
Definition: wimlib.h:865
Definition: wimlib.h:2551
uint64_t wimlib_get_compressor_needed_memory(enum wimlib_compression_type ctype, size_t max_block_size, unsigned int compression_level)
Return the approximate number of bytes needed to allocate a compressor with wimlib_create_compressor(...
int wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name)
Change the name of a WIM image.
wimlib_verify_wim() is starting to verify the metadata for an image.
Definition: wimlib.h:729
Definition: wimlib.h:2519
uint32_t total_chunks
The number of individually checksummed "chunks" the integrity-checked region is divided into...
Definition: wimlib.h:1061
Definition: wimlib.h:2499
Definition: wimlib.h:2570
Valid on messages WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and WIMLIB_PROGRESS_MSG_CALC_INTEGRITY.
Definition: wimlib.h:1049
Definition: wimlib.h:2512
Valid on messages WIMLIB_PROGRESS_MSG_RENAME.
Definition: wimlib.h:1022
Definition: wimlib.h:2497
wimlib_overwrite() has successfully renamed the temporary file to the original WIM file...
Definition: wimlib.h:666
void wimlib_free(WIMStruct *wim)
Release a reference to a WIMStruct.
struct wimlib_progress_info::wimlib_progress_info_unmount unmount
struct WIMStruct WIMStruct
Opaque structure that represents a WIM, possibly backed by an on-disk file.
Definition: wimlib.h:448
The image has been successfully extracted.
Definition: wimlib.h:619
const wimlib_tchar * target
Path to the directory or NTFS volume to which the files are being extracted.
Definition: wimlib.h:961
int wimlib_extract_paths(WIMStruct *wim, int image, const wimlib_tchar *target, const wimlib_tchar *const *paths, size_t num_paths, int extract_flags)
Extract zero or more paths (files or directory trees) from the specified WIM image.
struct wimlib_progress_info::wimlib_progress_info_extract extract
int wimlib_set_memory_allocator(void *(*malloc_func)(size_t), void(*free_func)(void *), void *(*realloc_func)(void *, size_t))
Set the functions that wimlib uses to allocate and free memory.
int wimlib_extract_pathlist(WIMStruct *wim, int image, const wimlib_tchar *target, const wimlib_tchar *path_list_file, int extract_flags)
Similar to wimlib_extract_paths(), but the paths to extract from the WIM image are specified in the A...
Definition: wimlib.h:2503
uint32_t write_in_progress
1 iff the "write in progress" flag is set in this WIM&#39;s header
Definition: wimlib.h:1366
wimlib_tchar * fs_source_path
Absolute or relative path to a file or directory on the external filesystem to be included in the ima...
Definition: wimlib.h:1257
uint64_t total_bytes
Total size of the original WIM&#39;s file and metadata resources (compressed).
Definition: wimlib.h:1081
Valid on the message WIMLIB_PROGRESS_MSG_WRITE_STREAMS.
Definition: wimlib.h:805
Definition: wimlib.h:2560
int wimlib_reference_template_image(WIMStruct *wim, int new_image, WIMStruct *template_wim, int template_image, int flags)
Declare that a newly added image is mostly the same as a prior image, but captured at a later point i...
uint64_t compressed_size
If this blob is located in a non-solid WIM resource, then this is the compressed size of that resourc...
Definition: wimlib.h:1418
int wimlib_write_to_fd(WIMStruct *wim, int fd, int image, int write_flags, unsigned num_threads)
Same as wimlib_write(), but write the WIM directly to a file descriptor, which need not be seekable i...
uint32_t current_image
Definition: wimlib.h:1168
int(* wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry, void *user_ctx)
Type of a callback function to wimlib_iterate_dir_tree().
Definition: wimlib.h:1652
wimlib_update_op
The specific type of update to perform.
Definition: wimlib.h:2415
uint64_t reserved[1]
Definition: wimlib.h:1470
int32_t compression_type
The compression type being used, as one of the wimlib_compression_type constants. ...
Definition: wimlib.h:839
int wimlib_add_tree(WIMStruct *wim, int image, const wimlib_tchar *fs_source_path, const wimlib_tchar *wim_target_path, int add_flags)
Add the file or directory tree at fs_source_path on the filesystem to the location wim_target_path wi...
uint32_t unix_gid
The UNIX group ID of this file.
Definition: wimlib.h:1610
const wimlib_tchar * path
Path to the file for which exclusion is being tested.
Definition: wimlib.h:1195
int wimlib_delete_image(WIMStruct *wim, int image)
Delete an image, or all images, from a WIMStruct.
int wimlib_add_image(WIMStruct *wim, const wimlib_tchar *source, const wimlib_tchar *name, const wimlib_tchar *config_file, int add_flags)
Add an image to a WIMStruct from an on-disk directory tree or NTFS volume.
uint32_t pipable
1 iff this WIM file is pipable (see WIMLIB_WRITE_FLAG_PIPABLE).
Definition: wimlib.h:1375
Definition: wimlib.h:2552
The LZMS compression format.
Definition: wimlib.h:567
Definition: wimlib.h:2517
int wimlib_create_decompressor(enum wimlib_compression_type ctype, size_t max_block_size, struct wimlib_decompressor **decompressor_ret)
Allocate a decompressor for the specified compression type.
wimlib_error_code
Possible values of the error code returned by many functions in wimlib.
Definition: wimlib.h:2489
Definition: wimlib.h:2538
Definition: wimlib.h:2545
int wimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags)
Change what is stored in the <FLAGS> element in the WIM XML document (usually something like "Core" o...
const wimlib_tchar * path_to_file
Path to the file whose data has been written to the WIM file, or is currently being asynchronously co...
Definition: wimlib.h:1160
A WIM update command has been executed.
Definition: wimlib.h:700
uint32_t unix_rdev
The UNIX device ID (major and minor number) of this file.
Definition: wimlib.h:1623
uint32_t attributes
File attributes, such as whether the file is a directory or not.
Definition: wimlib.h:1555
uint32_t num_links
Number of links to this file&#39;s inode (hard links).
Definition: wimlib.h:1579
bool will_exclude
Indicates whether the file or directory will be excluded from capture or not.
Definition: wimlib.h:1203
int wimlib_open_wim(const wimlib_tchar *wim_file, int open_flags, WIMStruct **wim_ret)
Open a WIM file and create a WIMStruct for it.
struct wimlib_progress_info::wimlib_progress_info_split split
uint32_t has_integrity_table
1 iff this WIM file has an integrity table.
Definition: wimlib.h:1345
Per-image metadata is about to be written to the WIM file.
Definition: wimlib.h:654
Definition: wimlib.h:2516
wimlib_timespec last_access_time
Time this file was last accessed.
Definition: wimlib.h:1600
struct wimlib_progress_info::wimlib_progress_info_integrity integrity
uint32_t has_rpfix
1 iff the "reparse point fix" flag is set in this WIM&#39;s header
Definition: wimlib.h:1357
const wimlib_tchar * reserved
Reserved.
Definition: wimlib.h:964
const wimlib_tchar * filename
For WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages, this is the path to the WIM file being checked...
Definition: wimlib.h:1073
Definition: wimlib.h:2491
A pointer to this union is passed to the user-supplied wimlib_progress_func_t progress function...
Definition: wimlib.h:800
uint32_t is_missing
1 iff a blob with this hash was not found in the blob lookup table of the WIMStruct.
Definition: wimlib.h:1451
Definition: wimlib.h:2509
uint32_t completed_parts
This is currently broken and will always be 0.
Definition: wimlib.h:847
int wimlib_create_compressor(enum wimlib_compression_type ctype, size_t max_block_size, unsigned int compression_level, struct wimlib_compressor **compressor_ret)
Allocate a compressor for the specified compression type using the specified parameters.
uint64_t raw_resource_compressed_size
If this blob is located in a solid WIM resource, then this is the compressed size of that solid resou...
Definition: wimlib.h:1464
Definition: wimlib.h:2493
Definition: wimlib.h:2561
Delete a file or directory tree from the image.
Definition: wimlib.h:2420
Definition: wimlib.h:2508
The operation should be continued.
Definition: wimlib.h:787
uint32_t resource_only
1 iff the "resource only" flag is set in this WIM&#39;s header
Definition: wimlib.h:1372
The contents of the WIM file are being checked against the integrity table.
Definition: wimlib.h:673
Definition: wimlib.h:2504
int wimlib_iterate_dir_tree(WIMStruct *wim, int image, const wimlib_tchar *path, int flags, wimlib_iterate_dir_tree_callback_t cb, void *user_ctx)
Iterate through a file or directory tree in a WIM image.
Definition: wimlib.h:2526
Valid on messages WIMLIB_PROGRESS_MSG_DONE_WITH_FILE.
Definition: wimlib.h:1141
struct wimlib_progress_info::wimlib_progress_info_test_file_exclusion test_file_exclusion
An error has occurred and the progress function is being asked whether to ignore the error or not...
Definition: wimlib.h:774
Data for a WIMLIB_UPDATE_OP_RENAME operation.
Definition: wimlib.h:2454
Definition: wimlib.h:2501
struct wimlib_progress_info::wimlib_progress_info_verify_streams verify_streams
uint32_t packed
1 iff this blob is located in a solid resource.
Definition: wimlib.h:1454
One or more file or directory trees within a WIM image is about to be extracted.
Definition: wimlib.h:589
Valid on messages WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN, WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGI...
Definition: wimlib.h:941
wimlib_tchar * wim_target_path
Destination path in the image.
Definition: wimlib.h:1261
uint32_t chunk_size
The default compression chunk size of resources in this WIM file.
Definition: wimlib.h:1326
Definition: wimlib.h:2541
Definition: wimlib.h:2563
uint32_t is_spanned
Definition: wimlib.h:1446
const wimlib_tchar * wimlib_get_image_property(const WIMStruct *wim, int image, const wimlib_tchar *property_name)
Since wimlib v1.8.3: get a per-image property from the WIM&#39;s XML document.
Starting to unmount an image.
Definition: wimlib.h:719
void wimlib_global_cleanup(void)
Cleanup function for wimlib.
An image is being extracted with WIMLIB_EXTRACT_FLAG_WIMBOOT, and a file is being extracted normally ...
Definition: wimlib.h:715
A wimlib_split() operation is in progress, and a new split part is about to be started.
Definition: wimlib.h:684
An array of these structures is passed to wimlib_add_image_multisource() to specify the sources from ...
Definition: wimlib.h:1254
const wimlib_tchar * wimlib_get_error_string(enum wimlib_error_code code)
Convert a wimlib error code into a string describing it.
Valid on messages WIMLIB_PROGRESS_MSG_HANDLE_ERROR.
Definition: wimlib.h:1207
Definition: wimlib.h:2553
bool wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name)
Determine if an image name is already used by some image in the WIM.
The XPRESS compression format.
Definition: wimlib.h:522
The files or directory trees have been successfully extracted.
Definition: wimlib.h:624
General information about a WIM file.
Definition: wimlib.h:1308
Definition: wimlib.h:2569
uint64_t completed_streams
The number of distinct file data "blobs" that have been written so far.
Definition: wimlib.h:831
Definition: wimlib.h:2490
const wimlib_tchar * path
Path to the file for which the error occurred, or NULL if not relevant.
Definition: wimlib.h:1211
The per-image metadata has been written to the WIM file.
Definition: wimlib.h:659
int wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads)
Commit a WIMStruct to disk, updating its backing file.
char wimlib_tchar
See Character encoding.
Definition: wimlib.h:456
struct wimlib_progress_info::wimlib_progress_info_handle_error handle_error
uint64_t total_bytes
The size of this WIM file in bytes, excluding the XML data and integrity table.
Definition: wimlib.h:1342
void wimlib_free_decompressor(struct wimlib_decompressor *decompressor)
Free a decompressor previously allocated with wimlib_create_decompressor().
wimlib_compression_type
Specifies a compression type.
Definition: wimlib.h:494
int wimlib_reference_resources(WIMStruct *wim, WIMStruct **resource_wims, unsigned num_resource_wims, int ref_flags)
Similar to wimlib_reference_resource_files(), but operates at a lower level where the caller must ope...
uint64_t total_streams
An upper bound on the number of distinct file data "blobs" that will be written.
Definition: wimlib.h:820
uint32_t is_compressed
1 iff this blob is located in a non-solid compressed WIM resource.
Definition: wimlib.h:1440
int wimlib_set_error_file_by_name(const wimlib_tchar *path)
Set the path to the file to which the library will print error and warning messages.
size_t security_descriptor_size
Size of the above security descriptor, in bytes.
Definition: wimlib.h:1534
uint32_t mount_flags
Flags that were passed to wimlib_mount_image() when the mountpoint was set up.
Definition: wimlib.h:1134
uint8_t object_id[WIMLIB_GUID_LEN]
Definition: wimlib.h:1501
int wimlib_extract_image_from_pipe_with_progress(int pipe_fd, const wimlib_tchar *image_num_or_name, const wimlib_tchar *target, int extract_flags, wimlib_progress_func_t progfunc, void *progctx)
Same as wimlib_extract_image_from_pipe(), but allows specifying a progress function.
const struct wimlib_update_command * command
Pointer to the update command that will be executed or has just been executed.
Definition: wimlib.h:1036
Valid on messages WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE and WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE.
Definition: wimlib.h:1165
Definition: wimlib.h:2550
const wimlib_tchar * wim_target_path
Target path in the image.
Definition: wimlib.h:900
Definition: wimlib.h:2492
wimlib_tchar * wim_source_path
The path to the source file or directory within the image.
Definition: wimlib.h:2457
const wimlib_tchar * source
Top-level directory being scanned; or, when capturing an NTFS volume with WIMLIB_ADD_FLAG_NTFS, this is instead the path to the file or block device that contains the NTFS volume being scanned.
Definition: wimlib.h:859
Definition: wimlib.h:2514
Definition: wimlib.h:2539
#define wimlib_timespec
Definition: wimlib.h:440
uint32_t reserved_flags
Definition: wimlib.h:1376
wimlib_timespec creation_time
Time this file was created.
Definition: wimlib.h:1594
size_t wimlib_compress(const void *uncompressed_data, size_t uncompressed_size, void *compressed_data, size_t compressed_size_avail, struct wimlib_compressor *compressor)
Compress a buffer of data.
int wimlib_extract_image_from_pipe(int pipe_fd, const wimlib_tchar *image_num_or_name, const wimlib_tchar *target, int extract_flags)
Extract one image from a pipe on which a pipable WIM is being sent.
The directory or NTFS volume has been successfully scanned.
Definition: wimlib.h:643
uint32_t reference_count
If this blob is not missing, then this is the number of times this blob is referenced over all images...
Definition: wimlib.h:1436
uint64_t total_streams
The number of file streams that will be extracted.
Definition: wimlib.h:977
int wimlib_rename_path(WIMStruct *wim, int image, const wimlib_tchar *source_path, const wimlib_tchar *dest_path)
Rename the source_path to the dest_path in the specified image of the wim.
const wimlib_tchar * wimfile
Definition: wimlib.h:1173
Definition: wimlib.h:2528
uint32_t num_named_streams
Number of named data streams this file has.
Definition: wimlib.h:1582
No compression.
Definition: wimlib.h:502
The LZX compression format.
Definition: wimlib.h:544
int wimlib_join(const wimlib_tchar *const *swms, unsigned num_swms, const wimlib_tchar *output_path, int swm_open_flags, int wim_write_flags)
Join a split WIM into a stand-alone (one-part) WIM.
Definition: wimlib.h:2557
int wimlib_global_init(int init_flags)
Initialization function for wimlib.
Valid on messages WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM.
Definition: wimlib.h:1107
struct wimlib_progress_info::wimlib_progress_info_verify_image verify_image
const wimlib_tchar * path_in_wim
Path to the file in the image.
Definition: wimlib.h:1115
int wimlib_verify_wim(WIMStruct *wim, int verify_flags)
Perform verification checks on a WIM file.
Definition: wimlib.h:2520
bool will_ignore
Indicates whether the error will be ignored or not.
Definition: wimlib.h:1221
struct wimlib_progress_info::wimlib_progress_info_write_streams write_streams
#define WIMLIB_GUID_LEN
Length of a Globally Unique Identifier (GUID), in bytes.
Definition: wimlib.h:482
Definition: wimlib.h:2548
Definition: wimlib.h:2536
Definition: wimlib.h:2498
uint64_t num_bytes_scanned
The number of bytes of file data detected so far, not counting excluded/unsupported files...
Definition: wimlib.h:919
int wimlib_unmount_image(const wimlib_tchar *dir, int unmount_flags)
Unmount a WIM image that was mounted using wimlib_mount_image().
Definition: wimlib.h:2547
int wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info)
Get basic information about a WIM file.
struct wimlib_progress_info::wimlib_progress_info_wimboot_exclude wimboot_exclude
Definition: wimlib.h:2532
int wimlib_join_with_progress(const wimlib_tchar *const *swms, unsigned num_swms, const wimlib_tchar *output_path, int swm_open_flags, int wim_write_flags, wimlib_progress_func_t progfunc, void *progctx)
Same as wimlib_join(), but allows specifying a progress function.
uint32_t metadata_only
1 iff the "metadata only" flag is set in this WIM&#39;s header
Definition: wimlib.h:1369
int wimlib_unmount_image_with_progress(const wimlib_tchar *dir, int unmount_flags, wimlib_progress_func_t progfunc, void *progctx)
Same as wimlib_unmount_image(), but allows specifying a progress function.
int rename_flags
Reserved; set to 0.
Definition: wimlib.h:2463
uint64_t total_bytes
An upper bound on the number of bytes of file data that will be written.
Definition: wimlib.h:812
Definition: wimlib.h:2558
int wimlib_add_empty_image(WIMStruct *wim, const wimlib_tchar *name, int *new_idx_ret)
Append an empty image to a WIMStruct.
wimlib_progress_status
Valid return values from user-provided progress functions (wimlib_progress_func_t).
Definition: wimlib.h:783
uint32_t mounted_image
1-based index of image being unmounted.
Definition: wimlib.h:1130
long reserved
Reserved; set to 0.
Definition: wimlib.h:1264
enum wimlib_progress_status(* wimlib_progress_func_t)(enum wimlib_progress_msg msg_type, union wimlib_progress_info *info, void *progctx)
A user-supplied function that will be called periodically during certain WIM operations.
Definition: wimlib.h:1244
A directory or file has been scanned.
Definition: wimlib.h:637
Definition: wimlib.h:2533
uint64_t uncompressed_size
If this blob is not missing, then this is the uncompressed size of this blob in bytes.
Definition: wimlib.h:1414
Structure passed to the wimlib_iterate_dir_tree() callback function.
Definition: wimlib.h:1511
Definition: wimlib.h:2542
int add_flags
Bitwise OR of WIMLIB_ADD_FLAG_* flags.
Definition: wimlib.h:2440
const wimlib_tchar * extraction_path
Path to which the file is being extracted.
Definition: wimlib.h:1118
unsigned cur_part_number
Number of the split WIM part that is about to be started (WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or ha...
Definition: wimlib.h:1091
Valid on messages WIMLIB_PROGRESS_MSG_SCAN_BEGIN, WIMLIB_PROGRESS_MSG_SCAN_DENTRY, and WIMLIB_PROGRESS_MSG_SCAN_END.
Definition: wimlib.h:853
Definition: wimlib.h:2537
Definition: wimlib.h:2511
uint32_t num_threads
The number of threads being used for data compression; or, if no compression is being performed...
Definition: wimlib.h:835
const wimlib_tchar * dos_name
8.3 name (or "DOS name", or "short name") of this file; or NULL if this file has no such name...
Definition: wimlib.h:1518
Definition: wimlib.h:2555
void wimlib_print_header(const WIMStruct *wim)
Print the header of the WIM file (intended for debugging only).
Definition: wimlib.h:2513
uint32_t total_parts
Currently only used for WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.
Definition: wimlib.h:989
uint64_t total_bytes
The number of bytes in the WIM file that are covered by integrity checks.
Definition: wimlib.h:1053
Definition: wimlib.h:2566
int(* wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resource_entry *resource, void *user_ctx)
Type of a callback function to wimlib_iterate_lookup_table().
Definition: wimlib.h:1659
uint32_t total_images
Definition: wimlib.h:1167
Starting to read a new part of a split pipable WIM over the pipe.
Definition: wimlib.h:606
uint32_t reserved_flags
Definition: wimlib.h:1456
wimlib_progress_msg
Possible values of the first parameter to the user-supplied wimlib_progress_func_t progress function...
Definition: wimlib.h:576
Definition: wimlib.h:2523
Definition: wimlib.h:2522
Definition: wimlib.h:2502
struct wimlib_progress_info::wimlib_progress_info_rename rename
uint32_t part_number
Currently only used for WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.
Definition: wimlib.h:985
Rename a file or directory tree in the image.
Definition: wimlib.h:2423
const wimlib_tchar * wimfile_name
If the WIMStruct from which the extraction being performed has a backing file, then this is an absolu...
Definition: wimlib.h:953
size_t completed_commands
Number of update commands that have been completed so far.
Definition: wimlib.h:1040
Definition: wimlib.h:2510
File data is currently being extracted.
Definition: wimlib.h:602
This message may be sent periodically (not for every file) while files and directories are being crea...
Definition: wimlib.h:597
Add a new file or directory tree to the image.
Definition: wimlib.h:2417
int wimlib_reference_resource_files(WIMStruct *wim, const wimlib_tchar *const *resource_wimfiles_or_globs, unsigned count, int ref_flags, int open_flags)
Reference file data from other WIM files or split WIM parts.
int wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size)
Set a WIMStruct&#39;s output compression chunk size.
int wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, int which)
Set basic information about a WIM.
uint32_t opened_from_file
1 iff this info struct is for a WIMStruct that has a backing file.
Definition: wimlib.h:1349
A wimlib_split() operation is in progress, and a split part has been finished.
Definition: wimlib.h:688
uint64_t completed_bytes
Number of bytes of file and metadata resources that have been copied out of the original WIM so far...
Definition: wimlib.h:1086
uint32_t boot_index
The 1-based index of the bootable image in this WIM file, or 0 if no image is bootable.
Definition: wimlib.h:1319
int wimlib_set_output_pack_compression_type(WIMStruct *wim, enum wimlib_compression_type ctype)
Similar to wimlib_set_output_compression_type(), but set the compression type for writing solid resou...
The operation should be aborted.
Definition: wimlib.h:791
int wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret)
Read a WIM file&#39;s XML document into an in-memory buffer.
uint32_t unix_uid
The UNIX user ID of this file.
Definition: wimlib.h:1605
uint32_t extract_flags
Extraction flags being used.
Definition: wimlib.h:948
wimlib_tchar * config_file
Path to capture configuration file to use, or NULL if not specified.
Definition: wimlib.h:2437
const wimlib_tchar * from
Name of the temporary file that the WIM was written to.
Definition: wimlib.h:1024
int wimlib_set_print_errors(bool show_messages)
Set whether wimlib can print error and warning messages to the error file, which defaults to standard...
const char * security_descriptor
Pointer to the security descriptor for this file, in Windows SECURITY_DESCRIPTOR_RELATIVE format...
Definition: wimlib.h:1531
int delete_flags
Bitwise OR of WIMLIB_DELETE_FLAG_* flags.
Definition: wimlib.h:2450
size_t total_commands
Number of update commands that are being executed as part of this call to wimlib_update_image().
Definition: wimlib.h:1044
int wimlib_extract_xml_data(WIMStruct *wim, FILE *fp)
Similar to wimlib_get_xml_data(), but the XML document will be written to the specified standard C FI...
int wimlib_delete_path(WIMStruct *wim, int image, const wimlib_tchar *path, int delete_flags)
Delete the path from the specified image of the wim.
int wimlib_set_output_compression_type(WIMStruct *wim, enum wimlib_compression_type ctype)
Set a WIMStruct&#39;s output compression type.
int error_code
The wimlib error code associated with the error.
Definition: wimlib.h:1214
uint32_t chunk_size
The size of each individually checksummed "chunk" in the integrity-checked region.
Definition: wimlib.h:1069
int wimlib_mount_image(WIMStruct *wim, int image, const wimlib_tchar *dir, int mount_flags, const wimlib_tchar *staging_dir)
Mount an image from a WIM file on a directory read-only or read-write.
Valid on messages WIMLIB_PROGRESS_MSG_VERIFY_STREAMS.
Definition: wimlib.h:1172
struct wimlib_progress_info::wimlib_progress_info_done_with_file done_with_file
Definition: wimlib.h:2495
Definition: wimlib.h:2530
uint64_t completed_bytes
The number of bytes of file data that have been extracted so far.
Definition: wimlib.h:971
int wimlib_decompress(const void *compressed_data, size_t compressed_size, void *uncompressed_data, size_t uncompressed_size, struct wimlib_decompressor *decompressor)
Decompress a buffer of data.
Definition: wimlib.h:2543
uint64_t completed_bytes
The number of bytes that have been checksummed so far.
Definition: wimlib.h:1057
int wimlib_set_default_compression_level(int ctype, unsigned int compression_level)
Set the default compression level for the specified compression type.
Information about a stream of a particular file in the WIM.
Definition: wimlib.h:1484
int wimlib_resolve_image(WIMStruct *wim, const wimlib_tchar *image_name_or_num)
Translate a string specifying the name or number of an image in the WIM into the number of the image...
size_t depth
Depth of this directory entry, where 0 is the root, 1 is the root&#39;s children, ..., etc.
Definition: wimlib.h:1526
Definition: wimlib.h:2559
const wimlib_tchar * to
Name of the original WIM file to which the temporary file is being renamed.
Definition: wimlib.h:1028
Data for a WIMLIB_UPDATE_OP_DELETE operation.
Definition: wimlib.h:2444
uint64_t current_file_count
For WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages...
Definition: wimlib.h:1000
wimlib_verify_wim() has finished verifying the metadata for an image.
Definition: wimlib.h:734
wimlib_verify_wim() is verifying file data integrity.
Definition: wimlib.h:738
int wimlib_set_image_descripton(WIMStruct *wim, int image, const wimlib_tchar *description)
Change the description of a WIM image.
uint32_t spanned
1 iff the "spanned" flag is set in this WIM&#39;s header
Definition: wimlib.h:1363
uint64_t completed_streams
Definition: wimlib.h:1176
int wimlib_iterate_lookup_table(WIMStruct *wim, int flags, wimlib_iterate_lookup_table_callback_t cb, void *user_ctx)
Iterate through the blob lookup table of a WIMStruct.
Definition: wimlib.h:2527
const wimlib_tchar * symlink_target
For WIMLIB_PROGRESS_MSG_SCAN_DENTRY and a status of WIMLIB_SCAN_DENTRY_FIXED_SYMLINK or WIMLIB_SCAN_D...
Definition: wimlib.h:906
Definition: wimlib.h:2506
Definition: wimlib.h:2515
Valid on messages WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN.
Definition: wimlib.h:1122
int wimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size)
Similar to wimlib_set_output_chunk_size(), but set the chunk size for writing solid resources...
const wimlib_tchar * mountpoint
Path to directory being unmounted.
Definition: wimlib.h:1124
uint32_t unix_mode
The UNIX mode of this file.
Definition: wimlib.h:1617
An integrity table is being calculated for the WIM being written.
Definition: wimlib.h:679
Definition: wimlib.h:2549
struct wimlib_progress_info::wimlib_progress_info_update update
uint32_t is_readonly
1 iff this WIM file is considered readonly for any reason (e.g.
Definition: wimlib.h:1354
void wimlib_free_compressor(struct wimlib_compressor *compressor)
Free a compressor previously allocated with wimlib_create_compressor().
int wimlib_add_image_multisource(WIMStruct *wim, const struct wimlib_capture_source *sources, size_t num_sources, const wimlib_tchar *name, const wimlib_tchar *config_file, int add_flags)
This function is equivalent to wimlib_add_image() except it allows for multiple sources to be combine...
Definition: wimlib.h:2525
wimlib_tchar * part_name
Name of the split WIM part that is about to be started (WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has ...
Definition: wimlib.h:1103
int wimlib_set_error_file(FILE *fp)
Set the file to which the library will print error and warning messages.
A WIM update command is about to be executed.
Definition: wimlib.h:694
uint32_t completed_chunks
The number of chunks that have been checksummed so far.
Definition: wimlib.h:1065
int32_t compression_type
The default compression type of resources in this WIM file, as one of the wimlib_compression_type con...
Definition: wimlib.h:1338
uint64_t num_dirs_scanned
The number of directories scanned so far, not counting excluded/unsupported files.
Definition: wimlib.h:911
int wimlib_open_wim_with_progress(const wimlib_tchar *wim_file, int open_flags, WIMStruct **wim_ret, wimlib_progress_func_t progfunc, void *progctx)
Same as wimlib_open_wim(), but allows specifying a progress function and progress context...
The directory or NTFS volume is about to be scanned for metadata.
Definition: wimlib.h:631
struct wimlib_progress_info::wimlib_progress_info_scan scan
Since wimlib v1.9.1: an object ID, which is an extra piece of metadata that may be associated with a ...
Definition: wimlib.h:1500
uint64_t num_nondirs_scanned
The number of non-directories scanned so far, not counting excluded/unsupported files.
Definition: wimlib.h:915
Definition: wimlib.h:2544
Definition: wimlib.h:2568
Specification of an update to perform on a WIM image.
Definition: wimlib.h:2467
Definition: wimlib.h:2564
uint32_t image_count
The number of images in this WIM file.
Definition: wimlib.h:1315
Definition: wimlib.h:2494
This message may be sent periodically (not necessarily for every file) while file and directory metad...
Definition: wimlib.h:614
Definition: wimlib.h:2505
uint64_t hard_link_group_id
A unique identifier for this file&#39;s inode.
Definition: wimlib.h:1591
uint32_t part_number
If this blob is located in a WIM resource, then this is the part number of the WIM file containing it...
Definition: wimlib.h:1431
wimlib_timespec last_write_time
Time this file was last written to.
Definition: wimlib.h:1597
uint32_t reparse_tag
If the file is a reparse point (FILE_ATTRIBUTE_REPARSE_POINT set in the attributes), this will give the reparse tag.
Definition: wimlib.h:1573
uint32_t image
The 1-based index of the image from which files are being extracted.
Definition: wimlib.h:945
uint64_t end_file_count
For WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages...
Definition: wimlib.h:1018
uint16_t part_number
For split WIMs, the 1-based index of this part within the split WIM; otherwise 1. ...
Definition: wimlib.h:1330
Definition: wimlib.h:2535
uint64_t raw_resource_uncompressed_size
If this blob is located in a solid WIM resource, then this is the uncompressed size of that solid res...
Definition: wimlib.h:1468
uint64_t total_bytes
The number of bytes of file data that will be extracted.
Definition: wimlib.h:967
Definition: wimlib.h:2540
Definition: wimlib.h:2507
Definition: wimlib.h:2496
File data is currently being written to the WIM.
Definition: wimlib.h:650
uint64_t offset
If this blob is located in a non-solid WIM resource, then this is the offset of that resource within ...
Definition: wimlib.h:1424
const wimlib_tchar * full_path
Full path to this file within the image.
Definition: wimlib.h:1522
uint32_t is_metadata
1 iff this blob contains the metadata for an image.
Definition: wimlib.h:1443
Valid on messages WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION.
Definition: wimlib.h:1181
uint32_t wimlib_get_version(void)
Return the version of wimlib as a 32-bit number whose top 12 bits contain the major version...
uint64_t completed_bytes
The number of bytes of file data that have been written so far.
Definition: wimlib.h:826
const wimlib_tchar * wimfile
Definition: wimlib.h:1166
int wimlib_update_image(WIMStruct *wim, int image, const struct wimlib_update_command *cmds, size_t num_cmds, int update_flags)
Update a WIM image by adding, deleting, and/or renaming files or directories.
const wimlib_tchar * path_in_wim
Path to the file in the image that is being replaced.
Definition: wimlib.h:1109
void wimlib_register_progress_function(WIMStruct *wim, wimlib_progress_func_t progfunc, void *progctx)
Register a progress function with a WIMStruct.
const wimlib_tchar * mounted_wim
Path to WIM file being unmounted.
Definition: wimlib.h:1127
uint32_t unmount_flags
Flags passed to wimlib_unmount_image().
Definition: wimlib.h:1137
The progress function is being asked whether a file should be excluded from capture or not...
Definition: wimlib.h:752
const wimlib_tchar * wimlib_get_image_description(const WIMStruct *wim, int image)
Get the description of the specified image.
wimlib_tchar * fs_source_path
Filesystem path to the file or directory tree to add.
Definition: wimlib.h:2429
Definition: wimlib.h:2529
uint32_t wim_version
The version of the WIM file format used in this WIM file.
Definition: wimlib.h:1322
Definition: wimlib.h:2556
Definition: wimlib.h:2554
Definition: wimlib.h:2518
Definition: wimlib.h:2531
wimlib_tchar * wim_path
The path to the file or directory within the image to delete.
Definition: wimlib.h:2447
wimlib has used a file&#39;s data for the last time (including all data streams, if it has multiple)...
Definition: wimlib.h:725
const wimlib_tchar * wimlib_get_compression_type_string(enum wimlib_compression_type ctype)
Convert a wimlib_compression_type value into a string.
int wimlib_extract_image(WIMStruct *wim, int image, const wimlib_tchar *target, int extract_flags)
Extract an image, or all images, from a WIMStruct.
const wimlib_tchar * wimlib_get_image_name(const WIMStruct *wim, int image)
Get the name of the specified image.
uint32_t is_marked_readonly
1 iff the "readonly" flag is set in this WIM&#39;s header
Definition: wimlib.h:1360
int wimlib_write(WIMStruct *wim, const wimlib_tchar *path, int image, int write_flags, unsigned num_threads)
Persist a WIMStruct to a new on-disk WIM file.
int wimlib_export_image(WIMStruct *src_wim, int src_image, WIMStruct *dest_wim, const wimlib_tchar *dest_name, const wimlib_tchar *dest_description, int export_flags)
Export an image, or all images, from a WIMStruct into another WIMStruct.
Definition: wimlib.h:2534
const wimlib_tchar * image_name
Name of the image from which files are being extracted, or the empty string if the image is unnamed...
Definition: wimlib.h:957
int wimlib_create_new_wim(enum wimlib_compression_type ctype, WIMStruct **wim_ret)
Create a WIMStruct which initially contains no images and is not backed by an on-disk file...
int wimlib_split(WIMStruct *wim, const wimlib_tchar *swm_name, uint64_t part_size, int write_flags)
Split a WIM into multiple parts.
Valid on messages WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND and WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND...
Definition: wimlib.h:1033
wimlib_tchar * wim_target_path
The path to the destination file or directory within the image.
Definition: wimlib.h:2460
Definition: wimlib.h:2521
Information about a "blob", which is a fixed length sequence of binary data.
Definition: wimlib.h:1410
uint16_t total_parts
For split WIMs, the total number of parts in the split WIM; otherwise 1.
Definition: wimlib.h:1334
Definition: wimlib.h:2524
A file in the image is being replaced as a result of a wimlib_add_command without WIMLIB_ADD_FLAG_NO_...
Definition: wimlib.h:707
Data for a WIMLIB_UPDATE_OP_ADD operation.
Definition: wimlib.h:2427
uint32_t is_free
Definition: wimlib.h:1445
void wimlib_print_available_images(const WIMStruct *wim, int image)
(Deprecated) Print information about one image, or all images, contained in a WIM.
uint64_t completed_streams
The number of file streams that have been extracted so far.
Definition: wimlib.h:981