380 lines
38 KiB
Plaintext
380 lines
38 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>"God"</span><span class=cF0>
|
||
|
<a name="l2"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>BibleInit</span><span class=cF0>()
|
||
|
<a name="l3"></a>{
|
||
|
<a name="l4"></a> </span><span class=cF5>DefineLstLoad</span><span class=cF0>(</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>,
|
||
|
<a name="l5"></a> </span><span class=cF6>"Genesis\0"</span><span class=cF0>
|
||
|
<a name="l6"></a> </span><span class=cF6>"Exodus\0"</span><span class=cF0>
|
||
|
<a name="l7"></a> </span><span class=cF6>"Leviticus\0"</span><span class=cF0>
|
||
|
<a name="l8"></a> </span><span class=cF6>"Numbers\0"</span><span class=cF0>
|
||
|
<a name="l9"></a> </span><span class=cF6>"Deuteronomy\0"</span><span class=cF0>
|
||
|
<a name="l10"></a> </span><span class=cF6>"Joshua\0"</span><span class=cF0>
|
||
|
<a name="l11"></a> </span><span class=cF6>"Judges\0"</span><span class=cF0>
|
||
|
<a name="l12"></a> </span><span class=cF6>"Ruth\0"</span><span class=cF0>
|
||
|
<a name="l13"></a> </span><span class=cF6>"1 Samuel\0"</span><span class=cF0>
|
||
|
<a name="l14"></a> </span><span class=cF6>"2 Samuel\0"</span><span class=cF0>
|
||
|
<a name="l15"></a> </span><span class=cF6>"1 Kings\0"</span><span class=cF0>
|
||
|
<a name="l16"></a> </span><span class=cF6>"2 Kings\0"</span><span class=cF0>
|
||
|
<a name="l17"></a> </span><span class=cF6>"1 Chronicles\0"</span><span class=cF0>
|
||
|
<a name="l18"></a> </span><span class=cF6>"2 Chronicles\0"</span><span class=cF0>
|
||
|
<a name="l19"></a> </span><span class=cF6>"Ezra\0"</span><span class=cF0>
|
||
|
<a name="l20"></a> </span><span class=cF6>"Nehemiah\0"</span><span class=cF0>
|
||
|
<a name="l21"></a> </span><span class=cF6>"Esther\0"</span><span class=cF0>
|
||
|
<a name="l22"></a> </span><span class=cF6>"Job\0"</span><span class=cF0>
|
||
|
<a name="l23"></a> </span><span class=cF6>"Psalms\0"</span><span class=cF0>
|
||
|
<a name="l24"></a> </span><span class=cF6>"Proverbs\0"</span><span class=cF0>
|
||
|
<a name="l25"></a> </span><span class=cF6>"Ecclesiastes\0"</span><span class=cF0>
|
||
|
<a name="l26"></a> </span><span class=cF6>"Song of Songs\0"</span><span class=cF0>
|
||
|
<a name="l27"></a> </span><span class=cF6>"Isaiah\0"</span><span class=cF0>
|
||
|
<a name="l28"></a> </span><span class=cF6>"Jeremiah\0"</span><span class=cF0>
|
||
|
<a name="l29"></a> </span><span class=cF6>"Lamentations\0"</span><span class=cF0>
|
||
|
<a name="l30"></a> </span><span class=cF6>"Ezekiel\0"</span><span class=cF0>
|
||
|
<a name="l31"></a> </span><span class=cF6>"Daniel\0"</span><span class=cF0>
|
||
|
<a name="l32"></a> </span><span class=cF6>"Hosea\0"</span><span class=cF0>
|
||
|
<a name="l33"></a> </span><span class=cF6>"Joel\0"</span><span class=cF0>
|
||
|
<a name="l34"></a> </span><span class=cF6>"Amos\0"</span><span class=cF0>
|
||
|
<a name="l35"></a> </span><span class=cF6>"Obadiah\0"</span><span class=cF0>
|
||
|
<a name="l36"></a> </span><span class=cF6>"Jonah\0"</span><span class=cF0>
|
||
|
<a name="l37"></a> </span><span class=cF6>"Micah\0"</span><span class=cF0>
|
||
|
<a name="l38"></a> </span><span class=cF6>"Nahum\0"</span><span class=cF0>
|
||
|
<a name="l39"></a> </span><span class=cF6>"Habakkuk\0"</span><span class=cF0>
|
||
|
<a name="l40"></a> </span><span class=cF6>"Zephaniah\0"</span><span class=cF0>
|
||
|
<a name="l41"></a> </span><span class=cF6>"Haggai\0"</span><span class=cF0>
|
||
|
<a name="l42"></a> </span><span class=cF6>"Zechariah\0"</span><span class=cF0>
|
||
|
<a name="l43"></a> </span><span class=cF6>"Malachi\0"</span><span class=cF0>
|
||
|
<a name="l44"></a> </span><span class=cF6>"Matthew\0"</span><span class=cF0>
|
||
|
<a name="l45"></a> </span><span class=cF6>"Mark\0"</span><span class=cF0>
|
||
|
<a name="l46"></a> </span><span class=cF6>"Luke\0"</span><span class=cF0>
|
||
|
<a name="l47"></a> </span><span class=cF6>"John\0"</span><span class=cF0>
|
||
|
<a name="l48"></a> </span><span class=cF6>"Acts\0"</span><span class=cF0>
|
||
|
<a name="l49"></a> </span><span class=cF6>"Romans\0"</span><span class=cF0>
|
||
|
<a name="l50"></a> </span><span class=cF6>"1 Corinthians\0"</span><span class=cF0>
|
||
|
<a name="l51"></a> </span><span class=cF6>"2 Corinthians\0"</span><span class=cF0>
|
||
|
<a name="l52"></a> </span><span class=cF6>"Galatians\0"</span><span class=cF0>
|
||
|
<a name="l53"></a> </span><span class=cF6>"Ephesians\0"</span><span class=cF0>
|
||
|
<a name="l54"></a> </span><span class=cF6>"Philippians\0"</span><span class=cF0>
|
||
|
<a name="l55"></a> </span><span class=cF6>"Colossians\0"</span><span class=cF0>
|
||
|
<a name="l56"></a> </span><span class=cF6>"1 Thessalonians\0"</span><span class=cF0>
|
||
|
<a name="l57"></a> </span><span class=cF6>"2 Thessalonians\0"</span><span class=cF0>
|
||
|
<a name="l58"></a> </span><span class=cF6>"1 Timothy\0"</span><span class=cF0>
|
||
|
<a name="l59"></a> </span><span class=cF6>"2 Timothy\0"</span><span class=cF0>
|
||
|
<a name="l60"></a> </span><span class=cF6>"Titus\0"</span><span class=cF0>
|
||
|
<a name="l61"></a> </span><span class=cF6>"Philemon\0"</span><span class=cF0>
|
||
|
<a name="l62"></a> </span><span class=cF6>"Hebrews\0"</span><span class=cF0>
|
||
|
<a name="l63"></a> </span><span class=cF6>"James\0"</span><span class=cF0>
|
||
|
<a name="l64"></a> </span><span class=cF6>"1 Peter\0"</span><span class=cF0>
|
||
|
<a name="l65"></a> </span><span class=cF6>"2 Peter\0"</span><span class=cF0>
|
||
|
<a name="l66"></a> </span><span class=cF6>"1 John\0"</span><span class=cF0>
|
||
|
<a name="l67"></a> </span><span class=cF6>"2 John\0"</span><span class=cF0>
|
||
|
<a name="l68"></a> </span><span class=cF6>"3 John\0"</span><span class=cF0>
|
||
|
<a name="l69"></a> </span><span class=cF6>"Jude\0"</span><span class=cF0>
|
||
|
<a name="l70"></a> </span><span class=cF6>"Revelation\0"</span><span class=cF0>);
|
||
|
<a name="l71"></a> </span><span class=cF5>DefineLstLoad</span><span class=cF0>(</span><span class=cF6>"ST_BIBLE_BOOK_LINES"</span><span class=cF0>,
|
||
|
<a name="l72"></a> </span><span class=cF6>"297\0"</span><span class=cF0>
|
||
|
<a name="l73"></a> </span><span class=cF6>"5068\0"</span><span class=cF0>
|
||
|
<a name="l74"></a> </span><span class=cF6>"9123\0"</span><span class=cF0>
|
||
|
<a name="l75"></a> </span><span class=cF6>"12005\0"</span><span class=cF0>
|
||
|
<a name="l76"></a> </span><span class=cF6>"15977\0"</span><span class=cF0>
|
||
|
<a name="l77"></a> </span><span class=cF6>"19168\0"</span><span class=cF0>
|
||
|
<a name="l78"></a> </span><span class=cF6>"21329\0"</span><span class=cF0>
|
||
|
<a name="l79"></a> </span><span class=cF6>"23598\0"</span><span class=cF0>
|
||
|
<a name="l80"></a> </span><span class=cF6>"23902\0"</span><span class=cF0>
|
||
|
<a name="l81"></a> </span><span class=cF6>"26892\0"</span><span class=cF0>
|
||
|
<a name="l82"></a> </span><span class=cF6>"29345\0"</span><span class=cF0>
|
||
|
<a name="l83"></a> </span><span class=cF6>"32241\0"</span><span class=cF0>
|
||
|
<a name="l84"></a> </span><span class=cF6>"34961\0"</span><span class=cF0>
|
||
|
<a name="l85"></a> </span><span class=cF6>"37633\0"</span><span class=cF0>
|
||
|
<a name="l86"></a> </span><span class=cF6>"40756\0"</span><span class=cF0>
|
||
|
<a name="l87"></a> </span><span class=cF6>"41671\0"</span><span class=cF0>
|
||
|
<a name="l88"></a> </span><span class=cF6>"42963\0"</span><span class=cF0>
|
||
|
<a name="l89"></a> </span><span class=cF6>"43605\0"</span><span class=cF0>
|
||
|
<a name="l90"></a> </span><span class=cF6>"46190\0"</span><span class=cF0>
|
||
|
<a name="l91"></a> </span><span class=cF6>"53793\0"</span><span class=cF0>
|
||
|
<a name="l92"></a> </span><span class=cF6>"56267\0"</span><span class=cF0>
|
||
|
<a name="l93"></a> </span><span class=cF6>"56966\0"</span><span class=cF0>
|
||
|
<a name="l94"></a> </span><span class=cF6>"57332\0"</span><span class=cF0>
|
||
|
<a name="l95"></a> </span><span class=cF6>"61806\0"</span><span class=cF0>
|
||
|
<a name="l96"></a> </span><span class=cF6>"66736\0"</span><span class=cF0>
|
||
|
<a name="l97"></a> </span><span class=cF6>"67217\0"</span><span class=cF0>
|
||
|
<a name="l98"></a> </span><span class=cF6>"71804\0"</span><span class=cF0>
|
||
|
<a name="l99"></a> </span><span class=cF6>"73189\0"</span><span class=cF0>
|
||
|
<a name="l100"></a> </span><span class=cF6>"73876\0"</span><span class=cF0>
|
||
|
<a name="l101"></a> </span><span class=cF6>"74130\0"</span><span class=cF0>
|
||
|
<a name="l102"></a> </span><span class=cF6>"74615\0"</span><span class=cF0>
|
||
|
<a name="l103"></a> </span><span class=cF6>"74697\0"</span><span class=cF0>
|
||
|
<a name="l104"></a> </span><span class=cF6>"74860\0"</span><span class=cF0>
|
||
|
<a name="l105"></a> </span><span class=cF6>"75241\0"</span><span class=cF0>
|
||
|
<a name="l106"></a> </span><span class=cF6>"75416\0"</span><span class=cF0>
|
||
|
<a name="l107"></a> </span><span class=cF6>"75604\0"</span><span class=cF0>
|
||
|
<a name="l108"></a> </span><span class=cF6>"75806\0"</span><span class=cF0>
|
||
|
<a name="l109"></a> </span><span class=cF6>"75932\0"</span><span class=cF0>
|
||
|
<a name="l110"></a> </span><span class=cF6>"76684\0"</span><span class=cF0>
|
||
|
<a name="l111"></a> </span><span class=cF6>"76908\0"</span><span class=cF0>
|
||
|
<a name="l112"></a> </span><span class=cF6>"79970\0"</span><span class=cF0>
|
||
|
<a name="l113"></a> </span><span class=cF6>"81941\0"</span><span class=cF0>
|
||
|
<a name="l114"></a> </span><span class=cF6>"85266\0"</span><span class=cF0>
|
||
|
<a name="l115"></a> </span><span class=cF6>"87803\0"</span><span class=cF0>
|
||
|
<a name="l116"></a> </span><span class=cF6>"90914\0"</span><span class=cF0>
|
||
|
<a name="l117"></a> </span><span class=cF6>"92110\0"</span><span class=cF0>
|
||
|
<a name="l118"></a> </span><span class=cF6>"93323\0"</span><span class=cF0>
|
||
|
<a name="l119"></a> </span><span class=cF6>"94088\0"</span><span class=cF0>
|
||
|
<a name="l120"></a> </span><span class=cF6>"94514\0"</span><span class=cF0>
|
||
|
<a name="l121"></a> </span><span class=cF6>"94869\0"</span><span class=cF0>
|
||
|
<a name="l122"></a> </span><span class=cF6>"95153\0"</span><span class=cF0>
|
||
|
<a name="l123"></a> </span><span class=cF6>"95402\0"</span><span class=cF0>
|
||
|
<a name="l124"></a> </span><span class=cF6>"95647\0"</span><span class=cF0>
|
||
|
<a name="l125"></a> </span><span class=cF6>"95772\0"</span><span class=cF0>
|
||
|
<a name="l126"></a> </span><span class=cF6>"96090\0"</span><span class=cF0>
|
||
|
<a name="l127"></a> </span><span class=cF6>"96320\0"</span><span class=cF0>
|
||
|
<a name="l128"></a> </span><span class=cF6>"96440\0"</span><span class=cF0>
|
||
|
<a name="l129"></a> </span><span class=cF6>"96500\0"</span><span class=cF0>
|
||
|
<a name="l130"></a> </span><span class=cF6>"97370\0"</span><span class=cF0>
|
||
|
<a name="l131"></a> </span><span class=cF6>"97687\0"</span><span class=cF0>
|
||
|
<a name="l132"></a> </span><span class=cF6>"97976\0"</span><span class=cF0>
|
||
|
<a name="l133"></a> </span><span class=cF6>"98163\0"</span><span class=cF0>
|
||
|
<a name="l134"></a> </span><span class=cF6>"98506\0"</span><span class=cF0>
|
||
|
<a name="l135"></a> </span><span class=cF6>"98552\0"</span><span class=cF0>
|
||
|
<a name="l136"></a> </span><span class=cF6>"98597\0"</span><span class=cF0>
|
||
|
<a name="l137"></a> </span><span class=cF6>"98684\0"</span><span class=cF0>
|
||
|
<a name="l138"></a> </span><span class=cF6>"100111\0"</span><span class=cF0>);
|
||
|
<a name="l139"></a> </span><span class=cF5>DefinePrint</span><span class=cF0>(</span><span class=cF6>"ST_BIBLE_LINES"</span><span class=cF0>,</span><span class=cF6>"%d"</span><span class=cF0>,
|
||
|
<a name="l140"></a> </span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF5>DefineSub</span><span class=cF0>(</span><span class=cF5>DefineCnt</span><span class=cF7>(</span><span class=cF6>"ST_BIBLE_BOOK_LINES"</span><span class=cF7>)</span><span class=cF0>-1,
|
||
|
<a name="l141"></a> </span><span class=cF6>"ST_BIBLE_BOOK_LINES"</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>-1);
|
||
|
<a name="l142"></a>} </span><span class=cF5>BibleInit</span><span class=cF0>;
|
||
|
<a name="l143"></a>
|
||
|
<a name="l144"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>BibleLine2Verse</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> line,</span><span class=cF9>I64</span><span class=cF0> separate_ch=</span><span class=cF3>CH_SPACE</span><span class=cF0>)
|
||
|
<a name="l145"></a>{</span><span class=cF2>//Line number to verse str, Malloc()ed.</span><span class=cF0>
|
||
|
<a name="l146"></a></span><span class=cF2>//Separate with <SPACE> or ','. If you pass '%', it uses "%20".</span><span class=cF0>
|
||
|
<a name="l147"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
||
|
<a name="l148"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
||
|
<a name="l149"></a> </span><span class=cF9>I64</span><span class=cF0> i=0,cnt=</span><span class=cF5>DefineCnt</span><span class=cF0>(</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>),</span><span class=cF1>start</span><span class=cF0>=0,last_start=0;
|
||
|
<a name="l150"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr=</span><span class=cF5>DefineSub</span><span class=cF0>(0,</span><span class=cF6>"ST_BIBLE_BOOK_LINES"</span><span class=cF0>),*ptr2;
|
||
|
<a name="l151"></a> </span><span class=cF1>while</span><span class=cF0> (i<=cnt) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l152"></a> last_start=</span><span class=cF1>start</span><span class=cF0>;
|
||
|
<a name="l153"></a> </span><span class=cF1>start</span><span class=cF0>=</span><span class=cF5>Str2I64</span><span class=cF0>(ptr);
|
||
|
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (line<</span><span class=cF1>start</span><span class=cF0>)
|
||
|
<a name="l155"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l156"></a> i++;
|
||
|
<a name="l157"></a> ptr+=</span><span class=cF5>StrLen</span><span class=cF0>(ptr)+1;
|
||
|
<a name="l158"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (0<=--i<cnt) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l160"></a> doc=</span><span class=cF5>DocRead</span><span class=cF0>(</span><span class=cF3>BIBLE_FILENAME</span><span class=cF0>,</span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>);
|
||
|
<a name="l161"></a> </span><span class=cF5>DocGoToLine</span><span class=cF0>(doc,line); </span><span class=cF2>//one based</span><span class=cF0>
|
||
|
<a name="l162"></a> doc_e=doc->cur_entry;
|
||
|
<a name="l163"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc && </span><span class=cF7>(</span><span class=cF0>doc_e->type_u8!=</span><span class=cF3>DOCT_TEXT</span><span class=cF0> || !*doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l164"></a> doc_e=doc_e->next;
|
||
|
<a name="l165"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && </span><span class=cF6>'0'</span><span class=cF0><=*doc_e->tag<=</span><span class=cF6>'9'</span><span class=cF0>) {
|
||
|
<a name="l166"></a> ptr=ptr2=doc_e->tag;
|
||
|
<a name="l167"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0><=*ptr2<=</span><span class=cF6>'9'</span><span class=cF0> || *ptr2==</span><span class=cF6>':'</span><span class=cF0>)
|
||
|
<a name="l168"></a> ptr2++;
|
||
|
<a name="l169"></a> *ptr2=0;
|
||
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (separate_ch==</span><span class=cF6>'%'</span><span class=cF0>)
|
||
|
<a name="l171"></a> ptr=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%Z%%20%s"</span><span class=cF0>,i,</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>,ptr);
|
||
|
<a name="l172"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l173"></a> ptr=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%Z%c%s"</span><span class=cF0>,i,</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>,separate_ch,ptr);
|
||
|
<a name="l174"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l175"></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="l176"></a> doc_e=doc_e->last;
|
||
|
<a name="l177"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc) {
|
||
|
<a name="l178"></a> ptr=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l179"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l180"></a> }
|
||
|
<a name="l181"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->y+1<last_start) {
|
||
|
<a name="l182"></a> ptr=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%Z"</span><span class=cF0>,i,</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>);
|
||
|
<a name="l183"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l184"></a> }
|
||
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e->tag</span><span class=cF7>)</span><span class=cF0>>=3) {
|
||
|
<a name="l186"></a> ptr=doc_e->tag+</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag)-1;
|
||
|
<a name="l187"></a> </span><span class=cF1>while</span><span class=cF0> (ptr>doc_e->tag && </span><span class=cF7>(</span><span class=cF0>!(</span><span class=cF6>'0'</span><span class=cF0><=*</span><span class=cF7>(</span><span class=cF0>ptr-1</span><span class=cF7>)</span><span class=cF0><=</span><span class=cF6>'9'</span><span class=cF0>) || *ptr!=</span><span class=cF6>':'</span><span class=cF0> ||
|
||
|
<a name="l188"></a> !(</span><span class=cF6>'0'</span><span class=cF0><=*</span><span class=cF7>(</span><span class=cF0>ptr+1</span><span class=cF7>)</span><span class=cF0><=</span><span class=cF6>'9'</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l189"></a> ptr--;
|
||
|
<a name="l190"></a> ptr--;
|
||
|
<a name="l191"></a> </span><span class=cF1>while</span><span class=cF0> (ptr>=doc_e->tag && </span><span class=cF6>'0'</span><span class=cF0><=*ptr<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l192"></a> ptr--;
|
||
|
<a name="l193"></a> ptr2=++ptr;
|
||
|
<a name="l194"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0><=*ptr2++<=</span><span class=cF6>'9'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l195"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0><=*ptr2<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l196"></a> ptr2++;
|
||
|
<a name="l197"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr2++==</span><span class=cF6>':'</span><span class=cF0> && </span><span class=cF6>'0'</span><span class=cF0><=*ptr2++<=</span><span class=cF6>'9'</span><span class=cF0>) {
|
||
|
<a name="l198"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0><=*ptr2<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l199"></a> ptr2++;
|
||
|
<a name="l200"></a> *ptr2=0;
|
||
|
<a name="l201"></a> </span><span class=cF1>if</span><span class=cF0> (separate_ch==</span><span class=cF6>'%'</span><span class=cF0>)
|
||
|
<a name="l202"></a> ptr=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%Z%%20%s"</span><span class=cF0>,i,</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>,ptr);
|
||
|
<a name="l203"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l204"></a> ptr=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%Z%c%s"</span><span class=cF0>,i,</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>,separate_ch,ptr);
|
||
|
<a name="l205"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l206"></a> }
|
||
|
<a name="l207"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l208"></a> }
|
||
|
<a name="l209"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l210"></a> }
|
||
|
<a name="l211"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
||
|
<a name="l212"></a> </span><span class=cF1>return</span><span class=cF0> ptr;
|
||
|
<a name="l213"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l214"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l215"></a>}
|
||
|
<a name="l216"></a>
|
||
|
<a name="l217"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>BookLines</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc_out=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> </span><span class=cF1>start</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> lines,
|
||
|
<a name="l218"></a> </span><span class=cF1>U8</span><span class=cF0> *book_filename=</span><span class=cF3>BIBLE_FILENAME</span><span class=cF0>)
|
||
|
<a name="l219"></a>{</span><span class=cF2>//Put N line starting at line M into doc.</span><span class=cF0>
|
||
|
<a name="l220"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc_in;
|
||
|
<a name="l221"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
||
|
<a name="l222"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_out) doc_out=</span><span class=cF5>DocPut</span><span class=cF0>;
|
||
|
<a name="l223"></a> </span><span class=cF1>if</span><span class=cF0> (doc_out && </span><span class=cF5>FileFind</span><span class=cF7>(</span><span class=cF0>book_filename</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l224"></a> doc_in=</span><span class=cF5>DocRead</span><span class=cF0>(book_filename,</span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>);
|
||
|
<a name="l225"></a> </span><span class=cF5>DocGoToLine</span><span class=cF0>(doc_in,</span><span class=cF1>start</span><span class=cF0>); </span><span class=cF2>//one based</span><span class=cF0>
|
||
|
<a name="l226"></a> doc_e=doc_in->cur_entry;
|
||
|
<a name="l227"></a> </span><span class=cF1>while</span><span class=cF0> (lines>0 && doc_e!=doc_in) {
|
||
|
<a name="l228"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0>)
|
||
|
<a name="l229"></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="l230"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l231"></a> </span><span class=cF5>DocPutKey</span><span class=cF0>(doc_out,</span><span class=cF6>'\n'</span><span class=cF0>);
|
||
|
<a name="l232"></a> lines--;
|
||
|
<a name="l233"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l234"></a> doc_e=doc_e->next;
|
||
|
<a name="l235"></a> }
|
||
|
<a name="l236"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc_in);
|
||
|
<a name="l237"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l238"></a>}
|
||
|
<a name="l239"></a>
|
||
|
<a name="l240"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>BibleVerse</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc_out=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *verse,</span><span class=cF9>I64</span><span class=cF0> lines)
|
||
|
<a name="l241"></a>{</span><span class=cF2>//Put N lines starting at verse str into doc.</span><span class=cF0>
|
||
|
<a name="l242"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l243"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc_in;
|
||
|
<a name="l244"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
||
|
<a name="l245"></a> </span><span class=cF1>U8</span><span class=cF0> *st,*st2;
|
||
|
<a name="l246"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_out) doc_out=</span><span class=cF5>DocPut</span><span class=cF0>;
|
||
|
<a name="l247"></a> </span><span class=cF1>if</span><span class=cF0> (doc_out && </span><span class=cF5>FileFind</span><span class=cF7>(</span><span class=cF3>BIBLE_FILENAME</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l248"></a> st=</span><span class=cF5>StrNew</span><span class=cF0>(verse);
|
||
|
<a name="l249"></a> st2=</span><span class=cF5>StrNew</span><span class=cF0>(verse);
|
||
|
<a name="l250"></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="l251"></a> </span><span class=cF5>StrLastRem</span><span class=cF0>(st,</span><span class=cF6>","</span><span class=cF0>,st2);
|
||
|
<a name="l252"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l253"></a> *st2=0;
|
||
|
<a name="l254"></a> i=</span><span class=cF5>DefineMatch</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=cF0>);
|
||
|
<a name="l255"></a> </span><span class=cF1>if</span><span class=cF0> (i>=0) {
|
||
|
<a name="l256"></a> i=</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="l257"></a> doc_in=</span><span class=cF5>DocRead</span><span class=cF0>(</span><span class=cF3>BIBLE_FILENAME</span><span class=cF0>,</span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>);
|
||
|
<a name="l258"></a> </span><span class=cF5>DocGoToLine</span><span class=cF0>(doc_in,i); </span><span class=cF2>//one based</span><span class=cF0>
|
||
|
<a name="l259"></a> </span><span class=cF1>if</span><span class=cF0> (*st2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l260"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(doc_in->find_replace->find_text,st2);
|
||
|
<a name="l261"></a> </span><span class=cF5>EdFindNext</span><span class=cF0>(doc_in);
|
||
|
<a name="l262"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l263"></a> doc_e=doc_in->cur_entry;
|
||
|
<a name="l264"></a> </span><span class=cF1>while</span><span class=cF0> (lines>0 && doc_e!=doc_in) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l265"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0>)
|
||
|
<a name="l266"></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="l267"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0>) {
|
||
|
<a name="l268"></a> </span><span class=cF5>DocPutKey</span><span class=cF0>(doc_out,</span><span class=cF6>'\n'</span><span class=cF0>);
|
||
|
<a name="l269"></a> lines--;
|
||
|
<a name="l270"></a> }
|
||
|
<a name="l271"></a> doc_e=doc_e->next;
|
||
|
<a name="l272"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l273"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc_in);
|
||
|
<a name="l274"></a> }
|
||
|
<a name="l275"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l276"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l277"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l278"></a>}
|
||
|
<a name="l279"></a>
|
||
|
<a name="l280"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDoc</span><span class=cF0> *</span><span class=cF5>BibleDoc</span><span class=cF0>()
|
||
|
<a name="l281"></a>{</span><span class=cF2>//Return Bible as DolDoc with trees.</span><span class=cF0>
|
||
|
<a name="l282"></a> </span><span class=cF9>CDoc</span><span class=cF0> *res=</span><span class=cF5>DocRead</span><span class=cF0>(</span><span class=cF3>BIBLE_FILENAME</span><span class=cF0>);
|
||
|
<a name="l283"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=res->head.next,*doc_e1;
|
||
|
<a name="l284"></a> </span><span class=cF1>Bool</span><span class=cF0> open_chapter=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l285"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr=</span><span class=cF5>Define</span><span class=cF0>(</span><span class=cF6>"ST_BIBLE_BOOK_LINES"</span><span class=cF0>);
|
||
|
<a name="l286"></a> </span><span class=cF9>I64</span><span class=cF0> book,book_cnt=</span><span class=cF5>DefineCnt</span><span class=cF0>(</span><span class=cF6>"ST_BIBLE_BOOK_LINES"</span><span class=cF0>)-1,
|
||
|
<a name="l287"></a> chapter,
|
||
|
<a name="l288"></a> line=</span><span class=cF5>Str2I64</span><span class=cF0>(ptr,,&ptr);
|
||
|
<a name="l289"></a> ptr++;
|
||
|
<a name="l290"></a> </span><span class=cF1>for</span><span class=cF0> (book=0;book<book_cnt;book++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l291"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e->y+1<line) {
|
||
|
<a name="l292"></a> doc_e1=doc_e->next;
|
||
|
<a name="l293"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(res,doc_e);
|
||
|
<a name="l294"></a> doc_e=doc_e1;
|
||
|
<a name="l295"></a> }
|
||
|
<a name="l296"></a> res->cur_entry=doc_e;
|
||
|
<a name="l297"></a> res->cur_col=0;
|
||
|
<a name="l298"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(res,</span><span class=cF6>"$TR,\"%Z\"$\n$ID,2$"</span><span class=cF0>,book,</span><span class=cF6>"ST_BIBLE_BOOKS"</span><span class=cF0>);
|
||
|
<a name="l299"></a> line=</span><span class=cF5>Str2I64</span><span class=cF0>(ptr,,&ptr);
|
||
|
<a name="l300"></a> ptr++;
|
||
|
<a name="l301"></a> chapter=1;
|
||
|
<a name="l302"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e->y+1<line) {
|
||
|
<a name="l303"></a> doc_e1=doc_e->next;
|
||
|
<a name="l304"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && </span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>":1 "</span><span class=cF0>,doc_e->tag</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l305"></a> res->cur_entry=doc_e;
|
||
|
<a name="l306"></a> res->cur_col=0;
|
||
|
<a name="l307"></a> </span><span class=cF1>if</span><span class=cF0> (open_chapter) {
|
||
|
<a name="l308"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(res,</span><span class=cF6>"$ID,-2$"</span><span class=cF0>);
|
||
|
<a name="l309"></a> open_chapter=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l310"></a> }
|
||
|
<a name="l311"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(res,</span><span class=cF6>"$TR,\"%d\"$\n$ID,2$"</span><span class=cF0>,chapter++);
|
||
|
<a name="l312"></a> open_chapter=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l313"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (chapter==1) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l314"></a> doc_e1=doc_e->next;
|
||
|
<a name="l315"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(res,doc_e);
|
||
|
<a name="l316"></a> doc_e=doc_e1;
|
||
|
<a name="l317"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l318"></a> doc_e=doc_e1;
|
||
|
<a name="l319"></a> }
|
||
|
<a name="l320"></a> res->cur_entry=doc_e;
|
||
|
<a name="l321"></a> res->cur_col=0;
|
||
|
<a name="l322"></a> </span><span class=cF1>if</span><span class=cF0> (open_chapter) {
|
||
|
<a name="l323"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(res,</span><span class=cF6>"$ID,-2$"</span><span class=cF0>);
|
||
|
<a name="l324"></a> open_chapter=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l325"></a> }
|
||
|
<a name="l326"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(res,</span><span class=cF6>"$ID,-2$"</span><span class=cF0>);
|
||
|
<a name="l327"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l328"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=res) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l329"></a> doc_e1=doc_e->next;
|
||
|
<a name="l330"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(res,doc_e);
|
||
|
<a name="l331"></a> doc_e=doc_e1;
|
||
|
<a name="l332"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l333"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l334"></a>}
|
||
|
<a name="l335"></a>
|
||
|
<a name="l336"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>BibleView</span><span class=cF0>()
|
||
|
<a name="l337"></a>{</span><span class=cF2>//View Bible as DolDoc with trees.</span><span class=cF0>
|
||
|
<a name="l338"></a> </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cF3>STR_LEN</span><span class=cF0>];
|
||
|
<a name="l339"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>BibleDoc</span><span class=cF0>;
|
||
|
<a name="l340"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf,</span><span class=cF6>"AL:%d,1"</span><span class=cF0>,doc);
|
||
|
<a name="l341"></a> </span><span class=cF5>Ed</span><span class=cF0>(buf);
|
||
|
<a name="l342"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
||
|
<a name="l343"></a>}
|
||
|
<a name="l344"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>CtrlAltB</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0>)
|
||
|
<a name="l345"></a>{
|
||
|
<a name="l346"></a> </span><span class=cF5>PopUp</span><span class=cF0>(</span><span class=cF6>"BibleView;"</span><span class=cF0>);
|
||
|
<a name="l347"></a>}
|
||
|
<a name="l348"></a></span><span class=cF5>CtrlAltCBSet</span><span class=cF0>(</span><span class=cF6>'B'</span><span class=cF0>,&</span><span class=cF5>CtrlAltB</span><span class=cF0>,</span><span class=cF6>"Cmd /Bible"</span><span class=cF0>);
|
||
|
</span></pre></body>
|
||
|
</html>
|