wimlib
wimlib.h
Go to the documentation of this file.
1 
364 #ifndef _WIMLIB_H
365 #define _WIMLIB_H
366 
367 #include <stdio.h>
368 #include <stddef.h>
369 #include <stdbool.h>
370 #include <inttypes.h>
371 #include <time.h>
372 
377 #define WIMLIB_MAJOR_VERSION 1
378 
380 #define WIMLIB_MINOR_VERSION 9
381 
383 #define WIMLIB_PATCH_VERSION 0
384 
385 #ifdef __cplusplus
386 extern "C" {
387 #endif
388 
393 #ifndef WIMLIB_WIMSTRUCT_DECLARED
394 typedef struct WIMStruct WIMStruct;
395 #define WIMLIB_WIMSTRUCT_DECLARED
396 #endif
397 
398 #ifdef __WIN32__
399 typedef wchar_t wimlib_tchar;
400 #else
401 
402 typedef char wimlib_tchar;
403 #endif
404 
405 #ifdef __WIN32__
406 
408 # define WIMLIB_WIM_PATH_SEPARATOR '\\'
409 # define WIMLIB_WIM_PATH_SEPARATOR_STRING L"\\"
410 #else
411 
413 # define WIMLIB_WIM_PATH_SEPARATOR '/'
414 # define WIMLIB_WIM_PATH_SEPARATOR_STRING "/"
415 #endif
416 
418 #define WIMLIB_WIM_ROOT_PATH WIMLIB_WIM_PATH_SEPARATOR_STRING
419 
422 #define WIMLIB_IS_WIM_ROOT_PATH(path) \
423  ((path)[0] == WIMLIB_WIM_PATH_SEPARATOR && \
424  (path)[1] == 0)
425 
427 #define WIMLIB_GUID_LEN 16
428 
448 
468 
490 
513 };
514 
522 
528 
535 
543 
548 
552 
560 
565 
570 
577 
583 
589 
596 
600 
605 
612 
619 
625 
630 
634 
640 
646 
653 
661 
665 
671 
675 
680 
684 
698 
720 };
721 
729 
733 
737 };
738 
746 
751 
757  uint64_t total_bytes;
758 
765  uint64_t total_streams;
766 
771  uint64_t completed_bytes;
772 
777 
780  uint32_t num_threads;
781 
785 
789  uint32_t total_parts;
790 
792  uint32_t completed_parts;
793  } write_streams;
794 
799 
804  const wimlib_tchar *source;
805 
810  const wimlib_tchar *cur_path;
811 
814  enum {
816  WIMLIB_SCAN_DENTRY_OK = 0,
817 
821 
825 
833 
839  } status;
840 
841  union {
845  const wimlib_tchar *wim_target_path;
846 
851  const wimlib_tchar *symlink_target;
852  };
853 
857 
861 
865  } scan;
866 
887 
890  uint32_t image;
891 
893  uint32_t extract_flags;
894 
898  const wimlib_tchar *wimfile_name;
899 
902  const wimlib_tchar *image_name;
903 
906  const wimlib_tchar *target;
907 
909  const wimlib_tchar *reserved;
910 
912  uint64_t total_bytes;
913 
916  uint64_t completed_bytes;
917 
922  uint64_t total_streams;
923 
927 
930  uint32_t part_number;
931 
934  uint32_t total_parts;
935 
938  uint8_t guid[WIMLIB_GUID_LEN];
939 
946 
963  uint64_t end_file_count;
964  } extract;
965 
969  const wimlib_tchar *from;
970 
973  const wimlib_tchar *to;
974  } rename;
975 
982 
986 
990  } update;
991 
995 
998  uint64_t total_bytes;
999 
1003 
1006  uint32_t total_chunks;
1007 
1011 
1014  uint32_t chunk_size;
1015 
1018  const wimlib_tchar *filename;
1019  } integrity;
1020 
1026  uint64_t total_bytes;
1027 
1032 
1037 
1039  unsigned total_parts;
1040 
1048  wimlib_tchar *part_name;
1049  } split;
1050 
1054  const wimlib_tchar *path_in_wim;
1055  } replace;
1056 
1060  const wimlib_tchar *path_in_wim;
1061 
1063  const wimlib_tchar *extraction_path;
1064  } wimboot_exclude;
1065 
1069  const wimlib_tchar *mountpoint;
1070 
1072  const wimlib_tchar *mounted_wim;
1073 
1075  uint32_t mounted_image;
1076 
1079  uint32_t mount_flags;
1080 
1082  uint32_t unmount_flags;
1083  } unmount;
1084 
1105  const wimlib_tchar *path_to_file;
1106  } done_with_file;
1107 
1111  const wimlib_tchar *wimfile;
1112  uint32_t total_images;
1113  uint32_t current_image;
1114  } verify_image;
1115 
1118  const wimlib_tchar *wimfile;
1119  uint64_t total_streams;
1120  uint64_t total_bytes;
1123  } verify_streams;
1124 
1127 
1140  const wimlib_tchar *path;
1141 
1150 
1153 
1156  const wimlib_tchar *path;
1157 
1160 
1167  } handle_error;
1168 };
1169 
1188 typedef enum wimlib_progress_status
1190  union wimlib_progress_info *info,
1191  void *progctx);
1192 
1202  wimlib_tchar *fs_source_path;
1203 
1206  wimlib_tchar *wim_target_path;
1207 
1209  long reserved;
1210 };
1211 
1222 #define WIMLIB_CHANGE_READONLY_FLAG 0x00000001
1223 
1226 #define WIMLIB_CHANGE_GUID 0x00000002
1227 
1230 #define WIMLIB_CHANGE_BOOT_INDEX 0x00000004
1231 
1238 #define WIMLIB_CHANGE_RPFIX_FLAG 0x00000008
1239 
1254 
1257  uint8_t guid[WIMLIB_GUID_LEN];
1258 
1260  uint32_t image_count;
1261 
1264  uint32_t boot_index;
1265 
1267  uint32_t wim_version;
1268 
1271  uint32_t chunk_size;
1272 
1275  uint16_t part_number;
1276 
1279  uint16_t total_parts;
1280 
1284 
1287  uint64_t total_bytes;
1288 
1290  uint32_t has_integrity_table : 1;
1291 
1294  uint32_t opened_from_file : 1;
1295 
1299  uint32_t is_readonly : 1;
1300 
1302  uint32_t has_rpfix : 1;
1303 
1305  uint32_t is_marked_readonly : 1;
1306 
1308  uint32_t spanned : 1;
1309 
1311  uint32_t write_in_progress : 1;
1312 
1314  uint32_t metadata_only : 1;
1315 
1317  uint32_t resource_only : 1;
1318 
1320  uint32_t pipable : 1;
1321  uint32_t reserved_flags : 22;
1322  uint32_t reserved[9];
1323 };
1324 
1356 
1360 
1364 
1369  uint64_t offset;
1370 
1372  uint8_t sha1_hash[20];
1373 
1376  uint32_t part_number;
1377 
1382 
1385  uint32_t is_compressed : 1;
1386 
1388  uint32_t is_metadata : 1;
1389 
1390  uint32_t is_free : 1;
1391  uint32_t is_spanned : 1;
1392 
1396  uint32_t is_missing : 1;
1397 
1399  uint32_t packed : 1;
1400 
1401  uint32_t reserved_flags : 26;
1402 
1406 
1410 
1414 
1415  uint64_t reserved[1];
1416 };
1417 
1430 
1432  const wimlib_tchar *stream_name;
1433 
1435  struct wimlib_resource_entry resource;
1436 
1437  uint64_t reserved[4];
1438 };
1439 
1447  const wimlib_tchar *filename;
1448 
1451  const wimlib_tchar *dos_name;
1452 
1455  const wimlib_tchar *full_path;
1456 
1459  size_t depth;
1460 
1464  const char *security_descriptor;
1465 
1468 
1469 #define WIMLIB_FILE_ATTRIBUTE_READONLY 0x00000001
1470 #define WIMLIB_FILE_ATTRIBUTE_HIDDEN 0x00000002
1471 #define WIMLIB_FILE_ATTRIBUTE_SYSTEM 0x00000004
1472 #define WIMLIB_FILE_ATTRIBUTE_DIRECTORY 0x00000010
1473 #define WIMLIB_FILE_ATTRIBUTE_ARCHIVE 0x00000020
1474 #define WIMLIB_FILE_ATTRIBUTE_DEVICE 0x00000040
1475 #define WIMLIB_FILE_ATTRIBUTE_NORMAL 0x00000080
1476 #define WIMLIB_FILE_ATTRIBUTE_TEMPORARY 0x00000100
1477 #define WIMLIB_FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
1478 #define WIMLIB_FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
1479 #define WIMLIB_FILE_ATTRIBUTE_COMPRESSED 0x00000800
1480 #define WIMLIB_FILE_ATTRIBUTE_OFFLINE 0x00001000
1481 #define WIMLIB_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
1482 #define WIMLIB_FILE_ATTRIBUTE_ENCRYPTED 0x00004000
1483 #define WIMLIB_FILE_ATTRIBUTE_VIRTUAL 0x00010000
1484 
1488  uint32_t attributes;
1489 
1490 #define WIMLIB_REPARSE_TAG_RESERVED_ZERO 0x00000000
1491 #define WIMLIB_REPARSE_TAG_RESERVED_ONE 0x00000001
1492 #define WIMLIB_REPARSE_TAG_MOUNT_POINT 0xA0000003
1493 #define WIMLIB_REPARSE_TAG_HSM 0xC0000004
1494 #define WIMLIB_REPARSE_TAG_HSM2 0x80000006
1495 #define WIMLIB_REPARSE_TAG_DRIVER_EXTENDER 0x80000005
1496 #define WIMLIB_REPARSE_TAG_SIS 0x80000007
1497 #define WIMLIB_REPARSE_TAG_DFS 0x8000000A
1498 #define WIMLIB_REPARSE_TAG_DFSR 0x80000012
1499 #define WIMLIB_REPARSE_TAG_FILTER_MANAGER 0x8000000B
1500 #define WIMLIB_REPARSE_TAG_WOF 0x80000017
1501 #define WIMLIB_REPARSE_TAG_SYMLINK 0xA000000C
1502 
1506  uint32_t reparse_tag;
1507 
1512  uint32_t num_links;
1513 
1516 
1525 
1527  struct timespec creation_time;
1528 
1530  struct timespec last_write_time;
1531 
1533  struct timespec last_access_time;
1534 
1538  uint32_t unix_uid;
1539 
1543  uint32_t unix_gid;
1544 
1550  uint32_t unix_mode;
1551 
1556  uint32_t unix_rdev;
1557 
1558  uint64_t reserved[14];
1559 
1574  struct wimlib_stream_entry streams[];
1575 };
1576 
1581 typedef int (*wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry,
1582  void *user_ctx);
1583 
1589  void *user_ctx);
1590 
1593 #define WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE 0x00000001
1594 
1597 #define WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN 0x00000002
1598 
1604 #define WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED 0x00000004
1605 
1606 
1620 #define WIMLIB_ADD_FLAG_NTFS 0x00000001
1621 
1624 #define WIMLIB_ADD_FLAG_DEREFERENCE 0x00000002
1625 
1629 #define WIMLIB_ADD_FLAG_VERBOSE 0x00000004
1630 
1639 #define WIMLIB_ADD_FLAG_BOOT 0x00000008
1640 
1646 #define WIMLIB_ADD_FLAG_UNIX_DATA 0x00000010
1647 
1650 #define WIMLIB_ADD_FLAG_NO_ACLS 0x00000020
1651 
1657 #define WIMLIB_ADD_FLAG_STRICT_ACLS 0x00000040
1658 
1663 #define WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE 0x00000080
1664 
1672 #define WIMLIB_ADD_FLAG_RPFIX 0x00000100
1673 
1675 #define WIMLIB_ADD_FLAG_NORPFIX 0x00000200
1676 
1681 #define WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE 0x00000400
1682 
1698 #define WIMLIB_ADD_FLAG_WINCONFIG 0x00000800
1699 
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 
1758 #define WIMLIB_ADD_FLAG_SNAPSHOT 0x00008000
1759 
1768 #define WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED 0x00010000
1769 
1775 #define WIMLIB_DELETE_FLAG_FORCE 0x00000001
1776 
1779 #define WIMLIB_DELETE_FLAG_RECURSIVE 0x00000002
1780 
1791 #define WIMLIB_EXPORT_FLAG_BOOT 0x00000001
1792 
1796 #define WIMLIB_EXPORT_FLAG_NO_NAMES 0x00000002
1797 
1799 #define WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS 0x00000004
1800 
1804 #define WIMLIB_EXPORT_FLAG_GIFT 0x00000008
1805 
1821 #define WIMLIB_EXPORT_FLAG_WIMBOOT 0x00000010
1822 
1836 #define WIMLIB_EXTRACT_FLAG_NTFS 0x00000001
1837 
1841 #define WIMLIB_EXTRACT_FLAG_UNIX_DATA 0x00000020
1842 
1845 #define WIMLIB_EXTRACT_FLAG_NO_ACLS 0x00000040
1846 
1854 #define WIMLIB_EXTRACT_FLAG_STRICT_ACLS 0x00000080
1855 
1863 #define WIMLIB_EXTRACT_FLAG_RPFIX 0x00000100
1864 
1868 #define WIMLIB_EXTRACT_FLAG_NORPFIX 0x00000200
1869 
1872 #define WIMLIB_EXTRACT_FLAG_TO_STDOUT 0x00000400
1873 
1882 #define WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES 0x00000800
1883 
1892 #define WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS 0x00001000
1893 
1897 #define WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS 0x00002000
1898 
1901 #define WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES 0x00004000
1902 
1907 #define WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS 0x00008000
1908 
1921 #define WIMLIB_EXTRACT_FLAG_GLOB_PATHS 0x00040000
1922 
1926 #define WIMLIB_EXTRACT_FLAG_STRICT_GLOB 0x00080000
1927 
1932 #define WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES 0x00100000
1933 
1939 #define WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE 0x00200000
1940 
1946 #define WIMLIB_EXTRACT_FLAG_WIMBOOT 0x00400000
1947 
1956 #define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K 0x01000000
1957 
1960 #define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K 0x02000000
1961 
1964 #define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K 0x04000000
1965 
1968 #define WIMLIB_EXTRACT_FLAG_COMPACT_LZX 0x08000000
1969 
1975 #define WIMLIB_MOUNT_FLAG_READWRITE 0x00000001
1976 
1978 #define WIMLIB_MOUNT_FLAG_DEBUG 0x00000002
1979 
1981 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE 0x00000004
1982 
1986 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR 0x00000008
1987 
1990 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS 0x00000010
1991 
1994 #define WIMLIB_MOUNT_FLAG_UNIX_DATA 0x00000020
1995 
1998 #define WIMLIB_MOUNT_FLAG_ALLOW_OTHER 0x00000040
1999 
2010 #define WIMLIB_OPEN_FLAG_CHECK_INTEGRITY 0x00000001
2011 
2015 #define WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT 0x00000002
2016 
2025 #define WIMLIB_OPEN_FLAG_WRITE_ACCESS 0x00000004
2026 
2033 #define WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY 0x00000001
2034 
2037 #define WIMLIB_UNMOUNT_FLAG_COMMIT 0x00000002
2038 
2041 #define WIMLIB_UNMOUNT_FLAG_REBUILD 0x00000004
2042 
2045 #define WIMLIB_UNMOUNT_FLAG_RECOMPRESS 0x00000008
2046 
2055 #define WIMLIB_UNMOUNT_FLAG_FORCE 0x00000010
2056 
2061 #define WIMLIB_UNMOUNT_FLAG_NEW_IMAGE 0x00000020
2062 
2069 #define WIMLIB_UPDATE_FLAG_SEND_PROGRESS 0x00000001
2070 
2083 #define WIMLIB_WRITE_FLAG_CHECK_INTEGRITY 0x00000001
2084 
2090 #define WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY 0x00000002
2091 
2105 #define WIMLIB_WRITE_FLAG_PIPABLE 0x00000004
2106 
2111 #define WIMLIB_WRITE_FLAG_NOT_PIPABLE 0x00000008
2112 
2138 #define WIMLIB_WRITE_FLAG_RECOMPRESS 0x00000010
2139 
2153 #define WIMLIB_WRITE_FLAG_FSYNC 0x00000020
2154 
2167 #define WIMLIB_WRITE_FLAG_REBUILD 0x00000040
2168 
2178 #define WIMLIB_WRITE_FLAG_SOFT_DELETE 0x00000080
2179 
2189 #define WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG 0x00000100
2190 
2197 #define WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS 0x00000200
2198 
2200 #define WIMLIB_WRITE_FLAG_STREAMS_OK 0x00000400
2201 
2208 #define WIMLIB_WRITE_FLAG_RETAIN_GUID 0x00000800
2209 
2245 #define WIMLIB_WRITE_FLAG_SOLID 0x00001000
2246 
2252 #define WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES 0x00002000
2253 
2259 #define WIMLIB_WRITE_FLAG_NO_SOLID_SORT 0x00004000
2260 
2277 #define WIMLIB_WRITE_FLAG_UNSAFE_COMPACT 0x00008000
2278 
2286 #define WIMLIB_INIT_FLAG_ASSUME_UTF8 0x00000001
2287 
2296 #define WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES 0x00000002
2297 
2303 #define WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES 0x00000004
2304 
2310 #define WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES 0x00000008
2311 
2314 #define WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE 0x00000010
2315 
2318 #define WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE 0x00000020
2319 
2326 #define WIMLIB_REF_FLAG_GLOB_ENABLE 0x00000001
2327 
2335 #define WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH 0x00000002
2336 
2346 
2349 
2352 };
2353 
2357  wimlib_tchar *fs_source_path;
2358 
2361  wimlib_tchar *wim_target_path;
2362 
2365  wimlib_tchar *config_file;
2366 
2369 };
2370 
2373 
2376  wimlib_tchar *wim_path;
2377 
2380 };
2381 
2384 
2387  wimlib_tchar *wim_source_path;
2388 
2391  wimlib_tchar *wim_target_path;
2392 
2395 };
2396 
2399 
2401 
2402  union {
2404  struct wimlib_delete_command delete_; /* Underscore is for C++
2405  compatibility. */
2407  };
2408 };
2409 
2502 };
2503 
2504 
2506 #define WIMLIB_NO_IMAGE 0
2507 
2509 #define WIMLIB_ALL_IMAGES (-1)
2510 
2541 extern int
2543  const wimlib_tchar *name,
2544  int *new_idx_ret);
2545 
2597 extern int
2599  const wimlib_tchar *source,
2600  const wimlib_tchar *name,
2601  const wimlib_tchar *config_file,
2602  int add_flags);
2603 
2619 extern int
2621  const struct wimlib_capture_source *sources,
2622  size_t num_sources,
2623  const wimlib_tchar *name,
2624  const wimlib_tchar *config_file,
2625  int add_flags);
2626 
2636 extern int
2637 wimlib_add_tree(WIMStruct *wim, int image,
2638  const wimlib_tchar *fs_source_path,
2639  const wimlib_tchar *wim_target_path, int add_flags);
2640 
2669 extern int
2671 
2700 extern int
2701 wimlib_delete_image(WIMStruct *wim, int image);
2702 
2711 extern int
2712 wimlib_delete_path(WIMStruct *wim, int image,
2713  const wimlib_tchar *path, int delete_flags);
2714 
2782 extern int
2783 wimlib_export_image(WIMStruct *src_wim, int src_image,
2784  WIMStruct *dest_wim,
2785  const wimlib_tchar *dest_name,
2786  const wimlib_tchar *dest_description,
2787  int export_flags);
2788 
2896 extern int
2897 wimlib_extract_image(WIMStruct *wim, int image,
2898  const wimlib_tchar *target, int extract_flags);
2899 
2938 extern int
2939 wimlib_extract_image_from_pipe(int pipe_fd,
2940  const wimlib_tchar *image_num_or_name,
2941  const wimlib_tchar *target, int extract_flags);
2942 
2952 extern int
2954  const wimlib_tchar *image_num_or_name,
2955  const wimlib_tchar *target,
2956  int extract_flags,
2957  wimlib_progress_func_t progfunc,
2958  void *progctx);
2959 
2976 extern int
2977 wimlib_extract_pathlist(WIMStruct *wim, int image,
2978  const wimlib_tchar *target,
2979  const wimlib_tchar *path_list_file,
2980  int extract_flags);
2981 
3055 extern int
3057  int image,
3058  const wimlib_tchar *target,
3059  const wimlib_tchar * const *paths,
3060  size_t num_paths,
3061  int extract_flags);
3062 
3077 extern int
3078 wimlib_extract_xml_data(WIMStruct *wim, FILE *fp);
3079 
3092 extern void
3093 wimlib_free(WIMStruct *wim);
3094 
3108 extern const wimlib_tchar *
3110 
3124 extern const wimlib_tchar *
3126 
3133 extern const wimlib_tchar *
3134 wimlib_get_image_description(const WIMStruct *wim, int image);
3135 
3144 extern const wimlib_tchar *
3145 wimlib_get_image_name(const WIMStruct *wim, int image);
3146 
3175 extern const wimlib_tchar *
3176 wimlib_get_image_property(const WIMStruct *wim, int image,
3177  const wimlib_tchar *property_name);
3178 
3190 extern uint32_t
3191 wimlib_get_version(void);
3192 
3207 extern int
3208 wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info);
3209 
3237 extern int
3238 wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret);
3239 
3259 extern int
3260 wimlib_global_init(int init_flags);
3261 
3268 extern void
3269 wimlib_global_cleanup(void);
3270 
3287 extern bool
3288 wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name);
3289 
3332 extern int
3333 wimlib_iterate_dir_tree(WIMStruct *wim, int image, const wimlib_tchar *path,
3334  int flags,
3335  wimlib_iterate_dir_tree_callback_t cb, void *user_ctx);
3336 
3366 extern int
3367 wimlib_iterate_lookup_table(WIMStruct *wim, int flags,
3369  void *user_ctx);
3370 
3407 extern int
3408 wimlib_join(const wimlib_tchar * const *swms,
3409  unsigned num_swms,
3410  const wimlib_tchar *output_path,
3411  int swm_open_flags,
3412  int wim_write_flags);
3413 
3425 extern int
3426 wimlib_join_with_progress(const wimlib_tchar * const *swms,
3427  unsigned num_swms,
3428  const wimlib_tchar *output_path,
3429  int swm_open_flags,
3430  int wim_write_flags,
3431  wimlib_progress_func_t progfunc,
3432  void *progctx);
3433 
3434 
3510 extern int
3512  int image,
3513  const wimlib_tchar *dir,
3514  int mount_flags,
3515  const wimlib_tchar *staging_dir);
3516 
3586 extern int
3587 wimlib_open_wim(const wimlib_tchar *wim_file,
3588  int open_flags,
3589  WIMStruct **wim_ret);
3590 
3602 extern int
3603 wimlib_open_wim_with_progress(const wimlib_tchar *wim_file,
3604  int open_flags,
3605  WIMStruct **wim_ret,
3606  wimlib_progress_func_t progfunc,
3607  void *progctx);
3608 
3668 extern int
3669 wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads);
3670 
3687 extern void
3688 wimlib_print_available_images(const WIMStruct *wim, int image);
3689 
3695 extern void
3696 wimlib_print_header(const WIMStruct *wim);
3697 
3739 extern int
3741  const wimlib_tchar * const *resource_wimfiles_or_globs,
3742  unsigned count,
3743  int ref_flags,
3744  int open_flags);
3745 
3766 extern int
3767 wimlib_reference_resources(WIMStruct *wim, WIMStruct **resource_wims,
3768  unsigned num_resource_wims, int ref_flags);
3769 
3831 extern int
3832 wimlib_reference_template_image(WIMStruct *wim, int new_image,
3833  WIMStruct *template_wim, int template_image,
3834  int flags);
3835 
3851 extern void
3853  wimlib_progress_func_t progfunc,
3854  void *progctx);
3855 
3865 extern int
3866 wimlib_rename_path(WIMStruct *wim, int image,
3867  const wimlib_tchar *source_path, const wimlib_tchar *dest_path);
3868 
3899 extern int
3901  const wimlib_tchar *image_name_or_num);
3902 
3920 extern int
3921 wimlib_set_error_file(FILE *fp);
3922 
3939 extern int
3940 wimlib_set_error_file_by_name(const wimlib_tchar *path);
3941 
3948 extern int
3949 wimlib_set_image_descripton(WIMStruct *wim, int image,
3950  const wimlib_tchar *description);
3951 
3959 extern int
3960 wimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags);
3961 
3968 extern int
3969 wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name);
3970 
4008 extern int
4009 wimlib_set_image_property(WIMStruct *wim, int image,
4010  const wimlib_tchar *property_name,
4011  const wimlib_tchar *property_value);
4012 
4041 extern int
4042 wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
4043  void (*free_func)(void *),
4044  void *(*realloc_func)(void *, size_t));
4045 
4071 extern int
4072 wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size);
4073 
4080 extern int
4081 wimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size);
4082 
4102 extern int
4104  enum wimlib_compression_type ctype);
4105 
4112 extern int
4114  enum wimlib_compression_type ctype);
4115 
4138 extern int
4139 wimlib_set_print_errors(bool show_messages);
4140 
4164 extern int
4165 wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info,
4166  int which);
4167 
4206 extern int
4207 wimlib_split(WIMStruct *wim,
4208  const wimlib_tchar *swm_name,
4209  uint64_t part_size,
4210  int write_flags);
4211 
4249 extern int
4250 wimlib_verify_wim(WIMStruct *wim, int verify_flags);
4251 
4285 extern int
4286 wimlib_unmount_image(const wimlib_tchar *dir, int unmount_flags);
4287 
4295 extern int
4296 wimlib_unmount_image_with_progress(const wimlib_tchar *dir,
4297  int unmount_flags,
4298  wimlib_progress_func_t progfunc,
4299  void *progctx);
4300 
4396 extern int
4398  int image,
4399  const struct wimlib_update_command *cmds,
4400  size_t num_cmds,
4401  int update_flags);
4402 
4464 extern int
4465 wimlib_write(WIMStruct *wim,
4466  const wimlib_tchar *path,
4467  int image,
4468  int write_flags,
4469  unsigned num_threads);
4470 
4491 extern int
4493  int fd,
4494  int image,
4495  int write_flags,
4496  unsigned num_threads);
4497 
4515 struct wimlib_compressor;
4516 
4518 struct wimlib_decompressor;
4519 
4549 extern int
4550 wimlib_set_default_compression_level(int ctype, unsigned int compression_level);
4551 
4560 extern uint64_t
4562  size_t max_block_size,
4563  unsigned int compression_level);
4564 
4565 #define WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE 0x80000000
4566 
4635 extern int
4637  size_t max_block_size,
4638  unsigned int compression_level,
4639  struct wimlib_compressor **compressor_ret);
4640 
4661 extern size_t
4662 wimlib_compress(const void *uncompressed_data, size_t uncompressed_size,
4663  void *compressed_data, size_t compressed_size_avail,
4664  struct wimlib_compressor *compressor);
4665 
4672 extern void
4673 wimlib_free_compressor(struct wimlib_compressor *compressor);
4674 
4708 extern int
4710  size_t max_block_size,
4711  struct wimlib_decompressor **decompressor_ret);
4712 
4740 extern int
4741 wimlib_decompress(const void *compressed_data, size_t compressed_size,
4742  void *uncompressed_data, size_t uncompressed_size,
4743  struct wimlib_decompressor *decompressor);
4744 
4751 extern void
4752 wimlib_free_decompressor(struct wimlib_decompressor *decompressor);
4753 
4754 
4760 #ifdef __cplusplus
4761 }
4762 #endif
4763 
4764 #endif /* _WIMLIB_H */
const wimlib_tchar * filename
Name of the file, or NULL if this file is unnamed.
Definition: wimlib.h:1447
const wimlib_tchar * stream_name
Name of the stream, or NULL if the stream is unnamed.
Definition: wimlib.h:1432
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:1405
Valid on messages WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and WIMLIB_PROGRESS_MSG_SPLIT_END_PART.
Definition: wimlib.h:1023
wimlib_tchar * wim_target_path
Destination path in the WIM image.
Definition: wimlib.h:2361
A WIM image is about to be extracted.
Definition: wimlib.h:527
Definition: wimlib.h:2432
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:1039
Valid on messages WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE.
Definition: wimlib.h:1058
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:789
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:810
Definition: wimlib.h:2484
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:674
Definition: wimlib.h:2452
uint32_t total_chunks
The number of individually checksummed "chunks" the integrity-checked region is divided into...
Definition: wimlib.h:1006
Definition: wimlib.h:2431
Valid on messages WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and WIMLIB_PROGRESS_MSG_CALC_INTEGRITY.
Definition: wimlib.h:994
Definition: wimlib.h:2445
Valid on messages WIMLIB_PROGRESS_MSG_RENAME.
Definition: wimlib.h:967
Definition: wimlib.h:2429
wimlib_overwrite() has successfully renamed the temporary file to the original WIM file...
Definition: wimlib.h:611
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:394
The image has been successfully extracted.
Definition: wimlib.h:564
const wimlib_tchar * target
Path to the directory or NTFS volume to which the files are being extracted.
Definition: wimlib.h:906
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:2435
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:1202
uint64_t total_bytes
Total size of the original WIM&#39;s file and metadata resources (compressed).
Definition: wimlib.h:1026
Valid on the message WIMLIB_PROGRESS_MSG_WRITE_STREAMS.
Definition: wimlib.h:750
Definition: wimlib.h:2493
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:1363
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...
File is being excluded from capture due to being of an unsupported type.
Definition: wimlib.h:824
uint32_t current_image
Definition: wimlib.h:1113
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:1581
wimlib_update_op
The specific type of update to perform.
Definition: wimlib.h:2342
uint64_t reserved[1]
Definition: wimlib.h:1415
int32_t compression_type
The compression type being used, as one of the wimlib_compression_type constants. ...
Definition: wimlib.h:784
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:1543
const wimlib_tchar * path
Path to the file for which exclusion is being tested.
Definition: wimlib.h:1140
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.
Definition: wimlib.h:2485
The LZMS compression format.
Definition: wimlib.h:512
Definition: wimlib.h:2450
Reparse-point fixups are enabled, but the file is an absolute symbolic link or junction that does not...
Definition: wimlib.h:838
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:2420
Definition: wimlib.h:2471
Definition: wimlib.h:2478
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:1105
A WIM update command has been executed.
Definition: wimlib.h:645
uint32_t unix_rdev
The UNIX device ID (major and minor number) of this file.
Definition: wimlib.h:1556
uint32_t attributes
File attributes, such as whether the file is a directory or not.
Definition: wimlib.h:1488
uint32_t num_links
Number of links to this file&#39;s inode (hard links).
Definition: wimlib.h:1512
bool will_exclude
Indicates whether the file or directory will be excluded from capture or not.
Definition: wimlib.h:1148
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
Per-image metadata is about to be written to the WIM file.
Definition: wimlib.h:599
Definition: wimlib.h:2449
struct wimlib_progress_info::wimlib_progress_info_integrity integrity
const wimlib_tchar * reserved
Reserved.
Definition: wimlib.h:909
const wimlib_tchar * filename
For WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages, this is the path to the WIM file being checked...
Definition: wimlib.h:1018
Definition: wimlib.h:2422
A pointer to this union is passed to the user-supplied wimlib_progress_func_t progress function...
Definition: wimlib.h:745
Definition: wimlib.h:2442
uint32_t completed_parts
This is currently broken and will always be 0.
Definition: wimlib.h:792
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:1409
Definition: wimlib.h:2424
Definition: wimlib.h:2494
Delete a file or directory tree from the WIM image.
Definition: wimlib.h:2348
Definition: wimlib.h:2441
The operation should be continued.
Definition: wimlib.h:732
The contents of the WIM file are being checked against the integrity table.
Definition: wimlib.h:618
Definition: wimlib.h:2436
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:2459
Valid on messages WIMLIB_PROGRESS_MSG_DONE_WITH_FILE.
Definition: wimlib.h:1086
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:719
Data for a WIMLIB_UPDATE_OP_RENAME operation.
Definition: wimlib.h:2383
Definition: wimlib.h:2433
struct wimlib_progress_info::wimlib_progress_info_verify_streams verify_streams
One or more file or directory trees within a WIM image is about to be extracted.
Definition: wimlib.h:534
Valid on messages WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN, WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGI...
Definition: wimlib.h:886
wimlib_tchar * wim_target_path
Destination path in the WIM image.
Definition: wimlib.h:1206
uint32_t chunk_size
The default compression chunk size of resources in this WIM file.
Definition: wimlib.h:1271
Definition: wimlib.h:2474
Definition: wimlib.h:2496
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 a WIM image.
Definition: wimlib.h:664
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:660
A wimlib_split() operation is in progress, and a new split part is about to be started.
Definition: wimlib.h:629
An array of these structures is passed to wimlib_add_image_multisource() to specify the sources from ...
Definition: wimlib.h:1199
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:1152
Definition: wimlib.h:2486
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:467
The files or directory trees have been successfully extracted.
Definition: wimlib.h:569
General information about a WIM file.
Definition: wimlib.h:1253
uint64_t completed_streams
The number of distinct file data "blobs" that have been written so far.
Definition: wimlib.h:776
Definition: wimlib.h:2421
const wimlib_tchar * path
Path to the file for which the error occurred, or NULL if not relevant.
Definition: wimlib.h:1156
The per-image metadata has been written to the WIM file.
Definition: wimlib.h:604
int wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads)
Commit a WIMStruct to disk, updating its backing file.
char wimlib_tchar
See Locales and character encodings.
Definition: wimlib.h:402
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:1287
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:439
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:765
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
Length of the above security descriptor.
Definition: wimlib.h:1467
uint32_t mount_flags
Flags that were passed to wimlib_mount_image() when the mountpoint was set up.
Definition: wimlib.h:1079
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:981
Valid on messages WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE and WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE.
Definition: wimlib.h:1110
Definition: wimlib.h:2483
const wimlib_tchar * wim_target_path
Target path in the WIM image.
Definition: wimlib.h:845
Definition: wimlib.h:2423
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:2387
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:804
Definition: wimlib.h:2447
Definition: wimlib.h:2472
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:588
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:1381
uint64_t total_streams
The number of file streams that will be extracted.
Definition: wimlib.h:922
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:1118
Definition: wimlib.h:2461
uint32_t num_named_streams
Number of named data streams this file has.
Definition: wimlib.h:1515
No compression.
Definition: wimlib.h:447
The LZX compression format.
Definition: wimlib.h:489
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:2490
int wimlib_global_init(int init_flags)
Initialization function for wimlib.
Valid on messages WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM.
Definition: wimlib.h:1052
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:1060
int wimlib_verify_wim(WIMStruct *wim, int verify_flags)
Perform verification checks on a WIM file.
Definition: wimlib.h:2453
bool will_ignore
Indicates whether the error will be ignored or not.
Definition: wimlib.h:1166
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:427
Definition: wimlib.h:2481
Definition: wimlib.h:2469
Definition: wimlib.h:2430
uint64_t num_bytes_scanned
The number of bytes of file data detected so far, not counting excluded/unsupported files...
Definition: wimlib.h:864
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:2480
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:2465
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.
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:2394
uint64_t total_bytes
An upper bound on the number of bytes of file data that will be written.
Definition: wimlib.h:757
Definition: wimlib.h:2491
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:728
uint32_t mounted_image
1-based index of image being unmounted.
Definition: wimlib.h:1075
long reserved
Reserved; set to 0.
Definition: wimlib.h:1209
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:1189
A directory or file has been scanned.
Definition: wimlib.h:582
Definition: wimlib.h:2466
uint64_t uncompressed_size
If this blob is not missing, then this is the uncompressed size of this blob in bytes.
Definition: wimlib.h:1359
Structure passed to the wimlib_iterate_dir_tree() callback function.
Definition: wimlib.h:1444
Definition: wimlib.h:2475
int add_flags
Bitwise OR of WIMLIB_ADD_FLAG_* flags.
Definition: wimlib.h:2368
const wimlib_tchar * extraction_path
Path to which the file is being extracted.
Definition: wimlib.h:1063
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:1036
Valid on messages WIMLIB_PROGRESS_MSG_SCAN_BEGIN, WIMLIB_PROGRESS_MSG_SCAN_DENTRY, and WIMLIB_PROGRESS_MSG_SCAN_END.
Definition: wimlib.h:798
Definition: wimlib.h:2470
Definition: wimlib.h:2444
uint32_t num_threads
The number of threads being used for data compression; or, if no compression is being performed...
Definition: wimlib.h:780
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:1451
Definition: wimlib.h:2488
void wimlib_print_header(const WIMStruct *wim)
Print the header of the WIM file (intended for debugging only).
Definition: wimlib.h:2446
uint32_t total_parts
Currently only used for WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.
Definition: wimlib.h:934
uint64_t total_bytes
The number of bytes in the WIM file that are covered by integrity checks.
Definition: wimlib.h:998
Definition: wimlib.h:2499
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:1588
uint32_t total_images
Definition: wimlib.h:1112
Starting to read a new part of a split pipable WIM over the pipe.
Definition: wimlib.h:551
wimlib_progress_msg
Possible values of the first parameter to the user-supplied wimlib_progress_func_t progress function...
Definition: wimlib.h:521
Definition: wimlib.h:2456
Definition: wimlib.h:2455
Definition: wimlib.h:2439
Definition: wimlib.h:2434
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:930
Rename a file or directory tree in the WIM image.
Definition: wimlib.h:2351
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:898
size_t completed_commands
Number of update commands that have been completed so far.
Definition: wimlib.h:985
Definition: wimlib.h:2443
File data is currently being extracted.
Definition: wimlib.h:547
This message may be sent periodically (not for every file) while files and directories are being crea...
Definition: wimlib.h:542
Add a new file or directory tree to the WIM image in a certain location.
Definition: wimlib.h:2345
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.
A wimlib_split() operation is in progress, and a split part has been finished.
Definition: wimlib.h:633
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:1031
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:1264
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:736
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:1538
uint32_t extract_flags
Extraction flags being used.
Definition: wimlib.h:893
wimlib_tchar * config_file
Path to capture configuration file to use, or NULL for default.
Definition: wimlib.h:2365
const wimlib_tchar * from
Name of the temporary file that the WIM was written to.
Definition: wimlib.h:969
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:1464
int delete_flags
Bitwise OR of WIMLIB_DELETE_FLAG_* flags.
Definition: wimlib.h:2379
size_t total_commands
Number of update commands that are being executed as part of this call to wimlib_update_image().
Definition: wimlib.h:989
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:1159
uint32_t chunk_size
The size of each individually checksummed "chunk" in the integrity-checked region.
Definition: wimlib.h:1014
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:1117
struct wimlib_progress_info::wimlib_progress_info_done_with_file done_with_file
Definition: wimlib.h:2427
Definition: wimlib.h:2463
uint64_t completed_bytes
The number of bytes of file data that have been extracted so far.
Definition: wimlib.h:916
Definition: wimlib.h:2426
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:2476
uint64_t completed_bytes
The number of bytes that have been checksummed so far.
Definition: wimlib.h:1002
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:1429
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:1459
Definition: wimlib.h:2492
const wimlib_tchar * to
Name of the original WIM file to which the temporary file is being renamed.
Definition: wimlib.h:973
Data for a WIMLIB_UPDATE_OP_DELETE operation.
Definition: wimlib.h:2372
uint64_t current_file_count
For WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages...
Definition: wimlib.h:945
wimlib_verify_wim() has finished verifying the metadata for an image.
Definition: wimlib.h:679
wimlib_verify_wim() is verifying file data integrity.
Definition: wimlib.h:683
int wimlib_set_image_descripton(WIMStruct *wim, int image, const wimlib_tchar *description)
Change the description of a WIM image.
uint64_t completed_streams
Definition: wimlib.h:1121
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:2460
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:851
Definition: wimlib.h:2438
Definition: wimlib.h:2448
Valid on messages WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN.
Definition: wimlib.h:1067
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:1069
uint32_t unix_mode
The UNIX mode of this file.
Definition: wimlib.h:1550
An integrity table is being calculated for the WIM being written.
Definition: wimlib.h:624
Definition: wimlib.h:2482
struct wimlib_progress_info::wimlib_progress_info_update update
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:2458
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:1048
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:639
uint32_t completed_chunks
The number of chunks that have been checksummed so far.
Definition: wimlib.h:1010
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:1283
uint64_t num_dirs_scanned
The number of directories scanned so far, not counting excluded/unsupported files.
Definition: wimlib.h:856
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:576
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:860
Definition: wimlib.h:2477
Definition: wimlib.h:2501
Specification of an update to perform on a WIM image.
Definition: wimlib.h:2398
Definition: wimlib.h:2497
uint32_t image_count
The number of images in this WIM file.
Definition: wimlib.h:1260
Definition: wimlib.h:2425
This message may be sent periodically (not necessarily for every file) while file and directory metad...
Definition: wimlib.h:559
Definition: wimlib.h:2437
uint64_t hard_link_group_id
A unique identifier for this file&#39;s inode.
Definition: wimlib.h:1524
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:1376
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:1506
uint32_t image
The 1-based index of the image from which files are being extracted.
Definition: wimlib.h:890
uint64_t end_file_count
For WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages...
Definition: wimlib.h:963
uint16_t part_number
For split WIMs, the 1-based index of this part within the split WIM; otherwise 1. ...
Definition: wimlib.h:1275
Definition: wimlib.h:2468
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:1413
uint64_t total_bytes
The number of bytes of file data that will be extracted.
Definition: wimlib.h:912
Definition: wimlib.h:2473
Definition: wimlib.h:2440
Definition: wimlib.h:2428
File data is currently being written to the WIM.
Definition: wimlib.h:595
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:1369
const wimlib_tchar * full_path
Full path to this file within the WIM image.
Definition: wimlib.h:1455
Valid on messages WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION.
Definition: wimlib.h:1126
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:771
const wimlib_tchar * wimfile
Definition: wimlib.h:1111
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:1054
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:1072
uint32_t unmount_flags
Flags passed to wimlib_unmount_image().
Definition: wimlib.h:1082
The progress function is being asked whether a file should be excluded from capture or not...
Definition: wimlib.h:697
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:2357
Definition: wimlib.h:2462
uint32_t wim_version
The version of the WIM file format used in this WIM file.
Definition: wimlib.h:1267
Definition: wimlib.h:2489
File is being excluded from capture due to the capture configuration.
Definition: wimlib.h:820
Definition: wimlib.h:2487
Definition: wimlib.h:2451
Definition: wimlib.h:2464
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:2376
wimlib has used a file&#39;s data for the last time (including all data streams, if it has multiple)...
Definition: wimlib.h:670
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.
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:2467
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:902
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:978
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:2391
Definition: wimlib.h:2454
Information about a "blob", which is a fixed length sequence of binary data.
Definition: wimlib.h:1355
uint16_t total_parts
For split WIMs, the total number of parts in the split WIM; otherwise 1.
Definition: wimlib.h:1279
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:832
Definition: wimlib.h:2457
A file in the WIM image is being replaced as a result of a wimlib_add_command without WIMLIB_ADD_FLAG...
Definition: wimlib.h:652
Data for a WIMLIB_UPDATE_OP_ADD operation.
Definition: wimlib.h:2355
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:926