ZealOS/docs/System/DolDoc/DocLink.CC.html
TomAwezome 1b75d91002 Fix Mount AHCI Port selection.
Add arg to SATARep to specify drive types to show.
Add checks in AHCIPortInit to verify port signatures, add helper method to get signatures from port.
2021-08-02 16:40:05 -04:00

441 lines
49 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.13">
<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>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc/Link&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF2>/* See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocInit.CC.html#l24"><span class=cF4>ZealOS Link Types</span></a><span class=cF2>.</span><span class=cF0>
<a name="l4"></a></span><span class=cF2>&quot;filename&quot;</span><span class=cF0>
<a name="l5"></a></span><span class=cF2>&quot;FI:filename&quot;</span><span class=cF0>
<a name="l6"></a></span><span class=cF2>&quot;FA:haystack_filename,needle_anchor_str&quot;</span><span class=cF0>
<a name="l7"></a></span><span class=cF2>&quot;FF:haystack_filename,needle_str&quot;</span><span class=cF0>
<a name="l8"></a></span><span class=cF2>&quot;FF:haystack_filename,needle_str:occurnum&quot;</span><span class=cF0>
<a name="l9"></a></span><span class=cF2>&quot;FL:filename,linenum&quot;</span><span class=cF0>
<a name="l10"></a></span><span class=cF2>&quot;MN:SymName&quot;</span><span class=cF0>
<a name="l11"></a></span><span class=cF2>&quot;PI:filename&quot;</span><span class=cF0>
<a name="l12"></a></span><span class=cF2>&quot;PF:haystack_filename,needle_str&quot;</span><span class=cF0>
<a name="l13"></a></span><span class=cF2>&quot;PF:haystack_filename,needle_str:occurnum&quot;</span><span class=cF0>
<a name="l14"></a></span><span class=cF2>&quot;PL:filename,linenum&quot;</span><span class=cF0>
<a name="l15"></a></span><span class=cF2>&quot;BF:haystack_bible_book,needle_str&quot;</span><span class=cF0>
<a name="l16"></a></span><span class=cF2>&quot;DN:word&quot;</span><span class=cF0>
<a name="l17"></a></span><span class=cF2>&quot;DN:word,defnum&quot;</span><span class=cF0>
<a name="l18"></a></span><span class=cF2>&quot;HI:index&quot;</span><span class=cF0>
<a name="l19"></a></span><span class=cF2>&quot;AD:code_address_number&quot;</span><span class=cF0>
<a name="l20"></a>
<a name="l21"></a></span><span class=cF2>To edit a doc structure already in memory. See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Gr/SpriteEd.CC.html#l701"><span class=cF4>SpriteEdText</span></a><span class=cF2>().</span><span class=cF0>
<a name="l22"></a></span><span class=cF2>&quot;AI:doc_address&quot;</span><span class=cF0>
<a name="l23"></a></span><span class=cF2>&quot;AA:haystack_doc_address,needle_anchor_str&quot;</span><span class=cF0>
<a name="l24"></a></span><span class=cF2>&quot;AF:haystack_doc_address,needle_str&quot;</span><span class=cF0>
<a name="l25"></a></span><span class=cF2>&quot;AF:haystack_doc_address,needle_str:occurnum&quot;</span><span class=cF0>
<a name="l26"></a></span><span class=cF2>&quot;AL:doc_address,linenum&quot;</span><span class=cF0>
<a name="l27"></a></span><span class=cF2>*/</span><span class=cF0>
<a name="l28"></a>
<a name="l29"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_FILE</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>
<a name="l30"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_FILE_ANCHOR</span><span class=cF0> </span><span class=cFE>1</span><span class=cF0>
<a name="l31"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_FILE_FIND</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0>
<a name="l32"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_FILE_LINE</span><span class=cF0> </span><span class=cFE>3</span><span class=cF0>
<a name="l33"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_MAN_PAGE</span><span class=cF0> </span><span class=cFE>4</span><span class=cF0>
<a name="l34"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_PLAIN</span><span class=cF0> </span><span class=cFE>5</span><span class=cF0>
<a name="l35"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_PLAIN_FIND</span><span class=cF0> </span><span class=cFE>6</span><span class=cF0>
<a name="l36"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_PLAIN_LINE</span><span class=cF0> </span><span class=cFE>7</span><span class=cF0>
<a name="l37"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0> </span><span class=cFE>8</span><span class=cF0>
<a name="l38"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_DEF</span><span class=cF0> </span><span class=cFE>9</span><span class=cF0>
<a name="l39"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_HELP_INDEX</span><span class=cF0> </span><span class=cFE>10</span><span class=cF0>
<a name="l40"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_ADDR</span><span class=cF0> </span><span class=cFE>11</span><span class=cF0>
<a name="l41"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_DOC</span><span class=cF0> </span><span class=cFE>12</span><span class=cF0> </span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Gr/SpriteEd.CC.html#l701"><span class=cF4>SpriteEdText</span></a><span class=cF2>()</span><span class=cF0>
<a name="l42"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_DOC_ANCHOR</span><span class=cF0> </span><span class=cFE>13</span><span class=cF0>
<a name="l43"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_DOC_FIND</span><span class=cF0> </span><span class=cFE>14</span><span class=cF0>
<a name="l44"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_DOC_LINE</span><span class=cF0> </span><span class=cFE>15</span><span class=cF0>
<a name="l45"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LK_PLACE_ANCHOR</span><span class=cF0> </span><span class=cFE>16</span><span class=cF0>
<a name="l46"></a>
<a name="l47"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>DocEntryLink</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e)
<a name="l48"></a>{</span><span class=cF2>//MAlloc new str, either tag or aux_str if link.</span><span class=cF0>
<a name="l49"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LINK</span><span class=cF0>)
<a name="l50"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l51"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_AUX_STR</span><span class=cF0>)
<a name="l52"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>StrNew</span><span class=cF0>(doc_e-&gt;aux_str, doc-&gt;mem_task);
<a name="l53"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_TAG</span><span class=cF0>)
<a name="l54"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>StrNew</span><span class=cF0>(doc_e-&gt;tag, doc-&gt;mem_task);
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l56"></a>
<a name="l57"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l58"></a>}
<a name="l59"></a>
<a name="l60"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocFileEd</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> _type, </span><span class=cF1>U8</span><span class=cF0> *filename, </span><span class=cF1>U8</span><span class=cF0> *needle_str, </span><span class=cF9>I64</span><span class=cF0> *_num, </span><span class=cF9>I64</span><span class=cF0> edf_dof_flags)
<a name="l61"></a>{
<a name="l62"></a> </span><span class=cF9>I64</span><span class=cF0> type = _type, flags = </span><span class=cFE>0</span><span class=cF0>, old_border_src = </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src;
<a name="l63"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l64"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l65"></a> </span><span class=cF1>Bool</span><span class=cF0> old_silent = </span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;display_flags, </span><span class=cF3>DISPLAYf_SILENT</span><span class=cF0>), res = </span><span class=cF3>FALSE</span><span class=cF0>, other_found = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l66"></a> </span><span class=cF1>U8</span><span class=cF0> *st1, *st2;
<a name="l67"></a>
<a name="l68"></a> </span><span class=cF1>try</span><span class=cF0>
<a name="l69"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l70"></a> </span><span class=cF1>switch</span><span class=cF0> (type)
<a name="l71"></a> {
<a name="l72"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN</span><span class=cF0>:
<a name="l73"></a> flags = </span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0> | </span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>;
<a name="l74"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC</span><span class=cF0>:
<a name="l75"></a> type = </span><span class=cF3>LK_FILE</span><span class=cF0>;
<a name="l76"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l77"></a>
<a name="l78"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_ANCHOR</span><span class=cF0>:
<a name="l79"></a> type = </span><span class=cF3>LK_FILE_ANCHOR</span><span class=cF0>;
<a name="l80"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l81"></a>
<a name="l82"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_FIND</span><span class=cF0>:
<a name="l83"></a> flags = </span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0> | </span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>;
<a name="l84"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_FIND</span><span class=cF0>:
<a name="l85"></a> type = </span><span class=cF3>LK_FILE_FIND</span><span class=cF0>;
<a name="l86"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l87"></a>
<a name="l88"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_LINE</span><span class=cF0>:
<a name="l89"></a> flags = </span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0> | </span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>;
<a name="l90"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_LINE</span><span class=cF0>:
<a name="l91"></a> type = </span><span class=cF3>LK_FILE_LINE</span><span class=cF0>;
<a name="l92"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l93"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0>:
<a name="l94"></a> flags = </span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0> | </span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>;
<a name="l95"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l96"></a> }
<a name="l97"></a>
<a name="l98"></a> flags |= </span><span class=cF3>DOCF_ALLOW_UNDO</span><span class=cF0>;
<a name="l99"></a>
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF3>LK_DOC</span><span class=cF0> &lt;= _type &lt;= </span><span class=cF3>LK_DOC_LINE</span><span class=cF0>)
<a name="l101"></a> {
<a name="l102"></a> doc = </span><span class=cF5>Str2I64</span><span class=cF0>(filename);</span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Gr/SpriteEd.CC.html#l701"><span class=cF4>SpriteEdText</span></a><span class=cF2>()</span><span class=cF0>
<a name="l103"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l104"></a> }
<a name="l105"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l106"></a> {
<a name="l107"></a> st1 = </span><span class=cF5>StrNew</span><span class=cF0>(filename);
<a name="l108"></a> st2 = </span><span class=cF5>StrNew</span><span class=cF0>(filename);
<a name="l109"></a> </span><span class=cF5>StrLastRemove</span><span class=cF0>(st1, </span><span class=cF6>&quot;/&quot;</span><span class=cF0>, st2); </span><span class=cF2>//st2 is name without dir</span><span class=cF0>
<a name="l110"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>FileNameCheck</span><span class=cF7>(</span><span class=cF0>st2</span><span class=cF7>)</span><span class=cF0>)
<a name="l111"></a> doc = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l112"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l113"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l114"></a> </span><span class=cF5>Silent</span><span class=cF0>;
<a name="l115"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;edf_dof_flags, </span><span class=cF3>EDf_BAIL</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF2>//if bail, scan parents</span><span class=cF0>
<a name="l116"></a> res = </span><span class=cF5>FileFind</span><span class=cF0>(filename,, </span><span class=cF3>FUF_JUST_FILES</span><span class=cF0> | </span><span class=cF3>FUF_SCAN_PARENTS</span><span class=cF0>);
<a name="l117"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>res = </span><span class=cF5>FileFind</span><span class=cF0>(filename,, </span><span class=cF3>FUF_JUST_FILES</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
<a name="l118"></a> other_found = </span><span class=cF5>FileFind</span><span class=cF0>(filename,, </span><span class=cF3>FUF_JUST_FILES</span><span class=cF0> | </span><span class=cF3>FUF_SCAN_PARENTS</span><span class=cF0>);
<a name="l119"></a> doc = </span><span class=cF5>DocRead</span><span class=cF0>(filename, flags);
<a name="l120"></a> doc-&gt;desc = </span><span class=cF6>'Edit'</span><span class=cF0>;
<a name="l121"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
<a name="l122"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src = </span><span class=cF3>BDS_ED_FILENAME_DRIVE</span><span class=cF0>;
<a name="l123"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l124"></a> </span><span class=cF5>Free</span><span class=cF0>(st1);
<a name="l125"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
<a name="l126"></a> }
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (!doc || doc-&gt;doc_signature != </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
<a name="l128"></a> res = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l129"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l130"></a> {
<a name="l131"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;edf_dof_flags, </span><span class=cF3>EDf_COLLAPSE</span><span class=cF7>)</span><span class=cF0>)
<a name="l132"></a> </span><span class=cF5>DocCollapse</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>, doc);
<a name="l133"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;edf_dof_flags, </span><span class=cF3>EDf_UNCOLLAPSE</span><span class=cF7>)</span><span class=cF0>)
<a name="l134"></a> </span><span class=cF5>DocCollapse</span><span class=cF0>(</span><span class=cF3>FALSE</span><span class=cF0>, doc);
<a name="l135"></a>
<a name="l136"></a> </span><span class=cF1>if</span><span class=cF0> (res || other_found)
<a name="l137"></a> </span><span class=cF1>switch</span><span class=cF0> (type)
<a name="l138"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l139"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_LINE</span><span class=cF0>:
<a name="l140"></a> res = </span><span class=cF5>DocGoToLine</span><span class=cF0>(doc, *_num);
<a name="l141"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l142"></a>
<a name="l143"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_ANCHOR</span><span class=cF0>:
<a name="l144"></a> res = </span><span class=cF5>DocAnchorFind</span><span class=cF0>(doc, needle_str);
<a name="l145"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l146"></a>
<a name="l147"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_FIND</span><span class=cF0>:
<a name="l148"></a> res = </span><span class=cF5>DocFind</span><span class=cF0>(doc,, needle_str, *_num);
<a name="l149"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l150"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0>:
<a name="l151"></a> res = </span><span class=cF5>DocFind</span><span class=cF0>(doc, *_num, needle_str);
<a name="l152"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l153"></a>
<a name="l154"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l155"></a> </span><span class=cF5>DocCenter</span><span class=cF0>(doc);
<a name="l156"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l157"></a> *_num = doc-&gt;cur_entry-&gt;y + </span><span class=cFE>1</span><span class=cF0>;
<a name="l158"></a>
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (edf_dof_flags &amp; </span><span class=cF3>EDF_WAS_WRITE</span><span class=cF0>)
<a name="l160"></a> res = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l161"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>edf_dof_flags &amp; </span><span class=cF3>EDF_BAIL</span><span class=cF7>)</span><span class=cF0>)
<a name="l162"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (*doc-&gt;filename.name)
<a name="l164"></a> doc-&gt;filename.dirc = </span><span class=cF5>DirContextNew</span><span class=cF0>(doc-&gt;filename.name);
<a name="l165"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l166"></a> doc-&gt;filename.dirc = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l167"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocEd</span><span class=cF7>(</span><span class=cF0>doc, edf_dof_flags | </span><span class=cF3>DOF_DONT_HOME</span><span class=cF7>)</span><span class=cF0>)
<a name="l168"></a> {
<a name="l169"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l170"></a> doc_e = doc-&gt;cur_entry;
<a name="l171"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != doc)
<a name="l172"></a> </span><span class=cF5>DocEntryRun</span><span class=cF0>(doc, doc_e, </span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l173"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l174"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF3>LK_DOC</span><span class=cF0> &lt;= _type &lt;= </span><span class=cF3>LK_DOC_LINE</span><span class=cF7>)</span><span class=cF0>)
<a name="l175"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l176"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(doc);
<a name="l177"></a> </span><span class=cF1>if</span><span class=cF0> (edf_dof_flags &amp; </span><span class=cF3>EDF_WAS_WRITE</span><span class=cF0>)
<a name="l178"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l179"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l180"></a> }
<a name="l181"></a> </span><span class=cF5>DirContextDel</span><span class=cF0>(doc-&gt;filename.dirc);
<a name="l182"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l183"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF3>LK_DOC</span><span class=cF0> &lt;= _type &lt;= </span><span class=cF3>LK_DOC_LINE</span><span class=cF7>)</span><span class=cF0>)
<a name="l184"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l185"></a> }
<a name="l186"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l187"></a> </span><span class=cF1>catch</span><span class=cF0>
<a name="l188"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l189"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
<a name="l190"></a> res = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l191"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l192"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src = old_border_src;
<a name="l193"></a>
<a name="l194"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l195"></a>}
<a name="l196"></a>
<a name="l197"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>DEFAULT_ADDR_LINK_BIN_SIZE</span><span class=cF0> </span><span class=cFE>64</span><span class=cF0>
<a name="l198"></a>
<a name="l199"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>EdLinkConvert</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *link_st, </span><span class=cF1>U8</span><span class=cF0> **_filename=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> **_needle_str=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> *_num=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> edf_dof_flags=</span><span class=cFE>0</span><span class=cF0>)
<a name="l200"></a>{</span><span class=cF2>//</span><a href="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocLink.CC.html#l29"><span class=cF4>Editor Link</span></a><span class=cF2>--&gt; filename, needle_str and line number.</span><span class=cF0>
<a name="l201"></a> </span><span class=cF1>U8</span><span class=cF0> *st, *ptr, *src, *filename = </span><span class=cF3>NULL</span><span class=cF0>, *needle_str = </span><span class=cF3>NULL</span><span class=cF0>, *filename2;
<a name="l202"></a> </span><span class=cF9>I64</span><span class=cF0> res, i, num = </span><span class=cFE>1</span><span class=cF0>;
<a name="l203"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
<a name="l204"></a>
<a name="l205"></a> </span><span class=cF1>if</span><span class=cF0> (!link_st || !*link_st)
<a name="l206"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l207"></a> </span><span class=cF1>if</span><span class=cF0> (edf_dof_flags &amp; </span><span class=cF3>EDF_BAIL</span><span class=cF0>)
<a name="l208"></a> </span><span class=cF1>return</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>;
<a name="l209"></a> link_st = </span><span class=cFB>blkdev</span><span class=cF0>.tmp_filename;
<a name="l210"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l211"></a> st = </span><span class=cF5>StrNew</span><span class=cF0>(link_st);
<a name="l212"></a> res = </span><span class=cF3>LK_FILE</span><span class=cF0>;
<a name="l213"></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> &gt; </span><span class=cFE>3</span><span class=cF0> &amp;&amp; st[</span><span class=cFE>2</span><span class=cF0>] == </span><span class=cF6>':'</span><span class=cF0>)
<a name="l214"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l215"></a> st[</span><span class=cFE>2</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
<a name="l216"></a> filename2 = st + </span><span class=cFE>3</span><span class=cF0>;
<a name="l217"></a> </span><span class=cF1>switch</span><span class=cF0> (res = </span><span class=cF5>DefineMatch</span><span class=cF7>(</span><span class=cF0>st, </span><span class=cF6>&quot;ST_LINK_TYPES&quot;</span><span class=cF0>, </span><span class=cF3>LMF_IGNORE_CASE</span><span class=cF7>)</span><span class=cF0>)
<a name="l218"></a> {
<a name="l219"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_MAN_PAGE</span><span class=cF0>:
<a name="l220"></a> </span><span class=cF1>if</span><span class=cF0> (tmph = </span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF5>Fs</span><span class=cF0>-&gt;hash_table, </span><span class=cF3>HTG_SRC_SYM</span><span class=cF7>)</span><span class=cF0>)
<a name="l221"></a> res = </span><span class=cF5>EdLinkConvert</span><span class=cF0>(tmph-&gt;src_link, &amp;filename, &amp;needle_str, &amp;num, edf_dof_flags);
<a name="l222"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l223"></a> res = -</span><span class=cFE>1</span><span class=cF0>;
<a name="l224"></a> </span><span class=cF1>goto</span><span class=cF0> lc_done;
<a name="l225"></a>
<a name="l226"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_ADDR</span><span class=cF0>:
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF6>&quot;,&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l228"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l229"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l230"></a> i = </span><span class=cF5>Str2I64</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l231"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l232"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l233"></a> i = </span><span class=cF3>DEFAULT_ADDR_LINK_BIN_SIZE</span><span class=cF0>;
<a name="l234"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>SrcEdLink</span><span class=cF7>(</span><span class=cF5>ExePrint</span><span class=cF0>(</span><span class=cF6>&quot;%s;&quot;</span><span class=cF0>, filename2), i</span><span class=cF7>)</span><span class=cF0>)
<a name="l235"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l236"></a> res = </span><span class=cF5>EdLinkConvert</span><span class=cF0>(ptr, &amp;filename, &amp;needle_str, &amp;num, edf_dof_flags);
<a name="l237"></a> </span><span class=cF5>Free</span><span class=cF0>(ptr);
<a name="l238"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l239"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l240"></a> res = -</span><span class=cFE>1</span><span class=cF0>;
<a name="l241"></a> </span><span class=cF1>goto</span><span class=cF0> lc_done;
<a name="l242"></a>
<a name="l243"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DEF</span><span class=cF0>:
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF6>&quot;,&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l245"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l246"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l247"></a> i = </span><span class=cF5>Str2I64</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l248"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l249"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l250"></a> i = -</span><span class=cFE>1</span><span class=cF0>;
<a name="l251"></a> filename = </span><span class=cF5>StrNew</span><span class=cF0>(filename2);
<a name="l252"></a> num = i;
<a name="l253"></a> </span><span class=cF1>goto</span><span class=cF0> lc_done;
<a name="l254"></a>
<a name="l255"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_HELP_INDEX</span><span class=cF0>:
<a name="l256"></a> filename = </span><span class=cF5>StrNew</span><span class=cF0>(filename2);
<a name="l257"></a> </span><span class=cF1>goto</span><span class=cF0> lc_done;
<a name="l258"></a>
<a name="l259"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0>:
<a name="l260"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF6>&quot;,&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l261"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l262"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l263"></a> src = ptr + </span><span class=cFE>1</span><span class=cF0>;
<a name="l264"></a> </span><span class=cF1>while</span><span class=cF0> (*src)
<a name="l265"></a> {</span><span class=cF2>//We do not allow ending verse</span><span class=cF0>
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (*src == </span><span class=cF6>'-'</span><span class=cF0>)
<a name="l267"></a> *src = </span><span class=cFE>0</span><span class=cF0>;
<a name="l268"></a> src++;
<a name="l269"></a> }
<a name="l270"></a> needle_str = </span><span class=cF5>StrNew</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l271"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l272"></a> i = </span><span class=cF5>DefineMatch</span><span class=cF0>(filename2, </span><span class=cF6>&quot;ST_BIBLE_BOOKS&quot;</span><span class=cF0>, </span><span class=cF3>LMF_IGNORE_CASE</span><span class=cF0>);
<a name="l273"></a> </span><span class=cF1>if</span><span class=cF0> (i &lt; </span><span class=cFE>0</span><span class=cF0>)
<a name="l274"></a> res = -</span><span class=cFE>1</span><span class=cF0>;
<a name="l275"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l276"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l277"></a> num = </span><span class=cF5>Str2I64</span><span class=cF0>(</span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>i, </span><span class=cF6>&quot;ST_BIBLE_BOOK_LINES&quot;</span><span class=cF7>)</span><span class=cF0>);
<a name="l278"></a> filename2 = </span><span class=cF3>BIBLE_FILENAME</span><span class=cF0>;
<a name="l279"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l280"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l281"></a>
<a name="l282"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_LINE</span><span class=cF0>:
<a name="l283"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_LINE</span><span class=cF0>:
<a name="l284"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_LINE</span><span class=cF0>:
<a name="l285"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF6>&quot;,&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l286"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l287"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l288"></a> num = </span><span class=cF5>Str2I64</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l289"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l290"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l291"></a>
<a name="l292"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_ANCHOR</span><span class=cF0>:
<a name="l293"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_ANCHOR</span><span class=cF0>:
<a name="l294"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF6>&quot;,&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l295"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l296"></a> *ptr =</span><span class=cFE>0</span><span class=cF0>;
<a name="l297"></a> needle_str = </span><span class=cF5>StrNew</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l298"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l299"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l300"></a>
<a name="l301"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_FIND</span><span class=cF0>:
<a name="l302"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_FIND</span><span class=cF0>:
<a name="l303"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_FIND</span><span class=cF0>:
<a name="l304"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>filename2, </span><span class=cF6>&quot;,&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l305"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l306"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l307"></a> needle_str = </span><span class=cF5>StrNew</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l308"></a> </span><span class=cF1>if</span><span class=cF0> (ptr = </span><span class=cF5>StrLastOcc</span><span class=cF7>(</span><span class=cF0>needle_str, </span><span class=cF6>&quot;:&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l309"></a> {
<a name="l310"></a> *ptr = </span><span class=cFE>0</span><span class=cF0>;
<a name="l311"></a> num = </span><span class=cF5>Str2I64</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0>);
<a name="l312"></a> }
<a name="l313"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l314"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l315"></a> }
<a name="l316"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l317"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l318"></a> filename2 = st;
<a name="l319"></a> </span><span class=cF1>if</span><span class=cF0> (res &gt;= </span><span class=cFE>0</span><span class=cF0>)
<a name="l320"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l321"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF3>LK_DOC</span><span class=cF0> &lt;= res &lt;= </span><span class=cF3>LK_DOC_LINE</span><span class=cF0>)
<a name="l322"></a> filename = </span><span class=cF5>StrNew</span><span class=cF0>(filename2); </span><span class=cF2>//Holds document address as number.</span><span class=cF0>
<a name="l323"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l324"></a> filename = </span><span class=cF5>FileNameAbs</span><span class=cF0>(filename2);
<a name="l325"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l326"></a>lc_done:
<a name="l327"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l328"></a> </span><span class=cF1>if</span><span class=cF0> (_filename)
<a name="l329"></a> *_filename = filename;
<a name="l330"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l331"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
<a name="l332"></a> </span><span class=cF1>if</span><span class=cF0> (_needle_str)
<a name="l333"></a> *_needle_str = needle_str;
<a name="l334"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l335"></a> </span><span class=cF5>Free</span><span class=cF0>(needle_str);
<a name="l336"></a> </span><span class=cF1>if</span><span class=cF0> (_num)
<a name="l337"></a> *_num = num;
<a name="l338"></a>
<a name="l339"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l340"></a>}
<a name="l341"></a>
<a name="l342"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocLinkCheck</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF1>U8</span><span class=cF0> *link_st)
<a name="l343"></a>{</span><span class=cF2>//Check for bad </span><a href="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocLink.CC.html#l29"><span class=cF4>Editor Link</span></a><span class=cF2>.</span><span class=cF0>
<a name="l344"></a> </span><span class=cF1>U8</span><span class=cF0> *filename, *st;
<a name="l345"></a> </span><span class=cF1>Bool</span><span class=cF0> res = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l346"></a> </span><span class=cF9>CDirContext</span><span class=cF0> *dirc;
<a name="l347"></a>
<a name="l348"></a> </span><span class=cF1>if</span><span class=cF0> (link_st)
<a name="l349"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l350"></a> st = </span><span class=cF5>FileNameAbs</span><span class=cF0>(doc-&gt;filename.name);
<a name="l351"></a> dirc = </span><span class=cF5>DirContextNew</span><span class=cF0>(st);
<a name="l352"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l353"></a> </span><span class=cF1>switch</span><span class=cF0> (</span><span class=cF5>EdLinkConvert</span><span class=cF7>(</span><span class=cF0>link_st, &amp;filename</span><span class=cF7>)</span><span class=cF0>)
<a name="l354"></a> {
<a name="l355"></a> </span><span class=cF1>case</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>:
<a name="l356"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l357"></a>
<a name="l358"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_LINE</span><span class=cF0>:
<a name="l359"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_LINE</span><span class=cF0>:
<a name="l360"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE</span><span class=cF0>:
<a name="l361"></a></span><span class=cF2>//We don't check line number</span><span class=cF0>
<a name="l362"></a> res = </span><span class=cF5>FileFind</span><span class=cF0>(filename,, </span><span class=cF3>FUF_JUST_FILES</span><span class=cF0> | </span><span class=cF3>FUF_SCAN_PARENTS</span><span class=cF0>);
<a name="l363"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l364"></a>
<a name="l365"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0>:
<a name="l366"></a> st = </span><span class=cF5>StrNew</span><span class=cF0>(link_st + </span><span class=cFE>3</span><span class=cF0>);
<a name="l367"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrOcc</span><span class=cF7>(</span><span class=cF0>st, </span><span class=cF6>','</span><span class=cF7>)</span><span class=cF0>)
<a name="l368"></a> </span><span class=cF5>StrLastRemove</span><span class=cF0>(st, </span><span class=cF6>&quot;,&quot;</span><span class=cF0>);
<a name="l369"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DefineMatch</span><span class=cF7>(</span><span class=cF0>st, </span><span class=cF6>&quot;ST_BIBLE_BOOKS&quot;</span><span class=cF0>, </span><span class=cF3>LMF_IGNORE_CASE</span><span class=cF7>)</span><span class=cF0> &gt;= </span><span class=cFE>0</span><span class=cF0>)
<a name="l370"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l371"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l372"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l373"></a>
<a name="l374"></a> </span><span class=cF1>default</span><span class=cF0>:</span><span class=cF2>//TODO: Need to validate HI: and DN:</span><span class=cF0>
<a name="l375"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Ed</span><span class=cF7>(</span><span class=cF0>link_st, </span><span class=cF3>EDF_BAIL</span><span class=cF7>)</span><span class=cF0>)
<a name="l376"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l377"></a> }
<a name="l378"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
<a name="l379"></a> </span><span class=cF5>DirContextDel</span><span class=cF0>(dirc);
<a name="l380"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l381"></a>
<a name="l382"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l383"></a>}
<a name="l384"></a>
<a name="l385"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>DocLinkFile</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *link_st, </span><span class=cF9>CTask</span><span class=cF0> *mem_task=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l386"></a>{</span><span class=cF2>//Return the file for an </span><a href="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocLink.CC.html#l29"><span class=cF4>Editor Link Types</span></a><span class=cF2>.</span><span class=cF0>
<a name="l387"></a> </span><span class=cF1>U8</span><span class=cF0> *filename = </span><span class=cF3>NULL</span><span class=cF0>, *st, *res = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l388"></a>
<a name="l389"></a> </span><span class=cF1>if</span><span class=cF0> (link_st)
<a name="l390"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l391"></a> </span><span class=cF1>switch</span><span class=cF0> (</span><span class=cF5>EdLinkConvert</span><span class=cF7>(</span><span class=cF0>link_st, &amp;filename</span><span class=cF7>)</span><span class=cF0>)
<a name="l392"></a> {
<a name="l393"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE</span><span class=cF0>:
<a name="l394"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_ANCHOR</span><span class=cF0>:
<a name="l395"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_FIND</span><span class=cF0>:
<a name="l396"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_LINE</span><span class=cF0>:
<a name="l397"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN</span><span class=cF0>:
<a name="l398"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_FIND</span><span class=cF0>:
<a name="l399"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_LINE</span><span class=cF0>:
<a name="l400"></a> st = </span><span class=cF5>FileNameAbs</span><span class=cF0>(filename, </span><span class=cF3>FUF_SCAN_PARENTS</span><span class=cF0>);
<a name="l401"></a> res = </span><span class=cF5>StrNew</span><span class=cF0>(st);
<a name="l402"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l403"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l404"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0>:
<a name="l405"></a> res = </span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF3>BIBLE_FILENAME</span><span class=cF0>, mem_task);
<a name="l406"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l407"></a> }
<a name="l408"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
<a name="l409"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l410"></a>
<a name="l411"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l412"></a>}
</span></pre></body>
</html>