Initial commit to Gerrit
[profile/ivi/orc.git] / doc / html / orc-OrcDebug.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
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">
13 </head>
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">
16 <tr valign="middle">
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>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#orc-OrcDebug.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#orc-OrcDebug.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry" title="OrcDebug">
30 <a name="orc-OrcDebug"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
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>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
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,
48                                                          ...)
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>);
64 </pre>
65 </div>
66 <div class="refsect1" title="Description">
67 <a name="orc-OrcDebug.description"></a><h2>Description</h2>
68 </div>
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 {
74   ORC_DEBUG_NONE = 0,
75   ORC_DEBUG_ERROR,
76   ORC_DEBUG_WARNING,
77   ORC_DEBUG_INFO,
78   ORC_DEBUG_DEBUG,
79   ORC_DEBUG_LOG
80 } OrcDebugLevel;
81 </pre>
82 <p>
83 Enumeration describing debug levels in Orc.
84 </p>
85 <div class="variablelist"><table border="0">
86 <col align="left" valign="top">
87 <tbody>
88 <tr>
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.
91 </td>
92 </tr>
93 <tr>
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.
98 </td>
99 </tr>
100 <tr>
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
104   want to know.
105 </td>
106 </tr>
107 <tr>
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.
111 </td>
112 </tr>
113 <tr>
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.
116 </td>
117 </tr>
118 <tr>
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
121   be logged at all.
122 </td>
123 </tr>
124 </tbody>
125 </table></div>
126 </div>
127 <hr>
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>
136 <p>
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.
140 </p>
141 <div class="variablelist"><table border="0">
142 <col align="left" valign="top">
143 <tbody>
144 <tr>
145 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
146 <td>the debug level
147 </td>
148 </tr>
149 <tr>
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
152 </td>
153 </tr>
154 <tr>
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
157 </td>
158 </tr>
159 <tr>
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
162 </td>
163 </tr>
164 <tr>
165 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
166 <td>a printf format
167 </td>
168 </tr>
169 <tr>
170 <td><p><span class="term"><em class="parameter"><code>varargs</code></em> :</span></p></td>
171 <td>varargs for the printf format
172 </td>
173 </tr>
174 </tbody>
175 </table></div>
176 </div>
177 <hr>
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>
181 <p>
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.
184 </p>
185 <div class="variablelist"><table border="0">
186 <col align="left" valign="top">
187 <tbody>
188 <tr>
189 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
190 <td>debug level of message
191 </td>
192 </tr>
193 <tr>
194 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
195 <td>printf-style format and arguments
196 </td>
197 </tr>
198 </tbody>
199 </table></div>
200 </div>
201 <hr>
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__)
205 </pre>
206 <p>
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>.
208 </p>
209 <div class="variablelist"><table border="0">
210 <col align="left" valign="top">
211 <tbody><tr>
212 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
213 <td>printf-style format and arguments
214 </td>
215 </tr></tbody>
216 </table></div>
217 </div>
218 <hr>
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__)
222 </pre>
223 <p>
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>.
225 </p>
226 <div class="variablelist"><table border="0">
227 <col align="left" valign="top">
228 <tbody><tr>
229 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
230 <td>printf-style format and arguments
231 </td>
232 </tr></tbody>
233 </table></div>
234 </div>
235 <hr>
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__)
239 </pre>
240 <p>
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>.
242 </p>
243 <div class="variablelist"><table border="0">
244 <col align="left" valign="top">
245 <tbody><tr>
246 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
247 <td>printf-style format and arguments
248 </td>
249 </tr></tbody>
250 </table></div>
251 </div>
252 <hr>
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__)
256 </pre>
257 <p>
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>.
259 </p>
260 <div class="variablelist"><table border="0">
261 <col align="left" valign="top">
262 <tbody><tr>
263 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
264 <td>printf-style format and arguments
265 </td>
266 </tr></tbody>
267 </table></div>
268 </div>
269 <hr>
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__)
273 </pre>
274 <p>
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>.
276 </p>
277 <div class="variablelist"><table border="0">
278 <col align="left" valign="top">
279 <tbody><tr>
280 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
281 <td>printf-style format and arguments
282 </td>
283 </tr></tbody>
284 </table></div>
285 </div>
286 <hr>
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>
290 <p>
291 Internal macro that points to __PRETTY_FUNCTION__ or __func__
292 if the former is not available.
293 </p>
294 </div>
295 <hr>
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>
299 <p>
300 Gets the current debug level.
301 </p>
302 <div class="variablelist"><table border="0">
303 <col align="left" valign="top">
304 <tbody><tr>
305 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
306 <td> the current debug level
307 </td>
308 </tr></tbody>
309 </table></div>
310 </div>
311 <hr>
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>
320 <p>
321 </p>
322 <div class="variablelist"><table border="0">
323 <col align="left" valign="top">
324 <tbody>
325 <tr>
326 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
327 <td>
328 </td>
329 </tr>
330 <tr>
331 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
332 <td>
333 </td>
334 </tr>
335 <tr>
336 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
337 <td>
338 </td>
339 </tr>
340 <tr>
341 <td><p><span class="term"><em class="parameter"><code>line</code></em> :</span></p></td>
342 <td>
343 </td>
344 </tr>
345 <tr>
346 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
347 <td>
348 </td>
349 </tr>
350 <tr>
351 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
352 <td>
353 </td>
354 </tr>
355 </tbody>
356 </table></div>
357 </div>
358 <hr>
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>
362 <p>
363 Sets the current debug level.
364 </p>
365 <div class="variablelist"><table border="0">
366 <col align="left" valign="top">
367 <tbody><tr>
368 <td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
369 <td>the new debug level
370 </td>
371 </tr></tbody>
372 </table></div>
373 </div>
374 <hr>
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>
378 <p>
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.
382 </p>
383 <div class="variablelist"><table border="0">
384 <col align="left" valign="top">
385 <tbody><tr>
386 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
387 <td>the function to call
388 </td>
389 </tr></tbody>
390 </table></div>
391 </div>
392 </div>
393 </div>
394 <div class="footer">
395 <hr>
396           Generated by GTK-Doc V1.14</div>
397 </body>
398 </html>