ZealOS/docs/Demo/Graphics/GrDir.CC.html
2021-08-09 02:04:03 -04:00

301 lines
26 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.14">
<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>define</span><span class=cF0> GRDIR_CLEAR </span><span class=cF3>TRUE</span><span class=cF0>
<a name="l2"></a></span><span class=cF2>//</span><span class=cF0>
<a name="l3"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>Set to TRUE if you want to clear</span><span class=cF0>
<a name="l4"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>the DolDoc before each dir listing,</span><span class=cF0>
<a name="l5"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>to make it look and work more</span><span class=cF0>
<a name="l6"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>like a modern file manager.</span><span class=cF0>
<a name="l7"></a>
<a name="l8"></a>
<a name="l9"></a> </span><span class=cFA>&lt;1&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;1&gt; code files</span><span class=cF0> </span><span class=cF2>(.CC)</span><span class=cF0>
<a name="l10"></a>
<a name="l11"></a>
<a name="l12"></a>
<a name="l13"></a>
<a name="l14"></a>
<a name="l15"></a> </span><span class=cFA>&lt;2&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;2&gt; header files</span><span class=cF0> </span><span class=cF2>(.HH)</span><span class=cF0>
<a name="l16"></a>
<a name="l17"></a>
<a name="l18"></a>
<a name="l19"></a>
<a name="l20"></a>
<a name="l21"></a>
<a name="l22"></a> </span><span class=cFA>&lt;3&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;3&gt; directories</span><span class=cF0>
<a name="l23"></a>
<a name="l24"></a>
<a name="l25"></a>
<a name="l26"></a>
<a name="l27"></a>
<a name="l28"></a>
<a name="l29"></a> </span><span class=cFA>&lt;4&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;4&gt; disc files</span><span class=cF0> </span><span class=cF2>(.iso, .ISO, .ISO.C)</span><span class=cF0>
<a name="l30"></a>
<a name="l31"></a>
<a name="l32"></a>
<a name="l33"></a>
<a name="l34"></a>
<a name="l35"></a>
<a name="l36"></a>
<a name="l37"></a>
<a name="l38"></a> </span><span class=cFA>&lt;5&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;5&gt; DolDoc files</span><span class=cF0> </span><span class=cF2>(.DD)</span><span class=cF0>
<a name="l39"></a>
<a name="l40"></a>
<a name="l41"></a>
<a name="l42"></a>
<a name="l43"></a>
<a name="l44"></a>
<a name="l45"></a>
<a name="l46"></a> </span><span class=cFA>&lt;6&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;6&gt; binary files</span><span class=cF0> </span><span class=cF2>(.BIN, .BIN.C)</span><span class=cF0>
<a name="l47"></a>
<a name="l48"></a>
<a name="l49"></a>
<a name="l50"></a>
<a name="l51"></a>
<a name="l52"></a>
<a name="l53"></a>
<a name="l54"></a>
<a name="l55"></a> </span><span class=cFA>&lt;7&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;7&gt; InFiles</span><span class=cF0> </span><span class=cF2>(.IN)</span><span class=cF0>
<a name="l56"></a>
<a name="l57"></a>
<a name="l58"></a>
<a name="l59"></a>
<a name="l60"></a>
<a name="l61"></a>
<a name="l62"></a> </span><span class=cFA>&lt;8&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;8&gt; text files</span><span class=cF0> </span><span class=cF2>(.TXT)</span><span class=cF0>
<a name="l63"></a>
<a name="l64"></a>
<a name="l65"></a>
<a name="l66"></a>
<a name="l67"></a>
<a name="l68"></a>
<a name="l69"></a>
<a name="l70"></a> </span><span class=cFA>&lt;9&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0> </span><span class=cF2>// &lt;9&gt; unknown filetype</span><span class=cF0>
<a name="l71"></a>
<a name="l72"></a>
<a name="l73"></a>
<a name="l74"></a>
<a name="l75"></a>
<a name="l76"></a>
<a name="l77"></a>
<a name="l78"></a>
<a name="l79"></a>
<a name="l80"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDocEntry</span><span class=cF0> *GrDirSprite(</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> *elems, </span><span class=cF1>U8</span><span class=cF0> *filename=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> align=-</span><span class=cFE>1</span><span class=cF0>)
<a name="l81"></a>{ </span><span class=cF2>// Draw a GrDir sprite into DolDoc: align arg is 0,1,2 for left,center,right.</span><span class=cF0>
<a name="l82"></a> </span><span class=cF2>// make into either Link and PopUp, or Left-Macro,</span><span class=cF0>
<a name="l83"></a> </span><span class=cF2>// so it can be left/right clicked just like the text links.</span><span class=cF0>
<a name="l84"></a> </span><span class=cF2>// See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Gr/GrSpritePlot.CC.html#l501"><span class=cF4>DocSprite</span></a><span class=cF2>.</span><span class=cF0>
<a name="l85"></a>
<a name="l86"></a> </span><span class=cF9>I64</span><span class=cF0> size;
<a name="l87"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l88"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l89"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l90"></a> </span><span class=cF9>CDocBin</span><span class=cF0> *tmpb;
<a name="l91"></a>
<a name="l92"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l93"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l94"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l95"></a> size = </span><span class=cF5>SpriteSize</span><span class=cF0>(elems);
<a name="l96"></a> tmpb = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocBin</span><span class=cF7>)</span><span class=cF0>, doc-&gt;mem_task);
<a name="l97"></a> tmpb-&gt;size = size;
<a name="l98"></a> tmpb-&gt;data = </span><span class=cF5>MAlloc</span><span class=cF0>(size, doc-&gt;mem_task);
<a name="l99"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(tmpb-&gt;data, elems, size);
<a name="l100"></a> tmpb-&gt;num = doc-&gt;cur_bin_num;
<a name="l101"></a> tmpb-&gt;use_count = </span><span class=cFE>1</span><span class=cF0>;
<a name="l102"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpb, doc-&gt;bin_head.last);
<a name="l103"></a>
<a name="l104"></a>
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (align == </span><span class=cFE>0</span><span class=cF0>)
<a name="l106"></a> </span><span class=cF6>&quot;\n$CM+LX-RE,LE=6$&quot;</span><span class=cF0>;
<a name="l107"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (align == </span><span class=cFE>1</span><span class=cF0>)
<a name="l108"></a> </span><span class=cF6>&quot;$CM+CX-RE,LE=2$&quot;</span><span class=cF0>;
<a name="l109"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (align == </span><span class=cFE>2</span><span class=cF0>)
<a name="l110"></a> </span><span class=cF6>&quot;$CM+RX-RE,LE=-1$&quot;</span><span class=cF0>;
<a name="l111"></a>
<a name="l112"></a>
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsDir</span><span class=cF7>(</span><span class=cF0>filename</span><span class=cF7>)</span><span class=cF0>)
<a name="l114"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;$SP+L+PU,\&quot;\&quot;,A=\&quot;%s\&quot;,BI=%d$&quot;</span><span class=cF0>, filename, doc-&gt;cur_bin_num++);
<a name="l115"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l116"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;$SP+X,\&quot;\&quot;,LM=\&quot;Cd(\\\&quot;%s\\\&quot;);GrDir;\n\&quot;,BI=%d$&quot;</span><span class=cF0>, filename, doc-&gt;cur_bin_num++);
<a name="l117"></a>
<a name="l118"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, st);
<a name="l119"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l120"></a> doc_e-&gt;bin_data = tmpb;
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e &amp;&amp; doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_TAG</span><span class=cF0> &amp;&amp; doc_e-&gt;tag &amp;&amp; *doc_e-&gt;tag)
<a name="l122"></a> tmpb-&gt;tag = </span><span class=cF5>StrNew</span><span class=cF0>(doc_e-&gt;tag, doc-&gt;mem_task);
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l124"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l125"></a>
<a name="l126"></a> </span><span class=cF1>return</span><span class=cF0> doc_e;
<a name="l127"></a>}
<a name="l128"></a>
<a name="l129"></a></span><span class=cF9>I64</span><span class=cF0> GrDir(</span><span class=cF1>U8</span><span class=cF0> *files_find_mask=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l130"></a>{
<a name="l131"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde1 = </span><span class=cF3>NULL</span><span class=cF0>, *tmpde2;
<a name="l132"></a> </span><span class=cF9>I64</span><span class=cF0> res = </span><span class=cFE>0</span><span class=cF0>;
<a name="l133"></a> </span><span class=cF1>U8</span><span class=cF0> *tag, *st,
<a name="l134"></a> *tmpb = </span><span class=cF3>NULL</span><span class=cF0>,
<a name="l135"></a> *tmpb0 = </span><span class=cF3>NULL</span><span class=cF0>, *tmpb1 = </span><span class=cF3>NULL</span><span class=cF0>, *tmpb2 = </span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF2>// sprite pointers</span><span class=cF0>
<a name="l136"></a> *tmpf0 = </span><span class=cF3>NULL</span><span class=cF0>, *tmpf1 = </span><span class=cF3>NULL</span><span class=cF0>, *tmpf2 = </span><span class=cF3>NULL</span><span class=cF0>; </span><span class=cF2>// filenames (for sprite links)</span><span class=cF0>
<a name="l137"></a>
<a name="l138"></a> tmpde1 = </span><span class=cF5>FilesFind</span><span class=cF0>(files_find_mask);
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde1)
<a name="l140"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l141"></a>
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (GRDIR_CLEAR)
<a name="l143"></a> </span><span class=cF6>&quot;$CL$&quot;</span><span class=cF0>;
<a name="l144"></a>
<a name="l145"></a> st = </span><span class=cF5>MAllocIdent</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l146"></a> </span><span class=cF5>StrLastRemove</span><span class=cF0>(st, </span><span class=cF6>&quot;/&quot;</span><span class=cF0>);
<a name="l147"></a> </span><span class=cF1>if</span><span class=cF0> (!st[</span><span class=cFE>2</span><span class=cF0>])
<a name="l148"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(st + </span><span class=cFE>2</span><span class=cF0>, </span><span class=cF6>&quot;/&quot;</span><span class=cF0>);
<a name="l149"></a>
<a name="l150"></a> </span><span class=cF6>&quot;\n$MA,T=\&quot;Directory\&quot;,LM=\&quot;PopUpCd;GrDir;\n\&quot;$ of %s\n\n&quot;</span><span class=cF0>, st;
<a name="l151"></a>
<a name="l152"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde1)
<a name="l153"></a> {
<a name="l154"></a> tmpde2 = tmpde1-&gt;next;
<a name="l155"></a>
<a name="l156"></a> </span><span class=cF1>switch</span><span class=cF0> (res % </span><span class=cFE>3</span><span class=cF0>)
<a name="l157"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l158"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>:
<a name="l159"></a> tag = </span><span class=cF6>&quot;LX&quot;</span><span class=cF0>;
<a name="l160"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l161"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>1</span><span class=cF0>:
<a name="l162"></a> tag = </span><span class=cF6>&quot;CX&quot;</span><span class=cF0>;
<a name="l163"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l164"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0>:
<a name="l165"></a> tag = </span><span class=cF6>&quot;RX&quot;</span><span class=cF0>;
<a name="l166"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l167"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l168"></a>
<a name="l169"></a> </span><span class=cF1>if</span><span class=cF0> (res % </span><span class=cFE>3</span><span class=cF0> == </span><span class=cFE>0</span><span class=cF0> &amp;&amp; res != </span><span class=cFE>0</span><span class=cF0>)
<a name="l170"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l171"></a> GrDirSprite(, tmpb0, tmpf0, </span><span class=cFE>0</span><span class=cF0>);
<a name="l172"></a> GrDirSprite(, tmpb1, tmpf1, </span><span class=cFE>1</span><span class=cF0>);
<a name="l173"></a> GrDirSprite(, tmpb2, tmpf2, </span><span class=cFE>2</span><span class=cF0>);
<a name="l174"></a>
<a name="l175"></a> </span><span class=cF6>&quot;\n\n\n\n\n\n\n&quot;</span><span class=cF0>;
<a name="l176"></a> tmpb = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l177"></a> tmpb0 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l178"></a> tmpb1 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l179"></a> tmpb2 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l180"></a>
<a name="l181"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf0);
<a name="l182"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf1);
<a name="l183"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf2);
<a name="l184"></a> tmpf0 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l185"></a> tmpf1 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l186"></a> tmpf2 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l187"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l188"></a>
<a name="l189"></a> </span><span class=cF1>if</span><span class=cF0> (res % </span><span class=cFE>3</span><span class=cF0> == </span><span class=cFE>2</span><span class=cF0>)
<a name="l190"></a> </span><span class=cF6>&quot;$CM-LE-RE$&quot;</span><span class=cF0>;
<a name="l191"></a>
<a name="l192"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde1-&gt;attr &amp; </span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>)
<a name="l193"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l194"></a>
<a name="l195"></a> </span><span class=cF6>&quot;$MA+%s,T=\&quot;%s\&quot;,LM=\&quot;Cd(\\\&quot;%s\\\&quot;);GrDir;\n\&quot;$&quot;</span><span class=cF0>, tag, tmpde1-&gt;name, tmpde1-&gt;full_name;
<a name="l196"></a> </span><span class=cF1>switch</span><span class=cF0> (res % </span><span class=cFE>3</span><span class=cF0>)
<a name="l197"></a> {
<a name="l198"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>:
<a name="l199"></a> tmpb0 = </span><span class=cFA>&lt;3&gt;</span><span class=cF0>;
<a name="l200"></a> tmpf0 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l201"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l202"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>1</span><span class=cF0>:
<a name="l203"></a> tmpb1 = </span><span class=cFA>&lt;3&gt;</span><span class=cF0>;
<a name="l204"></a> tmpf1 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l205"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l206"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0>:
<a name="l207"></a> tmpb2 = </span><span class=cFA>&lt;3&gt;</span><span class=cF0>;
<a name="l208"></a> tmpf2 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l209"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l210"></a> }
<a name="l211"></a>
<a name="l212"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l213"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l214"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l215"></a> </span><span class=cF6>&quot;$LK+%s+PU,\&quot;%s\&quot;,A=\&quot;FI:%s\&quot;$&quot;</span><span class=cF0>, tag, tmpde1-&gt;name, tmpde1-&gt;full_name;
<a name="l216"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.CC&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l217"></a> tmpb = </span><span class=cFA>&lt;1&gt;</span><span class=cF0>;
<a name="l218"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.DD&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l219"></a> tmpb = </span><span class=cFA>&lt;5&gt;</span><span class=cF0>;
<a name="l220"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.ISO.C&quot;</span><span class=cF7>)</span><span class=cF0> ||
<a name="l221"></a> !</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.ISO&quot;</span><span class=cF7>)</span><span class=cF0> ||
<a name="l222"></a> !</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.iso&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l223"></a> tmpb = </span><span class=cFA>&lt;4&gt;</span><span class=cF0>;
<a name="l224"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.HH&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l225"></a> tmpb = </span><span class=cFA>&lt;2&gt;</span><span class=cF0>;
<a name="l226"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.BIN.C&quot;</span><span class=cF7>)</span><span class=cF0> ||
<a name="l227"></a> !</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.BIN&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l228"></a> tmpb = </span><span class=cFA>&lt;6&gt;</span><span class=cF0>;
<a name="l229"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.IN&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l230"></a> tmpb = </span><span class=cFA>&lt;7&gt;</span><span class=cF0>;
<a name="l231"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF5>FileExtDot</span><span class=cF0>(tmpde1-&gt;name), </span><span class=cF6>&quot;.TXT&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l232"></a> tmpb = </span><span class=cFA>&lt;8&gt;</span><span class=cF0>;
<a name="l233"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l234"></a> </span><span class=cF2>// sprite for unknown filetype</span><span class=cF0>
<a name="l235"></a> tmpb = </span><span class=cFA>&lt;9&gt;</span><span class=cF0>;
<a name="l236"></a>
<a name="l237"></a> </span><span class=cF1>switch</span><span class=cF0> (res % </span><span class=cFE>3</span><span class=cF0>)
<a name="l238"></a> {
<a name="l239"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>:
<a name="l240"></a> tmpb0 = tmpb;
<a name="l241"></a> tmpf0 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l242"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l243"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>1</span><span class=cF0>:
<a name="l244"></a> tmpb1 = tmpb;
<a name="l245"></a> tmpf1 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l246"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l247"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0>:
<a name="l248"></a> tmpb2 = tmpb;
<a name="l249"></a> tmpf2 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l250"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l251"></a> }
<a name="l252"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l253"></a>
<a name="l254"></a> res++;
<a name="l255"></a> </span><span class=cF5>DirEntryDel</span><span class=cF0>(tmpde1);
<a name="l256"></a> tmpde1 = tmpde2;
<a name="l257"></a> }
<a name="l258"></a>
<a name="l259"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l260"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l261"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l262"></a> </span><span class=cF6>&quot;\nNo matching entries!!\n&quot;</span><span class=cF0>;
<a name="l263"></a>
<a name="l264"></a> GrDirSprite(, tmpb0, tmpf0, </span><span class=cFE>0</span><span class=cF0>);
<a name="l265"></a> GrDirSprite(, tmpb1, tmpf1, </span><span class=cFE>1</span><span class=cF0>);
<a name="l266"></a> GrDirSprite(, tmpb2, tmpf2, </span><span class=cFE>2</span><span class=cF0>);
<a name="l267"></a> </span><span class=cF6>&quot;\n\n\n\n\n\n\n&quot;</span><span class=cF0>;
<a name="l268"></a>
<a name="l269"></a>
<a name="l270"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l271"></a>}
<a name="l272"></a>
<a name="l273"></a>GrDir;</span></pre></body>
</html>