Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Kim committed Oct 28, 2022
1 parent 9c0042c commit ae07274
Show file tree
Hide file tree
Showing 7 changed files with 339 additions and 333 deletions.
13 changes: 7 additions & 6 deletions doc/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>qLibc: What&#39;s qLibc?</title>
<title>qLibc: What&#39;s qLibc? &lt;a href=&quot;https://github.com/wolkykim/qlibc/actions&quot; &gt;&lt;img src=&quot;https://github.com/wolkykim/qlibc/workflows/CI/badge.svg&quot; alt=&quot;Actions Status&quot;/&gt;&lt;/a&gt;</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>
Expand Down Expand Up @@ -59,7 +59,7 @@
</script>
<div id="doc-content">
<div><div class="header">
<div class="headertitle"><div class="title">What's qLibc? </div></div>
<div class="headertitle"><div class="title">What's qLibc? <a href="https://github.com/wolkykim/qlibc/actions"><img src="https://github.com/wolkykim/qlibc/workflows/CI/badge.svg" alt="Actions Status" style="pointer-events: none;" class="inline"/></a> </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md__Users_seungyou_github_qlibc_README"></a></p>
Expand Down Expand Up @@ -149,14 +149,14 @@ <h1><a class="anchor" id="autotoc_md3"></a>
<p >So, regardless of which container you use, you can simply put elements into a list with <code>container-&gt;put(container, ...)</code> or you can call them using direct API like qtreetbl_pub(container, ...).</p>
<p >An examples below illustrates how it looks like.</p>
<div class="fragment"><div class="line"><span class="comment">// create a hash-table.</span></div>
<div class="line">qhashtbl_t *tbl = <a class="code hl_function" href="qhashtbl_8c.html#a7a2314dcb8381b4599e8050becad2268">qhashtbl</a>(0, QHASHTBL_OPT_THREADSAFE);</div>
<div class="line">qhashtbl_t *tbl = <a class="code hl_function" href="qhashtbl_8c.html#a7a2314dcb8381b4599e8050becad2268">qhashtbl</a>(0, QHASHTBL_THREADSAFE);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// add an element which key name is &quot;score&quot;.</span></div>
<div class="line"><span class="keywordtype">int</span> x = 12345;</div>
<div class="line">tbl-&gt;put(tbl, <span class="stringliteral">&quot;score&quot;</span>, &amp;x, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
<div class="line"> </div>
<div class="line"><span class="comment">// get the value of the element.</span></div>
<div class="line"><span class="keywordtype">int</span> *px = tbl-&gt;get(tbl, <span class="stringliteral">&quot;score&quot;</span>);</div>
<div class="line"><span class="keywordtype">int</span> *px = tbl-&gt;get(tbl, <span class="stringliteral">&quot;score&quot;</span>, NULL, <span class="keyword">true</span>);</div>
<div class="line"><span class="keywordflow">if</span>(px != NULL) {</div>
<div class="line"> printf(<span class="stringliteral">&quot;%d\n&quot;</span>, *px);</div>
<div class="line"> free(px);</div>
Expand All @@ -167,14 +167,14 @@ <h1><a class="anchor" id="autotoc_md3"></a>
<div class="ttc" id="aqhashtbl_8c_html_a7a2314dcb8381b4599e8050becad2268"><div class="ttname"><a href="qhashtbl_8c.html#a7a2314dcb8381b4599e8050becad2268">qhashtbl</a></div><div class="ttdeci">qhashtbl_t * qhashtbl(size_t range, int options)</div><div class="ttdoc">Initialize hash table.</div><div class="ttdef"><b>Definition:</b> <a href="qhashtbl_8c_source.html#l00127">qhashtbl.c:127</a></div></div>
</div><!-- fragment --><p >Here is an identical implementation with a Linked-List-Table container. You may notice that there aren't any code changes at all, except for 1 line in the table creation. This is why qLibc encapsulates corresponding function pointers inside of the container object.</p>
<div class="fragment"><div class="line"><span class="comment">// create a linked-list-table. THE ONLY LINE YOU NEED TO CHANGE.</span></div>
<div class="line">qlisttbl_t *tbl = <a class="code hl_function" href="qlisttbl_8c.html#a0df1c9358a8712794a8a0030a1687f62">qlisttbl</a>(QLISTTBL_OPT_THREADSAFE);</div>
<div class="line">qlisttbl_t *tbl = <a class="code hl_function" href="qlisttbl_8c.html#a0df1c9358a8712794a8a0030a1687f62">qlisttbl</a>(QLISTTBL_THREADSAFE);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// add an element which key name is &quot;score&quot;.</span></div>
<div class="line"><span class="keywordtype">int</span> x = 12345;</div>
<div class="line">tbl-&gt;put(tbl, <span class="stringliteral">&quot;score&quot;</span>, &amp;x, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
<div class="line"> </div>
<div class="line"><span class="comment">// get the value of the element.</span></div>
<div class="line"><span class="keywordtype">int</span> *px = tbl-&gt;get(tbl, <span class="stringliteral">&quot;score&quot;</span>);</div>
<div class="line"><span class="keywordtype">int</span> *px = tbl-&gt;get(tbl, <span class="stringliteral">&quot;score&quot;</span>, NULL, <span class="keyword">true</span>);</div>
<div class="line"><span class="keywordflow">if</span>(px != NULL) {</div>
<div class="line"> printf(<span class="stringliteral">&quot;%d\n&quot;</span>, *px); </div>
<div class="line"> free(px);</div>
Expand Down Expand Up @@ -204,6 +204,7 @@ <h1><a class="anchor" id="autotoc_md5"></a>
<li><a href="https://github.com/Charles0429">Charles</a></li>
<li><a href="https://github.com/demitsuri">Dmitry Vorobiev</a></li>
<li><a href="https://github.com/ffontaine">Fabrice Fontaine</a></li>
<li><a href="https://github.com/Fullaxx">Fullaxx</a></li>
<li>HyoSup Woo</li>
<li><a href="https://github.com/netpoetica">Keith Rosenberg</a></li>
<li>Krishna</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/html/navtreedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var NAVTREE =
[
[ "qLibc", "index.html", [
[ "What's qLibc?", "index.html", [
[ "What's qLibc? <a href=\"https://github.com/wolkykim/qlibc/actions\" ><img src=\"https://github.com/wolkykim/qlibc/workflows/CI/badge.svg\" alt=\"Actions Status\"/></a>", "index.html", [
[ "qLibc Copyright", "index.html#autotoc_md0", null ],
[ "API Reference", "index.html#autotoc_md1", null ],
[ "qLibc Tables at a Glance", "index.html#autotoc_md2", null ],
Expand Down
16 changes: 8 additions & 8 deletions doc/html/qhash_8c.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#aef9d067568c8c774a1d45525
</dl>
<dl class="section return"><dt>Returns</dt><dd>32-bit unsigned hash value.</dd></dl>
<div class="fragment"><div class="line">uint32_t hashval = <a class="code hl_function" href="qhash_8c.html#aef9d067568c8c774a1d455259612a304">qhashfnv1_32</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5);</div>
<div class="ttc" id="aqhash_8c_html_aef9d067568c8c774a1d455259612a304"><div class="ttname"><a href="qhash_8c.html#aef9d067568c8c774a1d455259612a304">qhashfnv1_32</a></div><div class="ttdeci">uint32_t qhashfnv1_32(const void *data, size_t nbytes)</div><div class="ttdoc">Get 32-bit FNV1 hash.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00187">qhash.c:187</a></div></div>
<div class="ttc" id="aqhash_8c_html_aef9d067568c8c774a1d455259612a304"><div class="ttname"><a href="qhash_8c.html#aef9d067568c8c774a1d455259612a304">qhashfnv1_32</a></div><div class="ttdeci">uint32_t qhashfnv1_32(const void *data, size_t nbytes)</div><div class="ttdoc">Get 32-bit FNV1 hash.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00192">qhash.c:192</a></div></div>
</div><!-- fragment --><div class="fragment"><div class="line">Fowler/Noll/Vo hash</div>
<div class="line"> </div>
<div class="line">The basis of <span class="keyword">this</span> hash algorithm was taken from an idea sent as reviewer</div>
Expand All @@ -271,7 +271,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#aef9d067568c8c774a1d45525
<div class="line"> </div>
<div class="line"><span class="keywordflow">for</span> more details as well as other forms of the FNV hash.</div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00187">187</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00192">192</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -311,9 +311,9 @@ <h2 class="memtitle"><span class="permalink"><a href="#a4e5daad0624e2ce2bf8c77da
</dl>
<dl class="section return"><dt>Returns</dt><dd>64-bit unsigned hash value.</dd></dl>
<div class="fragment"><div class="line">uint64_t fnv64 = <a class="code hl_function" href="qhash_8c.html#a4e5daad0624e2ce2bf8c77da01228e0a">qhashfnv1_64</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5);</div>
<div class="ttc" id="aqhash_8c_html_a4e5daad0624e2ce2bf8c77da01228e0a"><div class="ttname"><a href="qhash_8c.html#a4e5daad0624e2ce2bf8c77da01228e0a">qhashfnv1_64</a></div><div class="ttdeci">uint64_t qhashfnv1_64(const void *data, size_t nbytes)</div><div class="ttdoc">Get 64-bit FNV1 hash integer.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00218">qhash.c:218</a></div></div>
<div class="ttc" id="aqhash_8c_html_a4e5daad0624e2ce2bf8c77da01228e0a"><div class="ttname"><a href="qhash_8c.html#a4e5daad0624e2ce2bf8c77da01228e0a">qhashfnv1_64</a></div><div class="ttdeci">uint64_t qhashfnv1_64(const void *data, size_t nbytes)</div><div class="ttdoc">Get 64-bit FNV1 hash integer.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00223">qhash.c:223</a></div></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00218">218</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00223">223</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -353,14 +353,14 @@ <h2 class="memtitle"><span class="permalink"><a href="#a433dc88e449b346a863f9574
</dl>
<dl class="section return"><dt>Returns</dt><dd>32-bit unsigned hash value.</dd></dl>
<div class="fragment"><div class="line">uint32_t hashval = <a class="code hl_function" href="qhash_8c.html#a433dc88e449b346a863f957421c4d2ba">qhashmurmur3_32</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5);</div>
<div class="ttc" id="aqhash_8c_html_a433dc88e449b346a863f957421c4d2ba"><div class="ttname"><a href="qhash_8c.html#a433dc88e449b346a863f957421c4d2ba">qhashmurmur3_32</a></div><div class="ttdeci">uint32_t qhashmurmur3_32(const void *data, size_t nbytes)</div><div class="ttdoc">Get 32-bit Murmur3 hash.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00258">qhash.c:258</a></div></div>
<div class="ttc" id="aqhash_8c_html_a433dc88e449b346a863f957421c4d2ba"><div class="ttname"><a href="qhash_8c.html#a433dc88e449b346a863f957421c4d2ba">qhashmurmur3_32</a></div><div class="ttdeci">uint32_t qhashmurmur3_32(const void *data, size_t nbytes)</div><div class="ttdoc">Get 32-bit Murmur3 hash.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00263">qhash.c:263</a></div></div>
</div><!-- fragment --><div class="fragment"><div class="line">MurmurHash3 was created by Austin Appleby in 2008. The initial</div>
<div class="line">implementation was published in C++ and placed in the <span class="keyword">public</span>.</div>
<div class="line"> https:<span class="comment">//sites.google.com/site/murmurhash/</span></div>
<div class="line">Seungyoung Kim has ported its implementation into C language</div>
<div class="line">in 2012 and published it as a part of qLibc component.</div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00258">258</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00263">263</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -414,9 +414,9 @@ <h2 class="memtitle"><span class="permalink"><a href="#ac130b57203ec6f04fd0faa09
<div class="line"><span class="keywordtype">char</span> *ascii = <a class="code hl_function" href="qencode_8c.html#aff18a5ca486ff7af31425c4f012afd7a">qhex_encode</a>(hash, 16);</div>
<div class="line">printf(<span class="stringliteral">&quot;Hex encoded Murmur3: %s\n&quot;</span>, ascii);</div>
<div class="line">free(ascii);</div>
<div class="ttc" id="aqhash_8c_html_ac130b57203ec6f04fd0faa097bf14b6b"><div class="ttname"><a href="qhash_8c.html#ac130b57203ec6f04fd0faa097bf14b6b">qhashmurmur3_128</a></div><div class="ttdeci">bool qhashmurmur3_128(const void *data, size_t nbytes, void *retbuf)</div><div class="ttdoc">Get 128-bit Murmur3 hash.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00330">qhash.c:330</a></div></div>
<div class="ttc" id="aqhash_8c_html_ac130b57203ec6f04fd0faa097bf14b6b"><div class="ttname"><a href="qhash_8c.html#ac130b57203ec6f04fd0faa097bf14b6b">qhashmurmur3_128</a></div><div class="ttdeci">bool qhashmurmur3_128(const void *data, size_t nbytes, void *retbuf)</div><div class="ttdoc">Get 128-bit Murmur3 hash.</div><div class="ttdef"><b>Definition:</b> <a href="qhash_8c_source.html#l00335">qhash.c:335</a></div></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00330">330</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00335">335</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
Expand Down
Loading

0 comments on commit ae07274

Please sign in to comment.