ZealOS/docs/System/Hash.CC.html
TomAwezome 1b75d91002 Fix Mount AHCI Port selection.
Add arg to SATARep to specify drive types to show.
Add checks in AHCIPortInit to verify port signatures, add helper method to get signatures from port.
2021-08-02 16:40:05 -04:00

513 lines
53 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V0.13">
<style type="text/css">
body {background-color:#fef1f0;}
.cF0{color:#000000;background-color:#fef1f0;}
.cF1{color:#0148a4;background-color:#fef1f0;}
.cF2{color:#3b7901;background-color:#fef1f0;}
.cF3{color:#057c7e;background-color:#fef1f0;}
.cF4{color:#bb2020;background-color:#fef1f0;}
.cF5{color:#9e42ae;background-color:#fef1f0;}
.cF6{color:#b57901;background-color:#fef1f0;}
.cF7{color:#b2b6af;background-color:#fef1f0;}
.cF8{color:#555753;background-color:#fef1f0;}
.cF9{color:#678fbb;background-color:#fef1f0;}
.cFA{color:#82bc49;background-color:#fef1f0;}
.cFB{color:#0097a2;background-color:#fef1f0;}
.cFC{color:#e26a6a;background-color:#fef1f0;}
.cFD{color:#c671bc;background-color:#fef1f0;}
.cFE{color:#c7ab00;background-color:#fef1f0;}
.cFF{color:#fef1f0;background-color:#fef1f0;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Info;Hash/System;Cmd Line (Typically)&quot;</span><span class=cF0>
<a name="l2"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF9>CWho</span><span class=cF0>
<a name="l3"></a>{
<a name="l4"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *h;
<a name="l5"></a> </span><span class=cF1>U8</span><span class=cF0> *idx;
<a name="l6"></a>};
<a name="l7"></a>
<a name="l8"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>HashEntriesCompare</span><span class=cF0>(</span><span class=cF9>CWho</span><span class=cF0> *h1, </span><span class=cF9>CWho</span><span class=cF0> *h2)
<a name="l9"></a>{
<a name="l10"></a> </span><span class=cF9>I64</span><span class=cF0> i1, i2;
<a name="l11"></a>
<a name="l12"></a> </span><span class=cF1>if</span><span class=cF0> (i1 = </span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>h1-&gt;h-&gt;str, h2-&gt;h-&gt;str</span><span class=cF7>)</span><span class=cF0>)
<a name="l13"></a> </span><span class=cF1>return</span><span class=cF0> i1;
<a name="l14"></a> i1 = </span><span class=cF5>HashTypeNum</span><span class=cF0>(h1-&gt;h);
<a name="l15"></a> i2 = </span><span class=cF5>HashTypeNum</span><span class=cF0>(h2-&gt;h);
<a name="l16"></a>
<a name="l17"></a> </span><span class=cF1>return</span><span class=cF0> i1 - i2;
<a name="l18"></a>}
<a name="l19"></a>
<a name="l20"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>HashEntriesCompare2</span><span class=cF0>(</span><span class=cF9>CWho</span><span class=cF0> *h1, </span><span class=cF9>CWho</span><span class=cF0> *h2)
<a name="l21"></a>{
<a name="l22"></a> </span><span class=cF9>CHashFun</span><span class=cF0> *tmpf1 = h1-&gt;h, *tmpf2 = h2-&gt;h;
<a name="l23"></a> </span><span class=cF9>I64</span><span class=cF0> i1 = </span><span class=cF5>HashVal</span><span class=cF0>(tmpf1), i2 = </span><span class=cF5>HashVal</span><span class=cF0>(tmpf2);
<a name="l24"></a>
<a name="l25"></a> </span><span class=cF1>if</span><span class=cF0> (i1 == i2)
<a name="l26"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l27"></a> i1 = </span><span class=cF5>HashTypeNum</span><span class=cF0>(tmpf1);
<a name="l28"></a> i2 = </span><span class=cF5>HashTypeNum</span><span class=cF0>(tmpf2);
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (i1 == i2)
<a name="l30"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>StrCompare</span><span class=cF0>(tmpf1-&gt;str, tmpf2-&gt;str);
<a name="l31"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l32"></a>
<a name="l33"></a> </span><span class=cF1>return</span><span class=cF0> i1 - i2;
<a name="l34"></a>}
<a name="l35"></a>
<a name="l36"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>HelpIndexCount</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *ptr, </span><span class=cF1>U8</span><span class=cF0> *idx)
<a name="l37"></a>{
<a name="l38"></a> </span><span class=cF9>I64</span><span class=cF0> count = </span><span class=cFE>0</span><span class=cF0>, ch, idx_len = </span><span class=cF5>StrLen</span><span class=cF0>(idx);
<a name="l39"></a>
<a name="l40"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr)
<a name="l41"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l42"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrNCompare</span><span class=cF7>(</span><span class=cF0>ptr, idx, idx_len</span><span class=cF7>)</span><span class=cF0>)
<a name="l43"></a> count++;
<a name="l44"></a> </span><span class=cF1>while</span><span class=cF0> (ch = *ptr++)
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>';'</span><span class=cF0>)
<a name="l46"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (!ch)
<a name="l48"></a> ptr--;
<a name="l49"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l50"></a>
<a name="l51"></a> </span><span class=cF1>return</span><span class=cF0> count;
<a name="l52"></a>}
<a name="l53"></a>
<a name="l54"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>HelpIndexStr</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> **_ptr, </span><span class=cF1>U8</span><span class=cF0> *idx)
<a name="l55"></a>{
<a name="l56"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr = *_ptr, *ptr2, *res;
<a name="l57"></a> </span><span class=cF9>I64</span><span class=cF0> ch, idx_len = </span><span class=cF5>StrLen</span><span class=cF0>(idx);
<a name="l58"></a>
<a name="l59"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr)
<a name="l60"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l61"></a> ptr2 = ptr;
<a name="l62"></a> </span><span class=cF1>while</span><span class=cF0> (ch = *ptr++)
<a name="l63"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>';'</span><span class=cF0>)
<a name="l64"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (!ch)
<a name="l66"></a> ptr--;
<a name="l67"></a> *_ptr = ptr;
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrNCompare</span><span class=cF7>(</span><span class=cF0>ptr2, idx, idx_len</span><span class=cF7>)</span><span class=cF0>)
<a name="l69"></a> {
<a name="l70"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>';'</span><span class=cF0>)
<a name="l71"></a> ptr--;
<a name="l72"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l73"></a> res = </span><span class=cF5>StrNew</span><span class=cF0>(ptr2);
<a name="l74"></a> *ptr = ch;
<a name="l75"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l76"></a> }
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l78"></a>
<a name="l79"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l80"></a>}
<a name="l81"></a>
<a name="l82"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>HelpComment</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF9>CHash</span><span class=cF0> *tmph, </span><span class=cF1>U8</span><span class=cF0> *_src_link)
<a name="l83"></a>{
<a name="l84"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l85"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l86"></a> </span><span class=cF1>U8</span><span class=cF0> *res = </span><span class=cF3>NULL</span><span class=cF0>, *ptr, *ptr2, *src_link = </span><span class=cF5>StrNew</span><span class=cF0>(_src_link);
<a name="l87"></a>
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (*src_link == </span><span class=cF6>'F'</span><span class=cF0> &amp;&amp; src_link[</span><span class=cFE>2</span><span class=cF0>] == </span><span class=cF6>':'</span><span class=cF0>)
<a name="l89"></a> *src_link = </span><span class=cF6>'P'</span><span class=cF0>;
<a name="l90"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;Ed(0x%X, DOF_DONT_WINMGR_SYNC | DOF_DONT_SHOW);\n&quot;</span><span class=cF0>, src_link);
<a name="l91"></a> </span><span class=cF5>Free</span><span class=cF0>(src_link);
<a name="l92"></a>
<a name="l93"></a> doc = </span><span class=cF5>DocPut</span><span class=cF0>(task);
<a name="l94"></a> doc_e = doc-&gt;cur_entry;
<a name="l95"></a> </span><span class=cF1>if</span><span class=cF0> (tmph-&gt;type &amp; </span><span class=cF3>HTT_FUN</span><span class=cF0>)
<a name="l96"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmph(</span><span class=cF9>CHashFun</span><span class=cF0> *)-&gt;flags, </span><span class=cF3>Ff__EXTERN</span><span class=cF7>)</span><span class=cF0> || </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmph(</span><span class=cF9>CHashFun</span><span class=cF0> *)-&gt;flags, </span><span class=cF3>Ff_INTERNAL</span><span class=cF7>)</span><span class=cF0>)
<a name="l98"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc &amp;&amp; </span><span class=cF7>(</span><span class=cF0>!(doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_TAG</span><span class=cF0>) || !</span><span class=cF5>StrOcc</span><span class=cF0>(doc_e-&gt;tag, </span><span class=cF6>';'</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
<a name="l99"></a> doc_e = doc_e-&gt;next;
<a name="l100"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l101"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc &amp;&amp; </span><span class=cF7>(</span><span class=cF0>!(doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_TAG</span><span class=cF0>) || !</span><span class=cF5>StrOcc</span><span class=cF0>(doc_e-&gt;tag, </span><span class=cF6>'{'</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
<a name="l102"></a> doc_e = doc_e-&gt;next;
<a name="l103"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l104"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != doc)
<a name="l105"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l106"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_TAG</span><span class=cF0>)
<a name="l107"></a> {
<a name="l108"></a> ptr = doc_e-&gt;tag;
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (ptr2 = </span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>&quot;//&quot;</span><span class=cF0>, ptr</span><span class=cF7>)</span><span class=cF0>)
<a name="l110"></a> ptr = ptr2 + </span><span class=cFE>2</span><span class=cF0>;
<a name="l111"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ptr2 = </span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>&quot;/*&quot;</span><span class=cF0>, ptr</span><span class=cF7>)</span><span class=cF0>)
<a name="l112"></a> ptr = ptr2 + </span><span class=cFE>2</span><span class=cF0>;
<a name="l113"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrNCompare</span><span class=cF7>(</span><span class=cF0>ptr, </span><span class=cF6>&quot;public&quot;</span><span class=cF0>, </span><span class=cFE>6</span><span class=cF7>)</span><span class=cF0>)
<a name="l114"></a> ptr += </span><span class=cFE>6</span><span class=cF0>;
<a name="l115"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr == </span><span class=cF3>CH_SPACE</span><span class=cF0>)
<a name="l116"></a> ptr++;
<a name="l117"></a> res = </span><span class=cF5>StrNew</span><span class=cF0>(ptr);
<a name="l118"></a> doc_e = doc_e-&gt;next;
<a name="l119"></a> }
<a name="l120"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc &amp;&amp; doc_e-&gt;type_u8 != </span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0>)
<a name="l121"></a> {
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;type_u8 == </span><span class=cF3>DOCT_TAB</span><span class=cF0>)
<a name="l123"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l124"></a> ptr = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%s &quot;</span><span class=cF0>, res);
<a name="l125"></a> </span><span class=cF5>Free</span><span class=cF0>(res);
<a name="l126"></a> res = ptr;
<a name="l127"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l128"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_TAG</span><span class=cF0>)
<a name="l129"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l130"></a> ptr = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%s%s&quot;</span><span class=cF0>, res, doc_e-&gt;tag);
<a name="l131"></a> </span><span class=cF5>Free</span><span class=cF0>(res);
<a name="l132"></a> res = ptr;
<a name="l133"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l134"></a> doc_e = doc_e-&gt;next;
<a name="l135"></a> }
<a name="l136"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l137"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;%c&quot;</span><span class=cF0>, </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>);
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (res)
<a name="l139"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l140"></a> ptr = </span><span class=cF5>MStrUtil</span><span class=cF0>(res, </span><span class=cF3>SUF_REM_TRAILING</span><span class=cF0> | </span><span class=cF3>SUF_REM_LEADING</span><span class=cF0> | </span><span class=cF3>SUF_SINGLE_SPACE</span><span class=cF0>);
<a name="l141"></a> </span><span class=cF5>Free</span><span class=cF0>(res);
<a name="l142"></a> res = ptr;
<a name="l143"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l144"></a>
<a name="l145"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l146"></a>}
<a name="l147"></a>
<a name="l148"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>HashEntriesCompare3</span><span class=cF0>(</span><span class=cF9>CWho</span><span class=cF0> *h1, </span><span class=cF9>CWho</span><span class=cF0> *h2)
<a name="l149"></a>{
<a name="l150"></a> </span><span class=cF9>I64</span><span class=cF0> i, i1 = </span><span class=cFE>0</span><span class=cF0>, i2 = </span><span class=cFE>0</span><span class=cF0>;
<a name="l151"></a>
<a name="l152"></a> i = </span><span class=cF5>StrCompare</span><span class=cF0>(h1-&gt;idx, h2-&gt;idx);
<a name="l153"></a> </span><span class=cF1>if</span><span class=cF0> (i)
<a name="l154"></a> </span><span class=cF1>return</span><span class=cF0> i;
<a name="l155"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l156"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l157"></a> </span><span class=cF1>if</span><span class=cF0> (h1-&gt;h-&gt;type &amp; </span><span class=cF3>HTT_HELP_FILE</span><span class=cF0>)
<a name="l158"></a> i1 = </span><span class=cFE>1</span><span class=cF0>;
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (h2-&gt;h-&gt;type &amp; </span><span class=cF3>HTT_HELP_FILE</span><span class=cF0>)
<a name="l160"></a> i2 = </span><span class=cFE>1</span><span class=cF0>;
<a name="l161"></a> i = i2 - i1;
<a name="l162"></a> </span><span class=cF1>if</span><span class=cF0> (i)
<a name="l163"></a> </span><span class=cF1>return</span><span class=cF0> i;
<a name="l164"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l165"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>StrCompare</span><span class=cF0>(h1-&gt;h-&gt;str, h2-&gt;h-&gt;str);
<a name="l166"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l167"></a>}
<a name="l168"></a>
<a name="l169"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Who</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>CHashTable</span><span class=cF0> *h=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> *idx=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l170"></a>{ </span><span class=cF2>//Dump hash symbol table.</span><span class=cF0>
<a name="l171"></a> </span><span class=cF2>// &quot;+p&quot; for only public symbols</span><span class=cF0>
<a name="l172"></a> </span><span class=cF2>// &quot;+m&quot; to order by number (normally alphabetical)</span><span class=cF0>
<a name="l173"></a> </span><span class=cF2>// &quot;-r&quot; just local hash table</span><span class=cF0>
<a name="l174"></a> </span><span class=cF9>CHashTable</span><span class=cF0> *table;
<a name="l175"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
<a name="l176"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *ptr;
<a name="l177"></a> </span><span class=cF9>CWho</span><span class=cF0> *list;
<a name="l178"></a> </span><span class=cF9>I64</span><span class=cF0> count, i, j, k, f = </span><span class=cFE>0</span><span class=cF0>;
<a name="l179"></a> </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cFE>512</span><span class=cF0>], *last_idx = </span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>&quot;&quot;</span><span class=cF0>), *cur_idx, *comment;
<a name="l180"></a> </span><span class=cF1>Bool</span><span class=cF0> recurse, publics, map;
<a name="l181"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
<a name="l182"></a>
<a name="l183"></a> </span><span class=cF5>FlagsScan</span><span class=cF0>(&amp;f, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>&quot;ST_FILE_UTIL_FLAGS&quot;</span><span class=cF7>)</span><span class=cF0>, </span><span class=cF6>&quot;+r&quot;</span><span class=cF0>);
<a name="l184"></a> </span><span class=cF5>FlagsScan</span><span class=cF0>(&amp;f, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>&quot;ST_FILE_UTIL_FLAGS&quot;</span><span class=cF7>)</span><span class=cF0>, fu_flags);
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (f &amp; ~</span><span class=cF7>(</span><span class=cF3>FUF_RECURSE</span><span class=cF0> | </span><span class=cF3>FUF_PUBLIC</span><span class=cF0> | </span><span class=cF3>FUF_MAP</span><span class=cF7>)</span><span class=cF0>)
<a name="l186"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'FUF'</span><span class=cF0>);
<a name="l187"></a> recurse = </span><span class=cF5>Bt</span><span class=cF0>(&amp;f, </span><span class=cF3>FUf_RECURSE</span><span class=cF0>);
<a name="l188"></a> publics = </span><span class=cF5>Bt</span><span class=cF0>(&amp;f, </span><span class=cF3>FUf_PUBLIC</span><span class=cF0>);
<a name="l189"></a> map = </span><span class=cF5>Bt</span><span class=cF0>(&amp;f, </span><span class=cF3>FUf_MAP</span><span class=cF0>);
<a name="l190"></a>
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (!h)
<a name="l192"></a> h = </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table;
<a name="l193"></a>
<a name="l194"></a> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l195"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l196"></a> task = </span><span class=cF5>User</span><span class=cF0>;
<a name="l197"></a> </span><span class=cF5>TaskWait</span><span class=cF0>(task);
<a name="l198"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&amp;task-&gt;display_flags, </span><span class=cF3>DISPLAYf_SHOW</span><span class=cF0>);
<a name="l199"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l200"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l201"></a> task = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l202"></a>
<a name="l203"></a> count = </span><span class=cFE>0</span><span class=cF0>;
<a name="l204"></a> table = h;
<a name="l205"></a> </span><span class=cF1>while</span><span class=cF0> (table)
<a name="l206"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l207"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt;= table-&gt;mask; i++)
<a name="l208"></a> {
<a name="l209"></a> tmph = table-&gt;body[i];
<a name="l210"></a> </span><span class=cF1>while</span><span class=cF0> (tmph)
<a name="l211"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmph-&gt;type &amp; (</span><span class=cF3>HTF_IMPORT</span><span class=cF0> | </span><span class=cF3>HTF_PRIVATE</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>tmph-&gt;type &amp; </span><span class=cF3>HTF_PUBLIC</span><span class=cF0> || !publics</span><span class=cF7>)</span><span class=cF0>)
<a name="l213"></a> {
<a name="l214"></a> </span><span class=cF1>if</span><span class=cF0> (!idx)
<a name="l215"></a> count++;
<a name="l216"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmph-&gt;type &amp; </span><span class=cF3>HTG_SRC_SYM</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>cur_idx = tmph-&gt;idx</span><span class=cF7>)</span><span class=cF0>)
<a name="l217"></a> count += </span><span class=cF5>HelpIndexCount</span><span class=cF0>(cur_idx, idx);
<a name="l218"></a> }
<a name="l219"></a> tmph = tmph-&gt;next;
<a name="l220"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l221"></a> }
<a name="l222"></a> </span><span class=cF1>if</span><span class=cF0> (recurse)
<a name="l223"></a> table = table-&gt;next;
<a name="l224"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l225"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l226"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (!count) </span><span class=cF1>goto</span><span class=cF0> wh_done;
<a name="l228"></a>
<a name="l229"></a> list = </span><span class=cF5>CAlloc</span><span class=cF0>(count * </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CWho</span><span class=cF7>)</span><span class=cF0>);
<a name="l230"></a> j = </span><span class=cFE>0</span><span class=cF0>;
<a name="l231"></a> table = h;
<a name="l232"></a> </span><span class=cF1>while</span><span class=cF0> (table)
<a name="l233"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l234"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt;= table-&gt;mask; i++)
<a name="l235"></a> {
<a name="l236"></a> tmph = table-&gt;body[i];
<a name="l237"></a> </span><span class=cF1>while</span><span class=cF0> (tmph)
<a name="l238"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l239"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmph-&gt;type &amp; (</span><span class=cF3>HTF_IMPORT</span><span class=cF0> | </span><span class=cF3>HTF_PRIVATE</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>tmph-&gt;type &amp; </span><span class=cF3>HTF_PUBLIC</span><span class=cF0> || !publics</span><span class=cF7>)</span><span class=cF0>)
<a name="l240"></a> </span><span class=cF1>if</span><span class=cF0> (!idx)
<a name="l241"></a> list[j++].h = tmph;
<a name="l242"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmph-&gt;type &amp; </span><span class=cF3>HTG_SRC_SYM</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>cur_idx=tmph-&gt;idx</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>k = </span><span class=cF5>HelpIndexCount</span><span class=cF0>(cur_idx, idx)</span><span class=cF7>)</span><span class=cF0>)
<a name="l243"></a> </span><span class=cF1>while</span><span class=cF0> (k--)
<a name="l244"></a> {
<a name="l245"></a> list[j].idx = </span><span class=cF5>HelpIndexStr</span><span class=cF0>(&amp;cur_idx, idx);
<a name="l246"></a> list[j++].h = tmph;
<a name="l247"></a> }
<a name="l248"></a> tmph = tmph-&gt;next;
<a name="l249"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l250"></a> }
<a name="l251"></a> </span><span class=cF1>if</span><span class=cF0> (recurse)
<a name="l252"></a> table = table-&gt;next;
<a name="l253"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l254"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l255"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l256"></a>
<a name="l257"></a> </span><span class=cF1>if</span><span class=cF0> (map)
<a name="l258"></a> </span><span class=cF5>QuickSort</span><span class=cF0>(list, count, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CWho</span><span class=cF7>)</span><span class=cF0>, &amp;</span><span class=cF5>HashEntriesCompare2</span><span class=cF0>);
<a name="l259"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l260"></a> </span><span class=cF5>QuickSort</span><span class=cF0>(list, count, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CWho</span><span class=cF7>)</span><span class=cF0>, &amp;</span><span class=cF5>HashEntriesCompare3</span><span class=cF0>);
<a name="l261"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l262"></a> </span><span class=cF5>QuickSort</span><span class=cF0>(list, count, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CWho</span><span class=cF7>)</span><span class=cF0>, &amp;</span><span class=cF5>HashEntriesCompare</span><span class=cF0>);
<a name="l263"></a>
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l265"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l266"></a> </span><span class=cFB>progress1_max</span><span class=cF0> = count;
<a name="l267"></a> </span><span class=cFB>progress1</span><span class=cF0> = </span><span class=cFE>0</span><span class=cF0>;
<a name="l268"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l269"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; count; i++)
<a name="l270"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l271"></a> comment = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l272"></a> ptr = list[i].h;
<a name="l273"></a> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l274"></a> </span><span class=cF1>if</span><span class=cF0> (cur_idx = list[i].idx)
<a name="l275"></a> {
<a name="l276"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>cur_idx, last_idx</span><span class=cF7>)</span><span class=cF0>)
<a name="l277"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l278"></a> </span><span class=cF5>Free</span><span class=cF0>(last_idx);
<a name="l279"></a> last_idx = </span><span class=cF5>StrNew</span><span class=cF0>(cur_idx);
<a name="l280"></a> </span><span class=cF1>if</span><span class=cF0> (i)
<a name="l281"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;\n\n&quot;</span><span class=cF0>);
<a name="l282"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$WW,0$$PURPLE$$TX+CX,\&quot;%$Q\&quot;$$FG$\n&quot;</span><span class=cF0>, cur_idx);
<a name="l283"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l284"></a> }
<a name="l285"></a>
<a name="l286"></a> </span><span class=cF1>if</span><span class=cF0> (idx &amp;&amp; ptr-&gt;type &amp; </span><span class=cF3>HTT_HELP_FILE</span><span class=cF0>)
<a name="l287"></a> {
<a name="l288"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$WW,1$&quot;</span><span class=cF0>);
<a name="l289"></a> </span><span class=cF5>DocType</span><span class=cF0>(doc, ptr-&gt;str);
<a name="l290"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$WW,0$&quot;</span><span class=cF0>);
<a name="l291"></a> }
<a name="l292"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l293"></a> {
<a name="l294"></a> </span><span class=cF1>if</span><span class=cF0> (ptr-&gt;type &amp; </span><span class=cF3>HTG_SRC_SYM</span><span class=cF0> &amp;&amp; ptr</span><span class=cF7>(</span><span class=cF9>CHashSrcSym</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;src_link)
<a name="l295"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l296"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$LK,\&quot;%-40s\&quot;,A=\&quot;%s\&quot;$&quot;</span><span class=cF0>, ptr-&gt;str, ptr</span><span class=cF7>(</span><span class=cF9>CHashSrcSym</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;src_link);
<a name="l297"></a> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l298"></a> comment = </span><span class=cF5>HelpComment</span><span class=cF0>(task, ptr, ptr</span><span class=cF7>(</span><span class=cF9>CHashSrcSym</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;src_link);
<a name="l299"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l300"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l301"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;%-40s&quot;</span><span class=cF0>, ptr-&gt;str);
<a name="l302"></a>
<a name="l303"></a> </span><span class=cF1>if</span><span class=cF0> (!idx)
<a name="l304"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l305"></a> </span><span class=cF1>if</span><span class=cF0> (ptr-&gt;type &amp; </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>)
<a name="l306"></a> {
<a name="l307"></a> j = ptr(</span><span class=cF9>CHashDefineStr</span><span class=cF0> *)-&gt;count;
<a name="l308"></a> </span><span class=cF1>if</span><span class=cF0> (j == -</span><span class=cFE>1</span><span class=cF0>)
<a name="l309"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%-10t$Q &quot;</span><span class=cF0>, ptr</span><span class=cF7>(</span><span class=cF9>CHashDefineStr</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;data);
<a name="l310"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l311"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%-10t$Q %02X&quot;</span><span class=cF0>, ptr</span><span class=cF7>(</span><span class=cF9>CHashDefineStr</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;data, j);
<a name="l312"></a> }
<a name="l313"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ptr-&gt;type &amp; </span><span class=cF3>HTT_GLOBAL_VAR</span><span class=cF0>)
<a name="l314"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%010X &quot;</span><span class=cF0>, ptr</span><span class=cF7>(</span><span class=cF9>CHashGlobalVar</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;data_addr);
<a name="l315"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l316"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%010X &quot;</span><span class=cF0>, </span><span class=cF5>HashVal</span><span class=cF7>(</span><span class=cF0>ptr</span><span class=cF7>)</span><span class=cF0>);
<a name="l317"></a> j = </span><span class=cF5>HashEntrySize</span><span class=cF0>(ptr);
<a name="l318"></a> </span><span class=cF1>if</span><span class=cF0> (j == -</span><span class=cFE>1</span><span class=cF0>)
<a name="l319"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot; %04X &quot;</span><span class=cF0>, ptr-&gt;use_count);
<a name="l320"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l321"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot; %04X %010X &quot;</span><span class=cF0>, ptr-&gt;use_count, j);
<a name="l322"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l323"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l324"></a> *buf = </span><span class=cFE>0</span><span class=cF0>;
<a name="l325"></a>
<a name="l326"></a> k = ptr-&gt;type;
<a name="l327"></a> </span><span class=cF1>if</span><span class=cF0> (publics)
<a name="l328"></a> k &amp;= ~</span><span class=cF3>HTF_PUBLIC</span><span class=cF0>;
<a name="l329"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>k &amp; </span><span class=cF3>HTG_TYPE_MASK</span><span class=cF7>)</span><span class=cF0>)
<a name="l330"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;NULL &quot;</span><span class=cF0>);
<a name="l331"></a> </span><span class=cF1>while</span><span class=cF0> (k)
<a name="l332"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l333"></a> j = </span><span class=cF5>Bsf</span><span class=cF0>(k);
<a name="l334"></a> </span><span class=cF1>if</span><span class=cF0> (j &lt; </span><span class=cFE>0</span><span class=cF0>)
<a name="l335"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l336"></a> </span><span class=cF5>Btr</span><span class=cF0>(&amp;k, j);
<a name="l337"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%Z &quot;</span><span class=cF0>, j, </span><span class=cF6>&quot;ST_HTT_TYPES&quot;</span><span class=cF0>);
<a name="l338"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l339"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, buf);
<a name="l340"></a> </span><span class=cF1>if</span><span class=cF0> (comment)
<a name="l341"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l342"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$GREEN$%s$FG$&quot;</span><span class=cF0>, comment);
<a name="l343"></a> </span><span class=cF5>Free</span><span class=cF0>(comment);
<a name="l344"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l345"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;\n&quot;</span><span class=cF0>);
<a name="l346"></a> }
<a name="l347"></a> </span><span class=cF5>Free</span><span class=cF0>(list[i].idx);
<a name="l348"></a> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l349"></a> </span><span class=cFB>progress1</span><span class=cF0>++;
<a name="l350"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l351"></a> </span><span class=cF5>Free</span><span class=cF0>(list);
<a name="l352"></a> </span><span class=cF1>if</span><span class=cF0> (idx)
<a name="l353"></a> </span><span class=cFB>progress1</span><span class=cF0> = </span><span class=cFB>progress1_max</span><span class=cF0> = </span><span class=cFE>0</span><span class=cF0>;
<a name="l354"></a>
<a name="l355"></a>wh_done:
<a name="l356"></a> </span><span class=cF1>if</span><span class=cF0> (doc)
<a name="l357"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l358"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;head.next == doc)
<a name="l359"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;No Match&quot;</span><span class=cF0>);
<a name="l360"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l361"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l362"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l363"></a> </span><span class=cF5>Free</span><span class=cF0>(last_idx);
<a name="l364"></a> </span><span class=cF5>Kill</span><span class=cF0>(task);
<a name="l365"></a>}
<a name="l366"></a>
<a name="l367"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Info;Hash;Cmd Line (Typically)&quot;</span><span class=cF0>
<a name="l368"></a>
<a name="l369"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>HDR_NUM</span><span class=cF0> </span><span class=cFE>16</span><span class=cF0>
<a name="l370"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>HashDepthRep</span><span class=cF0>(</span><span class=cF9>CHashTable</span><span class=cF0> *table=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l371"></a>{ </span><span class=cF2>//Hash table linked-list chain depth report.</span><span class=cF0>
<a name="l372"></a> </span><span class=cF2>//Histogram of collision count.</span><span class=cF0>
<a name="l373"></a> </span><span class=cF9>I64</span><span class=cF0> i, j, longest = </span><span class=cFE>0</span><span class=cF0>, count = </span><span class=cFE>0</span><span class=cF0>, a[</span><span class=cF3>HDR_NUM</span><span class=cF0>];
<a name="l374"></a> </span><span class=cF9>CHash</span><span class=cF0> *tmph;
<a name="l375"></a>
<a name="l376"></a> </span><span class=cF1>if</span><span class=cF0> (!table)
<a name="l377"></a> table = </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table;
<a name="l378"></a> </span><span class=cF5>MemSet</span><span class=cF0>(a, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>a</span><span class=cF7>)</span><span class=cF0>);
<a name="l379"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt;= table-&gt;mask; i++)
<a name="l380"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l381"></a> tmph = table-&gt;body[i];
<a name="l382"></a> </span><span class=cF1>if</span><span class=cF0> (tmph)
<a name="l383"></a> {
<a name="l384"></a> j = </span><span class=cF5>LinkedListCount</span><span class=cF0>(tmph);
<a name="l385"></a> </span><span class=cF1>if</span><span class=cF0> (j &lt; </span><span class=cF3>HDR_NUM</span><span class=cF0>)
<a name="l386"></a> a[j]++;
<a name="l387"></a> count += j;
<a name="l388"></a> </span><span class=cF1>if</span><span class=cF0> (j &gt; longest)
<a name="l389"></a> longest = j;
<a name="l390"></a> }
<a name="l391"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l392"></a> </span><span class=cF6>&quot;Histogram\n&quot;</span><span class=cF0>;
<a name="l393"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cF3>HDR_NUM</span><span class=cF0>; i++)
<a name="l394"></a> </span><span class=cF1>if</span><span class=cF0> (a[i])
<a name="l395"></a> </span><span class=cF6>&quot;%02d:%d\n&quot;</span><span class=cF0>, i, a[i];
<a name="l396"></a> </span><span class=cF6>&quot;Size:%d Count:%d Longest:%d\n&quot;</span><span class=cF0>, table-&gt;mask + </span><span class=cFE>1</span><span class=cF0>, count, longest;
<a name="l397"></a>
<a name="l398"></a> </span><span class=cF1>return</span><span class=cF0> longest;
<a name="l399"></a>}
<a name="l400"></a>
<a name="l401"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Help System&quot;</span><span class=cF0>
<a name="l402"></a>#</span><span class=cF1>help_file</span><span class=cF0> </span><span class=cF6>&quot;::/Doc/HelpSystem&quot;</span><span class=cF0>
<a name="l403"></a>
<a name="l404"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocHelpIdx</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF1>U8</span><span class=cF0> *idx)
<a name="l405"></a>{</span><span class=cF2>//Put to doc report for given help idx.</span><span class=cF0>
<a name="l406"></a> </span><span class=cF5>Who</span><span class=cF0>(</span><span class=cF6>&quot;+p&quot;</span><span class=cF0>,, idx, doc);
<a name="l407"></a>}
<a name="l408"></a>
<a name="l409"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>PopUpHelpIndex</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *idx, </span><span class=cF9>CTask</span><span class=cF0> *parent=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l410"></a>{</span><span class=cF2>//PopUp win report for given help idx.</span><span class=cF0>
<a name="l411"></a> </span><span class=cF1>U8</span><span class=cF0> *buf;
<a name="l412"></a>
<a name="l413"></a> buf = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;DocHelpIdx(DocPut, \&quot;%s\&quot;); View;&quot;</span><span class=cF0>, idx);
<a name="l414"></a> </span><span class=cF5>PopUp</span><span class=cF0>(buf, parent);
<a name="l415"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
<a name="l416"></a>}
<a name="l417"></a>
<a name="l418"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Hash/System&quot;</span><span class=cF0>
<a name="l419"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MapFileLoad</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *filename)
<a name="l420"></a>{</span><span class=cF2>//Load map file so we have src line info.</span><span class=cF0>
<a name="l421"></a> </span><span class=cF1>U8</span><span class=cF0> *st, *ptr, *name = </span><span class=cF5>ExtDefault</span><span class=cF0>(filename, </span><span class=cF6>&quot;MAP&quot;</span><span class=cF0>), *absname = </span><span class=cF5>FileNameAbs</span><span class=cF0>(name);
<a name="l422"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocRead</span><span class=cF0>(name);
<a name="l423"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l424"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
<a name="l425"></a> </span><span class=cF9>I64</span><span class=cF0> i, j, base=</span><span class=cFE>0</span><span class=cF0>;
<a name="l426"></a> </span><span class=cF9>CDebugInfo</span><span class=cF0> *debug_info;
<a name="l427"></a>
<a name="l428"></a> </span><span class=cF5>FileExtRemove</span><span class=cF0>(absname);
<a name="l429"></a> </span><span class=cF1>if</span><span class=cF0> (absname[</span><span class=cFE>1</span><span class=cF0>] == </span><span class=cF6>':'</span><span class=cF0> &amp;&amp; </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>absname</span><span class=cF7>)</span><span class=cF0> &gt; </span><span class=cFE>2</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>tmph = </span><span class=cF5>HashSingleTableFind</span><span class=cF0>(absname + </span><span class=cFE>2</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table, </span><span class=cF3>HTT_MODULE</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
<a name="l430"></a> base = tmph(</span><span class=cF9>CHashGeneric</span><span class=cF0> *)-&gt;user_data0 + </span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>CBinFile</span><span class=cF0>);
<a name="l431"></a>
<a name="l432"></a> </span><span class=cF1>if</span><span class=cF0> (!doc) </span><span class=cF1>return</span><span class=cF0>;
<a name="l433"></a> doc_e = doc-&gt;head.next;
<a name="l434"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
<a name="l435"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l436"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;type_u8 == </span><span class=cF3>DOCT_LINK</span><span class=cF0>)
<a name="l437"></a> {
<a name="l438"></a> </span><span class=cF1>if</span><span class=cF0> (*doc_e-&gt;tag)
<a name="l439"></a> st = </span><span class=cF5>MStrUtil</span><span class=cF0>(doc_e-&gt;tag, </span><span class=cF3>SUF_REM_TRAILING</span><span class=cF0>);
<a name="l440"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l441"></a> st = </span><span class=cF5>MStrUtil</span><span class=cF0>(doc_e-&gt;aux_str, </span><span class=cF3>SUF_REM_TRAILING</span><span class=cF0>);
<a name="l442"></a> </span><span class=cF1>if</span><span class=cF0> (tmph = </span><span class=cF5>HashSingleTableFind</span><span class=cF7>(</span><span class=cF0>st, </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table, </span><span class=cF3>HTG_SRC_SYM</span><span class=cF7>)</span><span class=cF0>)
<a name="l443"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l444"></a> </span><span class=cF1>if</span><span class=cF0> (*doc_e-&gt;tag)
<a name="l445"></a> {
<a name="l446"></a> </span><span class=cF5>Free</span><span class=cF0>(tmph-&gt;src_link);
<a name="l447"></a> tmph-&gt;src_link = doc_e-&gt;aux_str;
<a name="l448"></a> ptr = tmph-&gt;src_link;
<a name="l449"></a> </span><span class=cF1>if</span><span class=cF0> (ptr[</span><span class=cFE>0</span><span class=cF0>] &amp;&amp; ptr[</span><span class=cFE>1</span><span class=cF0>] &amp;&amp; ptr[</span><span class=cFE>2</span><span class=cF0>] == </span><span class=cF6>':'</span><span class=cF0>)
<a name="l450"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l451"></a> </span><span class=cF1>if</span><span class=cF0> (ptr[</span><span class=cFE>3</span><span class=cF0>] == </span><span class=cF6>':'</span><span class=cF0>)
<a name="l452"></a> ptr[</span><span class=cFE>3</span><span class=cF0>] = </span><span class=cFB>blkdev</span><span class=cF0>.boot_drive_let;
<a name="l453"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ptr[</span><span class=cFE>3</span><span class=cF0>] == </span><span class=cF6>'~'</span><span class=cF0>)
<a name="l454"></a> ptr[</span><span class=cFE>3</span><span class=cF0>] = *</span><span class=cFB>blkdev</span><span class=cF0>.home_dir;
<a name="l455"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l456"></a> doc_e-&gt;aux_str = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l457"></a> }
<a name="l458"></a> </span><span class=cF1>if</span><span class=cF0> (tmph-&gt;type &amp; </span><span class=cF7>(</span><span class=cF3>HTT_FUN</span><span class=cF0> | </span><span class=cF3>HTT_EXPORT_SYS_SYM</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l459"></a> !</span><span class=cF7>(</span><span class=cF0>debug_info = tmph-&gt;debug_info</span><span class=cF7>)</span><span class=cF0> &amp;&amp; doc_e-&gt;bin_data &amp;&amp;
<a name="l460"></a> </span><span class=cF7>(</span><span class=cF0>debug_info = doc_e-&gt;bin_data-&gt;data</span><span class=cF7>)</span><span class=cF0>)
<a name="l461"></a> {
<a name="l462"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;bin_data-&gt;size &gt; </span><span class=cF5>MSize</span><span class=cF7>(</span><span class=cF0>debug_info</span><span class=cF7>)</span><span class=cF0>)
<a name="l463"></a> </span><span class=cF6>&quot;Corrupt Map Entry\n&quot;</span><span class=cF0>;
<a name="l464"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l465"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l466"></a> doc_e-&gt;bin_data-&gt;data = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l467"></a> tmph-&gt;debug_info = debug_info;
<a name="l468"></a> </span><span class=cF1>for</span><span class=cF0> (i = debug_info-&gt;min_line; i &lt;= debug_info-&gt;max_line + </span><span class=cFE>1</span><span class=cF0>; i++)
<a name="l469"></a> {
<a name="l470"></a> j = i - debug_info-&gt;min_line;
<a name="l471"></a> </span><span class=cF1>if</span><span class=cF0> (debug_info-&gt;body[j])
<a name="l472"></a> debug_info-&gt;body[j] = debug_info-&gt;body[j] + base;
<a name="l473"></a> }
<a name="l474"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l475"></a> }
<a name="l476"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l477"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l478"></a> }
<a name="l479"></a> doc_e = doc_e-&gt;next;
<a name="l480"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l481"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l482"></a> </span><span class=cF5>Free</span><span class=cF0>(name);
<a name="l483"></a> </span><span class=cF5>Free</span><span class=cF0>(absname);
<a name="l484"></a>}
</span></pre></body>
</html>