ZealOS/docs/Demo/DolDoc/UnusedDefine.html
2021-07-03 02:47:45 -04:00

123 lines
11 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.05">
<style type="text/css">
body {background-color:#000000;}
.cF0{color:#ffffff;background-color:#000000;}
.cF1{color:#3465a4;background-color:#000000;}
.cF2{color:#4e9a06;background-color:#000000;}
.cF3{color:#06989a;background-color:#000000;}
.cF4{color:#a24444;background-color:#000000;}
.cF5{color:#75507b;background-color:#000000;}
.cF6{color:#ce982f;background-color:#000000;}
.cF7{color:#bcc0b9;background-color:#000000;}
.cF8{color:#555753;background-color:#000000;}
.cF9{color:#729fcf;background-color:#000000;}
.cFA{color:#82bc49;background-color:#000000;}
.cFB{color:#34e2e2;background-color:#000000;}
.cFC{color:#ac3535;background-color:#000000;}
.cFD{color:#ad7fa8;background-color:#000000;}
.cFE{color:#fce94f;background-color:#000000;}
.cFF{color:#000000;background-color:#000000;}
</style>
</head>
<body>
<pre style="font-family:courier;font-size:10pt">
<a name="l1"></a><span class=cF2>/*Scans the sym table and checks</span><span class=cF0>
<a name="l2"></a></span><span class=cF2>each </span><a href="https://www.tomawezome.github.io/ZealOS/Kernel/KernelA.html#l823"><span class=cF4>HTT_DEFINE_STR</span></a><span class=cF2> entry to see if</span><span class=cF0>
<a name="l3"></a></span><span class=cF2>it only occurs once in files.</span><span class=cF0>
<a name="l4"></a>
<a name="l5"></a></span><span class=cF2>It's a brute force solution, but</span><span class=cF0>
<a name="l6"></a></span><span class=cF2>gets the job done... slowly.</span><span class=cF0>
<a name="l7"></a></span><span class=cF4>
<a name="l8"></a></span><a href="https://www.tomawezome.github.io/ZealOS/System/Utils/Find.html#l166"><span class=cF4>Find</span></a><span class=cF2>() returns a count of matches.</span><span class=cF0>
<a name="l9"></a></span><span class=cF4>
<a name="l10"></a></span><a href="https://www.tomawezome.github.io/ZealOS/System/Utils/Find.html#l204"><span class=cF4>FileOcc</span></a><span class=cF2>() is </span><a href="https://www.tomawezome.github.io/ZealOS/System/Utils/Find.html#l166"><span class=cF4>Find</span></a><span class=cF2>() with</span><span class=cF0>
<a name="l11"></a></span><span class=cF2>output </span><a href="https://www.tomawezome.github.io/ZealOS/Kernel/KMisc.html#l237"><span class=cF4>Silent</span></a><span class=cF2>().</span><span class=cF0>
<a name="l12"></a></span><span class=cF2>*/</span><span class=cF0>
<a name="l13"></a>
<a name="l14"></a></span><span class=cF1>U0</span><span class=cF0> UnusedDefineScan()
<a name="l15"></a>{
<a name="l16"></a> </span><span class=cF9>CDoc</span><span class=cF0> *old_put_doc, *old_display_doc, *doc;
<a name="l17"></a> </span><span class=cF9>I64</span><span class=cF0> i, count = </span><span class=cFE>0</span><span class=cF0>;
<a name="l18"></a> </span><span class=cF9>CHashTable</span><span class=cF0> *table;
<a name="l19"></a> </span><span class=cF9>CHash</span><span class=cF0> *tmph;
<a name="l20"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, *doc_e2;
<a name="l21"></a> </span><span class=cF1>Bool</span><span class=cF0> old_silent = </span><span class=cF5>IsSilent</span><span class=cF0>;
<a name="l22"></a>
<a name="l23"></a> </span><span class=cF1>try</span><span class=cF0>
<a name="l24"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l25"></a> table = </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table;
<a name="l26"></a> </span><span class=cF1>while</span><span class=cF0> (table)
<a name="l27"></a> {
<a name="l28"></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="l29"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l30"></a> tmph = table-&gt;body[i];
<a name="l31"></a> </span><span class=cF1>while</span><span class=cF0> (tmph)
<a name="l32"></a> {
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (tmph-&gt;type &amp; </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>)
<a name="l34"></a> count++;
<a name="l35"></a> tmph = tmph-&gt;next;
<a name="l36"></a> }
<a name="l37"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l38"></a> table = table-&gt;next;
<a name="l39"></a> }
<a name="l40"></a>
<a name="l41"></a> </span><span class=cFB>progress1</span><span class=cF0> = </span><span class=cFE>0</span><span class=cF0>;
<a name="l42"></a> </span><span class=cFB>progress1_max</span><span class=cF0> = count;
<a name="l43"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(</span><span class=cFB>progress1_desc</span><span class=cF0>, </span><span class=cF6>&quot;Define Scan&quot;</span><span class=cF0>);
<a name="l44"></a>
<a name="l45"></a> table = </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table;
<a name="l46"></a> </span><span class=cF1>while</span><span class=cF0> (table)
<a name="l47"></a> {
<a name="l48"></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="l49"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l50"></a> tmph = table-&gt;body[i];
<a name="l51"></a> </span><span class=cF1>while</span><span class=cF0> (tmph)
<a name="l52"></a> {
<a name="l53"></a> </span><span class=cF1>if</span><span class=cF0> (tmph-&gt;type &amp; </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>)
<a name="l54"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l55"></a> </span><span class=cFB>progress1</span><span class=cF0>++;
<a name="l56"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>FileOcc</span><span class=cF7>(</span><span class=cF0>tmph-&gt;str, </span><span class=cF6>&quot;/*&quot;</span><span class=cF0>, </span><span class=cF6>&quot;+l-i+$&quot;</span><span class=cF7>)</span><span class=cF0> == </span><span class=cFE>1</span><span class=cF0>)
<a name="l57"></a> {
<a name="l58"></a> doc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l59"></a> old_put_doc = </span><span class=cF5>DocPut</span><span class=cF0>;
<a name="l60"></a> old_display_doc = </span><span class=cF5>DocDisplay</span><span class=cF0>;
<a name="l61"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc=doc;
<a name="l62"></a> </span><span class=cF5>Find</span><span class=cF0>(tmph-&gt;str, </span><span class=cF6>&quot;/*&quot;</span><span class=cF0>, </span><span class=cF6>&quot;+l-i+$&quot;</span><span class=cF0>);
<a name="l63"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc = old_put_doc;
<a name="l64"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc = old_display_doc;
<a name="l65"></a> doc_e = doc-&gt;head.next;
<a name="l66"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
<a name="l67"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l68"></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="l69"></a> {
<a name="l70"></a> </span><span class=cF6>&quot;%s &quot;</span><span class=cF0>, tmph-&gt;str;
<a name="l71"></a> doc_e2 = </span><span class=cF5>DocEntryCopy</span><span class=cF0>(doc, doc_e);
<a name="l72"></a> </span><span class=cF5>DocInsEntry</span><span class=cF0>(old_put_doc, doc_e2);
<a name="l73"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l74"></a> }
<a name="l75"></a> doc_e = doc_e-&gt;next;
<a name="l76"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l77"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l78"></a> }
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l80"></a> tmph = tmph-&gt;next;
<a name="l81"></a> }
<a name="l82"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l83"></a> table = table-&gt;next;
<a name="l84"></a> }
<a name="l85"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l86"></a> </span><span class=cF1>catch</span><span class=cF0>
<a name="l87"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
<a name="l88"></a>
<a name="l89"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
<a name="l90"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l91"></a> </span><span class=cF5>ProgressBarsReset</span><span class=cF0>;
<a name="l92"></a>}
<a name="l93"></a>
<a name="l94"></a>UnusedDefineScan;
</span></pre></body>
</html>