1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>OrcDebug</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="Orc Reference Manual">
8 <link rel="up" href="ch03.html" title="Extension API">
9 <link rel="prev" href="ch03.html" title="Extension API">
10 <link rel="next" href="orc-OrcOpcode.html" title="OrcOpcode">
11 <meta name="generator" content="GTK-Doc V1.14 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="ch03.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Orc Reference Manual</th>
21 <td><a accesskey="n" href="orc-OrcOpcode.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#orc-OrcDebug.synopsis" class="shortcut">Top</a>
26 <a href="#orc-OrcDebug.description" class="shortcut">Description</a>
29 <div class="refentry" title="OrcDebug">
30 <a name="orc-OrcDebug"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="orc-OrcDebug.top_of_page"></a>OrcDebug</span></h2>
34 <p>OrcDebug — Printing and formatting debug information</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv" title="Synopsis">
39 <a name="orc-OrcDebug.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">enum <a class="link" href="orc-OrcDebug.html#OrcDebugLevel" title="enum OrcDebugLevel">OrcDebugLevel</a>;
41 <span class="returnvalue">void</span> (<a class="link" href="orc-OrcDebug.html#OrcDebugPrintFunc" title="OrcDebugPrintFunc ()">*OrcDebugPrintFunc</a>) (<em class="parameter"><code><span class="type">int</span> level</code></em>,
42 <em class="parameter"><code>const <span class="type">char</span> *file</code></em>,
43 <em class="parameter"><code>const <span class="type">char</span> *func</code></em>,
44 <em class="parameter"><code><span class="type">int</span> line</code></em>,
45 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
46 <em class="parameter"><code><span class="type">va_list</span> varargs</code></em>);
47 #define <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-PRINT:CAPS" title="ORC_DEBUG_PRINT()">ORC_DEBUG_PRINT</a> (level,
49 #define <a class="link" href="orc-OrcDebug.html#ORC-ERROR:CAPS" title="ORC_ERROR()">ORC_ERROR</a> (...)
50 #define <a class="link" href="orc-OrcDebug.html#ORC-WARNING:CAPS" title="ORC_WARNING()">ORC_WARNING</a> (...)
51 #define <a class="link" href="orc-OrcDebug.html#ORC-INFO:CAPS" title="ORC_INFO()">ORC_INFO</a> (...)
52 #define <a class="link" href="orc-OrcDebug.html#ORC-DEBUG:CAPS" title="ORC_DEBUG()">ORC_DEBUG</a> (...)
53 #define <a class="link" href="orc-OrcDebug.html#ORC-LOG:CAPS" title="ORC_LOG()">ORC_LOG</a> (...)
54 #define <a class="link" href="orc-OrcDebug.html#ORC-FUNCTION:CAPS" title="ORC_FUNCTION">ORC_FUNCTION</a>
55 <span class="returnvalue">int</span> <a class="link" href="orc-OrcDebug.html#orc-debug-get-level" title="orc_debug_get_level ()">orc_debug_get_level</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
56 <span class="returnvalue">void</span> <a class="link" href="orc-OrcDebug.html#orc-debug-print" title="orc_debug_print ()">orc_debug_print</a> (<em class="parameter"><code><span class="type">int</span> level</code></em>,
57 <em class="parameter"><code>const <span class="type">char</span> *file</code></em>,
58 <em class="parameter"><code>const <span class="type">char</span> *func</code></em>,
59 <em class="parameter"><code><span class="type">int</span> line</code></em>,
60 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
61 <em class="parameter"><code>...</code></em>);
62 <span class="returnvalue">void</span> <a class="link" href="orc-OrcDebug.html#orc-debug-set-level" title="orc_debug_set_level ()">orc_debug_set_level</a> (<em class="parameter"><code><span class="type">int</span> level</code></em>);
63 <span class="returnvalue">void</span> <a class="link" href="orc-OrcDebug.html#orc-debug-set-print-function" title="orc_debug_set_print_function ()">orc_debug_set_print_function</a> (<em class="parameter"><code><a class="link" href="orc-OrcDebug.html#OrcDebugPrintFunc" title="OrcDebugPrintFunc ()"><span class="type">OrcDebugPrintFunc</span></a> func</code></em>);
66 <div class="refsect1" title="Description">
67 <a name="orc-OrcDebug.description"></a><h2>Description</h2>
69 <div class="refsect1" title="Details">
70 <a name="orc-OrcDebug.details"></a><h2>Details</h2>
71 <div class="refsect2" title="enum OrcDebugLevel">
72 <a name="OrcDebugLevel"></a><h3>enum OrcDebugLevel</h3>
73 <pre class="programlisting">typedef enum {
83 Enumeration describing debug levels in Orc.
85 <div class="variablelist"><table border="0">
86 <col align="left" valign="top">
89 <td><p><a name="ORC-DEBUG-NONE:CAPS"></a><span class="term"><code class="literal">ORC_DEBUG_NONE</code></span></p></td>
90 <td>No debugging. Used to disable debugging output.
94 <td><p><a name="ORC-DEBUG-ERROR:CAPS"></a><span class="term"><code class="literal">ORC_DEBUG_ERROR</code></span></p></td>
95 <td>The level for messages indicating that an error
96 has occurred that causes Orc to produce incorrect results. Also
97 used temporarily by developers for testing code.
101 <td><p><a name="ORC-DEBUG-WARNING:CAPS"></a><span class="term"><code class="literal">ORC_DEBUG_WARNING</code></span></p></td>
102 <td>Messages at this level indicate something has
103 occurred that a developer looking into an application problem may
108 <td><p><a name="ORC-DEBUG-INFO:CAPS"></a><span class="term"><code class="literal">ORC_DEBUG_INFO</code></span></p></td>
109 <td>Messages at this level provide high-level
110 information about Orc internals.
114 <td><p><a name="ORC-DEBUG-DEBUG:CAPS"></a><span class="term"><code class="literal">ORC_DEBUG_DEBUG</code></span></p></td>
115 <td>The default level for logging messages.
119 <td><p><a name="ORC-DEBUG-LOG:CAPS"></a><span class="term"><code class="literal">ORC_DEBUG_LOG</code></span></p></td>
120 <td>The level for messages that probably don't need to
128 <div class="refsect2" title="OrcDebugPrintFunc ()">
129 <a name="OrcDebugPrintFunc"></a><h3>OrcDebugPrintFunc ()</h3>
130 <pre class="programlisting"><span class="returnvalue">void</span> (*OrcDebugPrintFunc) (<em class="parameter"><code><span class="type">int</span> level</code></em>,
131 <em class="parameter"><code>const <span class="type">char</span> *file</code></em>,
132 <em class="parameter"><code>const <span class="type">char</span> *func</code></em>,
133 <em class="parameter"><code><span class="type">int</span> line</code></em>,
134 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
135 <em class="parameter"><code><span class="type">va_list</span> varargs</code></em>);</pre>
137 Typedef describing functions that can be registered using
138 <a class="link" href="orc-OrcDebug.html#orc-debug-set-print-function" title="orc_debug_set_print_function ()"><code class="function">orc_debug_set_print_function()</code></a> so that it is called to
139 print debugging messages.
141 <div class="variablelist"><table border="0">
142 <col align="left" valign="top">
145 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
150 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
151 <td>name of the file where the debug message occurs
155 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
156 <td>name of the function where the debug message occurs
160 <td><p><span class="term"><em class="parameter"><code>line</code></em> :</span></p></td>
161 <td>line in the file where the debug message occurs
165 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
170 <td><p><span class="term"><em class="parameter"><code>varargs</code></em> :</span></p></td>
171 <td>varargs for the printf format
178 <div class="refsect2" title="ORC_DEBUG_PRINT()">
179 <a name="ORC-DEBUG-PRINT:CAPS"></a><h3>ORC_DEBUG_PRINT()</h3>
180 <pre class="programlisting">#define ORC_DEBUG_PRINT(level, ...)</pre>
182 Macro to call <a class="link" href="orc-OrcDebug.html#orc-debug-print" title="orc_debug_print ()"><code class="function">orc_debug_print()</code></a> with the correct values for
183 the name of the source file, line of source file, and function.
185 <div class="variablelist"><table border="0">
186 <col align="left" valign="top">
189 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
190 <td>debug level of message
194 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
195 <td>printf-style format and arguments
202 <div class="refsect2" title="ORC_ERROR()">
203 <a name="ORC-ERROR:CAPS"></a><h3>ORC_ERROR()</h3>
204 <pre class="programlisting">#define ORC_ERROR(...) ORC_DEBUG_PRINT(ORC_DEBUG_ERROR, __VA_ARGS__)
207 Macro to call <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-PRINT:CAPS" title="ORC_DEBUG_PRINT()"><code class="function">ORC_DEBUG_PRINT()</code></a> with a level of <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-ERROR:CAPS"><span class="type">ORC_DEBUG_ERROR</span></a>.
209 <div class="variablelist"><table border="0">
210 <col align="left" valign="top">
212 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
213 <td>printf-style format and arguments
219 <div class="refsect2" title="ORC_WARNING()">
220 <a name="ORC-WARNING:CAPS"></a><h3>ORC_WARNING()</h3>
221 <pre class="programlisting">#define ORC_WARNING(...) ORC_DEBUG_PRINT(ORC_DEBUG_WARNING, __VA_ARGS__)
224 Macro to call <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-PRINT:CAPS" title="ORC_DEBUG_PRINT()"><code class="function">ORC_DEBUG_PRINT()</code></a> with a level of <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-WARNING:CAPS"><span class="type">ORC_DEBUG_WARNING</span></a>.
226 <div class="variablelist"><table border="0">
227 <col align="left" valign="top">
229 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
230 <td>printf-style format and arguments
236 <div class="refsect2" title="ORC_INFO()">
237 <a name="ORC-INFO:CAPS"></a><h3>ORC_INFO()</h3>
238 <pre class="programlisting">#define ORC_INFO(...) ORC_DEBUG_PRINT(ORC_DEBUG_INFO, __VA_ARGS__)
241 Macro to call <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-PRINT:CAPS" title="ORC_DEBUG_PRINT()"><code class="function">ORC_DEBUG_PRINT()</code></a> with a level of <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-INFO:CAPS"><span class="type">ORC_DEBUG_INFO</span></a>.
243 <div class="variablelist"><table border="0">
244 <col align="left" valign="top">
246 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
247 <td>printf-style format and arguments
253 <div class="refsect2" title="ORC_DEBUG()">
254 <a name="ORC-DEBUG:CAPS"></a><h3>ORC_DEBUG()</h3>
255 <pre class="programlisting">#define ORC_DEBUG(...) ORC_DEBUG_PRINT(ORC_DEBUG_DEBUG, __VA_ARGS__)
258 Macro to call <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-PRINT:CAPS" title="ORC_DEBUG_PRINT()"><code class="function">ORC_DEBUG_PRINT()</code></a> with a level of <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-DEBUG:CAPS"><span class="type">ORC_DEBUG_DEBUG</span></a>.
260 <div class="variablelist"><table border="0">
261 <col align="left" valign="top">
263 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
264 <td>printf-style format and arguments
270 <div class="refsect2" title="ORC_LOG()">
271 <a name="ORC-LOG:CAPS"></a><h3>ORC_LOG()</h3>
272 <pre class="programlisting">#define ORC_LOG(...) ORC_DEBUG_PRINT(ORC_DEBUG_LOG, __VA_ARGS__)
275 Macro to call <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-PRINT:CAPS" title="ORC_DEBUG_PRINT()"><code class="function">ORC_DEBUG_PRINT()</code></a> with a level of <a class="link" href="orc-OrcDebug.html#ORC-DEBUG-LOG:CAPS"><span class="type">ORC_DEBUG_LOG</span></a>.
277 <div class="variablelist"><table border="0">
278 <col align="left" valign="top">
280 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
281 <td>printf-style format and arguments
287 <div class="refsect2" title="ORC_FUNCTION">
288 <a name="ORC-FUNCTION:CAPS"></a><h3>ORC_FUNCTION</h3>
289 <pre class="programlisting">#define ORC_FUNCTION</pre>
291 Internal macro that points to __PRETTY_FUNCTION__ or __func__
292 if the former is not available.
296 <div class="refsect2" title="orc_debug_get_level ()">
297 <a name="orc-debug-get-level"></a><h3>orc_debug_get_level ()</h3>
298 <pre class="programlisting"><span class="returnvalue">int</span> orc_debug_get_level (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
300 Gets the current debug level.
302 <div class="variablelist"><table border="0">
303 <col align="left" valign="top">
305 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
306 <td> the current debug level
312 <div class="refsect2" title="orc_debug_print ()">
313 <a name="orc-debug-print"></a><h3>orc_debug_print ()</h3>
314 <pre class="programlisting"><span class="returnvalue">void</span> orc_debug_print (<em class="parameter"><code><span class="type">int</span> level</code></em>,
315 <em class="parameter"><code>const <span class="type">char</span> *file</code></em>,
316 <em class="parameter"><code>const <span class="type">char</span> *func</code></em>,
317 <em class="parameter"><code><span class="type">int</span> line</code></em>,
318 <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
319 <em class="parameter"><code>...</code></em>);</pre>
322 <div class="variablelist"><table border="0">
323 <col align="left" valign="top">
326 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
331 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
336 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
341 <td><p><span class="term"><em class="parameter"><code>line</code></em> :</span></p></td>
346 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
351 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
359 <div class="refsect2" title="orc_debug_set_level ()">
360 <a name="orc-debug-set-level"></a><h3>orc_debug_set_level ()</h3>
361 <pre class="programlisting"><span class="returnvalue">void</span> orc_debug_set_level (<em class="parameter"><code><span class="type">int</span> level</code></em>);</pre>
363 Sets the current debug level.
365 <div class="variablelist"><table border="0">
366 <col align="left" valign="top">
368 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
369 <td>the new debug level
375 <div class="refsect2" title="orc_debug_set_print_function ()">
376 <a name="orc-debug-set-print-function"></a><h3>orc_debug_set_print_function ()</h3>
377 <pre class="programlisting"><span class="returnvalue">void</span> orc_debug_set_print_function (<em class="parameter"><code><a class="link" href="orc-OrcDebug.html#OrcDebugPrintFunc" title="OrcDebugPrintFunc ()"><span class="type">OrcDebugPrintFunc</span></a> func</code></em>);</pre>
379 Sets the function to call when outputting debugging information.
380 A value of NULL for <em class="parameter"><code>func</code></em> will restore the default handler,
381 which prints debugging information to stderr.
383 <div class="variablelist"><table border="0">
384 <col align="left" valign="top">
386 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
387 <td>the function to call
396 Generated by GTK-Doc V1.14</div>