mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
122 lines
11 KiB
HTML
Executable file
122 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 V1.06">
|
|
<style type="text/css">
|
|
body {background-color:#1f1f1f;}
|
|
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
|
|
.cF1{color:#4f84a6;background-color:#1f1f1f;}
|
|
.cF2{color:#73a255;background-color:#1f1f1f;}
|
|
.cF3{color:#297582;background-color:#1f1f1f;}
|
|
.cF4{color:#b34f4b;background-color:#1f1f1f;}
|
|
.cF5{color:#8a52c3;background-color:#1f1f1f;}
|
|
.cF6{color:#b7822f;background-color:#1f1f1f;}
|
|
.cF7{color:#444444;background-color:#1f1f1f;}
|
|
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
|
|
.cF9{color:#94bfde;background-color:#1f1f1f;}
|
|
.cFA{color:#a1ce97;background-color:#1f1f1f;}
|
|
.cFB{color:#6db4be;background-color:#1f1f1f;}
|
|
.cFC{color:#e88e88;background-color:#1f1f1f;}
|
|
.cFD{color:#ca94e8;background-color:#1f1f1f;}
|
|
.cFE{color:#d4b475;background-color:#1f1f1f;}
|
|
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Debugging;Cmd Line (Typically)"</span><span class=cF0>
|
|
<a name="l2"></a>
|
|
<a name="l3"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>LinkCheckDoc</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF9>I64</span><span class=cF0> *_fuf_flags)
|
|
<a name="l4"></a>{
|
|
<a name="l5"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
|
<a name="l6"></a> </span><span class=cF1>Bool</span><span class=cF0> found, unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l7"></a> </span><span class=cF9>CDoc</span><span class=cF0> *old_doc;
|
|
<a name="l8"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e = doc->head.next;
|
|
<a name="l9"></a> </span><span class=cF9>I64</span><span class=cF0> res = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l10"></a>
|
|
<a name="l11"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
|
|
<a name="l12"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l13"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>KeyScan</span><span class=cF0>)
|
|
<a name="l14"></a> {
|
|
<a name="l15"></a> </span><span class=cF5>LBts</span><span class=cF0>(_fuf_flags, </span><span class=cF3>FUf_CANCEL</span><span class=cF0>);
|
|
<a name="l16"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l17"></a> }
|
|
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (st = </span><span class=cF5>DocEntryLink</span><span class=cF7>(</span><span class=cF0>doc, doc_e</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l19"></a> {
|
|
<a name="l20"></a> old_doc = </span><span class=cF5>DocPut</span><span class=cF0>;
|
|
<a name="l21"></a> </span><span class=cF5>DocLock</span><span class=cF0>(old_doc);
|
|
<a name="l22"></a> </span><span class=cF5>Fs</span><span class=cF0>->put_doc = doc;
|
|
<a name="l23"></a> found = </span><span class=cF5>DocLinkCheck</span><span class=cF0>(doc, st);
|
|
<a name="l24"></a> </span><span class=cF5>Fs</span><span class=cF0>->put_doc = old_doc;
|
|
<a name="l25"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(old_doc);
|
|
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (!found)
|
|
<a name="l27"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l28"></a> </span><span class=cF5>PutFileLink</span><span class=cF0>(doc->filename.name,, doc_e->y);
|
|
<a name="l29"></a> </span><span class=cF6>"$RED$ %04d:%s\n$FG$"</span><span class=cF0>, doc_e->y, st;
|
|
<a name="l30"></a> res++;
|
|
<a name="l31"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l32"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l33"></a> }
|
|
<a name="l34"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8 == </span><span class=cF3>DOCT_ERROR</span><span class=cF0>)
|
|
<a name="l35"></a> {
|
|
<a name="l36"></a> </span><span class=cF5>PutFileLink</span><span class=cF0>(doc->filename.name,, doc_e->y);
|
|
<a name="l37"></a> </span><span class=cF6>"$RED$ Doc Error\n$FG$"</span><span class=cF0>;
|
|
<a name="l38"></a> res++;
|
|
<a name="l39"></a> }
|
|
<a name="l40"></a> doc_e = doc_e->next;
|
|
<a name="l41"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l42"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
|
<a name="l43"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l44"></a>
|
|
<a name="l45"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l46"></a>}
|
|
<a name="l47"></a>
|
|
<a name="l48"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>LinkCheckFile</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *filename, </span><span class=cF9>I64</span><span class=cF0> *_fuf_flags)
|
|
<a name="l49"></a>{
|
|
<a name="l50"></a> </span><span class=cF9>I64</span><span class=cF0> res;
|
|
<a name="l51"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocRead</span><span class=cF0>(filename, </span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>);
|
|
<a name="l52"></a>
|
|
<a name="l53"></a> res = </span><span class=cF5>LinkCheckDoc</span><span class=cF0>(doc, _fuf_flags);
|
|
<a name="l54"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
|
<a name="l55"></a>
|
|
<a name="l56"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l57"></a>}
|
|
<a name="l58"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>LinkCheck</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *files_find_mask=</span><span class=cF6>"/*"</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l59"></a>{</span><span class=cF2>//Check documents for broken file links.</span><span class=cF0>
|
|
<a name="l60"></a> </span><span class=cF9>I64</span><span class=cF0> fuf_flags = </span><span class=cFE>0</span><span class=cF0>, res = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l61"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde, *tmpde1;
|
|
<a name="l62"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
|
<a name="l63"></a>
|
|
<a name="l64"></a> </span><span class=cFB>progress2_max</span><span class=cF0> = </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l65"></a> </span><span class=cF5>FlagsScan</span><span class=cF0>(&fuf_flags, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>, </span><span class=cF6>"+r+$+f+F+O"</span><span class=cF0>);
|
|
<a name="l66"></a> </span><span class=cF5>FlagsScan</span><span class=cF0>(&fuf_flags, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>, fu_flags);
|
|
<a name="l67"></a> tmpde = tmpde1 = </span><span class=cF5>FilesFind</span><span class=cF0>(files_find_mask, fuf_flags);
|
|
<a name="l68"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde && !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&fuf_flags, </span><span class=cF3>FUf_CANCEL</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l69"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l70"></a>
|
|
<a name="l71"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"Before %s Broke:%d"</span><span class=cF0>, tmpde->full_name, res);
|
|
<a name="l72"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0> > </span><span class=cF3>PROGRESS_DESC_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l73"></a> st[</span><span class=cF3>PROGRESS_DESC_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l74"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(</span><span class=cFB>progress2_desc</span><span class=cF0>, st);
|
|
<a name="l75"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l76"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
|
<a name="l77"></a>
|
|
<a name="l78"></a> res += </span><span class=cF5>LinkCheckFile</span><span class=cF0>(tmpde->full_name, &fuf_flags);
|
|
<a name="l79"></a>
|
|
<a name="l80"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"After %s Broke:%d"</span><span class=cF0>, tmpde->full_name, res);
|
|
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0> > </span><span class=cF3>PROGRESS_DESC_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l82"></a> st[</span><span class=cF3>PROGRESS_DESC_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l83"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(</span><span class=cFB>progress2_desc</span><span class=cF0>, st);
|
|
<a name="l84"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l85"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
|
<a name="l86"></a>
|
|
<a name="l87"></a> tmpde = tmpde->next;
|
|
<a name="l88"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l89"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
|
<a name="l90"></a> </span><span class=cFB>progress2_max</span><span class=cF0> = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l91"></a>
|
|
<a name="l92"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l93"></a>}
|
|
</span></pre></body>
|
|
</html>
|