templeos-info/public/Wb/Demo/DolDoc/UnusedDefine.HC.HTML

114 lines
8.3 KiB
Plaintext
Raw Normal View History

2024-03-24 21:24:44 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<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="/Wb/Kernel/KernelA.HH.HTML#l688"><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="/Wb/Adam/Opt/Utils/Find.HC.HTML#l145"><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="/Wb/Adam/Opt/Utils/Find.HC.HTML#l182"><span class=cF4>FileOcc</span></a><span class=cF2>() is </span><a href="/Wb/Adam/Opt/Utils/Find.HC.HTML#l145"><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="/Wb/Kernel/KMisc.HC.HTML#l270"><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,cnt=0;
<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> </span><span class=cF7>{</span><span class=cF0>
<a name="l24"></a> table=</span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table;
<a name="l25"></a> </span><span class=cF1>while</span><span class=cF0> (table) {
<a name="l26"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;=table-&gt;mask;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l27"></a> tmph=table-&gt;body[i];
<a name="l28"></a> </span><span class=cF1>while</span><span class=cF0> (tmph) {
<a name="l29"></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="l30"></a> cnt++;
<a name="l31"></a> tmph=tmph-&gt;next;
<a name="l32"></a> }
<a name="l33"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l34"></a> table=table-&gt;next;
<a name="l35"></a> }
<a name="l36"></a>
<a name="l37"></a> </span><span class=cFB>progress1</span><span class=cF0>=0;
<a name="l38"></a> </span><span class=cFB>progress1_max</span><span class=cF0>=cnt;
<a name="l39"></a> </span><span class=cF5>StrCpy</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="l40"></a>
<a name="l41"></a> table=</span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table;
<a name="l42"></a> </span><span class=cF1>while</span><span class=cF0> (table) {
<a name="l43"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;=table-&gt;mask;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l44"></a> tmph=table-&gt;body[i];
<a name="l45"></a> </span><span class=cF1>while</span><span class=cF0> (tmph) {
<a name="l46"></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>) </span><span class=cF7>{</span><span class=cF0>
<a name="l47"></a> </span><span class=cFB>progress1</span><span class=cF0>++;
<a name="l48"></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>==1) {
<a name="l49"></a> doc=</span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l50"></a> old_put_doc=</span><span class=cF5>DocPut</span><span class=cF0>;
<a name="l51"></a> old_display_doc=</span><span class=cF5>DocDisplay</span><span class=cF0>;
<a name="l52"></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="l53"></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="l54"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc=old_put_doc;
<a name="l55"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc=old_display_doc;
<a name="l56"></a> doc_e=doc-&gt;head.next;
<a name="l57"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l58"></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="l59"></a> </span><span class=cF6>&quot;%s &quot;</span><span class=cF0>,tmph-&gt;str;
<a name="l60"></a> doc_e2=</span><span class=cF5>DocEntryCopy</span><span class=cF0>(doc,doc_e);
<a name="l61"></a> </span><span class=cF5>DocInsEntry</span><span class=cF0>(old_put_doc,doc_e2);
<a name="l62"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l63"></a> }
<a name="l64"></a> doc_e=doc_e-&gt;next;
<a name="l65"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l66"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l67"></a> }
<a name="l68"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l69"></a> tmph=tmph-&gt;next;
<a name="l70"></a> }
<a name="l71"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l72"></a> table=table-&gt;next;
<a name="l73"></a> }
<a name="l74"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0>
<a name="l75"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
<a name="l76"></a>
<a name="l77"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
<a name="l78"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l79"></a> </span><span class=cF5>ProgressBarsRst</span><span class=cF0>;
<a name="l80"></a>}
<a name="l81"></a>
<a name="l82"></a>UnusedDefineScan;
</span></pre></body>
</html>