X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Fwim.h;h=67f55e3bb0ed24df599161cf7fd314ef01b80028;hb=d04a25a537201b46832cac28725a45bf559dc318;hp=4cf6779f93830cf4227773b046f87de5130b1983;hpb=cf13fe6161a69db6cbf17637b60c978fd746078a;p=wimlib diff --git a/include/wimlib/wim.h b/include/wimlib/wim.h index 4cf6779f..67f55e3b 100644 --- a/include/wimlib/wim.h +++ b/include/wimlib/wim.h @@ -67,6 +67,11 @@ struct WIMStruct { * referenced from other WIMStructs. */ struct blob_table *blob_table; + /* The number of references to this WIMStruct. This is equal to the + * number of resource descriptors that reference this WIMStruct, plus 1 + * if wimlib_free() still needs to be called. */ + ssize_t refcnt; + /* * The 1-based index of the currently selected image in this WIMStruct, * or WIMLIB_NO_IMAGE if no image is currently selected. @@ -105,16 +110,6 @@ struct WIMStruct { u8 decompressor_ctype; u32 decompressor_max_block_size; - /* - * 'subwims' is the list of dependent WIMStructs (linked by - * 'subwim_node') that have been opened by calls to - * wimlib_reference_resource_files(). These WIMStructs must be retained - * so that resources from them can be used. They are internal to the - * library and are not visible to API users. - */ - struct list_head subwims; - struct list_head subwim_node; - /* Temporary field; use sparingly */ void *private; @@ -190,6 +185,9 @@ static inline bool wim_is_pipable(const WIMStruct *wim) return (wim->hdr.magic == PWM_MAGIC); } +extern void +wim_decrement_refcnt(WIMStruct *wim); + extern bool wim_has_solid_resources(const WIMStruct *wim);