<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>thmlolb.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center>
<hr><h1>thmlolb.cpp</h1><div class="fragment"><pre>00001 <font class="comment">/***************************************************************************</font>
00002 <font class="comment"> thmlolb.cpp - ThML to OLB filter</font>
00003 <font class="comment"> -------------------</font>
00004 <font class="comment"> begin : 2001-05-10</font>
00005 <font class="comment"> copyright : 2001 by CrossWire Bible Society</font>
00006 <font class="comment"> ***************************************************************************/</font>
00007
00008 <font class="comment">/***************************************************************************</font>
00009 <font class="comment"> * *</font>
00010 <font class="comment"> * This program is free software; you can redistribute it and/or modify *</font>
00011 <font class="comment"> * it under the terms of the GNU General Public License as published by *</font>
00012 <font class="comment"> * the Free Software Foundation; either version 2 of the License, or *</font>
00013 <font class="comment"> * (at your option) any later version. *</font>
00014 <font class="comment"> * *</font>
00015 <font class="comment"> ***************************************************************************/</font>
00016
00017 <font class="preprocessor">#include <stdlib.h></font>
00018 <font class="preprocessor">#include <string.h></font>
00019 <font class="preprocessor">#include <thmlolb.h></font>
00020
00021
00022 ThMLOLB::ThMLOLB()
00023 {
00024 }
00025
00026
00027 <font class="keywordtype">char</font> ThMLOLB::ProcessText(<font class="keywordtype">char</font> *text, <font class="keywordtype">int</font> maxlen)
00028 {
00029 <font class="keywordtype">char</font> *to, *from, token[2048];
00030 <font class="keywordtype">int</font> tokpos = 0;
00031 <font class="keywordtype">bool</font> intoken = <font class="keyword">false</font>;
00032 <font class="keywordtype">int</font> len;
00033 <font class="keywordtype">bool</font> ampersand = <font class="keyword">false</font>;
00034 <font class="keywordtype">int</font> i;
00035
00036 len = strlen(text) + 1; <font class="comment">// shift string to right of buffer</font>
00037 <font class="keywordflow">if</font> (len < maxlen) {
00038 memmove(&text[maxlen - len], text, len);
00039 from = &text[maxlen - len];
00040 }
00041 <font class="keywordflow">else</font> from = text; <font class="comment">// -------------------------------</font>
00042 <font class="keywordflow">for</font> (to = text; *from; from++)
00043 {
00044 <font class="keywordflow">if</font> (*from == <font class="charliteral">'<'</font>) {
00045 intoken = <font class="keyword">true</font>;
00046 tokpos = 0;
00047 memset(token, 0, 2048);
00048 ampersand = <font class="keyword">false</font>;
00049 <font class="keywordflow">continue</font>;
00050 }
00051 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (*from == <font class="charliteral">'&'</font>) {
00052 intoken = <font class="keyword">true</font>;
00053 tokpos = 0;
00054 memset(token, 0, 2048);
00055 ampersand = <font class="keyword">true</font>;
00056 <font class="keywordflow">continue</font>;
00057 }
00058 <font class="keywordflow">if</font> (*from == <font class="charliteral">';'</font> && ampersand) {
00059 intoken = <font class="keyword">false</font>;
00060
00061 <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"nbsp"</font>, token, 4)) *to++ = <font class="charliteral">' '</font>;
00062 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"quot"</font>, token, 4)) *to++ = <font class="charliteral">'"'</font>;
00063 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"amp"</font>, token, 3)) *to++ = <font class="charliteral">'&'</font>;
00064 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"lt"</font>, token, 2)) *to++ = <font class="charliteral">'<'</font>;
00065 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"gt"</font>, token, 2)) *to++ = <font class="charliteral">'>'</font>;
00066 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"brvbar"</font>, token, 6)) *to++ = <font class="charliteral">'|'</font>;
00067 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"sect"</font>, token, 4)) *to++ = <font class="charliteral">'§'</font>;
00068 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"copy"</font>, token, 4)) *to++ = <font class="charliteral">'©'</font>;
00069 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"laquo"</font>, token, 5)) *to++ = <font class="charliteral">'«'</font>;
00070 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"reg"</font>, token, 3)) *to++ = <font class="charliteral">'®'</font>;
00071 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"acute"</font>, token, 5)) *to++ = <font class="charliteral">'´'</font>;
00072 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"para"</font>, token, 4)) *to++ = <font class="charliteral">'¶'</font>;
00073 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"raquo"</font>, token, 5)) *to++ = <font class="charliteral">'»'</font>;
00074
00075 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Aacute"</font>, token, 6)) *to++ = <font class="charliteral">'Á'</font>;
00076 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Agrave"</font>, token, 6)) *to++ = <font class="charliteral">'À'</font>;
00077 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Acirc"</font>, token, 5)) *to++ = <font class="charliteral">'Â'</font>;
00078 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Auml"</font>, token, 4)) *to++ = <font class="charliteral">'Ä'</font>;
00079 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Atilde"</font>, token, 6)) *to++ = <font class="charliteral">'Ã'</font>;
00080 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Aring"</font>, token, 5)) *to++ = <font class="charliteral">'Å'</font>;
00081 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"aacute"</font>, token, 6)) *to++ = <font class="charliteral">'á'</font>;
00082 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"agrave"</font>, token, 6)) *to++ = <font class="charliteral">'à'</font>;
00083 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"acirc"</font>, token, 5)) *to++ = <font class="charliteral">'â'</font>;
00084 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"auml"</font>, token, 4)) *to++ = <font class="charliteral">'ä'</font>;
00085 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"atilde"</font>, token, 6)) *to++ = <font class="charliteral">'ã'</font>;
00086 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"aring"</font>, token, 5)) *to++ = <font class="charliteral">'å'</font>;
00087 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Eacute"</font>, token, 6)) *to++ = <font class="charliteral">'É'</font>;
00088 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Egrave"</font>, token, 6)) *to++ = <font class="charliteral">'È'</font>;
00089 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ecirc"</font>, token, 5)) *to++ = <font class="charliteral">'Ê'</font>;
00090 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Euml"</font>, token, 4)) *to++ = <font class="charliteral">'Ë'</font>;
00091 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"eacute"</font>, token, 6)) *to++ = <font class="charliteral">'é'</font>;
00092 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"egrave"</font>, token, 6)) *to++ = <font class="charliteral">'è'</font>;
00093 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ecirc"</font>, token, 5)) *to++ = <font class="charliteral">'ê'</font>;
00094 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"euml"</font>, token, 4)) *to++ = <font class="charliteral">'ë'</font>;
00095 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Iacute"</font>, token, 6)) *to++ = <font class="charliteral">'Í'</font>;
00096 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Igrave"</font>, token, 6)) *to++ = <font class="charliteral">'Ì'</font>;
00097 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Icirc"</font>, token, 5)) *to++ = <font class="charliteral">'Î'</font>;
00098 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Iuml"</font>, token, 4)) *to++ = <font class="charliteral">'Ï'</font>;
00099 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"iacute"</font>, token, 6)) *to++ = <font class="charliteral">'í'</font>;
00100 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"igrave"</font>, token, 6)) *to++ = <font class="charliteral">'ì'</font>;
00101 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"icirc"</font>, token, 5)) *to++ = <font class="charliteral">'î'</font>;
00102 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"iuml"</font>, token, 4)) *to++ = <font class="charliteral">'ï'</font>;
00103 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Oacute"</font>, token, 6)) *to++ = <font class="charliteral">'Ó'</font>;
00104 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ograve"</font>, token, 6)) *to++ = <font class="charliteral">'Ò'</font>;
00105 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ocirc"</font>, token, 5)) *to++ = <font class="charliteral">'Ô'</font>;
00106 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ouml"</font>, token, 4)) *to++ = <font class="charliteral">'Ö'</font>;
00107 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Otilde"</font>, token, 6)) *to++ = <font class="charliteral">'Õ'</font>;
00108 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"oacute"</font>, token, 6)) *to++ = <font class="charliteral">'ó'</font>;
00109 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ograve"</font>, token, 6)) *to++ = <font class="charliteral">'ò'</font>;
00110 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ocirc"</font>, token, 5)) *to++ = <font class="charliteral">'ô'</font>;
00111 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ouml"</font>, token, 4)) *to++ = <font class="charliteral">'ö'</font>;
00112 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"otilde"</font>, token, 6)) *to++ = <font class="charliteral">'õ'</font>;
00113 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Uacute"</font>, token, 6)) *to++ = <font class="charliteral">'Ú'</font>;
00114 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ugrave"</font>, token, 6)) *to++ = <font class="charliteral">'Ù'</font>;
00115 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ucirc"</font>, token, 5)) *to++ = <font class="charliteral">'Û'</font>;
00116 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Uuml"</font>, token, 4)) *to++ = <font class="charliteral">'Ü'</font>;
00117 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"uacute"</font>, token, 6)) *to++ = <font class="charliteral">'ú'</font>;
00118 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ugrave"</font>, token, 6)) *to++ = <font class="charliteral">'ù'</font>;
00119 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ucirc"</font>, token, 5)) *to++ = <font class="charliteral">'û'</font>;
00120 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"uuml"</font>, token, 4)) *to++ = <font class="charliteral">'ü'</font>;
00121 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Yacute"</font>, token, 6)) *to++ = <font class="charliteral">'Ý'</font>;
00122 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"yacute"</font>, token, 6)) *to++ = <font class="charliteral">'ý'</font>;
00123 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"yuml"</font>, token, 4)) *to++ = <font class="charliteral">'ÿ'</font>;
00124
00125 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"deg"</font>, token, 3)) *to++ = <font class="charliteral">'°'</font>;
00126 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"plusmn"</font>, token, 6)) *to++ = <font class="charliteral">'±'</font>;
00127 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"sup2"</font>, token, 4)) *to++ = <font class="charliteral">'²'</font>;
00128 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"sup3"</font>, token, 4)) *to++ = <font class="charliteral">'³'</font>;
00129 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"sup1"</font>, token, 4)) *to++ = <font class="charliteral">'¹'</font>;
00130 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"nbsp"</font>, token, 4)) *to++ = <font class="charliteral">'º'</font>;
00131 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"pound"</font>, token, 5)) *to++ = <font class="charliteral">'£'</font>;
00132 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"cent"</font>, token, 4)) *to++ = <font class="charliteral">'¢'</font>;
00133 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"frac14"</font>, token, 6)) *to++ = <font class="charliteral">'¼'</font>;
00134 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"frac12"</font>, token, 6)) *to++ = <font class="charliteral">'½'</font>;
00135 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"frac34"</font>, token, 6)) *to++ = <font class="charliteral">'¾'</font>;
00136 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"iquest"</font>, token, 6)) *to++ = <font class="charliteral">'¿'</font>;
00137 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"iexcl"</font>, token, 5)) *to++ = <font class="charliteral">'¡'</font>;
00138 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ETH"</font>, token, 3)) *to++ = <font class="charliteral">'Ð'</font>;
00139 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"eth"</font>, token, 3)) *to++ = <font class="charliteral">'ð'</font>;
00140 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"THORN"</font>, token, 5)) *to++ = <font class="charliteral">'Þ'</font>;
00141 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"thorn"</font>, token, 5)) *to++ = <font class="charliteral">'þ'</font>;
00142 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"AElig"</font>, token, 5)) *to++ = <font class="charliteral">'Æ'</font>;
00143 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"aelig"</font>, token, 5)) *to++ = <font class="charliteral">'æ'</font>;
00144 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Oslash"</font>, token, 6)) *to++ = <font class="charliteral">'Ø'</font>;
00145 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"curren"</font>, token, 6)) *to++ = <font class="charliteral">'¤'</font>;
00146 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ccedil"</font>, token, 6)) *to++ = <font class="charliteral">'Ç'</font>;
00147 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ccedil"</font>, token, 6)) *to++ = <font class="charliteral">'ç'</font>;
00148 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"szlig"</font>, token, 5)) *to++ = <font class="charliteral">'ß'</font>;
00149 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"Ntilde"</font>, token, 6)) *to++ = <font class="charliteral">'Ñ'</font>;
00150 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ntilde"</font>, token, 6)) *to++ = <font class="charliteral">'ñ'</font>;
00151 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"yen"</font>, token, 3)) *to++ = <font class="charliteral">'¥'</font>;
00152 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"not"</font>, token, 3)) *to++ = <font class="charliteral">'¬'</font>;
00153 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"ordf"</font>, token, 4)) *to++ = <font class="charliteral">'ª'</font>;
00154 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"uml"</font>, token, 3)) *to++ = <font class="charliteral">'¨'</font>;
00155 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"shy"</font>, token, 3)) *to++ = <font class="charliteral">''</font>;
00156 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(<font class="stringliteral">"macr"</font>, token, 4)) *to++ = <font class="charliteral">'¯'</font>;
00157 <font class="keywordflow">continue</font>;
00158
00159 }
00160 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (*from == <font class="charliteral">'>'</font> && !ampersand)
00161 {
00162 intoken = <font class="keyword">false</font>;
00163 <font class="comment">// process desired tokens</font>
00164 <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"sync type=\"Strongs\" value=\"G"</font>, 27)) {
00165 *to++ = <font class="charliteral">'<'</font>;
00166 <font class="keywordflow">for</font> (i = 28; token[i] != <font class="charliteral">'\"'</font>; i++)
00167 *to++ = token[i];
00168 *to++ = <font class="charliteral">'>'</font>;
00169 <font class="keywordflow">continue</font>;
00170 }
00171 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"sync type=\"Strongs\" value=\"H"</font>, 27)) {
00172 *to++ = <font class="charliteral">'<'</font>;
00173 <font class="keywordflow">for</font> (i = 28; token[i] != <font class="charliteral">'\"'</font>; i++)
00174 *to++ = token[i];
00175 *to++ = <font class="charliteral">'>'</font>;
00176 <font class="keywordflow">continue</font>;
00177 }
00178 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"scripRef"</font>, 8)) {
00179 *to++ = <font class="charliteral">'#'</font>;
00180 <font class="keywordflow">continue</font>;
00181 }
00182 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"/scripRef"</font>, 9)) {
00183 *to++ = <font class="charliteral">' '</font>;
00184 <font class="keywordflow">continue</font>;
00185 }
00186 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"note "</font>, 5)) {
00187 *to++ = <font class="charliteral">'{'</font>;
00188 <font class="keywordflow">continue</font>;
00189 }
00190 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"/note"</font>, 5)) {
00191 *to++ = <font class="charliteral">'}'</font>;
00192 <font class="keywordflow">continue</font>;
00193 }
00194 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strnicmp(token, <font class="stringliteral">"font"</font>, 4)) {
00195 *to++ = <font class="charliteral">'\\'</font>;
00196 *to++ = <font class="charliteral">'\\'</font>;
00197 <font class="keywordflow">continue</font>;
00198 }
00199 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strnicmp(token, <font class="stringliteral">"/font"</font>, 5)) {
00200 *to++ = <font class="charliteral">'\\'</font>;
00201 *to++ = <font class="charliteral">'\\'</font>;
00202 <font class="keywordflow">continue</font>;
00203 }
00204 <font class="keywordflow">else</font> <font class="keywordflow">switch</font>(*token) {
00205 <font class="keywordflow">case</font> <font class="charliteral">'I'</font>: <font class="comment">// font tags</font>
00206 <font class="keywordflow">case</font> <font class="charliteral">'i'</font>:
00207 *to++ = <font class="charliteral">'\\'</font>;
00208 *to++ = <font class="charliteral">'@'</font>;
00209 <font class="keywordflow">continue</font>;
00210 <font class="keywordflow">case</font> <font class="charliteral">'B'</font>: <font class="comment">// bold start</font>
00211 <font class="keywordflow">case</font> <font class="charliteral">'b'</font>:
00212 *to++ = <font class="charliteral">'\\'</font>;
00213 *to++ = <font class="charliteral">'$'</font>;
00214 <font class="keywordflow">continue</font>;
00215 <font class="keywordflow">case</font> <font class="charliteral">'/'</font>:
00216 <font class="keywordflow">switch</font>(token[1]) {
00217 <font class="keywordflow">case</font> <font class="charliteral">'I'</font>:
00218 <font class="keywordflow">case</font> <font class="charliteral">'i'</font>: <font class="comment">// italic end</font>
00219 *to++ = <font class="charliteral">'\\'</font>;
00220 *to++ = <font class="charliteral">'@'</font>;
00221 <font class="keywordflow">continue</font>;
00222 <font class="keywordflow">case</font> <font class="charliteral">'B'</font>: <font class="comment">// bold start</font>
00223 <font class="keywordflow">case</font> <font class="charliteral">'b'</font>:
00224 *to++ = <font class="charliteral">'\\'</font>;
00225 *to++ = <font class="charliteral">'$'</font>;
00226 <font class="keywordflow">continue</font>;
00227 }
00228 }
00229 <font class="keywordflow">continue</font>;
00230 }
00231 <font class="keywordflow">if</font> (intoken) {
00232 <font class="keywordflow">if</font> (tokpos < 2047)
00233 token[tokpos++] = *from;
00234 }
00235 <font class="keywordflow">else</font> *to++ = *from;
00236 }
00237 *to++ = 0;
00238 *to = 0;
00239 <font class="keywordflow">return</font> 0;
00240 }
00241
00242
00243
</pre></div><hr><address align="right"><small>Generated on Thu Jun 20 22:13:01 2002 for The Sword Project by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>