112 lines
10 KiB
Plaintext
112 lines
10 KiB
Plaintext
|
<!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=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,*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="l4"></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>*64),
|
||
|
<a name="l5"></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>*64);
|
||
|
<a name="l6"></a></span><span class=cF2>//Note: word wrap is determined by</span><span class=cF0>
|
||
|
<a name="l7"></a> </span><span class=cF2>//doc->win_task when a </span><a href="/Wb/Kernel/KernelA.HH.HTML#l1367"><span class=cF4>CDoc</span></a><span class=cF2> is recalculated</span><span class=cF0>
|
||
|
<a name="l8"></a> </span><span class=cF2>//use </span><a href="/Wb/Adam/DolDoc/DocRecalc.HC.HTML#l256"><span class=cF4>DocRecalc</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l9"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocRead</span><span class=cF0>(filename,flags);
|
||
|
<a name="l10"></a>
|
||
|
<a name="l11"></a> </span><span class=cF2>//doc->head which is equ to doc is the</span><span class=cF0>
|
||
|
<a name="l12"></a> </span><span class=cF2>//header of the CQue and represents the end-of-file marker.</span><span class=cF0>
|
||
|
<a name="l13"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=doc->head.next;
|
||
|
<a name="l14"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l15"></a> cmd_stats[doc_e->type_u8]++;
|
||
|
<a name="l16"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<64;i++)
|
||
|
<a name="l17"></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="l18"></a> flags_stats[i]++;
|
||
|
<a name="l19"></a> </span><span class=cF1>for</span><span class=cF0> (i=16;i<32;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->type,i</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l21"></a> type_flags_stats[i]++;
|
||
|
<a name="l22"></a> doc_e=doc_e->next;
|
||
|
<a name="l23"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l24"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
||
|
<a name="l25"></a>
|
||
|
<a name="l26"></a> </span><span class=cF6>"$PURPLE$-------%s-------\n"</span><span class=cF0>,filename;
|
||
|
<a name="l27"></a> </span><span class=cF6>"$GREEN$The lowest byte of the 32-bit 'doc_e->type', "</span><span class=cF0>
|
||
|
<a name="l28"></a> </span><span class=cF6>"'$PURPLE$doc_e->type.u8[0]$GREEN$', "</span><span class=cF0>
|
||
|
<a name="l29"></a> </span><span class=cF6>"is cmd and accessed with the union "</span><span class=cF0>
|
||
|
<a name="l30"></a> </span><span class=cF6>"'$PURPLE$doc_e->type_u8$GREEN$'. "</span><span class=cF0>
|
||
|
<a name="l31"></a> </span><span class=cF6>"See $LK,\"CDocEntry\",A=\"MN:CDocEntry\"$, "</span><span class=cF0>
|
||
|
<a name="l32"></a> </span><span class=cF6>"$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$ and "</span><span class=cF0>
|
||
|
<a name="l33"></a> </span><span class=cF6>"$LK,\"Doc Type Codes\","</span><span class=cF0>
|
||
|
<a name="l34"></a> </span><span class=cF6>"A=\"FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS\"$.\n"</span><span class=cF0>
|
||
|
<a name="l35"></a> </span><span class=cF6>"$FG$"</span><span class=cF0>;
|
||
|
<a name="l36"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>;i++)
|
||
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (cmd_stats[i])
|
||
|
<a name="l38"></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="l39"></a>
|
||
|
<a name="l40"></a> </span><span class=cF6>"\n$GREEN$'$PURPLE$doc_e->type.u8[1]$GREEN$' is "</span><span class=cF0>
|
||
|
<a name="l41"></a> </span><span class=cF6>"the scrn color attr of the "</span><span class=cF0>
|
||
|
<a name="l42"></a> </span><span class=cF6>"entry. '$PURPLE$doc_e->type.u16[1]"</span><span class=cF0>
|
||
|
<a name="l43"></a> </span><span class=cF6>"$GREEN$' is some flags for blinking and "</span><span class=cF0>
|
||
|
<a name="l44"></a> </span><span class=cF6>"stuff. See $LK,\"Doc Type Flag "</span><span class=cF0>
|
||
|
<a name="l45"></a> </span><span class=cF6>"Defines\",A=\"MN:DOCET_BLINK\"$.\n$FG$"</span><span class=cF0>;
|
||
|
<a name="l46"></a>
|
||
|
<a name="l47"></a> </span><span class=cF1>for</span><span class=cF0> (i=16;i<32;i++)
|
||
|
<a name="l48"></a> </span><span class=cF1>if</span><span class=cF0> (type_flags_stats[i])
|
||
|
<a name="l49"></a> </span><span class=cF6>"%4d:%d\n"</span><span class=cF0>,i,type_flags_stats[i];
|
||
|
<a name="l50"></a>
|
||
|
<a name="l51"></a> </span><span class=cF6>"$GREEN$\n'$PURPLE$doc_e->de_flags$GREEN$' is 64-bit. "</span><span class=cF0>
|
||
|
<a name="l52"></a> </span><span class=cF6>"See $LK,\"Doc Flag Defines\",A=\"MN:DOCEf_TAG\"$ and "</span><span class=cF0>
|
||
|
<a name="l53"></a> </span><span class=cF6>"$LK,\"Doc Flag Codes\","</span><span class=cF0>
|
||
|
<a name="l54"></a> </span><span class=cF6>"A=\"FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS\"$.\n"</span><span class=cF0>
|
||
|
<a name="l55"></a> </span><span class=cF6>"$FG$"</span><span class=cF0>;
|
||
|
<a name="l56"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<64;i++)
|
||
|
<a name="l57"></a> </span><span class=cF1>if</span><span class=cF0> (flags_stats[i])
|
||
|
<a name="l58"></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="l59"></a>
|
||
|
<a name="l60"></a> </span><span class=cF5>Free</span><span class=cF0>(cmd_stats);
|
||
|
<a name="l61"></a> </span><span class=cF5>Free</span><span class=cF0>(flags_stats);
|
||
|
<a name="l62"></a> </span><span class=cF5>PressAKey</span><span class=cF0>;
|
||
|
<a name="l63"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l64"></a>}
|
||
|
<a name="l65"></a>
|
||
|
<a name="l66"></a></span><span class=cF2>/*See </span><a href="/Wb/Adam/Training.HC.HTML#l161"><span class=cF4>TipOfDay</span></a><span class=cF2>.</span><span class=cF0>
|
||
|
<a name="l67"></a>
|
||
|
<a name="l68"></a></span><span class=cF2>Note: Not all </span><a href="/Wb/Kernel/KernelA.HH.HTML#l1191"><span class=cF4>CDocEntry</span></a><span class=cF2>'s are full-sized nodes.</span><span class=cF0>
|
||
|
<a name="l69"></a></span><span class=cF2>Some are </span><a href="/Wb/Kernel/Mem/MAllocFree.HC.HTML#l387"><span class=cF4>MAlloc</span></a><span class=cF2>ed with a smaller size to save</span><span class=cF0>
|
||
|
<a name="l70"></a></span><span class=cF2>mem.</span><span class=cF0> </span><span class=cF2>They all have at least the size </span><a href="/Wb/Kernel/KernelA.HH.HTML#l1169"><span class=cF4>CDocEntryBase</span></a><span class=cF2>.</span><span class=cF0>
|
||
|
<a name="l71"></a>
|
||
|
<a name="l72"></a></span><span class=cF2>Note: </span><a href="/Wb/Kernel/KernelA.HH.HTML#l1191"><span class=cF4>CDocEntry</span></a><span class=cF2>'s should be alloced from the</span><span class=cF0>
|
||
|
<a name="l73"></a></span><span class=cF2>heap of the owning task, doc->mem_task.</span><span class=cF0>
|
||
|
<a name="l74"></a>
|
||
|
<a name="l75"></a></span><span class=cF2>The flag arrays </span><a href="/Wb/Adam/DolDoc/MakeDoc.HC.HTML#l21"><span class=cF4>doldoc.type_flags_form</span></a><span class=cF2>, etc</span><span class=cF0>
|
||
|
<a name="l76"></a></span><span class=cF2>are useful.</span><span class=cF0>
|
||
|
<a name="l77"></a></span><span class=cF2>*/</span><span class=cF0>
|
||
|
<a name="l78"></a>
|
||
|
<a name="l79"></a>DocProfile(</span><span class=cF6>"::/Doc/Welcome.DD"</span><span class=cF0>,0);
|
||
|
<a name="l80"></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>
|