X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwimlib.h;h=d1b22cd161cf608e4e82079f32954df50d41259c;hb=276f9f9f9658f4a8bafd6216db46760abe8c848d;hp=18417d19baf1041c3781ca0e14bf3117b4f1ea45;hpb=8d2bd90a2c9a151edc1619bf35be46b2fdda3e36;p=wimlib diff --git a/src/wimlib.h b/src/wimlib.h index 18417d19..d1b22cd1 100644 --- a/src/wimlib.h +++ b/src/wimlib.h @@ -270,11 +270,11 @@ */ typedef struct WIMStruct WIMStruct; -/** Byte of a string encoded in the locale-dependent encoding */ -typedef char wimlib_mbchar; - -/** Byte of a string encoded in UTF-8 */ -typedef char wimlib_utf8char; +#ifdef __WIN32__ +typedef wchar_t wimlib_tchar; +#else +typedef char wimlib_tchar; +#endif /** * Specifies the compression type of a WIM file. @@ -435,12 +435,12 @@ union wimlib_progress_info { * ::WIMLIB_PROGRESS_MSG_SCAN_END. */ struct wimlib_progress_info_scan { /** Directory or NTFS volume that is being scanned. */ - const wimlib_mbchar *source; + const wimlib_tchar *source; /** Path to the file or directory that is about to be scanned, * relative to the root of the image capture or the NTFS volume. * */ - const wimlib_mbchar *cur_path; + const wimlib_tchar *cur_path; /** True iff @a cur_path is being excluded from the image * capture due to the capture configuration file. */ @@ -449,7 +449,7 @@ union wimlib_progress_info { /** Target path in the WIM. Only valid on messages * ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and * ::WIMLIB_PROGRESS_MSG_SCAN_END. */ - const wimlib_mbchar *wim_target_path; + const wimlib_tchar *wim_target_path; } scan; /** Valid on messages ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, @@ -465,18 +465,18 @@ union wimlib_progress_info { int extract_flags; /** Full path to the WIM file being extracted. */ - const wimlib_mbchar *wimfile_name; + const wimlib_tchar *wimfile_name; /** Name of the image being extracted. */ - const wimlib_utf8char *image_name; + const wimlib_tchar *image_name; /** Directory or NTFS volume to which the image is being * extracted. */ - const wimlib_mbchar *target; + const wimlib_tchar *target; /** Current dentry being extracted. (Valid only if message is * ::WIMLIB_PROGRESS_MSG_EXTRACT_DENTRY.) */ - const wimlib_mbchar *cur_path; + const wimlib_tchar *cur_path; /** Number of bytes of uncompressed data that will be extracted. * Takes into account hard links (they are not counted for each @@ -498,11 +498,11 @@ union wimlib_progress_info { /** Valid on messages ::WIMLIB_PROGRESS_MSG_RENAME. */ struct wimlib_progress_info_rename { /** Name of the temporary file that the WIM was written to. */ - const wimlib_mbchar *from; + const wimlib_tchar *from; /** Name of the original WIM file to which the temporary file is * being renamed. */ - const wimlib_mbchar *to; + const wimlib_tchar *to; } rename; /** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and @@ -530,7 +530,7 @@ union wimlib_progress_info { /** Filename of the WIM (only valid if the message is * ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY). */ - const wimlib_mbchar *filename; + const wimlib_tchar *filename; } integrity; /** Valid on messages ::WIMLIB_PROGRESS_MSG_JOIN_STREAMS. */ @@ -572,7 +572,7 @@ union wimlib_progress_info { /** Name of the split WIM part that is about to be started * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). */ - const wimlib_mbchar *part_name; + const wimlib_tchar *part_name; } split; }; @@ -593,12 +593,12 @@ typedef int (*wimlib_progress_func_t)(enum wimlib_progress_msg msg_type, struct wimlib_capture_source { /** Absolute or relative path to a file or directory on the external * filesystem to be included in the WIM image. */ - wimlib_mbchar *fs_source_path; + wimlib_tchar *fs_source_path; /** Destination path in the WIM image. Leading and trailing slashes are * ignored. The empty string or @c NULL means the root directory of the * WIM image. */ - wimlib_mbchar *wim_target_path; + wimlib_tchar *wim_target_path; /** Reserved; set to 0. */ long reserved; @@ -764,6 +764,68 @@ struct wimlib_capture_source { * deleting an image in this way. */ #define WIMLIB_WRITE_FLAG_SOFT_DELETE 0x00000010 + +#if 0 +/**************************************************************** + * Definition of struct wimlib_modify_command, with various flags + ****************************************************************/ + +enum { + WIMLIB_MOVE_TREE_FLAG_OVERWRITE_ALL = 0x1, + WIMLIB_MOVE_TREE_FLAG_OVERWRITE_NONDIRECTORIES = 0x2, + WIMLIB_MOVE_TREE_FLAG_OVERWRITE_EMPTY_DIRECTORIES = 0x4, + WIMLIB_MOVE_TREE_FLAG_OVERWRITE_DIRECTORIES = 0x8, +}; + +enum { + WIMLIB_DELETE_TREE_FLAG_FORCE = 0x1, + WIMLIB_DELETE_TREE_FLAG_RECURSIVE = 0x2, + WIMLIB_DELETE_TREE_FLAG_REMOVE_EMPTY_DIR = 0x4, +}; + +enum { + WIMLIB_ADD_TREE_FLAG_DEREFERENCE = 0x1, + WIMLIB_ADD_TREE_FLAG_VERBOSE = 0x2, + WIMLIB_ADD_TREE_FLAG_UNIX_DATA = 0x4, + WIMLIB_ADD_TREE_FLAG_NOACLS = 0x8, + WIMLIB_ADD_TREE_FLAG_NTFS_VOLUME = 0x01, + WIMLIB_ADD_TREE_FLAG_OVERLAY = 0x02, + WIMLIB_ADD_TREE_FLAG_MAKE_NECESSARY_DIRS = 0x04, +}; + +enum wimlib_modify_op { + WIMLIB_MODIFY_OP_DELETE_TREE, + WIMLIB_MODIFY_OP_ADD_TREE, + WIMLIB_MODIFY_OP_MOVE_TREE, +}; + +struct wimlib_modify_command { + enum wimlib_modify_op op; + union { + struct wimlib_modify_command_delete_tree { + int delete_tree_flags; + const wimlib_tchar *tree_wim_path; + unsigned long reserved; + } delete_tree; + + struct wimlib_modify_command_add_tree { + int add_tree_flags; + const wimlib_tchar *fs_source_path; + const wimlib_tchar *wim_target_path; + unsigned long reserved; + } add_tree; + + struct wimlib_modify_command_move_tree { + int move_tree_flags; + const wimlib_tchar *wim_source_path; + const wimlib_tchar *wim_target_path; + unsigned long reserved; + } move_tree; + }; +}; +#endif + + /** * Possible values of the error code returned by many functions in wimlib. * @@ -924,10 +986,12 @@ enum wimlib_error_code { * wimlib was configured with the @c --without-ntfs-3g flag. */ extern int -wimlib_add_image(WIMStruct *wim, const wimlib_mbchar *source, - const wimlib_utf8char *name, - const wimlib_mbchar *config, - size_t config_len, int add_image_flags, +wimlib_add_image(WIMStruct *wim, + const wimlib_tchar *source, + const wimlib_tchar *name, + const wimlib_tchar *config, + size_t config_len, + int add_image_flags, wimlib_progress_func_t progress_func); /** This function is equivalent to wimlib_add_image() except it allows for @@ -956,8 +1020,8 @@ extern int wimlib_add_image_multisource(WIMStruct *w, struct wimlib_capture_source *sources, size_t num_sources, - const wimlib_utf8char *name, - const wimlib_mbchar *config_str, + const wimlib_tchar *name, + const wimlib_tchar *config_str, size_t config_len, int add_image_flags, wimlib_progress_func_t progress_func); @@ -1141,8 +1205,8 @@ wimlib_delete_image(WIMStruct *wim, int image); extern int wimlib_export_image(WIMStruct *src_wim, int src_image, WIMStruct *dest_wim, - const wimlib_utf8char *dest_name, - const wimlib_utf8char *dest_description, + const wimlib_tchar *dest_name, + const wimlib_tchar *dest_description, int export_flags, WIMStruct **additional_swms, unsigned num_additional_swms, @@ -1272,7 +1336,7 @@ wimlib_export_image(WIMStruct *src_wim, int src_image, */ extern int wimlib_extract_image(WIMStruct *wim, int image, - const wimlib_mbchar *target, + const wimlib_tchar *target, int extract_flags, WIMStruct **additional_swms, unsigned num_additional_swms, @@ -1346,7 +1410,7 @@ wimlib_get_compression_type(const WIMStruct *wim); * A statically allocated string: "None", "LZX", "XPRESS", or "Invalid", * respectively. */ -extern const wimlib_mbchar * +extern const wimlib_tchar * wimlib_get_compression_type_string(int ctype); /** @@ -1359,7 +1423,7 @@ wimlib_get_compression_type_string(int ctype); * Pointer to a statically allocated string describing the error code, * or @c NULL if the error code is not valid. */ -extern const wimlib_mbchar * +extern const wimlib_tchar * wimlib_get_error_string(enum wimlib_error_code code); /** @@ -1378,7 +1442,7 @@ wimlib_get_error_string(enum wimlib_error_code code); * in addition, the string will become invalid if the description of the * image is changed, the image is deleted, or the ::WIMStruct is destroyed. */ -extern const wimlib_utf8char * +extern const wimlib_tchar * wimlib_get_image_description(const WIMStruct *wim, int image); /** @@ -1400,7 +1464,7 @@ wimlib_get_image_description(const WIMStruct *wim, int image); * the WIM to be unnamed, in which case an empty string will be returned * when the corresponding name is requested. */ -extern const wimlib_utf8char * +extern const wimlib_tchar * wimlib_get_image_name(const WIMStruct *wim, int image); @@ -1482,7 +1546,7 @@ wimlib_has_integrity_table(const WIMStruct *wim); * the empty string, @c false is returned. */ extern bool -wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_utf8char *name); +wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name); /** * Joins a split WIM into a stand-alone one-part WIM. @@ -1522,9 +1586,9 @@ wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_utf8char *name); * wimlib_join(), since it is possible to export all images from a split WIM. */ extern int -wimlib_join(const wimlib_mbchar * const *swms, +wimlib_join(const wimlib_tchar * const *swms, unsigned num_swms, - const wimlib_mbchar *output_path, + const wimlib_tchar *output_path, int swm_open_flags, int wim_write_flags, wimlib_progress_func_t progress_func); @@ -1628,10 +1692,13 @@ wimlib_join(const wimlib_mbchar * const *swms, * support mounting a split WIM read-only. */ extern int -wimlib_mount_image(WIMStruct *wim, int image, const wimlib_mbchar *dir, - int mount_flags, WIMStruct **additional_swms, +wimlib_mount_image(WIMStruct *wim, + int image, + const wimlib_tchar *dir, + int mount_flags, + WIMStruct **additional_swms, unsigned num_additional_swms, - const wimlib_mbchar *staging_dir); + const wimlib_tchar *staging_dir); /** * Opens a WIM file and creates a ::WIMStruct for it. @@ -1712,8 +1779,10 @@ wimlib_mount_image(WIMStruct *wim, int image, const wimlib_mbchar *dir, * The XML data for @a wim_file is invalid. */ extern int -wimlib_open_wim(const wimlib_mbchar *wim_file, int open_flags, - WIMStruct **wim_ret, wimlib_progress_func_t progress_func); +wimlib_open_wim(const wimlib_tchar *wim_file, + int open_flags, + WIMStruct **wim_ret, + wimlib_progress_func_t progress_func); /** * Overwrites the file that the WIM was originally read from, with changes made. @@ -1950,7 +2019,7 @@ wimlib_print_wim_information(const WIMStruct *wim); */ extern int wimlib_resolve_image(WIMStruct *wim, - const wimlib_utf8char *image_name_or_num); + const wimlib_tchar *image_name_or_num); /** * Sets which image in the WIM is marked as bootable. @@ -1993,7 +2062,7 @@ wimlib_set_boot_idx(WIMStruct *wim, int boot_idx); */ extern int wimlib_set_image_descripton(WIMStruct *wim, int image, - const wimlib_utf8char *description); + const wimlib_tchar *description); /** * Changes what is written in the \ element in the WIM XML data @@ -2016,7 +2085,7 @@ wimlib_set_image_descripton(WIMStruct *wim, int image, * Failed to allocate the memory needed to duplicate the @a flags string. */ extern int wimlib_set_image_flags(WIMStruct *wim, int image, - const wimlib_utf8char *flags); + const wimlib_tchar *flags); /** * Changes the name of an image in the WIM. @@ -2041,7 +2110,7 @@ extern int wimlib_set_image_flags(WIMStruct *wim, int image, * Failed to allocate the memory needed to duplicate the @a name string. */ extern int wimlib_set_image_name(WIMStruct *wim, int image, - const wimlib_utf8char *name); + const wimlib_tchar *name); /** * Set the functions that wimlib uses to allocate and free memory. @@ -2134,8 +2203,10 @@ wimlib_set_print_errors(bool show_messages); * compressed resources re-compressed. */ extern int -wimlib_split(WIMStruct *wim, const wimlib_mbchar *swm_name, - size_t part_size, int write_flags, +wimlib_split(WIMStruct *wim, + const wimlib_tchar *swm_name, + size_t part_size, + int write_flags, wimlib_progress_func_t progress_func); /** @@ -2196,7 +2267,8 @@ wimlib_split(WIMStruct *wim, const wimlib_mbchar *swm_name, * been made to files in the staging directory. */ extern int -wimlib_unmount_image(const wimlib_mbchar *dir, int unmount_flags, +wimlib_unmount_image(const wimlib_tchar *dir, + int unmount_flags, wimlib_progress_func_t progress_func); /** @@ -2268,8 +2340,11 @@ wimlib_unmount_image(const wimlib_mbchar *dir, int unmount_flags, * path. */ extern int -wimlib_write(WIMStruct *wim, const wimlib_mbchar *path, int image, - int write_flags, unsigned num_threads, +wimlib_write(WIMStruct *wim, + const wimlib_tchar *path, + int image, + int write_flags, + unsigned num_threads, wimlib_progress_func_t progress_func); #endif /* _WIMLIB_H */