wimlib
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
wimlib.h
Go to the documentation of this file.
1 
367 #ifndef _WIMLIB_H
368 #define _WIMLIB_H
369 
370 #include <stdio.h>
371 #include <stddef.h>
372 #include <stdbool.h>
373 #include <inttypes.h>
374 #include <time.h>
375 
380 #define WIMLIB_MAJOR_VERSION 1
381 
383 #define WIMLIB_MINOR_VERSION 8
384 
386 #define WIMLIB_PATCH_VERSION 1
387 
388 #ifdef __cplusplus
389 extern "C" {
390 #endif
391 
396 #ifndef WIMLIB_WIMSTRUCT_DECLARED
397 typedef struct WIMStruct WIMStruct;
398 #define WIMLIB_WIMSTRUCT_DECLARED
399 #endif
400 
401 #ifdef __WIN32__
402 typedef wchar_t wimlib_tchar;
403 #else
404 
405 typedef char wimlib_tchar;
406 #endif
407 
408 #ifdef __WIN32__
409 
411 # define WIMLIB_WIM_PATH_SEPARATOR '\\'
412 # define WIMLIB_WIM_PATH_SEPARATOR_STRING L"\\"
413 #else
414 
416 # define WIMLIB_WIM_PATH_SEPARATOR '/'
417 # define WIMLIB_WIM_PATH_SEPARATOR_STRING "/"
418 #endif
419 
421 #define WIMLIB_WIM_ROOT_PATH WIMLIB_WIM_PATH_SEPARATOR_STRING
422 
425 #define WIMLIB_IS_WIM_ROOT_PATH(path) \
426  ((path)[0] == WIMLIB_WIM_PATH_SEPARATOR && \
427  (path)[1] == 0)
428 
430 #define WIMLIB_GUID_LEN 16
431 
451 
471 
493 
516 };
517 
525 
531 
538 
546 
551 
555 
563 
568 
573 
580 
586 
592 
599 
603 
608 
615 
622 
628 
633 
637 
643 
649 
656 
664 
668 
674 
678 
683 
687 
701 
723 };
724 
732 
736 
740 };
741 
749 
754 
760  uint64_t total_bytes;
761 
768  uint64_t total_streams;
769 
774  uint64_t completed_bytes;
775 
780 
783  uint32_t num_threads;
784 
788 
792  uint32_t total_parts;
793 
795  uint32_t completed_parts;
796  } write_streams;
797 
802 
807  const wimlib_tchar *source;
808 
813  const wimlib_tchar *cur_path;
814 
817  enum {
820 
824 
828 
836 
842  } status;
843 
844  union {
848  const wimlib_tchar *wim_target_path;
849 
854  const wimlib_tchar *symlink_target;
855  };
856 
860 
865 
870  } scan;
871 
892 
895  uint32_t image;
896 
898  uint32_t extract_flags;
899 
903  const wimlib_tchar *wimfile_name;
904 
907  const wimlib_tchar *image_name;
908 
911  const wimlib_tchar *target;
912 
914  const wimlib_tchar *reserved;
915 
917  uint64_t total_bytes;
918 
921  uint64_t completed_bytes;
922 
927  uint64_t total_streams;
928 
932 
935  uint32_t part_number;
936 
939  uint32_t total_parts;
940 
944 
951 
968  uint64_t end_file_count;
969  } extract;
970 
974  const wimlib_tchar *from;
975 
978  const wimlib_tchar *to;
979  } rename;
980 
987 
991 
995  } update;
996 
1000 
1003  uint64_t total_bytes;
1004 
1008 
1011  uint32_t total_chunks;
1012 
1016 
1019  uint32_t chunk_size;
1020 
1023  const wimlib_tchar *filename;
1024  } integrity;
1025 
1031  uint64_t total_bytes;
1032 
1037 
1042 
1044  unsigned total_parts;
1045 
1053  wimlib_tchar *part_name;
1054  } split;
1055 
1059  const wimlib_tchar *path_in_wim;
1060  } replace;
1061 
1065  const wimlib_tchar *path_in_wim;
1066 
1068  const wimlib_tchar *extraction_path;
1069  } wimboot_exclude;
1070 
1074  const wimlib_tchar *mountpoint;
1075 
1077  const wimlib_tchar *mounted_wim;
1078 
1080  uint32_t mounted_image;
1081 
1084  uint32_t mount_flags;
1085 
1087  uint32_t unmount_flags;
1088  } unmount;
1089 
1110  const wimlib_tchar *path_to_file;
1111  } done_with_file;
1112 
1116  const wimlib_tchar *wimfile;
1117  uint32_t total_images;
1118  uint32_t current_image;
1119  } verify_image;
1120 
1123  const wimlib_tchar *wimfile;
1124  uint64_t total_streams;
1125  uint64_t total_bytes;
1128  } verify_streams;
1129 
1132 
1145  const wimlib_tchar *path;
1146 
1155 
1158 
1161  const wimlib_tchar *path;
1162 
1165 
1172  } handle_error;
1173 };
1174 
1193 typedef enum wimlib_progress_status
1195  union wimlib_progress_info *info,
1196  void *progctx);
1197 
1207  wimlib_tchar *fs_source_path;
1208 
1211  wimlib_tchar *wim_target_path;
1212 
1214  long reserved;
1215 };
1216 
1227 #define WIMLIB_CHANGE_READONLY_FLAG 0x00000001
1228 
1231 #define WIMLIB_CHANGE_GUID 0x00000002
1232 
1235 #define WIMLIB_CHANGE_BOOT_INDEX 0x00000004
1236 
1243 #define WIMLIB_CHANGE_RPFIX_FLAG 0x00000008
1244 
1259 
1263 
1265  uint32_t image_count;
1266 
1269  uint32_t boot_index;
1270 
1272  uint32_t wim_version;
1273 
1276  uint32_t chunk_size;
1277 
1280  uint16_t part_number;
1281 
1284  uint16_t total_parts;
1285 
1289 
1292  uint64_t total_bytes;
1293 
1295  uint32_t has_integrity_table : 1;
1296 
1299  uint32_t opened_from_file : 1;
1300 
1304  uint32_t is_readonly : 1;
1305 
1307  uint32_t has_rpfix : 1;
1308 
1310  uint32_t is_marked_readonly : 1;
1311 
1313  uint32_t spanned : 1;
1314 
1316  uint32_t write_in_progress : 1;
1317 
1319  uint32_t metadata_only : 1;
1320 
1322  uint32_t resource_only : 1;
1323 
1325  uint32_t pipable : 1;
1326  uint32_t reserved_flags : 22;
1327  uint32_t reserved[9];
1328 };
1329 
1361 
1365 
1369 
1374  uint64_t offset;
1375 
1377  uint8_t sha1_hash[20];
1378 
1381  uint32_t part_number;
1382 
1387 
1390  uint32_t is_compressed : 1;
1391 
1393  uint32_t is_metadata : 1;
1394 
1395  uint32_t is_free : 1;
1396  uint32_t is_spanned : 1;
1397 
1401  uint32_t is_missing : 1;
1402 
1404  uint32_t packed : 1;
1405 
1406  uint32_t reserved_flags : 26;
1407 
1411 
1415 
1419 
1420  uint64_t reserved[1];
1421 };
1422 
1435 
1437  const wimlib_tchar *stream_name;
1438 
1441 
1442  uint64_t reserved[4];
1443 };
1444 
1452  const wimlib_tchar *filename;
1453 
1456  const wimlib_tchar *dos_name;
1457 
1460  const wimlib_tchar *full_path;
1461 
1464  size_t depth;
1465 
1469  const char *security_descriptor;
1470 
1473 
1474 #define WIMLIB_FILE_ATTRIBUTE_READONLY 0x00000001
1475 #define WIMLIB_FILE_ATTRIBUTE_HIDDEN 0x00000002
1476 #define WIMLIB_FILE_ATTRIBUTE_SYSTEM 0x00000004
1477 #define WIMLIB_FILE_ATTRIBUTE_DIRECTORY 0x00000010
1478 #define WIMLIB_FILE_ATTRIBUTE_ARCHIVE 0x00000020
1479 #define WIMLIB_FILE_ATTRIBUTE_DEVICE 0x00000040
1480 #define WIMLIB_FILE_ATTRIBUTE_NORMAL 0x00000080
1481 #define WIMLIB_FILE_ATTRIBUTE_TEMPORARY 0x00000100
1482 #define WIMLIB_FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
1483 #define WIMLIB_FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
1484 #define WIMLIB_FILE_ATTRIBUTE_COMPRESSED 0x00000800
1485 #define WIMLIB_FILE_ATTRIBUTE_OFFLINE 0x00001000
1486 #define WIMLIB_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
1487 #define WIMLIB_FILE_ATTRIBUTE_ENCRYPTED 0x00004000
1488 #define WIMLIB_FILE_ATTRIBUTE_VIRTUAL 0x00010000
1489 
1493  uint32_t attributes;
1494 
1495 #define WIMLIB_REPARSE_TAG_RESERVED_ZERO 0x00000000
1496 #define WIMLIB_REPARSE_TAG_RESERVED_ONE 0x00000001
1497 #define WIMLIB_REPARSE_TAG_MOUNT_POINT 0xA0000003
1498 #define WIMLIB_REPARSE_TAG_HSM 0xC0000004
1499 #define WIMLIB_REPARSE_TAG_HSM2 0x80000006
1500 #define WIMLIB_REPARSE_TAG_DRIVER_EXTENDER 0x80000005
1501 #define WIMLIB_REPARSE_TAG_SIS 0x80000007
1502 #define WIMLIB_REPARSE_TAG_DFS 0x8000000A
1503 #define WIMLIB_REPARSE_TAG_DFSR 0x80000012
1504 #define WIMLIB_REPARSE_TAG_FILTER_MANAGER 0x8000000B
1505 #define WIMLIB_REPARSE_TAG_WOF 0x80000017
1506 #define WIMLIB_REPARSE_TAG_SYMLINK 0xA000000C
1507 
1511  uint32_t reparse_tag;
1512 
1517  uint32_t num_links;
1518 
1521 
1530 
1532  struct timespec creation_time;
1533 
1535  struct timespec last_write_time;
1536 
1538  struct timespec last_access_time;
1539 
1543  uint32_t unix_uid;
1544 
1548  uint32_t unix_gid;
1549 
1555  uint32_t unix_mode;
1556 
1561  uint32_t unix_rdev;
1562 
1563  uint64_t reserved[14];
1564 
1580 };
1581 
1586 typedef int (*wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry,
1587  void *user_ctx);
1588 
1594  void *user_ctx);
1595 
1598 #define WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE 0x00000001
1599 
1602 #define WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN 0x00000002
1603 
1609 #define WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED 0x00000004
1610 
1611 
1625 #define WIMLIB_ADD_FLAG_NTFS 0x00000001
1626 
1629 #define WIMLIB_ADD_FLAG_DEREFERENCE 0x00000002
1630 
1634 #define WIMLIB_ADD_FLAG_VERBOSE 0x00000004
1635 
1644 #define WIMLIB_ADD_FLAG_BOOT 0x00000008
1645 
1651 #define WIMLIB_ADD_FLAG_UNIX_DATA 0x00000010
1652 
1655 #define WIMLIB_ADD_FLAG_NO_ACLS 0x00000020
1656 
1662 #define WIMLIB_ADD_FLAG_STRICT_ACLS 0x00000040
1663 
1668 #define WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE 0x00000080
1669 
1677 #define WIMLIB_ADD_FLAG_RPFIX 0x00000100
1678 
1680 #define WIMLIB_ADD_FLAG_NORPFIX 0x00000200
1681 
1686 #define WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE 0x00000400
1687 
1703 #define WIMLIB_ADD_FLAG_WINCONFIG 0x00000800
1704 
1728 #define WIMLIB_ADD_FLAG_WIMBOOT 0x00001000
1729 
1737 #define WIMLIB_ADD_FLAG_NO_REPLACE 0x00002000
1738 
1746 #define WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION 0x00004000
1747 
1748 /* Note: the WIMLIB_ADD_IMAGE_FLAG names are retained for source compatibility.
1749  * Use the WIMLIB_ADD_FLAG names in new code. */
1750 #define WIMLIB_ADD_IMAGE_FLAG_NTFS WIMLIB_ADD_FLAG_NTFS
1751 #define WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE WIMLIB_ADD_FLAG_DEREFERENCE
1752 #define WIMLIB_ADD_IMAGE_FLAG_VERBOSE WIMLIB_ADD_FLAG_VERBOSE
1753 #define WIMLIB_ADD_IMAGE_FLAG_BOOT WIMLIB_ADD_FLAG_BOOT
1754 #define WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA WIMLIB_ADD_FLAG_UNIX_DATA
1755 #define WIMLIB_ADD_IMAGE_FLAG_NO_ACLS WIMLIB_ADD_FLAG_NO_ACLS
1756 #define WIMLIB_ADD_IMAGE_FLAG_STRICT_ACLS WIMLIB_ADD_FLAG_STRICT_ACLS
1757 #define WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE
1758 #define WIMLIB_ADD_IMAGE_FLAG_RPFIX WIMLIB_ADD_FLAG_RPFIX
1759 #define WIMLIB_ADD_IMAGE_FLAG_NORPFIX WIMLIB_ADD_FLAG_NORPFIX
1760 #define WIMLIB_ADD_IMAGE_FLAG_NO_UNSUPPORTED_EXCLUDE \
1761  WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE
1762 #define WIMLIB_ADD_IMAGE_FLAG_WINCONFIG WIMLIB_ADD_FLAG_WINCONFIG
1763 #define WIMLIB_ADD_IMAGE_FLAG_WIMBOOT WIMLIB_ADD_FLAG_WIMBOOT
1764 
1765 
1771 #define WIMLIB_DELETE_FLAG_FORCE 0x00000001
1772 
1775 #define WIMLIB_DELETE_FLAG_RECURSIVE 0x00000002
1776 
1787 #define WIMLIB_EXPORT_FLAG_BOOT 0x00000001
1788 
1792 #define WIMLIB_EXPORT_FLAG_NO_NAMES 0x00000002
1793 
1795 #define WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS 0x00000004
1796 
1800 #define WIMLIB_EXPORT_FLAG_GIFT 0x00000008
1801 
1817 #define WIMLIB_EXPORT_FLAG_WIMBOOT 0x00000010
1818 
1832 #define WIMLIB_EXTRACT_FLAG_NTFS 0x00000001
1833 
1837 #define WIMLIB_EXTRACT_FLAG_UNIX_DATA 0x00000020
1838 
1841 #define WIMLIB_EXTRACT_FLAG_NO_ACLS 0x00000040
1842 
1850 #define WIMLIB_EXTRACT_FLAG_STRICT_ACLS 0x00000080
1851 
1859 #define WIMLIB_EXTRACT_FLAG_RPFIX 0x00000100
1860 
1864 #define WIMLIB_EXTRACT_FLAG_NORPFIX 0x00000200
1865 
1868 #define WIMLIB_EXTRACT_FLAG_TO_STDOUT 0x00000400
1869 
1878 #define WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES 0x00000800
1879 
1888 #define WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS 0x00001000
1889 
1893 #define WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS 0x00002000
1894 
1897 #define WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES 0x00004000
1898 
1903 #define WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS 0x00008000
1904 
1906 #define WIMLIB_EXTRACT_FLAG_RESUME 0x00010000
1907 
1920 #define WIMLIB_EXTRACT_FLAG_GLOB_PATHS 0x00040000
1921 
1925 #define WIMLIB_EXTRACT_FLAG_STRICT_GLOB 0x00080000
1926 
1931 #define WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES 0x00100000
1932 
1938 #define WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE 0x00200000
1939 
1945 #define WIMLIB_EXTRACT_FLAG_WIMBOOT 0x00400000
1946 
1952 #define WIMLIB_MOUNT_FLAG_READWRITE 0x00000001
1953 
1955 #define WIMLIB_MOUNT_FLAG_DEBUG 0x00000002
1956 
1958 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE 0x00000004
1959 
1963 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR 0x00000008
1964 
1967 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS 0x00000010
1968 
1971 #define WIMLIB_MOUNT_FLAG_UNIX_DATA 0x00000020
1972 
1975 #define WIMLIB_MOUNT_FLAG_ALLOW_OTHER 0x00000040
1976 
1987 #define WIMLIB_OPEN_FLAG_CHECK_INTEGRITY 0x00000001
1988 
1992 #define WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT 0x00000002
1993 
2002 #define WIMLIB_OPEN_FLAG_WRITE_ACCESS 0x00000004
2003 
2010 #define WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY 0x00000001
2011 
2014 #define WIMLIB_UNMOUNT_FLAG_COMMIT 0x00000002
2015 
2018 #define WIMLIB_UNMOUNT_FLAG_REBUILD 0x00000004
2019 
2022 #define WIMLIB_UNMOUNT_FLAG_RECOMPRESS 0x00000008
2023 
2032 #define WIMLIB_UNMOUNT_FLAG_FORCE 0x00000010
2033 
2038 #define WIMLIB_UNMOUNT_FLAG_NEW_IMAGE 0x00000020
2039 
2046 #define WIMLIB_UPDATE_FLAG_SEND_PROGRESS 0x00000001
2047 
2060 #define WIMLIB_WRITE_FLAG_CHECK_INTEGRITY 0x00000001
2061 
2067 #define WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY 0x00000002
2068 
2082 #define WIMLIB_WRITE_FLAG_PIPABLE 0x00000004
2083 
2088 #define WIMLIB_WRITE_FLAG_NOT_PIPABLE 0x00000008
2089 
2115 #define WIMLIB_WRITE_FLAG_RECOMPRESS 0x00000010
2116 
2130 #define WIMLIB_WRITE_FLAG_FSYNC 0x00000020
2131 
2144 #define WIMLIB_WRITE_FLAG_REBUILD 0x00000040
2145 
2155 #define WIMLIB_WRITE_FLAG_SOFT_DELETE 0x00000080
2156 
2166 #define WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG 0x00000100
2167 
2174 #define WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS 0x00000200
2175 
2177 #define WIMLIB_WRITE_FLAG_STREAMS_OK 0x00000400
2178 
2185 #define WIMLIB_WRITE_FLAG_RETAIN_GUID 0x00000800
2186 
2222 #define WIMLIB_WRITE_FLAG_SOLID 0x00001000
2223 
2228 #define WIMLIB_WRITE_FLAG_PACK_STREAMS WIMLIB_WRITE_FLAG_SOLID
2229 
2235 #define WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES 0x00002000
2236 
2242 #define WIMLIB_WRITE_FLAG_NO_SOLID_SORT 0x00004000
2243 
2251 #define WIMLIB_INIT_FLAG_ASSUME_UTF8 0x00000001
2252 
2260 #define WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES 0x00000002
2261 
2267 #define WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES 0x00000004
2268 
2274 #define WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES 0x00000008
2275 
2278 #define WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE 0x00000010
2279 
2282 #define WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE 0x00000020
2283 
2290 #define WIMLIB_REF_FLAG_GLOB_ENABLE 0x00000001
2291 
2299 #define WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH 0x00000002
2300 
2310 
2313 
2316 };
2317 
2321  wimlib_tchar *fs_source_path;
2322 
2325  wimlib_tchar *wim_target_path;
2326 
2329  wimlib_tchar *config_file;
2330 
2333 };
2334 
2337 
2340  wimlib_tchar *wim_path;
2341 
2344 };
2345 
2348 
2351  wimlib_tchar *wim_source_path;
2352 
2355  wimlib_tchar *wim_target_path;
2356 
2359 };
2360 
2363 
2365 
2366  union {
2368  struct wimlib_delete_command delete_; /* Underscore is for C++
2369  compatibility. */
2371  };
2372 };
2373 
2461 };
2462 
2463 
2465 #define WIMLIB_NO_IMAGE 0
2466 
2468 #define WIMLIB_ALL_IMAGES (-1)
2469 
2500 extern int
2502  const wimlib_tchar *name,
2503  int *new_idx_ret);
2504 
2556 extern int
2558  const wimlib_tchar *source,
2559  const wimlib_tchar *name,
2560  const wimlib_tchar *config_file,
2561  int add_flags);
2562 
2578 extern int
2580  const struct wimlib_capture_source *sources,
2581  size_t num_sources,
2582  const wimlib_tchar *name,
2583  const wimlib_tchar *config_file,
2584  int add_flags);
2585 
2595 extern int
2596 wimlib_add_tree(WIMStruct *wim, int image,
2597  const wimlib_tchar *fs_source_path,
2598  const wimlib_tchar *wim_target_path, int add_flags);
2599 
2628 extern int
2630 
2659 extern int
2660 wimlib_delete_image(WIMStruct *wim, int image);
2661 
2670 extern int
2671 wimlib_delete_path(WIMStruct *wim, int image,
2672  const wimlib_tchar *path, int delete_flags);
2673 
2734 extern int
2735 wimlib_export_image(WIMStruct *src_wim, int src_image,
2736  WIMStruct *dest_wim,
2737  const wimlib_tchar *dest_name,
2738  const wimlib_tchar *dest_description,
2739  int export_flags);
2740 
2848 extern int
2849 wimlib_extract_image(WIMStruct *wim, int image,
2850  const wimlib_tchar *target, int extract_flags);
2851 
2890 extern int
2891 wimlib_extract_image_from_pipe(int pipe_fd,
2892  const wimlib_tchar *image_num_or_name,
2893  const wimlib_tchar *target, int extract_flags);
2894 
2904 extern int
2906  const wimlib_tchar *image_num_or_name,
2907  const wimlib_tchar *target,
2908  int extract_flags,
2909  wimlib_progress_func_t progfunc,
2910  void *progctx);
2911 
2928 extern int
2929 wimlib_extract_pathlist(WIMStruct *wim, int image,
2930  const wimlib_tchar *target,
2931  const wimlib_tchar *path_list_file,
2932  int extract_flags);
2933 
3007 extern int
3009  int image,
3010  const wimlib_tchar *target,
3011  const wimlib_tchar * const *paths,
3012  size_t num_paths,
3013  int extract_flags);
3014 
3029 extern int
3030 wimlib_extract_xml_data(WIMStruct *wim, FILE *fp);
3031 
3041 extern void
3042 wimlib_free(WIMStruct *wim);
3043 
3057 extern const wimlib_tchar *
3059 
3073 extern const wimlib_tchar *
3075 
3093 extern const wimlib_tchar *
3094 wimlib_get_image_description(const WIMStruct *wim, int image);
3095 
3112 extern const wimlib_tchar *
3113 wimlib_get_image_name(const WIMStruct *wim, int image);
3114 
3126 extern uint32_t
3127 wimlib_get_version(void);
3128 
3143 extern int
3144 wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info);
3145 
3173 extern int
3174 wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret);
3175 
3195 extern int
3196 wimlib_global_init(int init_flags);
3197 
3204 extern void
3205 wimlib_global_cleanup(void);
3206 
3223 extern bool
3224 wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name);
3225 
3268 extern int
3269 wimlib_iterate_dir_tree(WIMStruct *wim, int image, const wimlib_tchar *path,
3270  int flags,
3271  wimlib_iterate_dir_tree_callback_t cb, void *user_ctx);
3272 
3302 extern int
3303 wimlib_iterate_lookup_table(WIMStruct *wim, int flags,
3305  void *user_ctx);
3306 
3343 extern int
3344 wimlib_join(const wimlib_tchar * const *swms,
3345  unsigned num_swms,
3346  const wimlib_tchar *output_path,
3347  int swm_open_flags,
3348  int wim_write_flags);
3349 
3361 extern int
3362 wimlib_join_with_progress(const wimlib_tchar * const *swms,
3363  unsigned num_swms,
3364  const wimlib_tchar *output_path,
3365  int swm_open_flags,
3366  int wim_write_flags,
3367  wimlib_progress_func_t progfunc,
3368  void *progctx);
3369 
3370 
3442 extern int
3444  int image,
3445  const wimlib_tchar *dir,
3446  int mount_flags,
3447  const wimlib_tchar *staging_dir);
3448 
3515 extern int
3516 wimlib_open_wim(const wimlib_tchar *wim_file,
3517  int open_flags,
3518  WIMStruct **wim_ret);
3519 
3531 extern int
3532 wimlib_open_wim_with_progress(const wimlib_tchar *wim_file,
3533  int open_flags,
3534  WIMStruct **wim_ret,
3535  wimlib_progress_func_t progfunc,
3536  void *progctx);
3537 
3596 extern int
3597 wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads);
3598 
3615 extern void
3616 wimlib_print_available_images(const WIMStruct *wim, int image);
3617 
3623 extern void
3624 wimlib_print_header(const WIMStruct *wim);
3625 
3667 extern int
3669  const wimlib_tchar * const *resource_wimfiles_or_globs,
3670  unsigned count,
3671  int ref_flags,
3672  int open_flags);
3673 
3698 extern int
3699 wimlib_reference_resources(WIMStruct *wim, WIMStruct **resource_wims,
3700  unsigned num_resource_wims, int ref_flags);
3701 
3763 extern int
3764 wimlib_reference_template_image(WIMStruct *wim, int new_image,
3765  WIMStruct *template_wim, int template_image,
3766  int flags);
3767 
3783 extern void
3785  wimlib_progress_func_t progfunc,
3786  void *progctx);
3787 
3797 extern int
3798 wimlib_rename_path(WIMStruct *wim, int image,
3799  const wimlib_tchar *source_path, const wimlib_tchar *dest_path);
3800 
3831 extern int
3833  const wimlib_tchar *image_name_or_num);
3834 
3852 extern int
3853 wimlib_set_error_file(FILE *fp);
3854 
3871 extern int
3872 wimlib_set_error_file_by_name(const wimlib_tchar *path);
3873 
3892 extern int
3893 wimlib_set_image_descripton(WIMStruct *wim, int image,
3894  const wimlib_tchar *description);
3895 
3915 extern int
3916 wimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags);
3917 
3939 extern int
3940 wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name);
3941 
3970 extern int
3971 wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
3972  void (*free_func)(void *),
3973  void *(*realloc_func)(void *, size_t));
3974 
4000 extern int
4001 wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size);
4002 
4009 extern int
4010 wimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size);
4011 
4031 extern int
4033  enum wimlib_compression_type ctype);
4034 
4041 extern int
4043  enum wimlib_compression_type ctype);
4044 
4067 extern int
4068 wimlib_set_print_errors(bool show_messages);
4069 
4093 extern int
4094 wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info,
4095  int which);
4096 
4135 extern int
4136 wimlib_split(WIMStruct *wim,
4137  const wimlib_tchar *swm_name,
4138  uint64_t part_size,
4139  int write_flags);
4140 
4178 extern int
4179 wimlib_verify_wim(WIMStruct *wim, int verify_flags);
4180 
4214 extern int
4215 wimlib_unmount_image(const wimlib_tchar *dir, int unmount_flags);
4216 
4224 extern int
4225 wimlib_unmount_image_with_progress(const wimlib_tchar *dir,
4226  int unmount_flags,
4227  wimlib_progress_func_t progfunc,
4228  void *progctx);
4229 
4322 extern int
4324  int image,
4325  const struct wimlib_update_command *cmds,
4326  size_t num_cmds,
4327  int update_flags);
4328 
4389 extern int
4390 wimlib_write(WIMStruct *wim,
4391  const wimlib_tchar *path,
4392  int image,
4393  int write_flags,
4394  unsigned num_threads);
4395 
4416 extern int
4418  int fd,
4419  int image,
4420  int write_flags,
4421  unsigned num_threads);
4422 
4440 struct wimlib_compressor;
4441 
4443 struct wimlib_decompressor;
4444 
4474 extern int
4475 wimlib_set_default_compression_level(int ctype, unsigned int compression_level);
4476 
4485 extern uint64_t
4487  size_t max_block_size,
4488  unsigned int compression_level);
4489 
4490 #define WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE 0x80000000
4491 
4560 extern int
4562  size_t max_block_size,
4563  unsigned int compression_level,
4564  struct wimlib_compressor **compressor_ret);
4565 
4586 extern size_t
4587 wimlib_compress(const void *uncompressed_data, size_t uncompressed_size,
4588  void *compressed_data, size_t compressed_size_avail,
4589  struct wimlib_compressor *compressor);
4590 
4597 extern void
4598 wimlib_free_compressor(struct wimlib_compressor *compressor);
4599 
4633 extern int
4635  size_t max_block_size,
4636  struct wimlib_decompressor **decompressor_ret);
4637 
4665 extern int
4666 wimlib_decompress(const void *compressed_data, size_t compressed_size,
4667  void *uncompressed_data, size_t uncompressed_size,
4668  struct wimlib_decompressor *decompressor);
4669 
4676 extern void
4677 wimlib_free_decompressor(struct wimlib_decompressor *decompressor);
4678 
4679 
4685 #ifdef __cplusplus
4686 }
4687 #endif
4688 
4689 #endif /* _WIMLIB_H */
const wimlib_tchar * filename
Name of the file, or NULL if this file is unnamed.
Definition: wimlib.h:1452
const wimlib_tchar * stream_name
Name of the stream, or NULL if the stream is unnamed.
Definition: wimlib.h:1437
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:1410
Valid on messages WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and WIMLIB_PROGRESS_MSG_SPLIT_END_PART.
Definition: wimlib.h:1028
wimlib_tchar * wim_target_path
Destination path in the WIM image.
Definition: wimlib.h:2325
A WIM image is about to be extracted.
Definition: wimlib.h:530
Definition: wimlib.h:2396
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:1044
Valid on messages WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE.
Definition: wimlib.h:1063
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:792
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:813
Definition: wimlib.h:2449
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:677
Definition: wimlib.h:2417
struct timespec last_write_time
Time this file was last written to.
Definition: wimlib.h:1535
uint32_t total_chunks
The number of individually checksummed "chunks" the integrity-checked region is divided into...
Definition: wimlib.h:1011
Definition: wimlib.h:2395
Valid on messages WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and WIMLIB_PROGRESS_MSG_CALC_INTEGRITY.
Definition: wimlib.h:999
Definition: wimlib.h:2409
Valid on messages WIMLIB_PROGRESS_MSG_RENAME.
Definition: wimlib.h:972
Definition: wimlib.h:2393
wimlib_overwrite() has successfully renamed the temporary file to the original WIM file...
Definition: wimlib.h:614
void wimlib_free(WIMStruct *wim)
Free all memory allocated for a WIMStruct and close all files associated with it. ...
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:397
The image has been successfully extracted.
Definition: wimlib.h:567
const wimlib_tchar * target
Path to the directory or NTFS volume to which the files are being extracted.
Definition: wimlib.h:911
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:2399
File looks okay and will be captured.
Definition: wimlib.h:819
uint32_t write_in_progress
1 iff the "write in progress" flag is set in this WIM's header
Definition: wimlib.h:1316
wimlib_tchar * fs_source_path
Absolute or relative path to a file or directory on the external filesystem to be included in the WIM...
Definition: wimlib.h:1207
uint64_t total_bytes
Total size of the original WIM's file and metadata resources (compressed).
Definition: wimlib.h:1031
Valid on the message WIMLIB_PROGRESS_MSG_WRITE_STREAMS.
Definition: wimlib.h:753
Definition: wimlib.h:2458
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:1368
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:1118
struct timespec last_access_time
Time this file was last accessed.
Definition: wimlib.h:1538
wimlib_update_op
The specific type of update to perform.
Definition: wimlib.h:2306
uint64_t reserved[1]
Definition: wimlib.h:1420
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:1586
int32_t compression_type
The compression type being used, as one of the wimlib_compression_type constants. ...
Definition: wimlib.h:787
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:1548
const wimlib_tchar * path
Path to the file for which exclusion is being tested.
Definition: wimlib.h:1145
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:1325
Definition: wimlib.h:2450
The LZMS compression format.
Definition: wimlib.h:515
Definition: wimlib.h:2415
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:2384
Definition: wimlib.h:2436
Definition: wimlib.h:2443
int wimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags)
Change what is stored in the 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:1110
A WIM update command has been executed.
Definition: wimlib.h:648
uint32_t unix_rdev
The UNIX device ID (major and minor number) of this file.
Definition: wimlib.h:1561
uint32_t attributes
File attributes, such as whether the file is a directory or not.
Definition: wimlib.h:1493
uint32_t num_links
Number of links to this file's inode (hard links).
Definition: wimlib.h:1517
bool will_exclude
Indicates whether the file or directory will be excluded from capture or not.
Definition: wimlib.h:1153
Reparse-point fixups are enabled, but the file is an absolute symbolic link or junction that does not...
Definition: wimlib.h:841
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:1295
Per-image metadata is about to be written to the WIM file.
Definition: wimlib.h:602
Definition: wimlib.h:2413
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's header
Definition: wimlib.h:1307
const wimlib_tchar * reserved
Reserved.
Definition: wimlib.h:914
const wimlib_tchar * filename
For WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages, this is the path to the WIM file being checked...
Definition: wimlib.h:1023
Definition: wimlib.h:2386
A pointer to this union is passed to the user-supplied wimlib_progress_func_t progress function...
Definition: wimlib.h:748
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:1401
Definition: wimlib.h:2406
uint32_t completed_parts
This is currently broken and will always be 0.
Definition: wimlib.h:795
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:1414
Definition: wimlib.h:2388
Definition: wimlib.h:2459
Delete a file or directory tree from the WIM image.
Definition: wimlib.h:2312
Definition: wimlib.h:2405
The operation should be continued.
Definition: wimlib.h:735
uint32_t resource_only
1 iff the "resource only" flag is set in this WIM's header
Definition: wimlib.h:1322
The contents of the WIM file are being checked against the integrity table.
Definition: wimlib.h:621
Definition: wimlib.h:2400
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 the WIM image.
Definition: wimlib.h:2424
Valid on messages WIMLIB_PROGRESS_MSG_DONE_WITH_FILE.
Definition: wimlib.h:1091
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:722
Data for a WIMLIB_UPDATE_OP_RENAME operation.
Definition: wimlib.h:2347
Definition: wimlib.h:2397
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:1404
One or more file or directory trees within a WIM image is about to be extracted.
Definition: wimlib.h:537
Valid on messages WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN, WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGI...
Definition: wimlib.h:891
wimlib_tchar * wim_target_path
Destination path in the WIM image.
Definition: wimlib.h:1211
uint32_t chunk_size
The default compression chunk size of resources in this WIM file.
Definition: wimlib.h:1276
Definition: wimlib.h:2439
uint32_t is_spanned
Definition: wimlib.h:1396
Starting to unmount a WIM image.
Definition: wimlib.h:667
void wimlib_global_cleanup(void)
Cleanup function for wimlib.
A WIM image is being extracted with WIMLIB_EXTRACT_FLAG_WIMBOOT, and a file is being extracted normal...
Definition: wimlib.h:663
A wimlib_split() operation is in progress, and a new split part is about to be started.
Definition: wimlib.h:632
An array of these structures is passed to wimlib_add_image_multisource() to specify the sources from ...
Definition: wimlib.h:1204
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:1157
Definition: wimlib.h:2451
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:470
The files or directory trees have been successfully extracted.
Definition: wimlib.h:572
General information about a WIM file.
Definition: wimlib.h:1258
uint64_t completed_streams
The number of distinct file data "blobs" that have been written so far.
Definition: wimlib.h:779
Definition: wimlib.h:2385
const wimlib_tchar * path
Path to the file for which the error occurred, or NULL if not relevant.
Definition: wimlib.h:1161
The per-image metadata has been written to the WIM file.
Definition: wimlib.h:607
int wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads)
Commit a WIMStruct to disk, overwriting its backing file or appending to it as needed.
char wimlib_tchar
See Locales and character encodings.
Definition: wimlib.h:405
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:1292
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:442
File is being excluded from capture due to the capture configuration.
Definition: wimlib.h:823
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:768
uint32_t is_compressed
1 iff this blob is located in a non-solid compressed WIM resource.
Definition: wimlib.h:1390
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.
struct wimlib_stream_entry streams[]
Array of streams that make up this file.
Definition: wimlib.h:1579
size_t security_descriptor_size
Length of the above security descriptor.
Definition: wimlib.h:1472
uint32_t mount_flags
Flags that were passed to wimlib_mount_image() when the mountpoint was set up.
Definition: wimlib.h:1084
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:986
Valid on messages WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE and WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE.
Definition: wimlib.h:1115
Definition: wimlib.h:2448
const wimlib_tchar * wim_target_path
Target path in the WIM image.
Definition: wimlib.h:848
Definition: wimlib.h:2387
wimlib_tchar * wim_source_path
Path, specified from the root of the WIM image, for the source file or directory tree within the WIM ...
Definition: wimlib.h:2351
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:807
Definition: wimlib.h:2411
Definition: wimlib.h:2437
struct wimlib_rename_command rename
Definition: wimlib.h:2370
uint32_t reserved_flags
Definition: wimlib.h:1326
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:591
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:1386
uint64_t total_streams
The number of file streams that will be extracted.
Definition: wimlib.h:927
uint8_t sha1_hash[20]
The SHA-1 message digest of the blob's uncompressed contents.
Definition: wimlib.h:1377
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:1123
Definition: wimlib.h:2426
uint32_t num_named_streams
Number of named data streams this file has.
Definition: wimlib.h:1520
No compression.
Definition: wimlib.h:450
The LZX compression format.
Definition: wimlib.h:492
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:2455
int wimlib_global_init(int init_flags)
Initialization function for wimlib.
Valid on messages WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM.
Definition: wimlib.h:1057
struct wimlib_progress_info::wimlib_progress_info_verify_image verify_image
const wimlib_tchar * path_in_wim
Path to the file in the WIM image.
Definition: wimlib.h:1065
int wimlib_verify_wim(WIMStruct *wim, int verify_flags)
Perform verification checks on a WIM file.
Definition: wimlib.h:2418
bool will_ignore
Indicates whether the error will be ignored or not.
Definition: wimlib.h:1171
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:430
Definition: wimlib.h:2446
Definition: wimlib.h:2434
Definition: wimlib.h:2394
uint64_t num_bytes_scanned
The number of bytes of file data detected so far, not counting excluded/unsupported files...
Definition: wimlib.h:869
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:2445
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:2430
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's header
Definition: wimlib.h:1319
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:2358
uint64_t total_bytes
An upper bound on the number of bytes of file data that will be written.
Definition: wimlib.h:760
Definition: wimlib.h:2456
File is being excluded from capture due to being of an unsupported type.
Definition: wimlib.h:827
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:731
uint32_t mounted_image
1-based index of image being unmounted.
Definition: wimlib.h:1080
long reserved
Reserved; set to 0.
Definition: wimlib.h:1214
A directory or file has been scanned.
Definition: wimlib.h:585
Definition: wimlib.h:2431
uint64_t uncompressed_size
If this blob is not missing, then this is the uncompressed size of this blob in bytes.
Definition: wimlib.h:1364
Structure passed to the wimlib_iterate_dir_tree() callback function.
Definition: wimlib.h:1449
Definition: wimlib.h:2440
int add_flags
Bitwise OR of WIMLIB_ADD_FLAG_* flags.
Definition: wimlib.h:2332
const wimlib_tchar * extraction_path
Path to which the file is being extracted.
Definition: wimlib.h:1068
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:1041
Valid on messages WIMLIB_PROGRESS_MSG_SCAN_BEGIN, WIMLIB_PROGRESS_MSG_SCAN_DENTRY, and WIMLIB_PROGRESS_MSG_SCAN_END.
Definition: wimlib.h:801
Definition: wimlib.h:2435
Definition: wimlib.h:2408
uint32_t num_threads
The number of threads being used for data compression; or, if no compression is being peformed...
Definition: wimlib.h:783
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:1456
enum wimlib_update_op op
Definition: wimlib.h:2364
Definition: wimlib.h:2453
void wimlib_print_header(const WIMStruct *wim)
Print the header of the WIM file (intended for debugging only).
Definition: wimlib.h:2410
uint32_t total_parts
Currently only used for WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.
Definition: wimlib.h:939
uint64_t total_bytes
The number of bytes in the WIM file that are covered by integrity checks.
Definition: wimlib.h:1003
uint32_t total_images
Definition: wimlib.h:1117
Starting to read a new part of a split pipable WIM over the pipe.
Definition: wimlib.h:554
uint32_t reserved_flags
Definition: wimlib.h:1406
wimlib_progress_msg
Possible values of the first parameter to the user-supplied wimlib_progress_func_t progress function...
Definition: wimlib.h:524
Definition: wimlib.h:2421
Definition: wimlib.h:2420
Definition: wimlib.h:2403
Definition: wimlib.h:2398
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:935
Rename a file or directory tree in the WIM image.
Definition: wimlib.h:2315
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:903
size_t completed_commands
Number of update commands that have been completed so far.
Definition: wimlib.h:990
Definition: wimlib.h:2407
File data is currently being extracted.
Definition: wimlib.h:550
This message may be sent periodically (not for every file) while files and directories are being crea...
Definition: wimlib.h:545
Add a new file or directory tree to the WIM image in a certain location.
Definition: wimlib.h:2309
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'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:1299
A wimlib_split() operation is in progress, and a split part has been finished.
Definition: wimlib.h:636
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:1036
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:1269
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:739
int wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret)
Read a WIM file's XML document into an in-memory buffer.
uint32_t unix_uid
The UNIX user ID of this file.
Definition: wimlib.h:1543
uint32_t extract_flags
Extraction flags being used.
Definition: wimlib.h:898
wimlib_tchar * config_file
Path to capture configuration file to use, or NULL for default.
Definition: wimlib.h:2329
const wimlib_tchar * from
Name of the temporary file that the WIM was written to.
Definition: wimlib.h:974
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:1469
int delete_flags
Bitwise OR of WIMLIB_DELETE_FLAG_* flags.
Definition: wimlib.h:2343
size_t total_commands
Number of update commands that are being executed as part of this call to wimlib_update_image().
Definition: wimlib.h:994
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's output compression type.
int error_code
The wimlib error code associated with the error.
Definition: wimlib.h:1164
uint32_t chunk_size
The size of each individually checksummed "chunk" in the integrity-checked region.
Definition: wimlib.h:1019
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:1122
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:1194
uint64_t reserved[14]
Definition: wimlib.h:1563
struct wimlib_progress_info::wimlib_progress_info_done_with_file done_with_file
Definition: wimlib.h:2391
uint8_t guid[WIMLIB_GUID_LEN]
Currently only used for WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.
Definition: wimlib.h:943
Definition: wimlib.h:2428
uint64_t completed_bytes
The number of bytes of file data that have been extracted so far.
Definition: wimlib.h:921
Definition: wimlib.h:2390
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:2441
uint64_t completed_bytes
The number of bytes that have been checksummed so far.
Definition: wimlib.h:1007
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:1434
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's children, ..., etc.
Definition: wimlib.h:1464
Definition: wimlib.h:2457
const wimlib_tchar * to
Name of the original WIM file to which the temporary file is being renamed.
Definition: wimlib.h:978
Data for a WIMLIB_UPDATE_OP_DELETE operation.
Definition: wimlib.h:2336
uint64_t current_file_count
For WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages...
Definition: wimlib.h:950
wimlib_verify_wim() has finished verifying the metadata for an image.
Definition: wimlib.h:682
wimlib_verify_wim() is verifying file data integrity.
Definition: wimlib.h:686
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's header
Definition: wimlib.h:1313
uint64_t completed_streams
Definition: wimlib.h:1126
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:2425
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:854
Definition: wimlib.h:2402
Definition: wimlib.h:2412
Valid on messages WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN.
Definition: wimlib.h:1072
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:1074
uint32_t unix_mode
The UNIX mode of this file.
Definition: wimlib.h:1555
An integrity table is being calculated for the WIM being written.
Definition: wimlib.h:627
Definition: wimlib.h:2447
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:1304
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:2423
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:1053
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:642
uint32_t completed_chunks
The number of chunks that have been checksummed so far.
Definition: wimlib.h:1015
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:1288
uint64_t num_dirs_scanned
The number of directories scanned so far, not counting excluded/unsupported files.
Definition: wimlib.h:859
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:579
uint8_t guid[WIMLIB_GUID_LEN]
The globally unique identifier for this WIM.
Definition: wimlib.h:1262
struct wimlib_progress_info::wimlib_progress_info_scan scan
uint64_t num_nondirs_scanned
The number of non-directories scanned so far, not counting excluded/unsupported files.
Definition: wimlib.h:864
Definition: wimlib.h:2442
Specification of an update to perform on a WIM image.
Definition: wimlib.h:2362
uint32_t image_count
The number of images in this WIM file.
Definition: wimlib.h:1265
Definition: wimlib.h:2389
This message may be sent periodically (not necessarily for every file) while file and directory metad...
Definition: wimlib.h:562
Definition: wimlib.h:2401
uint64_t hard_link_group_id
A unique identifier for this file's inode.
Definition: wimlib.h:1529
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:1381
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:1511
uint32_t image
The 1-based index of the image from which files are being extracted.
Definition: wimlib.h:895
uint64_t end_file_count
For WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages...
Definition: wimlib.h:968
uint16_t part_number
For split WIMs, the 1-based index of this part within the split WIM; otherwise 1. ...
Definition: wimlib.h:1280
Definition: wimlib.h:2433
struct wimlib_resource_entry resource
Info about this stream's data, such as its hash and size if known.
Definition: wimlib.h:1440
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:1418
struct wimlib_delete_command delete_
Definition: wimlib.h:2368
uint64_t total_bytes
The number of bytes of file data that will be extracted.
Definition: wimlib.h:917
Definition: wimlib.h:2438
Definition: wimlib.h:2404
Definition: wimlib.h:2392
File data is currently being written to the WIM.
Definition: wimlib.h:598
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:1374
const wimlib_tchar * full_path
Full path to this file within the WIM image.
Definition: wimlib.h:1460
uint32_t is_metadata
1 iff this blob contains the metadata for an image.
Definition: wimlib.h:1393
enum wimlib_progress_info::wimlib_progress_info_scan::@0 status
Dentry scan status, valid on WIMLIB_PROGRESS_MSG_SCAN_DENTRY.
Valid on messages WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION.
Definition: wimlib.h:1131
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:774
const wimlib_tchar * wimfile
Definition: wimlib.h:1116
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 WIM image that is being replaced.
Definition: wimlib.h:1059
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:1077
uint32_t unmount_flags
Flags passed to wimlib_unmount_image().
Definition: wimlib.h:1087
The progress function is being asked whether a file should be excluded from capture or not...
Definition: wimlib.h:700
The file is an absolute symbolic link or junction that points into the capture directory, and reparse-point fixups are enabled, so its target is being adjusted.
Definition: wimlib.h:835
struct wimlib_add_command add
Definition: wimlib.h:2367
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:2321
Definition: wimlib.h:2427
uint64_t reserved[4]
Definition: wimlib.h:1442
uint32_t wim_version
The version of the WIM file format used in this WIM file.
Definition: wimlib.h:1272
Definition: wimlib.h:2454
Definition: wimlib.h:2452
Definition: wimlib.h:2416
Definition: wimlib.h:2429
wimlib_tchar * wim_path
Path, specified from the root of the WIM image, for the file or directory tree within the WIM image t...
Definition: wimlib.h:2340
wimlib has used a file's data for the last time (including all data streams, if it has multiple)...
Definition: wimlib.h:673
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's header
Definition: wimlib.h:1310
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:2432
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:907
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.
uint32_t reserved[9]
Definition: wimlib.h:1327
Valid on messages WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND and WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND...
Definition: wimlib.h:983
wimlib_tchar * wim_target_path
Path, specified from the root of the WIM image, for the destination file or directory tree within the...
Definition: wimlib.h:2355
Definition: wimlib.h:2419
Information about a "blob", which is a fixed length sequence of binary data.
Definition: wimlib.h:1360
uint16_t total_parts
For split WIMs, the total number of parts in the split WIM; otherwise 1.
Definition: wimlib.h:1284
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:1593
Definition: wimlib.h:2422
struct timespec creation_time
Time this file was created.
Definition: wimlib.h:1532
A file in the WIM image is being replaced as a result of a wimlib_add_command without WIMLIB_ADD_FLAG...
Definition: wimlib.h:655
Data for a WIMLIB_UPDATE_OP_ADD operation.
Definition: wimlib.h:2319
uint32_t is_free
Definition: wimlib.h:1395
void wimlib_print_available_images(const WIMStruct *wim, int image)
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:931