Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > by-pkgid > 91d72cc9d6b0ad99c81fd8e232ee301e > files > 64

ocaml-findlib-1.2.4-5mdv2010.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Fl_package_base.html">
<link rel="next" href="Topfind.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Findlib" rel="Chapter" href="Findlib.html">
<link title="Fl_package_base" rel="Chapter" href="Fl_package_base.html">
<link title="Fl_metascanner" rel="Chapter" href="Fl_metascanner.html">
<link title="Topfind" rel="Chapter" href="Topfind.html"><title>The Findlib Library : Fl_metascanner</title>
</head>
<body>
<div class="navbar"><a href="Fl_package_base.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Topfind.html">Next</a>
</div>
<center><h1>Module <a href="type_Fl_metascanner.html">Fl_metascanner</a></h1></center>
<br>
<pre><span class="keyword">module</span> Fl_metascanner: <code class="code">sig</code> <a href="Fl_metascanner.html">..</a> <code class="code">end</code></pre>Parses META files<br>
<hr width="100%">
<pre><span class="keyword">type</span> <a name="TYPEformal_pred"></a><code class="type"></code>formal_pred = <code class="type">[ `NegPred of string | `Pred of string ]</code> </pre>

<pre><span class="keyword">type</span> <a name="TYPEflavour"></a><code class="type"></code>flavour = <code class="type">[ `Appendix | `BaseDef ]</code> </pre>
<div class="info">
<code class="code">`BaseDef</code> refers to META definitions using the "=" operator,
 and <code class="code">`Appendix</code> refers to definitions using the "+=" operator.<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEpkg_definition"></a><code class="type"></code>pkg_definition = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>def_var&nbsp;: <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The name of the defined variable</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>def_flav&nbsp;: <code class="type"><a href="Fl_metascanner.html#TYPEflavour">flavour</a></code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The flavour of the definition</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>def_preds&nbsp;: <code class="type"><a href="Fl_metascanner.html#TYPEformal_pred">formal_pred</a> list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The formal predicates of the def</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>def_value&nbsp;: <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The value assigned to the variable</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}

<div class="info">
A <code class="code">pkg_definition</code> is expressed by the syntax
  <pre><code class="code"> var(p1,p2,...) = "value" </code></pre> (flavour `BaseDef), 
  or the syntax
  <pre><code class="code"> var(p1,p2,...) += "value" </code></pre> (flavour `Appendix)
  in the META file. The list of predicates may be omitted. Predicates
  may be negated by using "-", e.g. "-x".<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEpkg_expr"></a><code class="type"></code>pkg_expr = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>pkg_defs&nbsp;: <code class="type"><a href="Fl_metascanner.html#TYPEpkg_definition">pkg_definition</a> list</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>pkg_children&nbsp;: <code class="type">(string * <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a>) list</code>;</code></td>

</tr></table>
}

<div class="info">
A value of type <code class="code">pkg_expr</code> denotes the contents of a META file.
  The component <code class="code">pkg_defs</code> are the variable definitions.
  The component <code class="code">pkg_children</code> contains
  the definitions of the subpackages.<br>
</div>

<pre><span class="keyword">val</span> <a name="VALparse"></a>parse : <code class="type">Pervasives.in_channel -> <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a></code></pre><div class="info">
<code class="code">parse ch:</code> 
 scans and parses the file connected with channel <code class="code">ch</code>. The file must
 have a syntax compatible with the META format. The return value
 contains the found definitions for the package and all subpackages.
<p>

 <code class="code">exception Stream.Error of string:</code> is
 raised on syntax errors. The string explains the error.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALprint"></a>print : <code class="type">Pervasives.out_channel -> <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a> -> unit</code></pre><div class="info">
<code class="code">print ch expr</code>:
 Outputs the package expression to a channel.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALlookup"></a>lookup : <code class="type">string -> string list -> <a href="Fl_metascanner.html#TYPEpkg_definition">pkg_definition</a> list -> string</code></pre><div class="info">
<code class="code">lookup variable_name predicate_list def</code>:
<p>

 Returns the value of <code class="code">variable_name</code> in <code class="code">def</code> under the assumption
 that the predicates in <code class="code">predicate_list</code> hold, but no other predicates.
<p>

 The rules are as follows: In the step (A), only the <code class="code">`BaseDef</code>
 definitions are considered. The first base definition is determined that
 matches all predicates and that has the longest predicate list.
 In the step (B) only the <code class="code">`Appendix</code> definitions are considered.
 All definitions are determined that match all predicates.
 The final result is the concatenation of the single result of (A)
 and all results of (B) (in the order they are defined). A space
 character is inserted between two concatenated strings.
<p>

 When step (A) does not find any matching definition, the exception
 <code class="code">Not_found</code> is raised.<br>
</div>
</body></html>