mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-29 16:56:30 +00:00
112 lines
11 KiB
HTML
Executable file
112 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=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> DocProfile(</span><span class=cF1>U8</span><span class=cF0> *filename,</span><span class=cF9>I64</span><span class=cF0> flags)
|
|
<a name="l2"></a>{
|
|
<a name="l3"></a> </span><span class=cF9>I64</span><span class=cF0> i,
|
|
<a name="l4"></a> *cmd_stats = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>),
|
|
<a name="l5"></a> *flags_stats = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF7>)</span><span class=cF0> * </span><span class=cFE>64</span><span class=cF0>),
|
|
<a name="l6"></a> *type_flags_stats = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF7>)</span><span class=cF0> * </span><span class=cFE>64</span><span class=cF0>);
|
|
<a name="l7"></a> </span><span class=cF2>//Note: word wrap is determined by</span><span class=cF0>
|
|
<a name="l8"></a> </span><span class=cF2>//doc->win_task when a </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l1501"><span class=cF4>CDoc</span></a><span class=cF2> is recalculated</span><span class=cF0>
|
|
<a name="l9"></a> </span><span class=cF2>//use </span><a href="https://tomawezome.github.io/ZealOS/System/DolDoc/DocRecalc.html#l305"><span class=cF4>DocRecalc</span></a><span class=cF2>().</span><span class=cF0>
|
|
<a name="l10"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocRead</span><span class=cF0>(filename, flags);
|
|
<a name="l11"></a>
|
|
<a name="l12"></a> </span><span class=cF2>//doc->head which is equ to doc is the</span><span class=cF0>
|
|
<a name="l13"></a> </span><span class=cF2>//header of the CQueue and represents the end-of-file marker.</span><span class=cF0>
|
|
<a name="l14"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e = doc->head.next;
|
|
<a name="l15"></a>
|
|
<a name="l16"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
|
|
<a name="l17"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l18"></a> cmd_stats[doc_e->type_u8]++;
|
|
<a name="l19"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFE>64</span><span class=cF0>; i++)
|
|
<a name="l20"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&doc_e->de_flags, i</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l21"></a> flags_stats[i]++;
|
|
<a name="l22"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>16</span><span class=cF0>; i < </span><span class=cFE>32</span><span class=cF0>; i++)
|
|
<a name="l23"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&doc_e->type, i</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l24"></a> type_flags_stats[i]++;
|
|
<a name="l25"></a> doc_e = doc_e->next;
|
|
<a name="l26"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l27"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
|
<a name="l28"></a>
|
|
<a name="l29"></a> </span><span class=cF6>"$PURPLE$-------%s-------\n"</span><span class=cF0>, filename;
|
|
<a name="l30"></a> </span><span class=cF6>"$GREEN$The lowest byte of the 32-bit 'doc_e->type', "</span><span class=cF0>
|
|
<a name="l31"></a> </span><span class=cF6>"'$PURPLE$doc_e->type.u8[0]$GREEN$', "</span><span class=cF0>
|
|
<a name="l32"></a> </span><span class=cF6>"is cmd and accessed with the union "</span><span class=cF0>
|
|
<a name="l33"></a> </span><span class=cF6>"'$PURPLE$doc_e->type_u8$GREEN$'. "</span><span class=cF0>
|
|
<a name="l34"></a> </span><span class=cF6>"See $LK,\"CDocEntry\",A=\"MN:CDocEntry\"$, "</span><span class=cF0>
|
|
<a name="l35"></a> </span><span class=cF6>"$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$ and "</span><span class=cF0>
|
|
<a name="l36"></a> </span><span class=cF6>"$LK,\"Doc Type Codes\","</span><span class=cF0>
|
|
<a name="l37"></a> </span><span class=cF6>"A=\"FF:::/System/DolDoc/DocInit.CC,ST_DOC_CMDS\"$.\n"</span><span class=cF0>
|
|
<a name="l38"></a> </span><span class=cF6>"$FG$"</span><span class=cF0>;
|
|
<a name="l39"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>; i++)
|
|
<a name="l40"></a> </span><span class=cF1>if</span><span class=cF0> (cmd_stats[i])
|
|
<a name="l41"></a> </span><span class=cF6>"%4Z:%d\n"</span><span class=cF0>, i, </span><span class=cF6>"ST_DOC_CMDS"</span><span class=cF0>, cmd_stats[i];
|
|
<a name="l42"></a>
|
|
<a name="l43"></a> </span><span class=cF6>"\n$GREEN$'$PURPLE$doc_e->type.u8[1]$GREEN$' is "</span><span class=cF0>
|
|
<a name="l44"></a> </span><span class=cF6>"the screen color attr of the "</span><span class=cF0>
|
|
<a name="l45"></a> </span><span class=cF6>"entry. '$PURPLE$doc_e->type.u16[1]"</span><span class=cF0>
|
|
<a name="l46"></a> </span><span class=cF6>"$GREEN$' is some flags for blinking and "</span><span class=cF0>
|
|
<a name="l47"></a> </span><span class=cF6>"stuff. See $LK,\"Doc Type Flag "</span><span class=cF0>
|
|
<a name="l48"></a> </span><span class=cF6>"Defines\",A=\"MN:DOCET_BLINK\"$.\n$FG$"</span><span class=cF0>;
|
|
<a name="l49"></a>
|
|
<a name="l50"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>16</span><span class=cF0>; i < </span><span class=cFE>32</span><span class=cF0>; i++)
|
|
<a name="l51"></a> </span><span class=cF1>if</span><span class=cF0> (type_flags_stats[i])
|
|
<a name="l52"></a> </span><span class=cF6>"%4d:%d\n"</span><span class=cF0>, i, type_flags_stats[i];
|
|
<a name="l53"></a>
|
|
<a name="l54"></a> </span><span class=cF6>"$GREEN$\n'$PURPLE$doc_e->de_flags$GREEN$' is 64-bit. "</span><span class=cF0>
|
|
<a name="l55"></a> </span><span class=cF6>"See $LK,\"Doc Flag Defines\",A=\"MN:DOCEf_TAG\"$ and "</span><span class=cF0>
|
|
<a name="l56"></a> </span><span class=cF6>"$LK,\"Doc Flag Codes\","</span><span class=cF0>
|
|
<a name="l57"></a> </span><span class=cF6>"A=\"FF:::/System/DolDoc/DocInit.CC,ST_DOC_FLAGS\"$.\n"</span><span class=cF0>
|
|
<a name="l58"></a> </span><span class=cF6>"$FG$"</span><span class=cF0>;
|
|
<a name="l59"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFE>64</span><span class=cF0>; i++)
|
|
<a name="l60"></a> </span><span class=cF1>if</span><span class=cF0> (flags_stats[i])
|
|
<a name="l61"></a> </span><span class=cF6>"%4Z:%d\n"</span><span class=cF0>, i, </span><span class=cF6>"ST_DOC_FLAGS"</span><span class=cF0>, flags_stats[i];
|
|
<a name="l62"></a>
|
|
<a name="l63"></a> </span><span class=cF5>Free</span><span class=cF0>(cmd_stats);
|
|
<a name="l64"></a> </span><span class=cF5>Free</span><span class=cF0>(flags_stats);
|
|
<a name="l65"></a> </span><span class=cF5>PressAKey</span><span class=cF0>;
|
|
<a name="l66"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
|
<a name="l67"></a>}
|
|
<a name="l68"></a>
|
|
<a name="l69"></a></span><span class=cF2>/*See </span><a href="https://tomawezome.github.io/ZealOS/System/Training.html#l174"><span class=cF4>TipOfDay</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l70"></a>
|
|
<a name="l71"></a></span><span class=cF2>Note: Not all </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l1325"><span class=cF4>CDocEntry</span></a><span class=cF2>'s are full-sized nodes.</span><span class=cF0>
|
|
<a name="l72"></a></span><span class=cF2>Some are </span><a href="https://tomawezome.github.io/ZealOS/Kernel/Memory/MAllocFree.html#l391"><span class=cF4>MAlloc</span></a><span class=cF2>ed with a smaller size to save</span><span class=cF0>
|
|
<a name="l73"></a></span><span class=cF2>mem.</span><span class=cF0> </span><span class=cF2>They all have at least the size </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l1302"><span class=cF4>CDocEntryBase</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l74"></a>
|
|
<a name="l75"></a></span><span class=cF2>Note: </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l1325"><span class=cF4>CDocEntry</span></a><span class=cF2>'s should be alloced from the</span><span class=cF0>
|
|
<a name="l76"></a></span><span class=cF2>heap of the owning task, doc->mem_task.</span><span class=cF0>
|
|
<a name="l77"></a>
|
|
<a name="l78"></a></span><span class=cF2>The flag arrays </span><a href="https://tomawezome.github.io/ZealOS/System/DolDoc/MakeDoc.html#l21"><span class=cF4>doldoc.type_flags_form</span></a><span class=cF2>, etc</span><span class=cF0>
|
|
<a name="l79"></a></span><span class=cF2>are useful.</span><span class=cF0>
|
|
<a name="l80"></a></span><span class=cF2>*/</span><span class=cF0>
|
|
<a name="l81"></a>
|
|
<a name="l82"></a>DocProfile(</span><span class=cF6>"::/Doc/Welcome.DD"</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l83"></a>DocProfile(</span><span class=cF6>"::/Doc/Welcome.DD"</span><span class=cF0>, </span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>);
|
|
</span></pre></body>
|
|
</html>
|