2025-10-11 01:35:43 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=11" / >
2026-10-08 20:15:08 +01:00
< meta name = "generator" content = "Doxygen 1.18.0" / >
2025-10-11 01:35:43 +01:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > libaaruformat: CacheHeader Struct Reference< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "dynsections.js" > < / script >
2026-10-08 20:15:08 +01:00
< script type = "text/javascript" src = "codefolding.js" > < / script >
2025-10-11 01:35:43 +01:00
< script type = "text/javascript" src = "clipboard.js" > < / script >
< link href = "navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "navtreedata.js" > < / script >
< script type = "text/javascript" src = "navtree.js" > < / script >
< script type = "text/javascript" src = "cookie.js" > < / script >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "search/searchdata.js" > < / script >
< script type = "text/javascript" src = "search/search.js" > < / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr id = "projectrow" >
< td id = "projectalign" >
< div id = "projectname" > libaaruformat< span id = "projectnumber" >   1.0< / span >
< / div >
< div id = "projectbrief" > Aaru Data Preservation Suite - Format Library< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2026-10-08 20:15:08 +01:00
<!-- Generated by Doxygen 1.18.0 -->
2025-10-11 01:35:43 +01:00
< script type = "text/javascript" >
2026-10-08 20:15:08 +01:00
let searchBox = new SearchBox("searchBox", "search/",'.html');
2025-10-11 01:35:43 +01:00
< / script >
< script type = "text/javascript" >
2026-10-08 20:15:08 +01:00
document.addEventListener('DOMContentLoaded', codefold.init);
< / script >
< script type = "application/json" id = "doxygen-config" >
{
"relPath": "",
"generateTreeView": true,
"searchEngine": true,
"serverBasedSearch": false,
"disableIndex": false,
"dynamicMenus": true,
"fullSidebar": false
}
2025-10-11 01:35:43 +01:00
< / script >
< script type = "text/javascript" src = "menudata.js" > < / script >
< script type = "text/javascript" src = "menu.js" > < / script >
2026-10-08 20:15:08 +01:00
< div id = "main-nav-mobile" >
< div class = "sm sm-dox" > < input id = "main-menu-state" type = "checkbox" / >
< label class = "main-menu-btn" for = "main-menu-state" >
< span class = "main-menu-btn-icon" > < / span > Toggle main menu visibility< / label >
< span id = "searchBoxPos1" > < / span >
< / div >
< / div > <!-- main - nav - mobile -->
< div id = "main-nav" >
< ul class = "sm sm-dox" id = "main-menu" >
< li id = "searchBoxPos2" >
< div id = "MSearchBox" class = "MSearchBoxInactive" >
< span class = "left" >
< span id = "MSearchSelect" class = "search-icon" > < span class = "search-icon-dropdown" > < / span > < / span >
< input type = "text" id = "MSearchField" value = "" placeholder = "Search" accesskey = "S" / >
< / span > < span class = "right" >
< a id = "MSearchClose" href = "javascript:searchBox.CloseResultsWindow()" > < div id = "MSearchCloseImg" class = "close-icon" > < / div > < / a >
< / span >
< / div >
< / li >
< / ul >
< / div > <!-- main - nav -->
2025-10-11 01:35:43 +01:00
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
2026-10-08 20:15:08 +01:00
< div id = "splitbar" class = "ui-resizable-handle" >
2025-10-11 01:35:43 +01:00
< / div >
< / div >
< script type = "text/javascript" >
2026-10-08 20:15:08 +01:00
document.addEventListener('DOMContentLoaded',() => { initNavTree('structCacheHeader.html','',''); });
2025-10-11 01:35:43 +01:00
< / script >
< div id = "container" >
< div id = "doc-content" >
<!-- window showing the filter options -->
2026-10-08 20:15:08 +01:00
< div id = "MSearchSelectWindow" >
2025-10-11 01:35:43 +01:00
< / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< div id = "MSearchResults" >
< div class = "SRPage" >
< div id = "SRIndex" >
< div id = "SRResults" > < / div >
< div class = "SRStatus" id = "Loading" > Loading...< / div >
< div class = "SRStatus" id = "Searching" > Searching...< / div >
< div class = "SRStatus" id = "NoMatches" > No Matches< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "header" >
< div class = "headertitle" > < div class = "title" > CacheHeader Struct Reference< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< p > Cache top-level descriptor encapsulating the hash table root and capacity limit.
< a href = "#details" > More...< / a > < / p >
< p > < code > #include < < a class = "el" href = "lru_8h_source.html" > aaruformat/lru.h< / a > > < / code > < / p >
< table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 id = "header-pub-attribs" class = "groupheader" > < a id = "pub-attribs" name = "pub-attribs" > < / a >
Data Fields< / h2 > < / td > < / tr >
2026-10-08 20:15:08 +01:00
< tr class = "memitem:af82718ebf5e59a398bc6e9428a389bb2" id = "r_af82718ebf5e59a398bc6e9428a389bb2" > < td class = "memItemLeft" > uint64_t  < / td > < td class = "memItemRight" > < a class = "el" href = "#af82718ebf5e59a398bc6e9428a389bb2" > max_bytes< / a > < / td > < / tr >
< tr class = "memdesc:af82718ebf5e59a398bc6e9428a389bb2" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Memory budget in bytes for the cached values. 0 means unlimited. < br / > < / td > < / tr >
< tr class = "memitem:ae6521ccf8e75b0c9c70297af637b1eaa" id = "r_ae6521ccf8e75b0c9c70297af637b1eaa" > < td class = "memItemLeft" > uint64_t  < / td > < td class = "memItemRight" > < a class = "el" href = "#ae6521ccf8e75b0c9c70297af637b1eaa" > cur_bytes< / a > < / td > < / tr >
< tr class = "memdesc:ae6521ccf8e75b0c9c70297af637b1eaa" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Bytes currently held by the cached values. < br / > < / td > < / tr >
2026-04-11 23:17:09 +01:00
< tr class = "memitem:a44229bb929d8949f3c2700d07123d224" id = "r_a44229bb929d8949f3c2700d07123d224" > < td class = "memItemLeft" > struct < a class = "el" href = "structCacheEntry.html" > CacheEntry< / a > *  < / td > < td class = "memItemRight" > < a class = "el" href = "#a44229bb929d8949f3c2700d07123d224" > cache< / a > < / td > < / tr >
2025-10-11 01:35:43 +01:00
< tr class = "memdesc:a44229bb929d8949f3c2700d07123d224" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Hash root (uthash). NULL when empty. < br / > < / td > < / tr >
2026-10-08 20:15:08 +01:00
< tr class = "memitem:a54d553e78f5d90cce34ee684829a410f" id = "r_a54d553e78f5d90cce34ee684829a410f" > < td class = "memItemLeft" > void(*)  < / td > < td class = "memItemRight" > < a class = "el" href = "#a54d553e78f5d90cce34ee684829a410f" > free_func< / a > (void *)< / td > < / tr >
< tr class = "memdesc:a54d553e78f5d90cce34ee684829a410f" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Optional callback to free cached values. NULL if not needed. < br / > < / td > < / tr >
2025-10-11 01:35:43 +01:00
< / table >
< a name = "details" id = "details" > < / a > < h2 id = "header-details" class = "groupheader" > Detailed Description< / h2 >
< div class = "textblock" > < p > Cache top-level descriptor encapsulating the hash table root and capacity limit. < / p >
2026-10-08 20:15:08 +01:00
< p > The cache is bounded by the total number of < em > bytes< / em > held by its values, not by the number of entries: the caches in this library store values of wildly different sizes (a block header is a few dozen bytes, a decompressed data block is megabytes), so an entry-count limit cannot express a memory budget. On insert, the least recently used entries are evicted until the cache is back under max_bytes.< / p >
2025-10-11 01:35:43 +01:00
< p > Fields:< / p > < ul >
2026-10-08 20:15:08 +01:00
< li > max_bytes: Memory budget in bytes; 0 means unlimited.< / li >
< li > cur_bytes: Bytes currently held by the cached values.< / li >
2026-04-11 23:17:09 +01:00
< li > cache: uthash root pointer; NULL when the cache is empty.< / li >
2026-10-08 20:15:08 +01:00
< li > free_func: Optional callback to free cached values on eviction/clear.< / li >
2025-10-11 01:35:43 +01:00
< / ul >
2026-10-08 20:15:08 +01:00
< p > The entry just inserted is never evicted, so a caller may keep using the pointer it handed over for the remainder of the call even if the value is larger than max_bytes. < / p >
2025-10-11 01:35:43 +01:00
2026-10-08 20:15:08 +01:00
< p class = "definition" > Definition at line < a class = "el" href = "lru_8h_source.html#l00050" > 50< / a > of file < a class = "el" href = "lru_8h_source.html" > lru.h< / a > .< / p >
2025-10-11 01:35:43 +01:00
< / div > < a name = "doc-variable-members" id = "doc-variable-members" > < / a > < h2 id = "header-doc-variable-members" class = "groupheader" > Field Documentation< / h2 >
< a id = "a44229bb929d8949f3c2700d07123d224" name = "a44229bb929d8949f3c2700d07123d224" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a44229bb929d8949f3c2700d07123d224" > ◆   < / a > < / span > cache< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > struct < a class = "el" href = "structCacheEntry.html" > CacheEntry< / a > * CacheHeader::cache< / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Hash root (uthash). NULL when empty. < / p >
2026-10-08 20:15:08 +01:00
< p class = "definition" > Definition at line < a class = "el" href = "lru_8h_source.html#l00054" > 54< / a > of file < a class = "el" href = "lru_8h_source.html" > lru.h< / a > .< / p >
< p class = "reference" > Referenced by < a class = "el" href = "create_8c_source.html#l00291" > aaruf_create()< / a > , < a class = "el" href = "open_8c_source.html#l00236" > aaruf_open()< / a > , < a class = "el" href = "lru_8c_source.html#l00068" > add_to_cache_uint64()< / a > , < a class = "el" href = "lru_8c_source.html#l00020" > drop_entry()< / a > , < a class = "el" href = "lru_8c_source.html#l00041" > find_in_cache_uint64()< / a > , and < a class = "el" href = "lru_8c_source.html#l00118" > free_cache()< / a > .< / p >
< / div >
< / div >
< a id = "ae6521ccf8e75b0c9c70297af637b1eaa" name = "ae6521ccf8e75b0c9c70297af637b1eaa" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ae6521ccf8e75b0c9c70297af637b1eaa" > ◆   < / a > < / span > cur_bytes< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > uint64_t CacheHeader::cur_bytes< / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Bytes currently held by the cached values. < / p >
< p class = "definition" > Definition at line < a class = "el" href = "lru_8h_source.html#l00053" > 53< / a > of file < a class = "el" href = "lru_8h_source.html" > lru.h< / a > .< / p >
2025-10-11 01:35:43 +01:00
2026-10-08 20:15:08 +01:00
< p class = "reference" > Referenced by < a class = "el" href = "create_8c_source.html#l00291" > aaruf_create()< / a > , < a class = "el" href = "open_8c_source.html#l00236" > aaruf_open()< / a > , < a class = "el" href = "lru_8c_source.html#l00068" > add_to_cache_uint64()< / a > , < a class = "el" href = "lru_8c_source.html#l00020" > drop_entry()< / a > , and < a class = "el" href = "lru_8c_source.html#l00118" > free_cache()< / a > .< / p >
2025-12-31 10:59:13 +00:00
< / div >
< / div >
2026-10-08 20:15:08 +01:00
< a id = "a54d553e78f5d90cce34ee684829a410f" name = "a54d553e78f5d90cce34ee684829a410f" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a54d553e78f5d90cce34ee684829a410f" > ◆   < / a > < / span > free_func< / h2 >
2025-12-31 10:59:13 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2026-10-08 20:15:08 +01:00
< td class = "memname" > void(*) CacheHeader::free_func(void *)< / td >
2025-12-31 10:59:13 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2026-04-11 23:17:09 +01:00
< p > Optional callback to free cached values. NULL if not needed. < / p >
2025-12-31 10:59:13 +00:00
2026-10-08 20:15:08 +01:00
< p class = "definition" > Definition at line < a class = "el" href = "lru_8h_source.html#l00055" > 55< / a > of file < a class = "el" href = "lru_8h_source.html" > lru.h< / a > .< / p >
2025-12-31 10:59:13 +00:00
2026-10-08 20:15:08 +01:00
< p class = "reference" > Referenced by < a class = "el" href = "create_8c_source.html#l00291" > aaruf_create()< / a > , < a class = "el" href = "open_8c_source.html#l00236" > aaruf_open()< / a > , < a class = "el" href = "lru_8c_source.html#l00068" > add_to_cache_uint64()< / a > , and < a class = "el" href = "lru_8c_source.html#l00020" > drop_entry()< / a > .< / p >
2025-10-11 01:35:43 +01:00
< / div >
< / div >
2026-10-08 20:15:08 +01:00
< a id = "af82718ebf5e59a398bc6e9428a389bb2" name = "af82718ebf5e59a398bc6e9428a389bb2" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#af82718ebf5e59a398bc6e9428a389bb2" > ◆   < / a > < / span > max_bytes< / h2 >
2025-10-11 01:35:43 +01:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2026-10-08 20:15:08 +01:00
< td class = "memname" > uint64_t CacheHeader::max_bytes< / td >
2025-10-11 01:35:43 +01:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2026-10-08 20:15:08 +01:00
< p > Memory budget in bytes for the cached values. 0 means unlimited. < / p >
2025-10-11 01:35:43 +01:00
2026-10-08 20:15:08 +01:00
< p class = "definition" > Definition at line < a class = "el" href = "lru_8h_source.html#l00052" > 52< / a > of file < a class = "el" href = "lru_8h_source.html" > lru.h< / a > .< / p >
2025-10-11 01:35:43 +01:00
2026-10-08 20:15:08 +01:00
< p class = "reference" > Referenced by < a class = "el" href = "create_8c_source.html#l00291" > aaruf_create()< / a > , < a class = "el" href = "open_8c_source.html#l00236" > aaruf_open()< / a > , and < a class = "el" href = "lru_8c_source.html#l00068" > add_to_cache_uint64()< / a > .< / p >
2025-10-11 01:35:43 +01:00
< / div >
< / div >
< hr / > The documentation for this struct was generated from the following file:< ul >
< li > include/aaruformat/< a class = "el" href = "lru_8h_source.html" > lru.h< / a > < / li >
< / ul >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
< div id = "page-nav" class = "page-nav-panel" >
< div id = "page-nav-resize-handle" > < / div >
< div id = "page-nav-tree" >
< div id = "page-nav-contents" >
< / div > <!-- page - nav - contents -->
< / div > <!-- page - nav - tree -->
< / div > <!-- page - nav -->
< / div > <!-- container -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "navelem" > < a href = "structCacheHeader.html" > CacheHeader< / a > < / li >
2026-10-08 20:15:08 +01:00
< li class = "footer" > Generated by < a href = "https://www.doxygen.org/index.html" > < img class = "footer" src = "doxygen.svg" width = "104" height = "31" alt = "doxygen" / > < / a > 1.18.0 < / li >
2025-10-11 01:35:43 +01:00
< / ul >
< / div >
< / body >
< / html >