Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > ffa1e6f5ad04360808fe8840fe3ba036 > files > 386

vrq-devel-1.0.88-1.fc14.i686.rpm

<!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.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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>
<h1>/net/fileserver/nas/home/mdh/vrq/src/glue.h</h1><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 &lt;stdio.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;list&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;stdarg.h&gt;</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#0cb58e7e6f0bad369840a52e54a56ae0">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>               <a class="code" href="glue_8h.html#0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>;
<a name="l00047"></a><a class="code" href="glue_8h.html#0b39d6d754cb24c708b0f2bdbe88130e">00047</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>      <a class="code" href="glue_8h.html#0b39d6d754cb24c708b0f2bdbe88130e" title="Short cut for unsigned 32 bit integer.">UINT32</a>;
<a name="l00051"></a><a class="code" href="glue_8h.html#f16992cf571ce4103a92355761cc471e">00051</a> <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span>   <a class="code" href="glue_8h.html#f16992cf571ce4103a92355761cc471e" title="Short cut for signed 64 bit integer.">INT64</a>;
<a name="l00055"></a><a class="code" href="glue_8h.html#57be03562867144161c1bfee95ca8f7c">00055</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> <a class="code" href="glue_8h.html#57be03562867144161c1bfee95ca8f7c" title="Short cut for unsigned 64 bit integer.">UINT64</a>;
<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 MAX_PATH_LENGTH (256)</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define PATH_SEPARATOR "/"</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span>
<a name="l00071"></a>00071 <span class="keyword">extern</span> <span class="keywordtype">int</span>      <a class="code" href="main_8cc.html#8078ca8fbb167e9f82fcfed78b0d2867">warningCount</a>;
<a name="l00072"></a>00072 <span class="keyword">extern</span> <span class="keywordtype">int</span>      <a class="code" href="main_8cc.html#6ca57b0e7167b99fb278bda039716599">errorCount</a>;
<a name="l00073"></a>00073 <span class="keyword">extern</span> FILE*    <a class="code" href="main_8cc.html#b25a3625a8efbaa3d81ef27bbb51c9c5">logfile</a>;
<a name="l00074"></a>00074 
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="main_8cc.html#dc1dbc809c78c7fbfb651ab5c3128979">shell_assert</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>*, <span class="keywordtype">int</span> );
<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="main_8cc.html#75b14974d5279e0e072d3b157dc996a4">shell_xfree</a>( <span class="keywordtype">void</span>*, <span class="keywordtype">int</span> );
<a name="l00080"></a>00080 <span class="keywordtype">void</span>* <a class="code" href="main_8cc.html#cec925771872e73156971d2a58a67a3f">shell_xmalloc</a>( <span class="keywordtype">int</span> );
<a name="l00090"></a>00090 <span class="keyword">class </span><a class="code" href="classMessage.html" title="Plugin&amp;#39;s should need these.">Message</a> {
<a name="l00091"></a>00091 <span class="keyword">public</span>:
<a name="l00095"></a><a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f94edbc4fab672c448844db9885d055201">00095</a>     <span class="keyword">enum</span> <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> {
<a name="l00096"></a><a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f90cc7b8664dca940d0528e39d9894b1a9">00096</a>         <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f94edbc4fab672c448844db9885d055201" title="ignore message, don&amp;#39;t print or increment counts.">eIGNORE</a>,        
<a name="l00097"></a><a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9b4be849a99a4e81d664dd5c22494e57f">00097</a>         <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f90cc7b8664dca940d0528e39d9894b1a9" title="error message, print and increment error count">eERROR</a>,         
<a name="l00098"></a><a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f928e32229684a6c16d47d328ad4a900fe">00098</a>         <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9b4be849a99a4e81d664dd5c22494e57f" title="warning message, print and increment warning count">eWARNING</a>,       
<a name="l00099"></a>00099         <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f928e32229684a6c16d47d328ad4a900fe" title="informative message, print only">eINFO</a>           
<a name="l00100"></a>00100     };
<a name="l00101"></a>00101 <span class="keyword">private</span>:
<a name="l00102"></a>00102     <span class="keyword">static</span> map&lt;string,Message*&gt; abbrev2Message; 
<a name="l00103"></a>00103     <span class="keyword">static</span> list&lt;Message*&gt; messages;             
<a name="l00104"></a>00104     <a class="code" href="classCBackend.html" title="This is the abstract class to overload to create new backend tools.">CBackend</a>* tool;                             
<a name="l00105"></a>00105     <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a>  action;                           
<a name="l00106"></a>00106     <span class="keywordtype">int</span>       locked;                           
<a name="l00107"></a>00107     <span class="keyword">const</span> <span class="keywordtype">string</span> abbrev;                        
<a name="l00108"></a>00108     <span class="keyword">const</span> <span class="keywordtype">string</span> helpText;                      
<a name="l00109"></a>00109     <span class="keyword">const</span> <span class="keywordtype">string</span> format;                        
<a name="l00110"></a>00110 <span class="keyword">public</span>:
<a name="l00120"></a>00120     <span class="keyword">static</span> <a class="code" href="classMessage.html" title="Plugin&amp;#39;s should need these.">Message</a>* <a class="code" href="group__utilities.html#g62829349326deaf109d8f7bbebef64c2" 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="l00121"></a>00121                       <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a>   defaultAction,
<a name="l00122"></a>00122                       <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev, 
<a name="l00123"></a>00123                       <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... );
<a name="l00132"></a>00132     <span class="keyword">static</span> <a class="code" href="classMessage.html" title="Plugin&amp;#39;s should need these.">Message</a>* <a class="code" href="group__utilities.html#g8a179fbaddce73f85b0de8e0a1ffec69" 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="l00133"></a>00133                       <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev, 
<a name="l00134"></a>00134                       <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... );
<a name="l00144"></a>00144     <span class="keyword">static</span> <a class="code" href="classMessage.html" title="Plugin&amp;#39;s should need these.">Message</a>* Find( <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev );
<a name="l00149"></a>00149     <span class="keyword">static</span> list&lt;Message*&gt;&amp; MessageList() { <span class="keywordflow">return</span> messages; }
<a name="l00150"></a>00150     <a class="code" href="classMessage.html" title="Plugin&amp;#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="l00151"></a>00151              <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> action,
<a name="l00152"></a>00152              <span class="keywordtype">int</span>    locked,
<a name="l00153"></a>00153              <span class="keyword">const</span> <span class="keywordtype">char</span>* abbrev,
<a name="l00154"></a>00154              <span class="keyword">const</span> <span class="keywordtype">char</span>* helpText,
<a name="l00155"></a>00155              <span class="keyword">const</span> <span class="keywordtype">char</span>* format );
<a name="l00156"></a>00156     
<a name="l00157"></a>00157     <span class="keyword">const</span> <span class="keywordtype">char</span>* Format() { <span class="keywordflow">return</span> format.c_str(); }
<a name="l00158"></a>00158     <span class="keyword">const</span> <span class="keywordtype">char</span>* Abbreviation() { <span class="keywordflow">return</span> abbrev.c_str(); }
<a name="l00159"></a>00159     <span class="keyword">const</span> <span class="keywordtype">char</span>* HelpText() { <span class="keywordflow">return</span> helpText.c_str(); }
<a name="l00160"></a>00160     <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a>    Action() { <span class="keywordflow">return</span> action; }
<a name="l00161"></a>00161     <span class="keywordtype">void</span>        Action( <a class="code" href="classMessage.html#b32daae480f3ef73a142ab35300820f9" title="Message behaviors.">Action_t</a> a ) { <span class="keywordflow">if</span>( !locked ) { action = a; } }
<a name="l00162"></a>00162     <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="l00163"></a>00163     <span class="keywordtype">int</span>         Locked() { <span class="keywordflow">return</span> locked; }
<a name="l00167"></a>00167 };
<a name="l00168"></a>00168 
<a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="group__utilities.html#gb707bd2f52fa5d46028aa01c74225b3d" 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&amp;#39;s should need these.">Message</a>* <a class="code" href="group__utilities.html#gb707bd2f52fa5d46028aa01c74225b3d" title="Print message.">message</a>, ... );
<a name="l00183"></a>00183 <span class="keywordtype">void</span> <a class="code" href="group__utilities.html#ge28b264fc971d8741b94feef009dc63b" title="Print to logfile.">vlogprintf</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* format, va_list args );
<a name="l00190"></a>00190 <span class="keywordtype">void</span> <a class="code" href="group__utilities.html#g5736e2effe9561d98a4bd804727da6ad" title="Print to logfile.">logprintf</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ... );
<a name="l00191"></a>00191 
<a name="l00192"></a>00192 
<a name="l00197"></a>00197 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#70a6949450beb6e2a23d196b9747a93f" 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="l00202"></a>00202 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#79d7879c9153cc0ef43ce5d821625e02" 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="l00207"></a>00207 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#d46537d50dde2a1ebd100a490ef4fdd6" 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="l00212"></a>00212 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#306aa4bd4a150391a2cffc5c3c33bdef" 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="l00217"></a>00217 <span class="keywordtype">void</span> <a class="code" href="glue_8h.html#76045ed8a8fa63362fc65b2384cd970b" 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="l00218"></a>00218 
<a name="l00219"></a>00219 
<a name="l00225"></a>00225 <span class="preprocessor">#define MASSERT(c) if(!(c)) { shell_assert( __FILE__, __LINE__ ); abort(); }</span>
<a name="l00226"></a>00226 <span class="preprocessor"></span>
<a name="l00231"></a>00231 <span class="preprocessor">#define MTHROW_NIL(p) MASSERT(p!=NULL);</span>
<a name="l00232"></a>00232 <span class="preprocessor"></span>
<a name="l00233"></a>00233 <span class="preprocessor">#endif // GLUE_HPP</span>
<a name="l00234"></a>00234 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 21 18:05:36 2009 for vrq by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>