The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<html>
<head>
<title>MHonArc Resources: RCFILE</title>
<link rel="stylesheet" type="text/css" href="../docstyles.css">
</head>
<body>
<!--x-rc-nav-->
<table border=0><tr valign="top">
<td align="left" width="50%">[Prev:&nbsp;<a href="quiet.html">QUIET</a>]</td><td><nobr>[<a href="../resources.html#rcfile">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next:&nbsp;<a href="reconvert.html">RECONVERT</a>]</td></tr></table>
<!--/x-rc-nav-->
<hr>
<h1>RCFILE</h1>
<!--X-TOC-Start-->
<ul>
<li><a href="#syntax">Syntax</a>
<li><a href="#description">Description</a>
<ul>
<li><small><a href="#">Resource file syntax</a></small>
<li><small><a href="#">Resource variables</a></small>
<li><small><a href="#locale">Localized resource file variations</a></small>
</ul>
<li><a href="#default">Default Setting</a>
<li><a href="#rcvars">Resource Variables</a>
<li><a href="#examples">Examples</a>
<li><a href="#version">Version</a>
<li><a href="#seealso">See Also</a>
</ul>
<!--X-TOC-End-->

<!-- *************************************************************** -->
<hr>
<h2><a name="syntax">Syntax</a></h2>

<dl>

<dt><strong>Envariable</strong></dt>
<dd><p>
<code>M2H_RCFILE=</code><var>filename</var>
</p>
</dd>

<dt><strong>Element</strong></dt>
<dd><p>N/A
</p>
</dd>

<dt><strong>Command-line Option</strong></dt>
<dd><p>
<code>-rcfile </code><var>filename</var>
</p>
</dd>

</dl>

<!-- *************************************************************** -->
<hr>
<h2><a name="description">Description</a></h2>

<p>RCFILE tells MHonArc what resource files to load.
A resource file allows you to specify most of the resources set by 
environment variables and command-line options along with other
resources to control MHonArc's behavior.
</p>

<p>The <tt>-rcfile</tt> command-line option can be specified multiple
times.  For example,
</p>
<table border="1" width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc -rcfile <var>file1.mrc</var> -rcfile <var>file2.mrc</var></b> ...
</pre></td></tr></table>

<p>Each resource file specified will be loaded in the order
specified on the command-line.
</p>

<h3>Resource file syntax</h3>

<P>Resources are set in the file by using <EM>elements</EM> similiar
in style to HTML/XML markup. However, MHonArc uses simpler
parsing rules for the resource file than standard XML: </P>

<UL>

<LI><P>Any line that is not a recognized element open tag, <EM>and</EM>
the line is not contained within an element, is ignored.  This implies
that regular text can be put anywhere <STRONG>outside</STRONG> of
recognized elements for commenting purposes.  </P>

<table class="note" width="100%">
<tr valign=top>
<td><strong>NOTE:</strong></td>
<td width="100%"><p>You should use XML comment declarations
(<CODE>&lt;!-- </CODE>...<CODE> --&gt;</CODE>) when commenting a
resource file. This will eliminate possible conflicts
if more stricter parsing rules are adopted.
</p>
</td>
</tr>
</table>
<br>

<LI><P>The open tag of an element must occur by itself on a
single line.</P>
<p><b>Correct</b>:
</p>
<pre class="code">
<b><u>&lt;LiTemplate&gt;</u></b>
&lt;li&gt;&lt;strong&gt;$SUBJECT$&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt;From&lt;/em&gt;: $FROM$&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/LiTemplate&gt;
</pre>
<p><b>Wrong</b>:
</p>
<pre class="code">
<b style="color: red;"><u>&lt;LiTemplate&gt;</u></b>&lt;li&gt;&lt;strong&gt;$SUBJECT$&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt;From&lt;/em&gt;: $FROM$&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/LiTemplate&gt;
</pre>
<p> </p>
</li>

<LI><P>Comments inside elements are treated as part of the
element content.
</P>

<LI><P>Each element must have a close tag,
<CODE>&lt;/</CODE><VAR>element_name</VAR><CODE>&gt;</CODE>, on
its own line.</p>
<p><b>Correct</b>:
</p>
<pre class="code">
&lt;LiTemplate&gt;
&lt;li&gt;&lt;strong&gt;$SUBJECT$&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt;From&lt;/em&gt;: $FROM$&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
<b><u>&lt;/LiTemplate&gt;</u></b>
</pre>
<p><b>Wrong</b>:
</p>
<pre class="code">
&lt;LiTemplate&gt;
&lt;li&gt;&lt;strong&gt;$SUBJECT$&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt;From&lt;/em&gt;: $FROM$&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;<b style="color: red;"><u>&lt;/LiTemplate&gt;</u></b>
</pre>

<p>Close tags are not needed for boolean resources.
</P>
</li>

<LI><P>Some elements can take an optional attribute called
"<CODE>Override</CODE>".  This tells MHonArc
that the contents of the element will completely override the default
behavior of MHonArc and previous instances of the element. Example:
"<tt class="icode">&lt;EXCS Override&gt;</tt>". If
"<tt class="icode">Override</tt>" is not specified, then the contents of the
element augment the current setting.  </P>

<LI><P>Some elements can take an optional attribute called
"<CODE>Chop</CODE>".  This tells MHonArc
to remove the last line-break of the element's content.
</P>

<LI><P>Element names are case-insensitive.
</P>

<LI><P>Elements can occur in any order in the resource file.
</P>

<LI><P>Elements <b>CANNOT</b> be nested.  Many resources define
the values of <a href="../rcvars.html">resource variables</a>, which
may be used within resource elements:
</P>
<p><b>Correct</b>:
</p>
<pre class="code">
<b><u>&lt;TTitle&gt;
Example List Threads
&lt;/TTitle&gt;</u></b>

&lt;TIdxPgBegin&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;<b><u>$TIDXTITLE$</u></b>&lt;/title&gt;
...
&lt;/TIdxPgBegin&gt;
</pre>
<p><b>Wrong</b>:
</p>
<pre class="code">
&lt;TIdxPgBegin&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;
<b style="color: red;"><u>&lt;TTitle&gt;
Example List Threads
&lt;/TTitle&gt;</u></b>
&lt;/title&gt;
...
&lt;/TIdxPgBegin&gt;
</pre>
</li>

</UL>

<H3>Resource variables</h3>

<p>Many resources are allowed to have <em>resource variables</em> as
part of there content.  Resource variables represent data that
defined during run-time: resource variables
will get expanded to the appropriate value during the execution
of MHonArc.  For more information on resource variables, see
<cite><a href="../rcvars.html">Resource Variables</a></cite>.
</p>

<h3><a name="locale">Localized resource file variations</a></h3>

<p>MHonArc supports the ability to define locale specific variations
of a resource file based upon the <a href="lang.html">LANG</a> resource
setting.  For example:
</p>
<table border="1" width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="lang.html">-lang</a> en_US -rcfile settings.mrc</b> ...
</pre></td></tr></table>
<p>MHonArc will check for and read the following resource files, in order:
</p>
<ol>
<li><tt>settings.mrc</tt></li>
<li><tt>settings.mrc.en</tt></li>
<li><tt>settings.mrc.en_us</tt></li>
</ol>
<table class="note" width="100%">
<tr valign="baseline">
<td><strong>NOTE:</strong></td>
<td width="100%"><p>MHonArc will quietly ignore any locale-specific files
that do not exist.
</p>
</td>
</tr>
</table>
<p> </p>
<table class="note" width="100%">
<tr valign="baseline">
<td><strong>NOTE:</strong></td>
<td width="100%"><p>Setting <a href="lang.html">LANG</a> via a resource
file element will only affect subsequent resource file resolution: subsequent
resource files loaded via multiple
<tt>-rcfile</tt> options and resource
files loaded via the
<a href="include.html">INCLUDE</a> and
<a href="otherindexes.html">OTHERINDEXES</a>
resources.
</p>
</td>
</tr>
</table>
<p>Continuing with the
previous example, the following specifies a French-Canadian
archive:
</p>
<table border="1" width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="lang.html">-lang</a> fr_CA -rcfile settings.mrc</b> ...
</pre></td></tr></table>
<p>Causing the following resource files to be examined:
</p>
<ol>
<li><tt>settings.mrc</tt></li>
<li><tt>settings.mrc.fr</tt></li>
<li><tt>settings.mrc.fr_ca</tt></li>
</ol>

<p>The following is the list of files examined given a resource
file <tt><var>file.mrc</var></tt> and the generic locale setting
<tt><var>language</var>_<var>country</var>.<var>codeset</var></tt>:
</p>

<ol>
<li><tt><var>file.mrc</var></tt></li>
<li><tt><var>file.mrc</var>.<var>language</var></tt></li>
<li><tt><var>file.mrc</var>.<var>language</var>.<var>codeset</var></tt></li>
<li><tt><var>file.mrc</var>.<var>language</var>_<var>country</var></tt></li>
<li><tt><var>file.mrc</var>.<var>language</var>_<var>country</var>.<var>codeset</var></tt></li>
</ol>

<p>If you manage multiple archives comprising multiple languages,
you can define generic settings in a shared resource file and define
language-specific overrides and/or variations in locale-specific
resource files.  For example,
by leveraging the use of custom <a href="definevar.html">resource
variables</a>, you can parameterize textual labels so the locale-specific
resource files only need to define variable values instead of redefining
layout.  For example, the following is the default value of the
<a href="nextbutton.html">NEXTBUTTON</a> resource:
</p>
<pre class="code">
<b>&lt;NextButton chop&gt;</b>
[&lt;a href="$MSG(NEXT)$"&gt;Date Next&lt;/a&gt;]
<b>&lt;/NextButton&gt;</b>
</pre>

<p>To facilitate the the localization of your archives, change
the resource so the button label becomes a custom resource variable
reference:
</p>
<pre class="code">
<b>&lt;NextButton chop&gt;</b>
[&lt;a href="$MSG(NEXT)$"&gt;<b>$BUTTON-DATE-NEXT-LABEL$</b>&lt;/a&gt;]
<b>&lt;/NextButton&gt;</b>
</pre>

<p>Notice that "<tt class="icode">Date Next</tt>" has been
changed to "<tt class="icode">$BUTTON-DATE-NEXT-LABEL$</tt>".
In the locale specific resource file, all you need to do is
define <tt>$BUTTON-DATE-NEXT-LABEL$</tt>.  Continuing with the
<tt>settings.mrc</tt> example, the following would be defined in
<tt>settings.mrc.en</tt> to set the English version of the label:
</p>
<pre class="code">
<b>&lt;<a href="definevar.html">DefineVar</a> chop&gt;</b>
$BUTTON-DATE-NEXT-LABEL$
Date Next
<b>&lt;/DefineVar&gt;</b>
</pre>


<!-- *************************************************************** -->
<hr>
<h2><a name="default">Default Setting</a></h2>

<p>Nil.
</p>

<!-- *************************************************************** -->
<hr>
<h2><a name="rcvars">Resource Variables</a></h2>

<p>N/A
</p>

<!-- *************************************************************** -->
<hr>
<h2><a name="examples">Examples</a></h2>

<p>The following illustrates what a resource file looks like.
For more examples of resource files, see
<a href="../app-rcfileexs.html"><cite>Appendix: Resource File Examples</cite></a>.
</p>

<PRE class="code">
&lt;!-- MHonArc resource file
  --&gt;
<b>&lt;<a href="sort.html">SORT</a>&gt;</b>
<b>&lt;<a href="title.html">TITLE</a>&gt;</b>
MHonArc test
<b>&lt;/TITLE&gt;</b>
 
<b>&lt;<a href="ttitle.html">TTITLE</a>&gt;</b>
MHonArc test (by thread)
<b>&lt;/TTITLE&gt;</b>
 
&lt;!--=== Index Page Customizations =========================================--&gt;
 
&lt;!-- Have LISTBEGIN contain last updated information
  --&gt;
<b>&lt;<a href="listbegin.html">LISTBEGIN</a>&gt;</b>
&lt;address&gt;
Last updated: <a href="../rcvars.html#LOCALDATE">$LOCALDATE$</a>&lt;br&gt;
<a href="../rcvars.html#NUMOFMSG">$NUMOFMSG$</a> messages in chronological order&lt;br&gt;
&lt;/address&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="<a href="../rcvars.html#TIDXFNAME">$TIDXFNAME$</a>"&gt;Thread Index&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Listing format is the following:
&lt;p&gt;
&lt;ul&gt;&lt;li&gt; 
&lt;strong&gt;Subject&lt;/strong&gt;
(# of follow-ups)
&lt;em&gt;From&lt;/em&gt;&lt;br&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;ul&gt;
<b>&lt;/LISTBEGIN&gt;</b>
 
 
&lt;!-- A compact listing template
  --&gt;
<b>&lt;<a href="litemplate.html">LITEMPLATE</a>&gt;</b>
&lt;li&gt; 
&lt;strong&gt;<a href="../rcvars.html#SUBJECT">$SUBJECT:40$</a>&lt;/strong&gt;
(<a href="../rcvars.html#NUMFOLUP">$NUMFOLUP$</a>) &lt;em&gt;<a href="../rcvars.html#FROMNAME">$FROMNAME$</a>&lt;/em&gt;&lt;br&gt;
<b>&lt;/LITEMPLATE&gt;</b>
 
<b>&lt;<a href="listend.html">LISTEND</a>&gt;</b>
&lt;/ul&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;strong&gt;
&lt;a href="http://example.com/"&gt;Home&lt;/a&gt;
&lt;/strong&gt;
&lt;p&gt;
<b>&lt;/LISTEND&gt;</b>
 
&lt;!--=== Thread Index Page Customizations ==================================--&gt;
<b>&lt;<a href="thead.html">THEAD</a>&gt;</b>
&lt;address&gt;
Thread index&lt;br&gt;
Last updated: <a href="../rcvars.html#LOCALDATE">$LOCALDATE$</a>&lt;br&gt;
<a href="../rcvars.html#NUMOFMSG">$NUMOFMSG$</a> messages&lt;br&gt;
&lt;/address&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="<a href="../rcvars.html#IDXFNAME">$IDXFNAME$</a>"&gt;Main Index&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
<b>&lt;/THEAD&gt;</b>
 
&lt;!--=== Message Customizations ============================================--&gt;
<b>&lt;<a href="excs.html">EXCS</a> override&gt;</b>
apparently
errors-to 
followup
forward 
lines 
message-id
mime- 
nntp- 
originator 
path 
precedence 
received 
replied 
return-path 
status 
via 
x- 
<b>&lt;/EXCS&gt;</b>

<b>&lt;<a href="labelstyles.html">LABELSTYLES</a>&gt;</b>
-default-
subject:strong
from:strong
to:strong
&lt;/LABELSTYLES&gt;
 
<b>&lt;<a href="fieldstyles.html">FIELDSTYLES</a>&gt;</b>
-default-
subject:strong
from:strong
to:strong
keywords:em
newsgroups:strong
<b>&lt;/FIELDSTYLES&gt;</b>
 
<b>&lt;<a href="msghead.html">MSGHEAD</a>&gt;</b>
&lt;address&gt;
MHonArc test archive
&lt;/address&gt;
<b>&lt;/MSGHEAD&gt;</b>
 
<b>&lt;<a href="msgfoot.html">MSGFOOT</a>&gt;</b>
&lt;strong&gt;
&lt;a href="http://example.com/"&gt;Home&lt;/a&gt; |
&lt;a href="<a href="../rcvars.html#IDXFNAME">$IDXFNAME$</a>"&gt;Main Index&lt;/a&gt; |
&lt;a href="<a href="../rcvars.html#TIDXFNAME">$TIDXFNAME$</a>"&gt;Thread Index&lt;/a&gt;
&lt;/strong&gt;
<b>&lt;/MSGFOOT&gt;</b>
 
&lt;!--=== Icons =============================================================--&gt;
<b>&lt;<a href="icons.html">ICONS</a>&gt;</b>
application/*;[20x22]/icons/generic.gif
application/msword;[20x22]/icons/layout.gif
application/postscript;[20x22]/icons/ps.gif
application/rtf;[20x22]/icons/layout.gif
application/x-csh;[20x22]/icons/script.gif
application/x-dvi;[20x22]/icons/dvi.gif
application/x-gtar;[20x22]/icons/tar.gif
application/x-gzip;[20x22]/icons/compressed.gif
application/x-ksh;[20x22]/icons/script.gif
application/x-latex;[20x22]/icons/tex.gif
application/octet-stream;[20x22]/icons/binary.gif
application/x-patch;[20x22]/icons/patch.gif
application/pdf;[20x22]/icons/pdf.gif
application/x-script;[20x22]/icons/script.gif
application/x-sh;[20x22]/icons/script.gif
application/x-tar;[20x22]/icons/tar.gif
application/x-tex;[20x22]/icons/tex.gif
application/x-zip-compressed;[20x22]/icons/compressed.gif
application/zip;[20x22]/icons/compressed.gif
audio/*;[20x22]/icons/sound1.gif
chemical/*;[20x22]/icons/sphere2.gif
image/*;[20x22]/icons/image2.gif
message/external-body;[20x22]/icons/link.gif
multipart/*;[20x22]/icons/layout.gif
text/*;[20x22]/icons/text.gif
video/*;[20x22]/icons/movie.gif
*/*;[20x22]/icons/generic.gif
<b>&lt;/ICONS&gt;</b>
</PRE>

<!-- *************************************************************** -->
<hr>
<h2><a name="version">Version</a></h2>

<p>1.0
</p>

<!-- *************************************************************** -->
<hr>
<h2><a name="seealso">See Also</a></h2>

<p>
<a href="lang.html">LANG</a>
</p>

<!-- *************************************************************** -->
<hr>
<!--x-rc-nav-->
<table border=0><tr valign="top">
<td align="left" width="50%">[Prev:&nbsp;<a href="quiet.html">QUIET</a>]</td><td><nobr>[<a href="../resources.html#rcfile">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next:&nbsp;<a href="reconvert.html">RECONVERT</a>]</td></tr></table>
<!--/x-rc-nav-->
<hr>
<address>
$Date: 2005/06/07 19:15:44 $ <br>
<img align="top" src="../monicon.png" alt="">
<a href="http://www.mhonarc.org/"
><strong>MHonArc</strong></a><br>
Copyright &#169; 1997-1999,2003, <a href="http://www.earlhood.com/"
>Earl Hood</a>, <a href="mailto:mhonarc&#37;40mhonarc.org"
> mhonarc<!--
-->&#64;<!--
-->mhonarc.org</a><br>
</address>

</body>
</html>