/usr/share/gtk-doc/html/ctpl/ctpl-CtplEval.html is in libctpl-doc 0.3.3.dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CtplEval</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="CTPL Reference Manual">
<link rel="up" href="ch02.html" title="API reference">
<link rel="prev" href="ctpl-CtplParser.html" title="CtplParser">
<link rel="next" href="ctpl-Generic-IO.html" title="Generic IO">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ctpl-CtplParser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">CTPL Reference Manual</th>
<td><a accesskey="n" href="ctpl-Generic-IO.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#ctpl-CtplEval.synopsis" class="shortcut">Top</a>
|
<a href="#ctpl-CtplEval.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="ctpl-CtplEval"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="ctpl-CtplEval.top_of_page"></a>CtplEval</span></h2>
<p>CtplEval — Expression evaluation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="ctpl-CtplEval.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <ctpl/ctpl.h>
#define <a class="link" href="ctpl-CtplEval.html#CTPL-EVAL-ERROR:CAPS" title="CTPL_EVAL_ERROR">CTPL_EVAL_ERROR</a>
enum <a class="link" href="ctpl-CtplEval.html#CtplEvalError" title="enum CtplEvalError">CtplEvalError</a>;
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="ctpl-CtplEval.html#ctpl-eval-value" title="ctpl_eval_value ()">ctpl_eval_value</a> (<em class="parameter"><code>const <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> *expr</code></em>,
<em class="parameter"><code><a class="link" href="ctpl-CtplEnviron.html#CtplEnviron" title="CtplEnviron"><span class="type">CtplEnviron</span></a> *env</code></em>,
<em class="parameter"><code><a class="link" href="ctpl-CtplValue.html#CtplValue" title="struct CtplValue"><span class="type">CtplValue</span></a> *value</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="ctpl-CtplEval.html#ctpl-eval-bool" title="ctpl_eval_bool ()">ctpl_eval_bool</a> (<em class="parameter"><code>const <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> *expr</code></em>,
<em class="parameter"><code><a class="link" href="ctpl-CtplEnviron.html#CtplEnviron" title="CtplEnviron"><span class="type">CtplEnviron</span></a> *env</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *result</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="ctpl-CtplEval.description"></a><h2>Description</h2>
<p>
Computes a <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> against a <a class="link" href="ctpl-CtplEnviron.html#CtplEnviron" title="CtplEnviron"><span class="type">CtplEnviron</span></a>. It is the equivalent of
<a class="link" href="ctpl-CtplParser.html" title="CtplParser">the parser</a> for expressions.
</p>
<p>
Theses functions computes an expressions and flattens it to a single value:
the result.
To evaluate an expression, use <a class="link" href="ctpl-CtplEval.html#ctpl-eval-value" title="ctpl_eval_value ()"><code class="function">ctpl_eval_value()</code></a>. You can evaluate an
expression to a boolean with <a class="link" href="ctpl-CtplEval.html#ctpl-eval-bool" title="ctpl_eval_bool ()"><code class="function">ctpl_eval_bool()</code></a>.
</p>
</div>
<div class="refsect1">
<a name="ctpl-CtplEval.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="CTPL-EVAL-ERROR:CAPS"></a><h3>CTPL_EVAL_ERROR</h3>
<pre class="programlisting">#define CTPL_EVAL_ERROR (ctpl_eval_error_quark ())
</pre>
<p>
Error domain of CtplEval.
</p>
</div>
<hr>
<div class="refsect2">
<a name="CtplEvalError"></a><h3>enum CtplEvalError</h3>
<pre class="programlisting">typedef enum _CtplEvalError
{
CTPL_EVAL_ERROR_INVALID_OPERAND,
CTPL_EVAL_ERROR_SYMBOL_NOT_FOUND,
CTPL_EVAL_ERROR_FAILED
} CtplEvalError;
</pre>
<p>
Error codes that eval functions can throw, from the <a class="link" href="ctpl-CtplEval.html#CTPL-EVAL-ERROR:CAPS" title="CTPL_EVAL_ERROR"><code class="literal">CTPL_EVAL_ERROR</code></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="CTPL-EVAL-ERROR-INVALID-OPERAND:CAPS"></a><span class="term"><code class="literal">CTPL_EVAL_ERROR_INVALID_OPERAND</code></span></p></td>
<td>An operand is incompatible with is usage.
</td>
</tr>
<tr>
<td><p><a name="CTPL-EVAL-ERROR-SYMBOL-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">CTPL_EVAL_ERROR_SYMBOL_NOT_FOUND</code></span></p></td>
<td>A symbol cannot be found in the
environment.
</td>
</tr>
<tr>
<td><p><a name="CTPL-EVAL-ERROR-FAILED:CAPS"></a><span class="term"><code class="literal">CTPL_EVAL_ERROR_FAILED</code></span></p></td>
<td>An error occurred without any precision on what
failed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ctpl-eval-value"></a><h3>ctpl_eval_value ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> ctpl_eval_value (<em class="parameter"><code>const <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> *expr</code></em>,
<em class="parameter"><code><a class="link" href="ctpl-CtplEnviron.html#CtplEnviron" title="CtplEnviron"><span class="type">CtplEnviron</span></a> *env</code></em>,
<em class="parameter"><code><a class="link" href="ctpl-CtplValue.html#CtplValue" title="struct CtplValue"><span class="type">CtplValue</span></a> *value</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Computes the given <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> with the environ <em class="parameter"><code>env</code></em>, storing the resutl
in <em class="parameter"><code>value</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expr</code></em> :</span></p></td>
<td>The <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> to evaluate</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>The expression's environment, where lookup symbols</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>
<a class="link" href="ctpl-CtplValue.html#CtplValue" title="struct CtplValue"><span class="type">CtplValue</span></a> where store the evaluation result on success</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore them</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.2</p>
</div>
<hr>
<div class="refsect2">
<a name="ctpl-eval-bool"></a><h3>ctpl_eval_bool ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> ctpl_eval_bool (<em class="parameter"><code>const <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> *expr</code></em>,
<em class="parameter"><code><a class="link" href="ctpl-CtplEnviron.html#CtplEnviron" title="CtplEnviron"><span class="type">CtplEnviron</span></a> *env</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *result</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Computes the given expression to a boolean.
Computing to a boolean means computing the expression's value and then check
if this value should be considered as false or true.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>expr</code></em> :</span></p></td>
<td>The <a class="link" href="ctpl-CtplToken.html#CtplTokenExpr" title="CtplTokenExpr"><span class="type">CtplTokenExpr</span></a> to evaluate</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>The expression's environment, where lookup symbols</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>Return location for the expression result,
or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore them</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.2</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.17</div>
</body>
</html>
|