<ahref="lru_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aid="l00001"name="l00001"></a><spanclass="lineno"> 1</span><spanclass="comment">//</span></div>
<divclass="line"><aid="l00002"name="l00002"></a><spanclass="lineno"> 2</span><spanclass="comment">// Created by claunia on 2/10/22.</span></div>
<divclass="ttc"id="alru_8h_html_a0735969939ca80db3fe439ed92b787bb"><divclass="ttname"><ahref="lru_8h.html#a0735969939ca80db3fe439ed92b787bb">add_to_cache_uint64</a></div><divclass="ttdeci">void add_to_cache_uint64(struct CacheHeader *cache, uint64_t key, void *value)</div><divclass="ttdoc">Adds a value to the cache with a uint64_t key, using string conversion.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00113">lru.c:113</a></div></div>
<divclass="ttc"id="alru_8h_html_a8cb7ac8e057627210732ee61d2966e35"><divclass="ttname"><ahref="lru_8h.html#a8cb7ac8e057627210732ee61d2966e35">find_in_cache_uint64</a></div><divclass="ttdeci">void * find_in_cache_uint64(struct CacheHeader *cache, uint64_t key)</div><divclass="ttdoc">Finds a value in the cache by uint64_t key, using string conversion.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00093">lru.c:93</a></div></div>
<divclass="ttc"id="alru_8h_html_a92e298695411672c3497ae5c8d9c0427"><divclass="ttname"><ahref="lru_8h.html#a92e298695411672c3497ae5c8d9c0427">free_cache</a></div><divclass="ttdeci">void free_cache(struct CacheHeader *cache)</div><divclass="ttdoc">Frees all entries in the cache and clears it.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00130">lru.c:130</a></div></div>
<divclass="ttc"id="alru_8h_html_a962bb6b97fb208cbd8a5932afb60e680"><divclass="ttname"><ahref="lru_8h.html#a962bb6b97fb208cbd8a5932afb60e680">add_to_cache</a></div><divclass="ttdeci">void add_to_cache(struct CacheHeader *cache, const char *key, void *value)</div><divclass="ttdoc">Adds a value to the cache with a string key, pruning if necessary.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00047">lru.c:47</a></div></div>
<divclass="ttc"id="alru_8h_html_ac7008173fc7e392fa825c69410920f0a"><divclass="ttname"><ahref="lru_8h.html#ac7008173fc7e392fa825c69410920f0a">find_in_cache</a></div><divclass="ttdeci">void * find_in_cache(struct CacheHeader *cache, const char *key)</div><divclass="ttdoc">Finds a value in the cache by string key.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00024">lru.c:24</a></div></div>
<divclass="ttc"id="astructCacheEntry_html"><divclass="ttname"><ahref="structCacheEntry.html">CacheEntry</a></div><divclass="ttdoc">Single hash entry in the in-memory cache.</div><divclass="ttdef"><b>Definition</b><ahref="#l00026">lru.h:27</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_a7d6d1ed0aab03cffbb34aff16f6f3d56"><divclass="ttname"><ahref="structCacheEntry.html#a7d6d1ed0aab03cffbb34aff16f6f3d56">CacheEntry::value</a></div><divclass="ttdeci">void * value</div><divclass="ttdoc">Opaque value pointer associated with key (not freed automatically on eviction/clear).</div><divclass="ttdef"><b>Definition</b><ahref="#l00029">lru.h:29</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_ae7e5f03fa52b88d99e27e2433623b4f5"><divclass="ttname"><ahref="structCacheEntry.html#ae7e5f03fa52b88d99e27e2433623b4f5">CacheEntry::hh</a></div><divclass="ttdeci">UT_hash_handle hh</div><divclass="ttdoc">uthash handle linking this entry into the hash table (must remain last or per uthash docs).</div><divclass="ttdef"><b>Definition</b><ahref="#l00030">lru.h:30</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_aeb007cfa604b485f120ec1f7526c95f4"><divclass="ttname"><ahref="structCacheEntry.html#aeb007cfa604b485f120ec1f7526c95f4">CacheEntry::key</a></div><divclass="ttdeci">char * key</div><divclass="ttdoc">Null-terminated key string (unique within the cache). May encode numeric keys.</div><divclass="ttdef"><b>Definition</b><ahref="#l00028">lru.h:28</a></div></div>
<divclass="ttc"id="astructCacheHeader_html"><divclass="ttname"><ahref="structCacheHeader.html">CacheHeader</a></div><divclass="ttdoc">Cache top-level descriptor encapsulating the hash table root and capacity limit.</div><divclass="ttdef"><b>Definition</b><ahref="#l00045">lru.h:46</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_a44229bb929d8949f3c2700d07123d224"><divclass="ttname"><ahref="structCacheHeader.html#a44229bb929d8949f3c2700d07123d224">CacheHeader::cache</a></div><divclass="ttdeci">struct CacheEntry * cache</div><divclass="ttdoc">Hash root (uthash). NULL when empty.</div><divclass="ttdef"><b>Definition</b><ahref="#l00048">lru.h:48</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_ad3b962f8ce6c6115143cf581c7936e55"><divclass="ttname"><ahref="structCacheHeader.html#ad3b962f8ce6c6115143cf581c7936e55">CacheHeader::max_items</a></div><divclass="ttdeci">uint64_t max_items</div><divclass="ttdoc">Hard limit for number of entries (policy: enforce/ignore depends on implementation).</div><divclass="ttdef"><b>Definition</b><ahref="#l00047">lru.h:47</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_afeac54c794f8fece845e49954fd89f1a"><divclass="ttname"><ahref="structCacheHeader.html#afeac54c794f8fece845e49954fd89f1a">CacheHeader::free_func</a></div><divclass="ttdeci">void(* free_func)(void *)</div><divclass="ttdoc">Optional callback to free cached values. NULL if values don't need freeing.</div><divclass="ttdef"><b>Definition</b><ahref="#l00049">lru.h:49</a></div></div>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.15.0 </li>