mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 16:26:35 +00:00
923b700822
Add CAtapiWriteCmd for AHCIAtapiBlksWrite. Remove AHCIAtapiSeek and AHCIAtapiFormat.
441 lines
49 KiB
HTML
Executable file
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.16">
|
|
<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>"DolDoc/Link"</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>"filename"</span><span class=cF0>
|
|
<a name="l5"></a></span><span class=cF2>"FI:filename"</span><span class=cF0>
|
|
<a name="l6"></a></span><span class=cF2>"FA:haystack_filename,needle_anchor_str"</span><span class=cF0>
|
|
<a name="l7"></a></span><span class=cF2>"FF:haystack_filename,needle_str"</span><span class=cF0>
|
|
<a name="l8"></a></span><span class=cF2>"FF:haystack_filename,needle_str:occurnum"</span><span class=cF0>
|
|
<a name="l9"></a></span><span class=cF2>"FL:filename,linenum"</span><span class=cF0>
|
|
<a name="l10"></a></span><span class=cF2>"MN:SymName"</span><span class=cF0>
|
|
<a name="l11"></a></span><span class=cF2>"PI:filename"</span><span class=cF0>
|
|
<a name="l12"></a></span><span class=cF2>"PF:haystack_filename,needle_str"</span><span class=cF0>
|
|
<a name="l13"></a></span><span class=cF2>"PF:haystack_filename,needle_str:occurnum"</span><span class=cF0>
|
|
<a name="l14"></a></span><span class=cF2>"PL:filename,linenum"</span><span class=cF0>
|
|
<a name="l15"></a></span><span class=cF2>"BF:haystack_bible_book,needle_str"</span><span class=cF0>
|
|
<a name="l16"></a></span><span class=cF2>"DN:word"</span><span class=cF0>
|
|
<a name="l17"></a></span><span class=cF2>"DN:word,defnum"</span><span class=cF0>
|
|
<a name="l18"></a></span><span class=cF2>"HI:index"</span><span class=cF0>
|
|
<a name="l19"></a></span><span class=cF2>"AD:code_address_number"</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>"AI:doc_address"</span><span class=cF0>
|
|
<a name="l23"></a></span><span class=cF2>"AA:haystack_doc_address,needle_anchor_str"</span><span class=cF0>
|
|
<a name="l24"></a></span><span class=cF2>"AF:haystack_doc_address,needle_str"</span><span class=cF0>
|
|
<a name="l25"></a></span><span class=cF2>"AF:haystack_doc_address,needle_str:occurnum"</span><span class=cF0>
|
|
<a name="l26"></a></span><span class=cF2>"AL:doc_address,linenum"</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->de_flags & </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->de_flags & </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->aux_str, doc->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->de_flags & </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->tag, doc->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>->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>(&</span><span class=cF5>Fs</span><span class=cF0>->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> <= _type <= </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>"/"</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>&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->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>->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->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>&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>&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->cur_entry->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 & </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 & </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->filename.name)
|
|
<a name="l164"></a> doc->filename.dirc = </span><span class=cF5>DirContextNew</span><span class=cF0>(doc->filename.name);
|
|
<a name="l165"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l166"></a> doc->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->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> <= _type <= </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 & </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->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> <= _type <= </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>->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>--> 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 & </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> > </span><span class=cFE>3</span><span class=cF0> && 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>"ST_LINK_TYPES"</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>->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->src_link, &filename, &needle_str, &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>","</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>"%s;"</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, &filename, &needle_str, &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>","</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>","</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>"ST_BIBLE_BOOKS"</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 < </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>"ST_BIBLE_BOOK_LINES"</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>","</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>","</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>","</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>":"</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 >= </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> <= res <= </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->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, &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>","</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>"ST_BIBLE_BOOKS"</span><span class=cF0>, </span><span class=cF3>LMF_IGNORE_CASE</span><span class=cF7>)</span><span class=cF0> >= </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, &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>
|