421 lines
47 KiB
Plaintext
421 lines
47 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"DolDoc/Conversion"</span><span class=cF0>
|
||
|
<a name="l2"></a>
|
||
|
<a name="l3"></a></span><span class=cF2>//See </span><a href="/Wb/Doc/Credits.DD.HTML#l1"><span class=cF4>::/Doc/Credits.DD</span></a><span class=cF2>.</span><span class=cF0>
|
||
|
<a name="l4"></a>
|
||
|
<a name="l5"></a>#</span><span class=cF1>define</span><span class=cF0> DOCET_UNDEF_COLOR 0x100000000
|
||
|
<a name="l6"></a>#</span><span class=cF1>define</span><span class=cF0> DOCET_LINK_UNDERLINE 0x200000000
|
||
|
<a name="l7"></a></span><span class=cF1>U0</span><span class=cF0> HtmlPutS(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> u32_attr,</span><span class=cF9>I64</span><span class=cF0> *_old_u32_attr,</span><span class=cF1>Bool</span><span class=cF0> underline_update,
|
||
|
<a name="l8"></a> </span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF9>I64</span><span class=cF0> *_col,</span><span class=cF1>U8</span><span class=cF0> *style_bitmap=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l9"></a>{
|
||
|
<a name="l10"></a> </span><span class=cF1>U8</span><span class=cF0> *ch,*ptr;
|
||
|
<a name="l11"></a> u32_attr&=0xFFFFFF00;
|
||
|
<a name="l12"></a> </span><span class=cF1>if</span><span class=cF0> (u32_attr&</span><span class=cF3>DOCET_INVERT</span><span class=cF0>)
|
||
|
<a name="l13"></a> u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4;
|
||
|
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (underline_update &&
|
||
|
<a name="l15"></a> !</span><span class=cF7>(</span><span class=cF0>u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF7>)</span><span class=cF0> && *_old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>*_old_u32_attr&DOCET_LINK_UNDERLINE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l17"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"</u>"</span><span class=cF0>);
|
||
|
<a name="l18"></a> *_old_u32_attr&=~DOCET_LINK_UNDERLINE;
|
||
|
<a name="l19"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l20"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF7>)</span><span class=cF0> && *_old_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF0>)
|
||
|
<a name="l21"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"</blink>"</span><span class=cF0>);
|
||
|
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (u32_attr&0xFF00!=*_old_u32_attr&0xFF00) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l23"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>*_old_u32_attr&DOCET_UNDEF_COLOR</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l24"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"</span>"</span><span class=cF0>);
|
||
|
<a name="l25"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"<span class=c%02X>"</span><span class=cF0>,u32_attr.u8[1]);
|
||
|
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (style_bitmap)
|
||
|
<a name="l27"></a> </span><span class=cF5>LBts</span><span class=cF0>(style_bitmap,u32_attr.u8[1]);
|
||
|
<a name="l28"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>*_old_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l30"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"<blink>"</span><span class=cF0>);
|
||
|
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (underline_update) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l32"></a> </span><span class=cF1>if</span><span class=cF0> (u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>*_old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l33"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"<u>"</span><span class=cF0>);
|
||
|
<a name="l34"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF2>//Keep same underline status.</span><span class=cF0>
|
||
|
<a name="l35"></a> u32_attr=u32_attr&~</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0> | *_old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0>;
|
||
|
<a name="l36"></a>
|
||
|
<a name="l37"></a> *_old_u32_attr=u32_attr | *_old_u32_attr&DOCET_LINK_UNDERLINE;
|
||
|
<a name="l38"></a>
|
||
|
<a name="l39"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*st++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l40"></a> </span><span class=cF1>switch</span><span class=cF0> (ch) {
|
||
|
<a name="l41"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\t'</span><span class=cF0>:
|
||
|
<a name="l42"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l43"></a> </span><span class=cF5>DocPutKey</span><span class=cF0>(doc,</span><span class=cF3>CH_SPACE</span><span class=cF0>,0);
|
||
|
<a name="l44"></a> *_col=*_col+1;
|
||
|
<a name="l45"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (*_col&7);
|
||
|
<a name="l46"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l47"></a>
|
||
|
<a name="l48"></a> </span><span class=cF1>start</span><span class=cF0>:
|
||
|
<a name="l49"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'pi'</span><span class=cF0>: ptr=</span><span class=cF6>"pi"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l50"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'theta'</span><span class=cF0>: ptr=</span><span class=cF6>"theta"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l51"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'phi'</span><span class=cF0>: ptr=</span><span class=cF6>"phi"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l52"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'omega'</span><span class=cF0>: ptr=</span><span class=cF6>"omega"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l53"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'inf'</span><span class=cF0>: ptr=</span><span class=cF6>"inf"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l54"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'u'</span><span class=cF0>: ptr=</span><span class=cF6>"u"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l55"></a> </span><span class=cF1>end</span><span class=cF0>:
|
||
|
<a name="l56"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,ptr);
|
||
|
<a name="l57"></a> *_col=*_col+</span><span class=cF5>StrLen</span><span class=cF0>(ptr);
|
||
|
<a name="l58"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l59"></a>
|
||
|
<a name="l60"></a> </span><span class=cF1>start</span><span class=cF0>:
|
||
|
<a name="l61"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>: ptr=</span><span class=cF6>" "</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l62"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'&'</span><span class=cF0>: ptr=</span><span class=cF6>"&amp;"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l63"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'<'</span><span class=cF0>: ptr=</span><span class=cF6>"&lt;"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l64"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'>'</span><span class=cF0>: ptr=</span><span class=cF6>"&gt;"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l65"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'"'</span><span class=cF0>: ptr=</span><span class=cF6>"&quot;"</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l66"></a> </span><span class=cF1>end</span><span class=cF0>:
|
||
|
<a name="l67"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,ptr);
|
||
|
<a name="l68"></a> *_col=*_col+1;
|
||
|
<a name="l69"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l70"></a>
|
||
|
<a name="l71"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l72"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF3>CH_SPACE</span><span class=cF0><=ch<0x7F || ch==</span><span class=cF6>'\n'</span><span class=cF0>)
|
||
|
<a name="l73"></a> </span><span class=cF5>DocPutKey</span><span class=cF0>(doc,ch,0);
|
||
|
<a name="l74"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l75"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"."</span><span class=cF0>);
|
||
|
<a name="l76"></a> *_col=*_col+1;
|
||
|
<a name="l77"></a> }
|
||
|
<a name="l78"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l79"></a>}
|
||
|
<a name="l80"></a>
|
||
|
<a name="l81"></a></span><span class=cF1>U8</span><span class=cF0> *TOSLinkCvt2(</span><span class=cF1>U8</span><span class=cF0> *filename,</span><span class=cF9>I64</span><span class=cF0> line_num)
|
||
|
<a name="l82"></a>{</span><span class=cF2>// ::/ --> http://www.templeos.org/Wb/</span><span class=cF0>
|
||
|
<a name="l83"></a></span><span class=cF2>//Make your own LinkCvt routine</span><span class=cF0>
|
||
|
<a name="l84"></a> </span><span class=cF1>U8</span><span class=cF0> *res=</span><span class=cF3>NULL</span><span class=cF0>,*st;
|
||
|
<a name="l85"></a> </span><span class=cF1>if</span><span class=cF0> (filename) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l86"></a> st=</span><span class=cF5>ExtChg</span><span class=cF0>(filename,</span><span class=cF6>"html"</span><span class=cF0>);
|
||
|
<a name="l87"></a> </span><span class=cF1>if</span><span class=cF0> (st && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0>>3 && !</span><span class=cF5>StrNCmp</span><span class=cF7>(</span><span class=cF0>st+1,</span><span class=cF6>":/"</span><span class=cF0>,2</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l88"></a> res=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"http://www.templeos.org/Wb/%s#l%d"</span><span class=cF0>,st+3,line_num);
|
||
|
<a name="l89"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l90"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l91"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l92"></a>}
|
||
|
<a name="l93"></a>
|
||
|
<a name="l94"></a></span><span class=cF1>U8</span><span class=cF0> *URLBibleGateway(</span><span class=cF1>U8</span><span class=cF0> *src)
|
||
|
<a name="l95"></a>{
|
||
|
<a name="l96"></a> </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cF3>STR_LEN</span><span class=cF0>],*dst=buf;
|
||
|
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MemCmp</span><span class=cF7>(</span><span class=cF0>src,</span><span class=cF6>"BF:"</span><span class=cF0>,3</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l98"></a> src+=3;
|
||
|
<a name="l99"></a> </span><span class=cF1>while</span><span class=cF0> (*src) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (*src==</span><span class=cF3>CH_SPACE</span><span class=cF0> || *src==</span><span class=cF6>','</span><span class=cF0>)
|
||
|
<a name="l101"></a> *dst++=</span><span class=cF6>'+'</span><span class=cF0>;
|
||
|
<a name="l102"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l103"></a> *dst++=*src;
|
||
|
<a name="l104"></a> src++;
|
||
|
<a name="l105"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l106"></a> *dst=0;
|
||
|
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrOcc</span><span class=cF7>(</span><span class=cF0>buf,</span><span class=cF6>'-'</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l108"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>MStrPrint</span><span class=cF0>(
|
||
|
<a name="l109"></a> </span><span class=cF6>"http://www.biblegateway.com/passage/?search=%s&version=NIV"</span><span class=cF0>,buf);
|
||
|
<a name="l110"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l111"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>MStrPrint</span><span class=cF0>(
|
||
|
<a name="l112"></a> </span><span class=cF6>"http://www.biblegateway.com/verse/en/%s"</span><span class=cF0>,buf);
|
||
|
<a name="l113"></a>}
|
||
|
<a name="l114"></a>
|
||
|
<a name="l115"></a></span><span class=cF1>U8</span><span class=cF0> *TOSLinkCvt1(</span><span class=cF1>U8</span><span class=cF0> *link_st)
|
||
|
<a name="l116"></a>{
|
||
|
<a name="l117"></a> </span><span class=cF1>static</span><span class=cF0> </span><span class=cF9>CDoc</span><span class=cF0> *bible=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l118"></a> </span><span class=cF1>static</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> locks=0;
|
||
|
<a name="l119"></a> </span><span class=cF1>U8</span><span class=cF0> *res=</span><span class=cF3>NULL</span><span class=cF0>,*filename,*needle;
|
||
|
<a name="l120"></a> </span><span class=cF9>I64</span><span class=cF0> i,num;
|
||
|
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (link_st) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l122"></a> </span><span class=cF1>switch</span><span class=cF0> (i=</span><span class=cF5>EdLinkCvt</span><span class=cF7>(</span><span class=cF0>link_st,&filename,&needle,&num</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l123"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE_LINE</span><span class=cF0>:
|
||
|
<a name="l124"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_PLAIN_LINE</span><span class=cF0>:
|
||
|
<a name="l125"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_FILE</span><span class=cF0>:
|
||
|
<a name="l126"></a> res=TOSLinkCvt2(filename,num);
|
||
|
<a name="l127"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l128"></a> </span><span class=cF1>case</span><span class=cF0> -1:
|
||
|
<a name="l129"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DEF</span><span class=cF0>:
|
||
|
<a name="l130"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_HELP_INDEX</span><span class=cF0>:
|
||
|
<a name="l131"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC</span><span class=cF0>:
|
||
|
<a name="l132"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_ANCHOR</span><span class=cF0>:
|
||
|
<a name="l133"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_FIND</span><span class=cF0>:
|
||
|
<a name="l134"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DOC_LINE</span><span class=cF0>:
|
||
|
<a name="l135"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l136"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_BIBLE_FIND</span><span class=cF0>:
|
||
|
<a name="l137"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>LBts</span><span class=cF7>(</span><span class=cF0>&locks,0</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l138"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (!bible)
|
||
|
<a name="l140"></a> bible=</span><span class=cF5>Adam</span><span class=cF0>(</span><span class=cF6>"DocRead(\"%s\");"</span><span class=cF0>,filename);
|
||
|
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocFind</span><span class=cF7>(</span><span class=cF0>bible,num,needle</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l142"></a> res=URLBibleGateway(link_st);
|
||
|
<a name="l143"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&locks,0);
|
||
|
<a name="l144"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l145"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l146"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocFileEd</span><span class=cF7>(</span><span class=cF0>i,filename,needle,&num,</span><span class=cF3>EDF_UNCOLLAPSE</span><span class=cF0>|</span><span class=cF3>EDF_BAIL</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l147"></a> res=TOSLinkCvt2(filename,num);
|
||
|
<a name="l148"></a> }
|
||
|
<a name="l149"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
|
||
|
<a name="l150"></a> </span><span class=cF5>Free</span><span class=cF0>(needle);
|
||
|
<a name="l151"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l152"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l153"></a>}
|
||
|
<a name="l154"></a>
|
||
|
<a name="l155"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDoc</span><span class=cF0> *Doc2Html(</span><span class=cF9>CDoc</span><span class=cF0> *doc_in,</span><span class=cF1>U8</span><span class=cF0> *html_header=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *body_header=</span><span class=cF3>NULL</span><span class=cF0>,
|
||
|
<a name="l156"></a> </span><span class=cF1>U8</span><span class=cF0> *body_footer=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *html_footer=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>Bool</span><span class=cF0> line_anchors=</span><span class=cF3>TRUE</span><span class=cF0>,
|
||
|
<a name="l157"></a> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF7>(</span><span class=cF0>*link_cvt</span><span class=cF7>)(</span><span class=cF1>U8</span><span class=cF0> *link_st</span><span class=cF7>)</span><span class=cF0>=&TOSLinkCvt1,</span><span class=cF1>Bool</span><span class=cF0> line_nums=</span><span class=cF3>FALSE</span><span class=cF0>)
|
||
|
<a name="l158"></a>{</span><span class=cF2>//Cvt </span><a href="/Wb/Doc/DolDocOverview.DD.HTML#l1"><span class=cF4>DolDoc</span></a><span class=cF2>doc to HTML file.</span><span class=cF0>
|
||
|
<a name="l159"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,*style,*doc_e2;
|
||
|
<a name="l160"></a> </span><span class=cF9>I64</span><span class=cF0> i,y,old_y=</span><span class=cF3>I64_MIN</span><span class=cF0>,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
|
||
|
<a name="l161"></a> </span><span class=cF9>U32</span><span class=cF0> *hl,*src;
|
||
|
<a name="l162"></a> </span><span class=cF1>U8</span><span class=cF0> *st,st_2[2],*link_st,*style_bitmap=</span><span class=cF5>CAlloc</span><span class=cF0>(256/8);
|
||
|
<a name="l163"></a> </span><span class=cF9>CBGR48</span><span class=cF0> p[</span><span class=cF3>COLORS_NUM</span><span class=cF0>];
|
||
|
<a name="l164"></a> </span><span class=cF5>GrPaletteGet</span><span class=cF0>(p);
|
||
|
<a name="l165"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc_out=</span><span class=cF5>DocNew</span><span class=cF0>;
|
||
|
<a name="l166"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock_doc_in=</span><span class=cF5>DocLock</span><span class=cF0>(doc_in),no_bwd;
|
||
|
<a name="l167"></a>
|
||
|
<a name="l168"></a> old_attr=doc_in->win_task->text_attr;
|
||
|
<a name="l169"></a> doc_in->win_task->text_attr=</span><span class=cF3>DOC_ATTR_DFT_TEXT</span><span class=cF0>;
|
||
|
<a name="l170"></a>
|
||
|
<a name="l171"></a> </span><span class=cF1>for</span><span class=cF0> (i=0xF0;i<=0xFF;i++)
|
||
|
<a name="l172"></a> </span><span class=cF5>LBts</span><span class=cF0>(style_bitmap,i);
|
||
|
<a name="l173"></a>
|
||
|
<a name="l174"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc_in,</span><span class=cF3>RECALCt_NORMAL</span><span class=cF0>|</span><span class=cF3>RECALCF_TO_HTML</span><span class=cF0>);
|
||
|
<a name="l175"></a>
|
||
|
<a name="l176"></a> digits=</span><span class=cF5>Log10</span><span class=cF0>(doc_in->head.last->y+1)+1;
|
||
|
<a name="l177"></a>
|
||
|
<a name="l178"></a> st_2[0]=0; st_2[1]=0;
|
||
|
<a name="l179"></a> doc_out->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="l180"></a>
|
||
|
<a name="l181"></a> </span><span class=cF1>if</span><span class=cF0> (!html_header) html_header=
|
||
|
<a name="l182"></a> </span><span class=cF6>"<!DOCTYPE HTML>\n"</span><span class=cF0>
|
||
|
<a name="l183"></a> </span><span class=cF6>"<html>\n"</span><span class=cF0>
|
||
|
<a name="l184"></a> </span><span class=cF6>"<head>\n"</span><span class=cF0>
|
||
|
<a name="l185"></a> </span><span class=cF6>"<meta http-equiv=\"Content-Type\" "</span><span class=cF0>
|
||
|
<a name="l186"></a> </span><span class=cF6>"content=\"text/html;charset=US-ASCII\">\n"</span><span class=cF0>
|
||
|
<a name="l187"></a> </span><span class=cF6>"<meta name=\"generator\" content=\"TempleOS V5.03\">\n"</span><span class=cF0>;
|
||
|
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (!body_header) body_header=
|
||
|
<a name="l189"></a> </span><span class=cF6>"<body>\n"</span><span class=cF0>
|
||
|
<a name="l190"></a> </span><span class=cF6>"<pre style=\"font-family:courier;font-size:10pt\">\n"</span><span class=cF0>;
|
||
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (!body_footer) body_footer=
|
||
|
<a name="l192"></a> </span><span class=cF6>"</pre></body>\n"</span><span class=cF0>;
|
||
|
<a name="l193"></a> </span><span class=cF1>if</span><span class=cF0> (!html_footer) html_footer=
|
||
|
<a name="l194"></a> </span><span class=cF6>"</html>\n"</span><span class=cF0>;
|
||
|
<a name="l195"></a>
|
||
|
<a name="l196"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%s"</span><span class=cF0>,html_header);
|
||
|
<a name="l197"></a>
|
||
|
<a name="l198"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"<style type=\"text/css\">\n"</span><span class=cF0>);
|
||
|
<a name="l199"></a> style=doc_out->cur_entry->last;
|
||
|
<a name="l200"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,
|
||
|
<a name="l201"></a> </span><span class=cF6>"</style>\n"</span><span class=cF0>
|
||
|
<a name="l202"></a> </span><span class=cF6>"</head>\n"</span><span class=cF0>);
|
||
|
<a name="l203"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%s"</span><span class=cF0>,body_header);
|
||
|
<a name="l204"></a>
|
||
|
<a name="l205"></a> doc_e=doc_in->head.next;
|
||
|
<a name="l206"></a> col=doc_e->x;
|
||
|
<a name="l207"></a> y=doc_e->y;
|
||
|
<a name="l208"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc_in) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l209"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_SKIP</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l210"></a> </span><span class=cF1>if</span><span class=cF0> (y!=old_y) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l211"></a> </span><span class=cF1>if</span><span class=cF0> (line_anchors)
|
||
|
<a name="l212"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"<a name=\"l%d\"></a>"</span><span class=cF0>,y+1);
|
||
|
<a name="l213"></a> </span><span class=cF1>if</span><span class=cF0> (line_nums)
|
||
|
<a name="l214"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%0*d "</span><span class=cF0>,digits,y+1);
|
||
|
<a name="l215"></a> old_y=y;
|
||
|
<a name="l216"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l217"></a> </span><span class=cF1>while</span><span class=cF0> (y<doc_e->y) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l218"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,</span><span class=cF3>FALSE</span><span class=cF0>,
|
||
|
<a name="l219"></a> </span><span class=cF6>"\n"</span><span class=cF0>,&col,style_bitmap);
|
||
|
<a name="l220"></a> </span><span class=cF1>if</span><span class=cF0> (++y!=old_y) {
|
||
|
<a name="l221"></a> </span><span class=cF1>if</span><span class=cF0> (line_anchors)
|
||
|
<a name="l222"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"<a name=\"l%d\"></a>"</span><span class=cF0>,y+1);
|
||
|
<a name="l223"></a> </span><span class=cF1>if</span><span class=cF0> (line_nums)
|
||
|
<a name="l224"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%0*d "</span><span class=cF0>,digits,y+1);
|
||
|
<a name="l225"></a> old_y=y;
|
||
|
<a name="l226"></a> }
|
||
|
<a name="l227"></a> col=0;
|
||
|
<a name="l228"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l229"></a>
|
||
|
<a name="l230"></a> no_bwd=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l231"></a> doc_e2=doc_e->next;
|
||
|
<a name="l232"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e2!=doc_in && doc_e2->y==doc_e->y) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l233"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2->x<doc_e->x) {
|
||
|
<a name="l234"></a> no_bwd=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l235"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l236"></a> }
|
||
|
<a name="l237"></a> doc_e2=doc_e2->next;
|
||
|
<a name="l238"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l239"></a>
|
||
|
<a name="l240"></a> </span><span class=cF1>if</span><span class=cF0> (no_bwd)
|
||
|
<a name="l241"></a> </span><span class=cF1>while</span><span class=cF0> (col<doc_e->x)
|
||
|
<a name="l242"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr&~</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0>,
|
||
|
<a name="l243"></a> &old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF6>" "</span><span class=cF0>,&col,style_bitmap);
|
||
|
<a name="l244"></a>
|
||
|
<a name="l245"></a> link_st=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l246"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_HTML_LINK</span><span class=cF0>)
|
||
|
<a name="l247"></a> link_st=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e->html_link);
|
||
|
<a name="l248"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (st=</span><span class=cF5>DocEntryLink</span><span class=cF7>(</span><span class=cF0>doc_in,doc_e</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l249"></a> link_st=link_cvt(st);
|
||
|
<a name="l250"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l251"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l252"></a>
|
||
|
<a name="l253"></a> </span><span class=cF1>if</span><span class=cF0> (link_st) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l254"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0> &&!</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_LINK_UNDERLINE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l255"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</u>"</span><span class=cF0>);
|
||
|
<a name="l256"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF0>)
|
||
|
<a name="l257"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</blink>"</span><span class=cF0>);
|
||
|
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_UNDEF_COLOR</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l259"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</span>"</span><span class=cF0>);
|
||
|
<a name="l260"></a> old_u32_attr=DOCET_UNDEF_COLOR|</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0>|DOCET_LINK_UNDERLINE;
|
||
|
<a name="l261"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"<a href=\"%s\">"</span><span class=cF0>,link_st);
|
||
|
<a name="l262"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l263"></a>
|
||
|
<a name="l264"></a> </span><span class=cF1>switch</span><span class=cF0> (doc_e->type_u8) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l265"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TEXT</span><span class=cF0>:
|
||
|
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>) {
|
||
|
<a name="l267"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->last==doc_in)
|
||
|
<a name="l268"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e->settings,&doc_in->settings_head,
|
||
|
<a name="l269"></a> </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l270"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l271"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e->settings,&doc_e->last->settings,
|
||
|
<a name="l272"></a> </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l273"></a> src=hl=</span><span class=cF5>DocHighlight</span><span class=cF0>(doc_e,doc_e->tag,</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e->tag</span><span class=cF7>)</span><span class=cF0>,
|
||
|
<a name="l274"></a> doc_e->type&0xFF00);
|
||
|
<a name="l275"></a> </span><span class=cF1>while</span><span class=cF0> (*src) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l276"></a> st_2[0]=*src&0xFF;
|
||
|
<a name="l277"></a> HtmlPutS(doc_out,*src++,&old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,
|
||
|
<a name="l278"></a> st_2,&col,style_bitmap);
|
||
|
<a name="l279"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l280"></a> </span><span class=cF5>Free</span><span class=cF0>(hl);
|
||
|
<a name="l281"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l282"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||
|
<a name="l283"></a> &old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,doc_e->tag,&col,style_bitmap);
|
||
|
<a name="l284"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l285"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TAB</span><span class=cF0>:
|
||
|
<a name="l286"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,
|
||
|
<a name="l287"></a> </span><span class=cF6>"\t"</span><span class=cF0>,&col,style_bitmap);
|
||
|
<a name="l288"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l289"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HTML_CODE</span><span class=cF0>:
|
||
|
<a name="l290"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0> &&
|
||
|
<a name="l291"></a> !</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_LINK_UNDERLINE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l292"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</u>"</span><span class=cF0>);
|
||
|
<a name="l293"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF0>)
|
||
|
<a name="l294"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</blink>"</span><span class=cF0>);
|
||
|
<a name="l295"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_UNDEF_COLOR</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l296"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</span>"</span><span class=cF0>);
|
||
|
<a name="l297"></a> old_u32_attr=DOCET_UNDEF_COLOR;
|
||
|
<a name="l298"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%s"</span><span class=cF0>,doc_e->tag);
|
||
|
<a name="l299"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l300"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SPRITE</span><span class=cF0>:
|
||
|
<a name="l301"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||
|
<a name="l302"></a> &old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,doc_e->tag,&col,style_bitmap);
|
||
|
<a name="l303"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||
|
<a name="l304"></a> &old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF6>"/* Graphics Not Rendered in HTML */"</span><span class=cF0>,
|
||
|
<a name="l305"></a> &col,style_bitmap);
|
||
|
<a name="l306"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l307"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l308"></a> </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="l309"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||
|
<a name="l310"></a> &old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,doc_e->tag,&col,style_bitmap);
|
||
|
<a name="l311"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l312"></a> </span><span class=cF1>if</span><span class=cF0> (link_st) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l313"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0> &&!</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_LINK_UNDERLINE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l314"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</u>"</span><span class=cF0>);
|
||
|
<a name="l315"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF0>)
|
||
|
<a name="l316"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</blink>"</span><span class=cF0>);
|
||
|
<a name="l317"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_UNDEF_COLOR</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l318"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</span>"</span><span class=cF0>);
|
||
|
<a name="l319"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</a>"</span><span class=cF0>);
|
||
|
<a name="l320"></a> old_u32_attr=DOCET_UNDEF_COLOR|</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0>|DOCET_LINK_UNDERLINE;
|
||
|
<a name="l321"></a> </span><span class=cF5>Free</span><span class=cF0>(link_st);
|
||
|
<a name="l322"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l323"></a> }
|
||
|
<a name="l324"></a> doc_e=doc_e->next;
|
||
|
<a name="l325"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l326"></a> </span><span class=cF1>while</span><span class=cF0> (y++<doc_e->y) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l327"></a> HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||
|
<a name="l328"></a> &old_u32_attr,</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF6>"\n"</span><span class=cF0>,&col,style_bitmap);
|
||
|
<a name="l329"></a> col=0;
|
||
|
<a name="l330"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l331"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_UNDERLINE</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_LINK_UNDERLINE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l332"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</u>"</span><span class=cF0>);
|
||
|
<a name="l333"></a> </span><span class=cF1>if</span><span class=cF0> (old_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF0>)
|
||
|
<a name="l334"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</blink>"</span><span class=cF0>);
|
||
|
<a name="l335"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>old_u32_attr&DOCET_UNDEF_COLOR</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l336"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"</span>"</span><span class=cF0>);
|
||
|
<a name="l337"></a> old_u32_attr=DOCET_UNDEF_COLOR;
|
||
|
<a name="l338"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%s"</span><span class=cF0>,body_footer);
|
||
|
<a name="l339"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,</span><span class=cF6>"%s"</span><span class=cF0>,html_footer);
|
||
|
<a name="l340"></a>
|
||
|
<a name="l341"></a> doc_out->cur_entry=style->next;
|
||
|
<a name="l342"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<256;i++)
|
||
|
<a name="l343"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>style_bitmap,i</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l344"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc_out,
|
||
|
<a name="l345"></a> </span><span class=cF6>".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n"</span><span class=cF0>,
|
||
|
<a name="l346"></a> i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8,
|
||
|
<a name="l347"></a> p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8);
|
||
|
<a name="l348"></a> doc_out->cur_entry=&doc_out->head;
|
||
|
<a name="l349"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc_out);
|
||
|
<a name="l350"></a>
|
||
|
<a name="l351"></a> doc_in->win_task->text_attr=old_attr;
|
||
|
<a name="l352"></a>
|
||
|
<a name="l353"></a> </span><span class=cF1>if</span><span class=cF0> (unlock_doc_in)
|
||
|
<a name="l354"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc_in);
|
||
|
<a name="l355"></a> </span><span class=cF1>return</span><span class=cF0> doc_out;
|
||
|
<a name="l356"></a>}
|
||
|
<a name="l357"></a>
|
||
|
<a name="l358"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)"</span><span class=cF0>
|
||
|
<a name="l359"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> ToHtml(</span><span class=cF1>U8</span><span class=cF0> *_in_name,</span><span class=cF1>U8</span><span class=cF0> *_out_name=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *html_header=</span><span class=cF3>NULL</span><span class=cF0>,
|
||
|
<a name="l360"></a> </span><span class=cF1>U8</span><span class=cF0> *body_header=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *body_footer=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *html_footer=</span><span class=cF3>NULL</span><span class=cF0>,
|
||
|
<a name="l361"></a> </span><span class=cF9>I64</span><span class=cF0> width=80,</span><span class=cF1>Bool</span><span class=cF0> line_anchors=</span><span class=cF3>TRUE</span><span class=cF0>,
|
||
|
<a name="l362"></a> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF7>(</span><span class=cF0>*link_cvt</span><span class=cF7>)(</span><span class=cF1>U8</span><span class=cF0> *link_st</span><span class=cF7>)</span><span class=cF0>=&TOSLinkCvt1,</span><span class=cF1>Bool</span><span class=cF0> line_nums=</span><span class=cF3>FALSE</span><span class=cF0>)
|
||
|
<a name="l363"></a>{</span><span class=cF2>//Convert </span><a href="/Wb/Doc/DolDocOverview.DD.HTML#l1"><span class=cF4>DolDoc</span></a><span class=cF2>file to HTML.</span><span class=cF0>
|
||
|
<a name="l364"></a></span><span class=cF2>//Supply your own link_cvt routine.</span><span class=cF0>
|
||
|
<a name="l365"></a> </span><span class=cF1>U8</span><span class=cF0> *in_name,*out_name;
|
||
|
<a name="l366"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc_in,*doc_out;
|
||
|
<a name="l367"></a>
|
||
|
<a name="l368"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="/Wb/Adam/TaskSettings.HC.HTML#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
|
||
|
<a name="l369"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(0,width-1); </span><span class=cF2>//Sets doc width for word wrap.</span><span class=cF0>
|
||
|
<a name="l370"></a>
|
||
|
<a name="l371"></a> in_name=</span><span class=cF5>ExtDft</span><span class=cF0>(_in_name,</span><span class=cF6>"HC.Z"</span><span class=cF0>);
|
||
|
<a name="l372"></a> </span><span class=cF1>if</span><span class=cF0> (_out_name)
|
||
|
<a name="l373"></a> out_name=</span><span class=cF5>ExtDft</span><span class=cF0>(_out_name,</span><span class=cF6>"html"</span><span class=cF0>);
|
||
|
<a name="l374"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l375"></a> out_name=</span><span class=cF5>ExtChg</span><span class=cF0>(_in_name,</span><span class=cF6>"html"</span><span class=cF0>);
|
||
|
<a name="l376"></a>
|
||
|
<a name="l377"></a> doc_in=</span><span class=cF5>DocRead</span><span class=cF0>(in_name);
|
||
|
<a name="l378"></a> doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer,
|
||
|
<a name="l379"></a> line_anchors,link_cvt,line_nums);
|
||
|
<a name="l380"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(&doc_out->filename.name,out_name);
|
||
|
<a name="l381"></a>
|
||
|
<a name="l382"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
|
||
|
<a name="l383"></a>
|
||
|
<a name="l384"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(doc_out);
|
||
|
<a name="l385"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc_in);
|
||
|
<a name="l386"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc_out);
|
||
|
<a name="l387"></a> </span><span class=cF5>Free</span><span class=cF0>(in_name);
|
||
|
<a name="l388"></a> </span><span class=cF5>Free</span><span class=cF0>(out_name);
|
||
|
<a name="l389"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|