258 lines
26 KiB
HTML
Executable File
258 lines
26 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="generator" content="TempleOS V5.03">
|
|
<meta name="viewport" content="width=device-width">
|
|
<link rel="stylesheet" href="/style/templeos.css">
|
|
<script src="/script/templeos.js"></script>
|
|
<style type="text/css">
|
|
.cF0{color:#000000;background-color:#ffffff;}
|
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
|
.cF8{color:#555555;background-color:#ffffff;}
|
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre id="content">
|
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"AutoComplete/Dictionary"</span><span class=cF0>
|
|
<a name="l2"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>ACDDefGet</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF9>I64</span><span class=cF0> def_num=1)
|
|
<a name="l3"></a>{</span><span class=cF2>//MAlloc str holding single dict definition of word.</span><span class=cF0>
|
|
<a name="l4"></a> </span><span class=cF9>CFile</span><span class=cF0> *f;
|
|
<a name="l5"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *tmph;
|
|
<a name="l6"></a> </span><span class=cF1>U8</span><span class=cF0> *res=</span><span class=cF3>NULL</span><span class=cF0>,*buf,*in_ptr,
|
|
<a name="l7"></a> *st2=</span><span class=cF5>MStrUtil</span><span class=cF0>(st,</span><span class=cF3>SUF_TO_UPPER</span><span class=cF0>);
|
|
<a name="l8"></a> tmph=</span><span class=cF5>HashFind</span><span class=cF0>(st2,</span><span class=cFB>ac</span><span class=cF0>.hash_table,</span><span class=cF3>HTT_DICT_WORD</span><span class=cF0>);
|
|
<a name="l9"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (tmph) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l11"></a> </span><span class=cF1>if</span><span class=cF0> (f=</span><span class=cF5>FOpen</span><span class=cF7>(</span><span class=cF3>ACD_DEF_FILENAME</span><span class=cF0>,</span><span class=cF6>"r"</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l12"></a> buf=</span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2+1);
|
|
<a name="l13"></a> buf[</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2]=0; </span><span class=cF2>//terminate</span><span class=cF0>
|
|
<a name="l14"></a> </span><span class=cF5>FBlkRead</span><span class=cF0>(f,buf,tmph->user_data0*</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>/</span><span class=cF3>BLK_SIZE</span><span class=cF0>,
|
|
<a name="l15"></a> </span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2/</span><span class=cF3>BLK_SIZE</span><span class=cF0>);
|
|
<a name="l16"></a> </span><span class=cF5>FClose</span><span class=cF0>(f);
|
|
<a name="l17"></a> in_ptr=buf;
|
|
<a name="l18"></a> </span><span class=cF1>while</span><span class=cF0> (in_ptr<buf+</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF1>while</span><span class=cF0> (*in_ptr!=</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0> && in_ptr<buf+</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2)
|
|
<a name="l20"></a> in_ptr++;
|
|
<a name="l21"></a> </span><span class=cF1>if</span><span class=cF0> (*in_ptr++==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>) {
|
|
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrICmp</span><span class=cF7>(</span><span class=cF0>st,in_ptr</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l23"></a> </span><span class=cF1>while</span><span class=cF0> (def_num && *in_ptr!=</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>
|
|
<a name="l24"></a> && in_ptr<buf+</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2) {
|
|
<a name="l25"></a> </span><span class=cF1>if</span><span class=cF0> (*in_ptr==</span><span class=cF3>ACD_DEF_CHAR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (!--def_num)
|
|
<a name="l27"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l28"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l29"></a> in_ptr++;
|
|
<a name="l30"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l31"></a> in_ptr++;
|
|
<a name="l32"></a> }
|
|
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (*in_ptr++==</span><span class=cF3>ACD_DEF_CHAR</span><span class=cF0>) {
|
|
<a name="l34"></a> res=</span><span class=cF5>StrNew</span><span class=cF0>(in_ptr);
|
|
<a name="l35"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l36"></a> }
|
|
<a name="l37"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l38"></a> }
|
|
<a name="l39"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l40"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l41"></a> }
|
|
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l43"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l44"></a>}
|
|
<a name="l45"></a>
|
|
<a name="l46"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>ACDDefsGet</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st)
|
|
<a name="l47"></a>{</span><span class=cF2>//MAlloc str with all dict definitions of word.</span><span class=cF0>
|
|
<a name="l48"></a> </span><span class=cF9>CFile</span><span class=cF0> *f;
|
|
<a name="l49"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *tmph;
|
|
<a name="l50"></a> </span><span class=cF1>U8</span><span class=cF0> *res=</span><span class=cF3>NULL</span><span class=cF0>,*buf,*in_ptr,*in_ptr2,
|
|
<a name="l51"></a> *st2=</span><span class=cF5>MStrUtil</span><span class=cF0>(st,</span><span class=cF3>SUF_TO_UPPER</span><span class=cF0>);
|
|
<a name="l52"></a> tmph=</span><span class=cF5>HashFind</span><span class=cF0>(st2,</span><span class=cFB>ac</span><span class=cF0>.hash_table,</span><span class=cF3>HTT_DICT_WORD</span><span class=cF0>);
|
|
<a name="l53"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l54"></a> </span><span class=cF1>if</span><span class=cF0> (tmph) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (f=</span><span class=cF5>FOpen</span><span class=cF7>(</span><span class=cF3>ACD_DEF_FILENAME</span><span class=cF0>,</span><span class=cF6>"r"</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l56"></a> buf=</span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2+1);
|
|
<a name="l57"></a> buf[</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2]=0; </span><span class=cF2>//terminate</span><span class=cF0>
|
|
<a name="l58"></a> </span><span class=cF5>FBlkRead</span><span class=cF0>(f,buf,tmph->user_data0*</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>/</span><span class=cF3>BLK_SIZE</span><span class=cF0>,
|
|
<a name="l59"></a> </span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2/</span><span class=cF3>BLK_SIZE</span><span class=cF0>);
|
|
<a name="l60"></a> </span><span class=cF5>FClose</span><span class=cF0>(f);
|
|
<a name="l61"></a> in_ptr=buf;
|
|
<a name="l62"></a> </span><span class=cF1>while</span><span class=cF0> (in_ptr<buf+</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l63"></a> </span><span class=cF1>while</span><span class=cF0> (*in_ptr!=</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0> && in_ptr<buf+</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2)
|
|
<a name="l64"></a> in_ptr++;
|
|
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (*in_ptr++==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>) {
|
|
<a name="l66"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrICmp</span><span class=cF7>(</span><span class=cF0>st,in_ptr</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l67"></a> in_ptr2=in_ptr;
|
|
<a name="l68"></a> in_ptr--;
|
|
<a name="l69"></a> </span><span class=cF1>while</span><span class=cF0> (*in_ptr2!=</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>
|
|
<a name="l70"></a> && in_ptr2<buf+</span><span class=cF3>ACD_BLK_SIZE</span><span class=cF0>*2) {
|
|
<a name="l71"></a> in_ptr2++;
|
|
<a name="l72"></a> }
|
|
<a name="l73"></a> res=</span><span class=cF5>MAlloc</span><span class=cF0>(in_ptr2+1-in_ptr);
|
|
<a name="l74"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(res,in_ptr,in_ptr2-in_ptr);
|
|
<a name="l75"></a> res[in_ptr2-in_ptr]=</span><span class=cF3>ACD_END_CHAR</span><span class=cF0>;
|
|
<a name="l76"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l78"></a> }
|
|
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l80"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l81"></a> }
|
|
<a name="l82"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l83"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l84"></a>}
|
|
<a name="l85"></a>
|
|
<a name="l86"></a></span><span class=cF2>/*Fmt of word lst entry:</span><span class=cF0>
|
|
<a name="l87"></a></span><span class=cF2> U8 ACD_WORD_CHAR</span><span class=cF0>
|
|
<a name="l88"></a></span><span class=cF2> U8 word[] with terminating zero</span><span class=cF0>
|
|
<a name="l89"></a></span><span class=cF2> I16 block;</span><span class=cF0>
|
|
<a name="l90"></a></span><span class=cF2>*/</span><span class=cF0>
|
|
<a name="l91"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>ACDWordPtAt</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st)
|
|
<a name="l92"></a>{</span><span class=cF2>//Point to word in word list.</span><span class=cF0>
|
|
<a name="l93"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l94"></a> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF1>start</span><span class=cF0>=</span><span class=cFB>acd</span><span class=cF0>.word_lst,*r=</span><span class=cF1>start</span><span class=cF0>,
|
|
<a name="l95"></a> *</span><span class=cF1>end</span><span class=cF0>=</span><span class=cFB>acd</span><span class=cF0>.word_lst+</span><span class=cFB>acd</span><span class=cF0>.word_lst_size;
|
|
<a name="l96"></a> </span><span class=cF1>if</span><span class=cF0> (!st || !*st)
|
|
<a name="l97"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cFB>acd</span><span class=cF0>.word_lst;
|
|
<a name="l98"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>acd</span><span class=cF0>.word_lst_size) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l99"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF1>start</span><span class=cF0>+3<</span><span class=cF1>end</span><span class=cF0>) {
|
|
<a name="l100"></a> r=(</span><span class=cF1>start</span><span class=cF0>+</span><span class=cF1>end</span><span class=cF0>)>>1;
|
|
<a name="l101"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l102"></a> </span><span class=cF1>while</span><span class=cF0> (*r!=</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0> && r></span><span class=cFB>acd</span><span class=cF0>.word_lst)
|
|
<a name="l103"></a> r--;
|
|
<a name="l104"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>r[2]==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>||r[1]==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF7>)</span><span class=cF0>&&r-3></span><span class=cFB>acd</span><span class=cF0>.word_lst)
|
|
<a name="l105"></a> r--;
|
|
<a name="l106"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l107"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l108"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (*r==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l110"></a> i=</span><span class=cF5>StrICmp</span><span class=cF0>(st,r+1);
|
|
<a name="l111"></a> </span><span class=cF1>if</span><span class=cF0> (i<0)
|
|
<a name="l112"></a> </span><span class=cF1>end</span><span class=cF0>=r-1;
|
|
<a name="l113"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i>0)
|
|
<a name="l114"></a> </span><span class=cF1>start</span><span class=cF0>=r+</span><span class=cF5>StrLen</span><span class=cF0>(r)+3;
|
|
<a name="l115"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l116"></a> </span><span class=cF1>return</span><span class=cF0> r;
|
|
<a name="l117"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l118"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l119"></a> }
|
|
<a name="l120"></a> r=(</span><span class=cF1>start</span><span class=cF0>+</span><span class=cF1>end</span><span class=cF0>)>>1;
|
|
<a name="l121"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) {
|
|
<a name="l122"></a> </span><span class=cF1>while</span><span class=cF0> (*r!=</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0> && r></span><span class=cFB>acd</span><span class=cF0>.word_lst)
|
|
<a name="l123"></a> r--;
|
|
<a name="l124"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>r[2]==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>||r[1]==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF7>)</span><span class=cF0>&&r-3></span><span class=cFB>acd</span><span class=cF0>.word_lst)
|
|
<a name="l125"></a> r--;
|
|
<a name="l126"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l127"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l128"></a> }
|
|
<a name="l129"></a> </span><span class=cF1>if</span><span class=cF0> (*r==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0> && </span><span class=cF5>StrICmp</span><span class=cF7>(</span><span class=cF0>st,r+1</span><span class=cF7>)</span><span class=cF0>>0)
|
|
<a name="l130"></a> r+=</span><span class=cF5>StrLen</span><span class=cF0>(r)+3;
|
|
<a name="l131"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l132"></a> </span><span class=cF1>if</span><span class=cF0> (*r==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>)
|
|
<a name="l133"></a> </span><span class=cF1>return</span><span class=cF0> r;
|
|
<a name="l134"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l135"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cFB>acd</span><span class=cF0>.word_lst;
|
|
<a name="l136"></a>}
|
|
<a name="l137"></a>
|
|
<a name="l138"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ACDFillin</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> n)
|
|
<a name="l139"></a>{
|
|
<a name="l140"></a> </span><span class=cF1>U8</span><span class=cF0> *s;
|
|
<a name="l141"></a> </span><span class=cF9>I64</span><span class=cF0> len;
|
|
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (0<=n<</span><span class=cFB>acd</span><span class=cF0>.num_fillins) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l143"></a> s=</span><span class=cFB>acd</span><span class=cF0>.fillins[n]+1;
|
|
<a name="l144"></a> len=</span><span class=cF5>StrLen</span><span class=cF0>(s);
|
|
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (len></span><span class=cFB>ac</span><span class=cF0>.partial_len)
|
|
<a name="l146"></a> </span><span class=cF5>In</span><span class=cF0>(s+</span><span class=cFB>ac</span><span class=cF0>.partial_len);
|
|
<a name="l147"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l148"></a>}
|
|
<a name="l149"></a>
|
|
<a name="l150"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ACDDefsPut</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF9>I64</span><span class=cF0> num=-1)
|
|
<a name="l151"></a>{</span><span class=cF2>//Put to doc a dictionary definition(s) of a word.</span><span class=cF0>
|
|
<a name="l152"></a> </span><span class=cF1>U8</span><span class=cF0> *st2,*st3;
|
|
<a name="l153"></a> </span><span class=cF9>I64</span><span class=cF0> ch,i=0;
|
|
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (!st) </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l155"></a> </span><span class=cF1>if</span><span class=cF0> (*st==</span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>)
|
|
<a name="l156"></a> st++;
|
|
<a name="l157"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$WW,1$$RED$%s:$FG$\n\n"</span><span class=cF0>,st);
|
|
<a name="l158"></a> </span><span class=cF1>if</span><span class=cF0> (num<0) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (st3=</span><span class=cF5>ACDDefsGet</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l160"></a> st2=st3;
|
|
<a name="l161"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*st2++) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l162"></a> </span><span class=cF1>switch</span><span class=cF0> (ch) {
|
|
<a name="l163"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ACD_WORD_CHAR</span><span class=cF0>:
|
|
<a name="l164"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l165"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ACD_DEF_CHAR</span><span class=cF0>:
|
|
<a name="l166"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$GREEN$(%d)$FG$ %s\n"</span><span class=cF0>,
|
|
<a name="l167"></a> ++i,st2);
|
|
<a name="l168"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l169"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ACD_PRONUNCIATION_CHAR</span><span class=cF0>:
|
|
<a name="l170"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$LTGREEN$%s$FG$\n"</span><span class=cF0>,st2);
|
|
<a name="l171"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l172"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ACD_POS_CHAR</span><span class=cF0>:
|
|
<a name="l173"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$BLACK$%s$FG$\n"</span><span class=cF0>,st2);
|
|
<a name="l174"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l175"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ACD_EXTRA_CHAR</span><span class=cF0>:
|
|
<a name="l176"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$LTBLUE$%s$FG$\n"</span><span class=cF0>,st2);
|
|
<a name="l177"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l178"></a> }
|
|
<a name="l179"></a> st2+=</span><span class=cF5>StrLen</span><span class=cF0>(st2)+1;
|
|
<a name="l180"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l181"></a> </span><span class=cF5>Free</span><span class=cF0>(st3);
|
|
<a name="l182"></a> }
|
|
<a name="l183"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l184"></a> </span><span class=cF1>while</span><span class=cF0> (st2=</span><span class=cF5>ACDDefGet</span><span class=cF7>(</span><span class=cF0>st,++i</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (i==num)
|
|
<a name="l186"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$GREEN$(%d)$FG$ %s\n"</span><span class=cF0>,
|
|
<a name="l187"></a> i,st2);
|
|
<a name="l188"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l189"></a> }
|
|
<a name="l190"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l191"></a>}
|
|
<a name="l192"></a>
|
|
<a name="l193"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ACDPopUpDef</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF9>I64</span><span class=cF0> num=-1,</span><span class=cF9>CTask</span><span class=cF0> *parent=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l194"></a>{
|
|
<a name="l195"></a> </span><span class=cF1>U8</span><span class=cF0> *buf;
|
|
<a name="l196"></a> buf=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"ACDDefsPut(DocPut,\"%s\",%d);View;"</span><span class=cF0>,st,num);
|
|
<a name="l197"></a> </span><span class=cF5>PopUp</span><span class=cF0>(buf,parent);
|
|
<a name="l198"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l199"></a>}
|
|
<a name="l200"></a>
|
|
<a name="l201"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ACDDef</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> n,</span><span class=cF9>CTask</span><span class=cF0> *parent=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l202"></a>{
|
|
<a name="l203"></a> </span><span class=cF1>if</span><span class=cF0> (0<=n<</span><span class=cFB>acd</span><span class=cF0>.num_fillins)
|
|
<a name="l204"></a> </span><span class=cF5>ACDPopUpDef</span><span class=cF0>(</span><span class=cFB>acd</span><span class=cF0>.fillins[n],-1,parent);
|
|
<a name="l205"></a>}
|
|
<a name="l206"></a>
|
|
<a name="l207"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"AutoComplete"</span><span class=cF0>
|
|
<a name="l208"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ACFillIn</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> n)
|
|
<a name="l209"></a>{
|
|
<a name="l210"></a> </span><span class=cF1>U8</span><span class=cF0> *s;
|
|
<a name="l211"></a> </span><span class=cF1>if</span><span class=cF0> (0<=--n<</span><span class=cFB>ac</span><span class=cF0>.num_fillins) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l212"></a> s=</span><span class=cFB>ac</span><span class=cF0>.fillin_matches[n]->str;
|
|
<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>s</span><span class=cF7>)</span><span class=cF0>></span><span class=cFB>ac</span><span class=cF0>.partial_len)
|
|
<a name="l214"></a> </span><span class=cF5>In</span><span class=cF0>(s+</span><span class=cFB>ac</span><span class=cF0>.partial_len);
|
|
<a name="l215"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l216"></a>}
|
|
<a name="l217"></a>
|
|
<a name="l218"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ACMan</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> n,</span><span class=cF9>CTask</span><span class=cF0> *parent_task=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l219"></a>{
|
|
<a name="l220"></a> </span><span class=cF9>CHashAC</span><span class=cF0> *tmpw;
|
|
<a name="l221"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
|
|
<a name="l222"></a> </span><span class=cF1>if</span><span class=cF0> (0<=--n<</span><span class=cFB>ac</span><span class=cF0>.num_fillins && </span><span class=cF7>(</span><span class=cF0>tmpw=</span><span class=cFB>ac</span><span class=cF0>.fillin_matches[n]</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l223"></a> </span><span class=cF7>(</span><span class=cF0>tmph=</span><span class=cF5>HashFind</span><span class=cF0>(tmpw->str,</span><span class=cF5>Fs</span><span class=cF0>->hash_table,</span><span class=cF3>HTG_SRC_SYM</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l224"></a> tmph->src_link)
|
|
<a name="l225"></a> </span><span class=cF5>PopUpEd</span><span class=cF0>(tmph->src_link,parent_task);
|
|
<a name="l226"></a>}
|
|
</span></pre></body>
|
|
</html>
|