/usr/share/doc/libqb-dev/html/qb_map_overview.html is in libqb-doc 1.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libqb: Map</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libqb
 <span id="projectnumber">1.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="index.html">index</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Map </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This provides a map interface to a Patricia trie, hashtable or skiplist.</p>
<dl class="section user"><dt>Ordering</dt><dd>The hashtable is NOT ordered, but ptrie and skiplist are.</dd></dl>
<dl class="section user"><dt>Iterating</dt><dd>Below is a simple example of how to iterate over a map. <div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> *p;</div><div class="line"><span class="keywordtype">void</span> *data;</div><div class="line"><a class="code" href="qbmap_8h.html#a6312b26a9852b03023365fce76b04947">qb_map_iter_t</a> *it = <a class="code" href="qbmap_8h.html#a72fe80e5569e5115f6e92e46d82a416d">qb_map_iter_create</a>(m);</div><div class="line"><span class="keywordflow">for</span> (p = <a class="code" href="qbmap_8h.html#a8fc94968f29e187cf15d3a15e874b664">qb_map_iter_next</a>(it, &data); p; p = <a class="code" href="qbmap_8h.html#a8fc94968f29e187cf15d3a15e874b664">qb_map_iter_next</a>(it, &data)) {</div><div class="line"> printf(<span class="stringliteral">"%s > %s\n"</span>, p, (<span class="keywordtype">char</span>*) data);</div><div class="line">}</div><div class="line"><a class="code" href="qbmap_8h.html#ac42fdf91f567699ee6c5f8e803718908">qb_map_iter_free</a>(it);</div></div><!-- fragment --></dd></dl>
<p>Deletion of items within the iterator is supported. But note do not free the item memory in the iterator. If you need to free the data items then register for a notifier and free the memory there. This is required as the items are reference counted. </p><div class="fragment"><div class="line"><a class="code" href="qbmap_8h.html#af609266bc70e3461d1a8fb99a8756bb0">qb_map_notify_add</a>(m, NULL, my_map_free_handler,</div><div class="line"> <a class="code" href="qbmap_8h.html#a09e0ad929e503bc677b7f9cd8603ca40">QB_MAP_NOTIFY_FREE</a>, NULL);</div></div><!-- fragment --><dl class="section user"><dt>Notifications</dt><dd>These allow you to get callbacks when values are inserted/removed or replaced. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>hashtable only supports deletion and replacement notificatins. There is also a special global callback for freeing deleted and replaced values (QB_MAP_NOTIFY_FREE). </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="qbmap_8h.html#af609266bc70e3461d1a8fb99a8756bb0" title="Add a notifier to the map. ">qb_map_notify_add()</a> <a class="el" href="qbmap_8h.html#abca55f8605f5db5180ab64b9e3d2c5cf" title="Delete a notifier from the map (including the userdata). ">qb_map_notify_del_2()</a></dd></dl>
<dl class="section user"><dt>Prefix matching</dt><dd>The ptrie supports prefixes in the iterator:</dd></dl>
<div class="fragment"><div class="line">it = <a class="code" href="qbmap_8h.html#a79b9cc643af7318ea147a770906e6576">qb_map_pref_iter_create</a>(m, <span class="stringliteral">"aa"</span>);</div><div class="line"><span class="keywordflow">while</span> ((p = <a class="code" href="qbmap_8h.html#a8fc94968f29e187cf15d3a15e874b664">qb_map_iter_next</a>(it, &data)) != NULL) {</div><div class="line"> printf(<span class="stringliteral">"%s > %s\n"</span>, p, (<span class="keywordtype">char</span>*)data);</div><div class="line">}</div><div class="line"><a class="code" href="qbmap_8h.html#ac42fdf91f567699ee6c5f8e803718908">qb_map_iter_free</a>(it);</div></div><!-- fragment --><p>The ptrie also supports prefixes in notifications: (remember to pass QB_MAP_NOTIFY_RECURSIVE into the notify_add. </p><div class="fragment"><div class="line"><a class="code" href="qbmap_8h.html#af609266bc70e3461d1a8fb99a8756bb0">qb_map_notify_add</a>(m, <span class="stringliteral">"root"</span>, my_map_notification,</div><div class="line"> (<a class="code" href="qbmap_8h.html#a956325e2495485b0bf8b5806221a4e47">QB_MAP_NOTIFY_INSERTED</a>|</div><div class="line"> <a class="code" href="qbmap_8h.html#a443778b7c7416c75cd858711050240d1">QB_MAP_NOTIFY_DELETED</a>|</div><div class="line"> <a class="code" href="qbmap_8h.html#aab33c659e5e8139f008879e89275a940">QB_MAP_NOTIFY_REPLACED</a>|</div><div class="line"> <a class="code" href="qbmap_8h.html#a3a3d60c4772c4776db779d927612d05a">QB_MAP_NOTIFY_RECURSIVE</a>),</div><div class="line"> NULL);</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="qbmap_8h.html" title="This provides a map interface to a Patricia trie, hashtable or skiplist. ">qbmap.h</a> </dd></dl>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
|