X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib%2Fblob_table.h;h=c86fac0d932efc9507b05c4549a3d83b1e0b6bc7;hp=e273de2531b8fd16280b5737c6421526e32afb75;hb=3abe6501c7ebb20a0ead1cd69ebd93cbe6b917e1;hpb=6f535b981a9192e1e2a38b3a8aaa8cd8124d8e96 diff --git a/include/wimlib/blob_table.h b/include/wimlib/blob_table.h index e273de25..c86fac0d 100644 --- a/include/wimlib/blob_table.h +++ b/include/wimlib/blob_table.h @@ -345,13 +345,31 @@ blob_extraction_targets(struct blob_descriptor *blob) return blob->blob_extraction_targets; } +/* + * Declare that the specified blob is located in the specified WIM resource at + * the specified offset. The caller is expected to set blob->size if required. + */ static inline void blob_set_is_located_in_wim_resource(struct blob_descriptor *blob, - struct wim_resource_descriptor *rdesc) + struct wim_resource_descriptor *rdesc, + u64 offset_in_res) { blob->blob_location = BLOB_IN_WIM; blob->rdesc = rdesc; list_add_tail(&blob->rdesc_node, &rdesc->blob_list); + blob->offset_in_res = offset_in_res; +} + +/* + * Declare that the specified blob is located in the specified non-solid WIM + * resource. In this case, the blob data is the entire uncompressed resource. + */ +static inline void +blob_set_is_located_in_nonsolid_wim_resource(struct blob_descriptor *blob, + struct wim_resource_descriptor *rdesc) +{ + blob_set_is_located_in_wim_resource(blob, rdesc, 0); + blob->size = rdesc->uncompressed_size; } static inline void @@ -361,6 +379,15 @@ blob_unset_is_located_in_wim_resource(struct blob_descriptor *blob) blob->blob_location = BLOB_NONEXISTENT; } +static inline void +blob_set_is_located_in_attached_buffer(struct blob_descriptor *blob, + void *buffer, size_t size) +{ + blob->blob_location = BLOB_IN_ATTACHED_BUFFER; + blob->attached_buffer = buffer; + blob->size = size; +} + extern struct blob_descriptor * new_blob_from_data_buffer(const void *buffer, size_t size, struct blob_table *blob_table);