Retrieve information about a WIM or WIM image.
More...
|
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 FILE* instead of retrieved in an in-memory buffer. More...
|
|
const wimlib_tchar * | wimlib_get_image_description (const WIMStruct *wim, int image) |
| Get the description of the specified image. More...
|
|
const wimlib_tchar * | wimlib_get_image_name (const WIMStruct *wim, int image) |
| Get the name of the specified image. More...
|
|
int | wimlib_get_wim_info (WIMStruct *wim, struct wimlib_wim_info *info) |
| Get basic information about a WIM file. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
void | wimlib_print_available_images (const WIMStruct *wim, int image) |
| Print information about one image, or all images, contained in a WIM. More...
|
|
void | wimlib_print_header (const WIMStruct *wim) |
| Print the header of the WIM file (intended for debugging only). More...
|
|
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. More...
|
|
Retrieve information about a WIM or WIM image.
#define WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE 0x00000001 |
#define WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN 0x00000002 |
For wimlib_iterate_dir_tree(): Don't iterate on the file or directory itself; only its children (in the case of a non-empty directory)
#define WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED 0x00000004 |
typedef int(* wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry, void *user_ctx) |
typedef int(* wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resource_entry *resource, void *user_ctx) |
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 FILE*
instead of retrieved in an in-memory buffer.
- Returns
- 0 on success; a wimlib_error_code value on failure. This may return any error code which can be returned by wimlib_get_xml_data() as well as the following error codes:
- Return values
-
Get the description of the specified image.
- Parameters
-
wim | Pointer to the WIMStruct to query. This need not represent a standalone WIM (e.g. it could represent part of a split WIM). |
image | The 1-based index of the image for which to query the description. |
- Returns
- The description of the image, or
NULL
if there is no such image, or NULL
if the specified image has no description. The string may not remain valid after later library calls, so the caller should duplicate it if needed.
Get the name of the specified image.
- Parameters
-
wim | Pointer to the WIMStruct to query. This need not represent a standalone WIM (e.g. it could represent part of a split WIM). |
image | The 1-based index of the image for which to query the name. |
- Returns
- The name of the image, or
NULL
if there is no such image, or an empty string if the image is unnamed. The string may not remain valid after later library calls, so the caller should duplicate it if needed.
Get basic information about a WIM file.
- Parameters
-
wim | Pointer to the WIMStruct to query. This need not represent a standalone WIM (e.g. it could represent part of a split WIM). |
info | A wimlib_wim_info structure that will be filled in with information about the WIM file. |
- Returns
- 0
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.
The XML document contains metadata about the WIM file and the images stored in it.
- Parameters
-
wim | Pointer to the WIMStruct to query. This need not represent a standalone WIM (e.g. it could represent part of a split WIM). |
buf_ret | On success, a pointer to an allocated buffer containing the raw UTF16-LE XML document is written to this location. |
bufsize_ret | The size of the XML document in bytes is written to this location. |
- Returns
- 0 on success; a wimlib_error_code value on failure.
- Return values
-
Determine if an image name is already used by some image in the WIM.
- Parameters
-
wim | Pointer to the WIMStruct to query. This need not represent a standalone WIM (e.g. it could represent part of a split WIM). |
name | The name to check. |
- Returns
true
if there is already an image in wim
named name
; false
if there is no image named name
in wim
. If name
is NULL
or the empty string, then false
is returned.
Iterate through a file or directory tree in the WIM image.
By specifying appropriate flags and a callback function, you can get the attributes of a file in the WIM image, get a directory listing, or even get a listing of the entire WIM image.
- Parameters
-
wim | The WIMStruct containing the image(s) over which to iterate. This WIMStruct must contain image metadata, so it cannot be the non-first part of a split WIM (for example). |
image | The 1-based index of the image that contains the files or directories to iterate over, or WIMLIB_ALL_IMAGES to iterate over all images. |
path | Path in the WIM image at which to do the iteration. |
flags | Bitwise OR of flags prefixed with WIMLIB_ITERATE_DIR_TREE_FLAG. |
cb | A callback function that will receive each directory entry. |
user_ctx | An extra parameter that will always be passed to the callback function cb . |
- Returns
- Normally, returns 0 if all calls to
cb
returned 0; otherwise the first nonzero value that was returned from cb
. However, additional wimlib_error_code values may be returned, including the following:
- Return values
-
This function can additionally return WIMLIB_ERR_DECOMPRESSION, WIMLIB_ERR_INVALID_METADATA_RESOURCE, WIMLIB_ERR_METADATA_NOT_FOUND, WIMLIB_ERR_READ, or WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which indicate failure (for different reasons) to read the metadata resource for an image over which iteration needed to be done.
Iterate through the blob lookup table of a WIMStruct.
This can be used to directly get a listing of the unique "blobs" contained in a WIM file, which are deduplicated over all images.
Specifically, each listed blob may be from any of the following sources:
- Parameters
-
wim | Pointer to the WIMStruct for which to get the blob listing. |
flags | Reserved; set to 0. |
cb | A callback function that will receive each blob. |
user_ctx | An extra parameter that will always be passed to the callback function cb . |
- Returns
- 0 if all calls to
cb
returned 0; otherwise the first nonzero value that was returned from cb
.
void wimlib_print_available_images |
( |
const WIMStruct * |
wim, |
|
|
int |
image |
|
) |
| |
Print information about one image, or all images, contained in a WIM.
- Parameters
-
wim | Pointer to the WIMStruct to query. This need not represent a standalone WIM (e.g. it could represent part of a split WIM). |
image | The 1-based index of the image for which to print information, or WIMLIB_ALL_IMAGES to print information about all images. |
- Returns
- This function has no return value. No error checking is done when printing the information. If
image
is invalid, an error message is printed.
void wimlib_print_header |
( |
const WIMStruct * |
wim | ) |
|
Print the header of the WIM file (intended for debugging only).
Translate a string specifying the name or number of an image in the WIM into the number of the image.
The images are numbered starting at 1.
- Parameters
-
wim | Pointer to the WIMStruct for a WIM. |
image_name_or_num | A string specifying the name or number of an image in the WIM. If it parses to a positive integer, this integer is taken to specify the number of the image, indexed starting at 1. Otherwise, it is taken to be the name of an image, as given in the XML data for the WIM file. It also may be the keyword "all" or the string "*", both of which will resolve to WIMLIB_ALL_IMAGES.
There is no way to search for an image actually named "all", "*", or an integer number, or an image that has no name. However, you can use wimlib_get_image_name() to get the name of any image. |
- Returns
- If the string resolved to a single existing image, the number of that image, indexed starting at 1, is returned. If the keyword "all" or "*" was specified, WIMLIB_ALL_IMAGES is returned. Otherwise, WIMLIB_NO_IMAGE is returned. If
image_name_or_num
was NULL
or the empty string, WIMLIB_NO_IMAGE is returned, even if one or more images in wim
has no name. (Since a WIM may have multiple unnamed images, an unnamed image must be specified by index to eliminate the ambiguity.)