<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>vrq: /net/fileserver/nas/home/mdh/vrq/src/glue.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="180"><a href="index.html"><img src="vrq.png" width="150" height="100" border="0" alt="vrq"></a></td> <td background="top_bg.png" align="right" width="100%"> <img src="glyth.png" width="500" height="100" border="0" alt=""> </td> </tr> <tr> <td background="#FFFFFF" align="right" width="50" height="4"></td> </tr> </table> </head><body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>/net/fileserver/nas/home/mdh/vrq/src/glue.h</h1> </div> </div> <div class="contents"> <a href="glue_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 1997-2007, Mark Hummel</span> <a name="l00003"></a>00003 <span class="comment"> * This file is part of Vrq.</span> <a name="l00004"></a>00004 <span class="comment"> *</span> <a name="l00005"></a>00005 <span class="comment"> * Vrq is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public</span> <a name="l00007"></a>00007 <span class="comment"> * License as published by the Free Software Foundation; either</span> <a name="l00008"></a>00008 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * Vrq is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00013"></a>00013 <span class="comment"> * General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"> *</span> <a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public</span> <a name="l00016"></a>00016 <span class="comment"> * License along with this library; if not, write to the Free Software</span> <a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, </span> <a name="l00018"></a>00018 <span class="comment"> * Boston, MA 02110-1301 USA</span> <a name="l00019"></a>00019 <span class="comment"> *****************************************************************************</span> <a name="l00020"></a>00020 <span class="comment"> */</span> <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="preprocessor">#ifndef GLUE_HPP</span> <a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define GLUE_HPP</span> <a name="l00024"></a>00024 <span class="preprocessor"></span> <a name="l00025"></a>00025 <span class="preprocessor">#include <stdio.h></span> <a name="l00026"></a>00026 <span class="preprocessor">#include <stdlib.h></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <string></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <list></span> <a name="l00029"></a>00029 <span class="preprocessor">#include <map></span> <a name="l00030"></a>00030 <span class="preprocessor">#include <iostream></span> <a name="l00031"></a>00031 <span class="preprocessor">#include <stdarg.h></span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keyword">using</span> std::string; <a name="l00034"></a>00034 <span class="keyword">using</span> std::map; <a name="l00035"></a>00035 <span class="keyword">using</span> std::list; <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="keyword">struct </span><a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>; <a name="l00038"></a><a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0">00038</a> <span class="keyword">class </span><a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>; <a name="l00039"></a>00039 <a name="l00043"></a>00043 <span class="keyword">typedef</span> <span class="keywordtype">long</span> INT32; <a name="l00047"></a><a class="code" href="glue_8h.html#a0b39d6d754cb24c708b0f2bdbe88130e">00047</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> UINT32; <a name="l00051"></a><a class="code" href="glue_8h.html#af16992cf571ce4103a92355761cc471e">00051</a> <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> INT64; <a name="l00055"></a><a class="code" href="glue_8h.html#a57be03562867144161c1bfee95ca8f7c">00055</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> UINT64; <a name="l00056"></a>00056 <a name="l00061"></a>00061 <span class="preprocessor">#ifndef TRUE</span> <a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define TRUE 1</span> <a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#ifndef FALSE</span> <a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define FALSE 0</span> <a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00067"></a>00067 <span class="preprocessor"></span> <a name="l00068"></a>00068 <span class="preprocessor">#define PATH_SEPARATOR "/"</span> <a name="l00069"></a>00069 <span class="preprocessor"></span> <a name="l00070"></a>00070 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="main_8cc.html#a8078ca8fbb167e9f82fcfed78b0d2867">warningCount</a>; <a name="l00071"></a>00071 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="main_8cc.html#a6ca57b0e7167b99fb278bda039716599">errorCount</a>; <a name="l00072"></a>00072 <span class="keyword">extern</span> FILE* <a class="code" href="main_8cc.html#ab25a3625a8efbaa3d81ef27bbb51c9c5">logfile</a>; <a name="l00073"></a>00073 <a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="main_8cc.html#adc1dbc809c78c7fbfb651ab5c3128979">shell_assert</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>*, <span class="keywordtype">int</span> ); <a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="main_8cc.html#a75b14974d5279e0e072d3b157dc996a4">shell_xfree</a>( <span class="keywordtype">void</span>*, <span class="keywordtype">int</span> ); <a name="l00079"></a>00079 <span class="keywordtype">void</span>* <a class="code" href="main_8cc.html#acec925771872e73156971d2a58a67a3f">shell_xmalloc</a>( <span class="keywordtype">int</span> ); <a name="l00089"></a><a class="code" href="classMessage.html">00089</a> <span class="keyword">class </span><a class="code" href="classMessage.html" title="Plugin&#39;s should need these.">Message</a> { <a name="l00090"></a>00090 <span class="keyword">public</span>: <a name="l00094"></a><a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9">00094</a> <span class="keyword">enum</span> <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> { <a name="l00095"></a><a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9a4edbc4fab672c448844db9885d055201">00095</a> eIGNORE, <a name="l00096"></a><a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9a0cc7b8664dca940d0528e39d9894b1a9">00096</a> eERROR, <a name="l00097"></a><a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9ab4be849a99a4e81d664dd5c22494e57f">00097</a> eWARNING, <a name="l00098"></a><a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9a28e32229684a6c16d47d328ad4a900fe">00098</a> <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9a28e32229684a6c16d47d328ad4a900fe" title="informative message, print only">eINFO</a> <a name="l00099"></a>00099 }; <a name="l00100"></a>00100 <span class="keyword">private</span>: <a name="l00101"></a>00101 <span class="keyword">static</span> map<string,Message*> abbrev2Message; <a name="l00102"></a>00102 <span class="keyword">static</span> list<Message*> messages; <a name="l00103"></a>00103 <a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>* tool; <a name="l00104"></a>00104 <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> action; <a name="l00105"></a>00105 <span class="keywordtype">int</span> locked; <a name="l00106"></a>00106 <span class="keyword">const</span> <span class="keywordtype">string</span> abbrev; <a name="l00107"></a>00107 <span class="keyword">const</span> <span class="keywordtype">string</span> helpText; <a name="l00108"></a>00108 <span class="keyword">const</span> <span class="keywordtype">string</span> format; <a name="l00109"></a>00109 <span class="keyword">public</span>: <a name="l00119"></a>00119 <span class="keyword">static</span> <a class="code" href="classMessage.html" title="Plugin&#39;s should need these.">Message</a>* <a class="code" href="group__utilities.html#ga62829349326deaf109d8f7bbebef64c2" title="Register a warning message.">RegisterWarning</a>( <a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>* tool, <a name="l00120"></a>00120 <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> defaultAction, <a name="l00121"></a>00121 <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev, <a name="l00122"></a>00122 <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00131"></a>00131 <span class="keyword">static</span> <a class="code" href="classMessage.html" title="Plugin&#39;s should need these.">Message</a>* <a class="code" href="group__utilities.html#ga8a179fbaddce73f85b0de8e0a1ffec69" title="Register an error message.">RegisterError</a>( <a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>* tool, <a name="l00132"></a>00132 <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev, <a name="l00133"></a>00133 <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00143"></a>00143 <span class="keyword">static</span> <a class="code" href="classMessage.html" title="Plugin&#39;s should need these.">Message</a>* Find( <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev ); <a name="l00148"></a>00148 <span class="keyword">static</span> list<Message*>& MessageList() { <span class="keywordflow">return</span> messages; } <a name="l00149"></a>00149 <a class="code" href="classMessage.html" title="Plugin&#39;s should need these.">Message</a>( <a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>* tool, <a name="l00150"></a>00150 <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> action, <a name="l00151"></a>00151 <span class="keywordtype">int</span> locked, <a name="l00152"></a>00152 <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev, <a name="l00153"></a>00153 <span class="keyword">const</span> <span class="keywordtype">char</span>* helpText, <a name="l00154"></a>00154 <span class="keyword">const</span> <span class="keywordtype">char</span>* format ); <a name="l00155"></a>00155 <a name="l00156"></a>00156 <span class="keyword">const</span> <span class="keywordtype">char</span>* Format() { <span class="keywordflow">return</span> format.c_str(); } <a name="l00157"></a>00157 <span class="keyword">const</span> <span class="keywordtype">char</span>* Abbreviation() { <span class="keywordflow">return</span> abbrev.c_str(); } <a name="l00158"></a>00158 <span class="keyword">const</span> <span class="keywordtype">char</span>* HelpText() { <span class="keywordflow">return</span> helpText.c_str(); } <a name="l00159"></a>00159 <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> Action() { <span class="keywordflow">return</span> action; } <a name="l00160"></a>00160 <span class="keywordtype">void</span> Action( <a class="code" href="classMessage.html#ab32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> a ) { <span class="keywordflow">if</span>( !locked ) { action = a; } } <a name="l00161"></a>00161 <a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>* Tool() { <span class="keywordflow">return</span> tool; } <a name="l00162"></a>00162 <span class="keywordtype">int</span> Locked() { <span class="keywordflow">return</span> locked; } <a name="l00166"></a>00166 }; <a name="l00167"></a>00167 <a name="l00175"></a>00175 <span class="keywordtype">void</span> <a class="code" href="group__utilities.html#gab707bd2f52fa5d46028aa01c74225b3d" title="Print message.">message</a>( <span class="keyword">struct</span> <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* location, <a class="code" href="classMessage.html" title="Plugin&#39;s should need these.">Message</a>* <a class="code" href="group__utilities.html#gab707bd2f52fa5d46028aa01c74225b3d" title="Print message.">message</a>, ... ); <a name="l00182"></a>00182 <span class="keywordtype">void</span> <a class="code" href="group__utilities.html#gae28b264fc971d8741b94feef009dc63b" title="Print to logfile.">vlogprintf</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* format, va_list args ); <a name="l00189"></a>00189 <span class="keywordtype">void</span> <a class="code" href="group__utilities.html#ga5736e2effe9561d98a4bd804727da6ad" title="Print to logfile.">logprintf</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00190"></a>00190 <a name="l00191"></a>00191 <a name="l00196"></a>00196 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#a70a6949450beb6e2a23d196b9747a93f" title="This routine should not be used by plugins.">warning</a>( <span class="keyword">struct</span> <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* location, <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00201"></a>00201 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#a79d7879c9153cc0ef43ce5d821625e02" title="This routine should not be used by plugins.">error</a>( <span class="keyword">struct</span> <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* location, <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00206"></a>00206 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#ad46537d50dde2a1ebd100a490ef4fdd6" title="This routine should not be used by plugins.">info</a>( <span class="keyword">struct</span> <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* location, <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00211"></a>00211 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#a306aa4bd4a150391a2cffc5c3c33bdef" title="This routine should not be used by plugins.">fatal</a>( <span class="keyword">struct</span> <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* location, <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00216"></a>00216 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#a76045ed8a8fa63362fc65b2384cd970b" title="This routine should not be used by plugins.">trace</a>( <span class="keyword">struct</span> <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* location, <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... ); <a name="l00217"></a>00217 <a name="l00218"></a>00218 <a name="l00224"></a>00224 <span class="preprocessor">#define MASSERT(c) if(!(c)) { shell_assert( __FILE__, __LINE__ ); abort(); }</span> <a name="l00225"></a>00225 <span class="preprocessor"></span> <a name="l00230"></a>00230 <span class="preprocessor">#define MTHROW_NIL(p) MASSERT(p!=NULL);</span> <a name="l00231"></a>00231 <span class="preprocessor"></span> <a name="l00232"></a>00232 <span class="preprocessor">#endif // GLUE_HPP</span> <a name="l00233"></a>00233 <span class="preprocessor"></span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>