X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib.h;h=32482032149e7e43df140eef5a9b5b39d832693f;hp=132233ff4b3f8d6ebc18c60245bc4bee14f48133;hb=82bfc7bdc6a85406dff3fa4f9fcc7b9fc0ae5de5;hpb=61ac5994e9fe3666d1c057dafca8c79406c59077 diff --git a/include/wimlib.h b/include/wimlib.h index 132233ff..32482032 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -180,6 +180,10 @@ /** Patch version of the library (for example, the 5 in 1.2.5). */ #define WIMLIB_PATCH_VERSION 0 +#ifdef __cplusplus +extern "C" { +#endif + /** * Opaque structure that represents a WIM file. This is an in-memory structure * and need not correspond to a specific on-disk file. However, a ::WIMStruct @@ -1339,6 +1343,7 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour * @name Init flags * * The following flags can be passed to wimlib_global_init(). + * @{ */ /** Assume that strings are represented in UTF-8, even if this is not the @@ -1374,6 +1379,7 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour * * The following flags can be passed to wimlib_reference_resource_files() and * wimlib_reference_resources(). + * @{ */ /** wimlib_reference_resource_files() only: Enable shell-style filename @@ -1392,6 +1398,50 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour * @} */ +/** Data for a ::WIMLIB_UPDATE_OP_ADD operation. */ +struct wimlib_add_command { + /** Filesystem path to the file or directory tree to + * add. */ + wimlib_tchar *fs_source_path; + /** Path, specified from the root of the WIM image, at + * which to add the file or directory tree within the + * WIM image. */ + wimlib_tchar *wim_target_path; + + /** Configuration for excluded files. @c NULL means + * exclude no files (use no configuration), unless + * ::WIMLIB_ADD_FLAG_WINCONFIG is specified in @p + * add_flags. */ + struct wimlib_capture_config *config; + + /** Bitwise OR of WIMLIB_ADD_FLAG_* flags. */ + int add_flags; +}; + +/** Data for a ::WIMLIB_UPDATE_OP_DELETE operation. */ +struct wimlib_delete_command { + /** Path, specified from the root of the WIM image, for + * the file or directory tree within the WIM image to be + * deleted. */ + wimlib_tchar *wim_path; + /** Bitwise OR of WIMLIB_DELETE_FLAG_* flags. */ + int delete_flags; +}; + +/** Data for a ::WIMLIB_UPDATE_OP_RENAME operation. */ +struct wimlib_rename_command { + /** Path, specified from the root of the WIM image, for + * the source file or directory tree within the WIM + * image. */ + wimlib_tchar *wim_source_path; + /** Path, specified from the root of the WIM image, for + * the destination file or directory tree within the WIM + * image. */ + wimlib_tchar *wim_target_path; + /** Reserved; set to 0. */ + int rename_flags; +}; + /** Specification of an update to perform on a WIM image. */ struct wimlib_update_command { @@ -1408,47 +1458,10 @@ struct wimlib_update_command { WIMLIB_UPDATE_OP_RENAME, } op; union { - /** Data for a ::WIMLIB_UPDATE_OP_ADD operation. */ - struct wimlib_add_command { - /** Filesystem path to the file or directory tree to - * add. */ - wimlib_tchar *fs_source_path; - /** Path, specified from the root of the WIM image, at - * which to add the file or directory tree within the - * WIM image. */ - wimlib_tchar *wim_target_path; - - /** Configuration for excluded files. @c NULL means - * exclude no files (use no configuration), unless - * ::WIMLIB_ADD_FLAG_WINCONFIG is specified in @p - * add_flags. */ - struct wimlib_capture_config *config; - - /** Bitwise OR of WIMLIB_ADD_FLAG_* flags. */ - int add_flags; - } add; - /** Data for a ::WIMLIB_UPDATE_OP_DELETE operation. */ - struct wimlib_delete_command { - /** Path, specified from the root of the WIM image, for - * the file or directory tree within the WIM image to be - * deleted. */ - wimlib_tchar *wim_path; - /** Bitwise OR of WIMLIB_DELETE_FLAG_* flags. */ - int delete_flags; - } delete; - /** Data for a ::WIMLIB_UPDATE_OP_RENAME operation. */ - struct wimlib_rename_command { - /** Path, specified from the root of the WIM image, for - * the source file or directory tree within the WIM - * image. */ - wimlib_tchar *wim_source_path; - /** Path, specified from the root of the WIM image, for - * the destination file or directory tree within the WIM - * image. */ - wimlib_tchar *wim_target_path; - /** Reserved; set to 0. */ - int rename_flags; - } rename; + struct wimlib_add_command add; + struct wimlib_delete_command delete_; /* Underscore is for C++ + compatibility. */ + struct wimlib_rename_command rename; }; }; @@ -2031,7 +2044,7 @@ wimlib_extract_image(WIMStruct *wim, int image, * wimlib_resolve_image() uses. However, unlike wimlib_extract_image(), * only a single image (not all images) can be specified. Alternatively, * specify @p NULL here to use the first image in the WIM if it contains - * exactly one image but otherwise return @p WIMLIB_ERR_INVALID_IMAGE. + * exactly one image but otherwise return ::WIMLIB_ERR_INVALID_IMAGE. * @param target * Same as the corresponding parameter to wimlib_extract_image(). * @param extract_flags @@ -2307,8 +2320,8 @@ wimlib_iterate_lookup_table(WIMStruct *wim, int flags, * Number of filenames in @p swms. * @param swm_open_flags * Open flags for the split WIM parts (e.g. - * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY). Note: WIMLIB_OPEN_FLAG_SPLIT_OK is - * automatically added to the value specified here. + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY). Note: ::WIMLIB_OPEN_FLAG_SPLIT_OK + * is automatically added to the value specified here. * @param wim_write_flags * Bitwise OR of relevant flags prefixed with WIMLIB_WRITE_FLAG, which will * be used to write the joined WIM. @@ -3365,4 +3378,8 @@ extern int wimlib_xpress_decompress(const void *compressed_data, unsigned compressed_len, void *uncompressed_data, unsigned uncompressed_len); +#ifdef __cplusplus +} +#endif + #endif /* _WIMLIB_H */