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>girffi: GObject Introspection Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="GObject Introspection Reference Manual">
8 <link rel="up" href="ch03.html" title="TODO">
9 <link rel="prev" href="ch03.html" title="TODO">
10 <link rel="next" href="gi-gir-reference.html" title="The GIR XML format">
11 <meta name="generator" content="GTK-Doc V1.25.1 (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="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18 <a href="#gi-girffi.description" class="shortcut">Description</a></span>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ch03.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="ch03.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="gi-gir-reference.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
25 <div class="refentry">
26 <a name="gi-girffi"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
29 <h2><span class="refentrytitle"><a name="gi-girffi.top_of_page"></a>girffi</span></h2>
32 <td class="gallery_image" valign="top" align="right"></td>
34 <div class="refsect1">
35 <a name="gi-girffi.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
43 <td class="function_type">
44 <span class="returnvalue">void</span>
46 <td class="function_name">
47 <span class="c_punctuation">(</span><a class="link" href="gi-girffi.html#GIFFIClosureCallback" title="GIFFIClosureCallback ()">*GIFFIClosureCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
51 <td class="function_type">
52 <span class="returnvalue">ffi_type</span> *
54 <td class="function_name">
55 <a class="link" href="gi-girffi.html#gi-type-tag-get-ffi-type" title="gi_type_tag_get_ffi_type ()">gi_type_tag_get_ffi_type</a> <span class="c_punctuation">()</span>
59 <td class="function_type">
60 <span class="returnvalue">ffi_type</span> *
62 <td class="function_name">
63 <a class="link" href="gi-girffi.html#g-type-info-get-ffi-type" title="g_type_info_get_ffi_type ()">g_type_info_get_ffi_type</a> <span class="c_punctuation">()</span>
67 <td class="function_type">
68 <span class="returnvalue">void</span>
70 <td class="function_name">
71 <a class="link" href="gi-girffi.html#gi-type-info-extract-ffi-return-value" title="gi_type_info_extract_ffi_return_value ()">gi_type_info_extract_ffi_return_value</a> <span class="c_punctuation">()</span>
75 <td class="function_type">
76 <span class="returnvalue">gboolean</span>
78 <td class="function_name">
79 <a class="link" href="gi-girffi.html#g-function-info-prep-invoker" title="g_function_info_prep_invoker ()">g_function_info_prep_invoker</a> <span class="c_punctuation">()</span>
83 <td class="function_type">
84 <span class="returnvalue">gboolean</span>
86 <td class="function_name">
87 <a class="link" href="gi-girffi.html#g-function-invoker-new-for-address" title="g_function_invoker_new_for_address ()">g_function_invoker_new_for_address</a> <span class="c_punctuation">()</span>
91 <td class="function_type">
92 <span class="returnvalue">void</span>
94 <td class="function_name">
95 <a class="link" href="gi-girffi.html#g-function-invoker-destroy" title="g_function_invoker_destroy ()">g_function_invoker_destroy</a> <span class="c_punctuation">()</span>
99 <td class="function_type">
100 <span class="returnvalue">ffi_closure</span> *
102 <td class="function_name">
103 <a class="link" href="gi-girffi.html#g-callable-info-prepare-closure" title="g_callable_info_prepare_closure ()">g_callable_info_prepare_closure</a> <span class="c_punctuation">()</span>
107 <td class="function_type">
108 <span class="returnvalue">void</span>
110 <td class="function_name">
111 <a class="link" href="gi-girffi.html#g-callable-info-free-closure" title="g_callable_info_free_closure ()">g_callable_info_free_closure</a> <span class="c_punctuation">()</span>
117 <div class="refsect1">
118 <a name="gi-girffi.other"></a><h2>Types and Values</h2>
119 <div class="informaltable"><table class="informaltable" width="100%" border="0">
121 <col width="150px" class="name">
122 <col class="description">
126 <td class="datatype_keyword">struct</td>
127 <td class="function_name"><a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker">GIFunctionInvoker</a></td>
130 <td class="typedef_keyword">typedef</td>
131 <td class="function_name"><a class="link" href="gi-girffi.html#GIFFIReturnValue" title="GIFFIReturnValue">GIFFIReturnValue</a></td>
136 <div class="refsect1">
137 <a name="gi-girffi.description"></a><h2>Description</h2>
140 <div class="refsect1">
141 <a name="gi-girffi.functions_details"></a><h2>Functions</h2>
142 <div class="refsect2">
143 <a name="GIFFIClosureCallback"></a><h3>GIFFIClosureCallback ()</h3>
144 <pre class="programlisting"><span class="returnvalue">void</span>
145 <span class="c_punctuation">(</span>*GIFFIClosureCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">ffi_cif</span> *Param1</code></em>,
146 <em class="parameter"><code><span class="type">void</span> *Param2</code></em>,
147 <em class="parameter"><code><span class="type">void</span> **Param3</code></em>,
148 <em class="parameter"><code><span class="type">void</span> *Param4</code></em>);</pre>
150 <div class="refsect3">
151 <a name="GIFFIClosureCallback.parameters"></a><h4>Parameters</h4>
152 <div class="informaltable"><table class="informaltable" width="100%" border="0">
154 <col width="150px" class="parameters_name">
155 <col class="parameters_description">
156 <col width="200px" class="parameters_annotations">
160 <td class="parameter_name"><p>Param1</p></td>
161 <td class="parameter_description"><p>TODO</p></td>
162 <td class="parameter_annotations"> </td>
165 <td class="parameter_name"><p>Param2</p></td>
166 <td class="parameter_description"><p>TODO</p></td>
167 <td class="parameter_annotations"> </td>
170 <td class="parameter_name"><p>Param3</p></td>
171 <td class="parameter_description"><p>TODO</p></td>
172 <td class="parameter_annotations"> </td>
175 <td class="parameter_name"><p>Param4</p></td>
176 <td class="parameter_description"><p>TODO</p></td>
177 <td class="parameter_annotations"> </td>
184 <div class="refsect2">
185 <a name="gi-type-tag-get-ffi-type"></a><h3>gi_type_tag_get_ffi_type ()</h3>
186 <pre class="programlisting"><span class="returnvalue">ffi_type</span> *
187 gi_type_tag_get_ffi_type (<em class="parameter"><code><a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="type">GITypeTag</span></a> type_tag</code></em>,
188 <em class="parameter"><code><span class="type">gboolean</span> is_pointer</code></em>);</pre>
190 <div class="refsect3">
191 <a name="gi-type-tag-get-ffi-type.parameters"></a><h4>Parameters</h4>
192 <div class="informaltable"><table class="informaltable" width="100%" border="0">
194 <col width="150px" class="parameters_name">
195 <col class="parameters_description">
196 <col width="200px" class="parameters_annotations">
200 <td class="parameter_name"><p>type_tag</p></td>
201 <td class="parameter_description"><p>A <a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="type">GITypeTag</span></a></p></td>
202 <td class="parameter_annotations"> </td>
205 <td class="parameter_name"><p>is_pointer</p></td>
206 <td class="parameter_description"><p>Whether or not this is a pointer type</p></td>
207 <td class="parameter_annotations"> </td>
212 <div class="refsect3">
213 <a name="gi-type-tag-get-ffi-type.returns"></a><h4>Returns</h4>
214 <p> A <span class="type">ffi_type</span> corresponding to the platform default C ABI for <em class="parameter"><code>tag</code></em>
215 and <em class="parameter"><code>is_pointer</code></em>
220 <div class="refsect2">
221 <a name="g-type-info-get-ffi-type"></a><h3>g_type_info_get_ffi_type ()</h3>
222 <pre class="programlisting"><span class="returnvalue">ffi_type</span> *
223 g_type_info_get_ffi_type (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
225 <div class="refsect3">
226 <a name="g-type-info-get-ffi-type.parameters"></a><h4>Parameters</h4>
227 <div class="informaltable"><table class="informaltable" width="100%" border="0">
229 <col width="150px" class="parameters_name">
230 <col class="parameters_description">
231 <col width="200px" class="parameters_annotations">
234 <td class="parameter_name"><p>info</p></td>
235 <td class="parameter_description"><p>A <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a></p></td>
236 <td class="parameter_annotations"> </td>
240 <div class="refsect3">
241 <a name="g-type-info-get-ffi-type.returns"></a><h4>Returns</h4>
242 <p> A <span class="type">ffi_type</span> corresponding to the platform default C ABI for <em class="parameter"><code>info</code></em>
247 <div class="refsect2">
248 <a name="gi-type-info-extract-ffi-return-value"></a><h3>gi_type_info_extract_ffi_return_value ()</h3>
249 <pre class="programlisting"><span class="returnvalue">void</span>
250 gi_type_info_extract_ffi_return_value (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *return_info</code></em>,
251 <em class="parameter"><code><a class="link" href="gi-girffi.html#GIFFIReturnValue" title="GIFFIReturnValue"><span class="type">GIFFIReturnValue</span></a> *ffi_value</code></em>,
252 <em class="parameter"><code><a class="link" href="gi-common-types.html#GIArgument" title="GIArgument"><span class="type">GIArgument</span></a> *arg</code></em>);</pre>
253 <p>Extract the correct bits from an ffi_arg return value into
254 GIArgument: https://bugzilla.gnome.org/show_bug.cgi?id=665152</p>
255 <p>Also see <span class="citerefentry"><span class="refentrytitle">ffi_call</span>(3)</span></p>
256 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>the storage requirements for return values are "special".</p></li></ul></div>
257 <div class="refsect3">
258 <a name="gi-type-info-extract-ffi-return-value.parameters"></a><h4>Parameters</h4>
259 <div class="informaltable"><table class="informaltable" width="100%" border="0">
261 <col width="150px" class="parameters_name">
262 <col class="parameters_description">
263 <col width="200px" class="parameters_annotations">
267 <td class="parameter_name"><p>return_info</p></td>
268 <td class="parameter_description"><p>TODO</p></td>
269 <td class="parameter_annotations"> </td>
272 <td class="parameter_name"><p>ffi_value</p></td>
273 <td class="parameter_description"><p>TODO</p></td>
274 <td class="parameter_annotations"> </td>
277 <td class="parameter_name"><p>arg</p></td>
278 <td class="parameter_description"><p> TODO. </p></td>
279 <td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
286 <div class="refsect2">
287 <a name="g-function-info-prep-invoker"></a><h3>g_function_info_prep_invoker ()</h3>
288 <pre class="programlisting"><span class="returnvalue">gboolean</span>
289 g_function_info_prep_invoker (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>,
290 <em class="parameter"><code><a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker"><span class="type">GIFunctionInvoker</span></a> *invoker</code></em>,
291 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
292 <p>Initialize the caller-allocated <em class="parameter"><code>invoker</code></em>
293 structure with a cache
294 of information needed to invoke the C function corresponding to
295 <em class="parameter"><code>info</code></em>
296 with the platform's default ABI.</p>
297 <p>A primary intent of this function is that a dynamic structure allocated
298 by a language binding could contain a <a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker"><span class="type">GIFunctionInvoker</span></a> structure
299 inside the binding's function mapping.</p>
300 <div class="refsect3">
301 <a name="g-function-info-prep-invoker.parameters"></a><h4>Parameters</h4>
302 <div class="informaltable"><table class="informaltable" width="100%" border="0">
304 <col width="150px" class="parameters_name">
305 <col class="parameters_description">
306 <col width="200px" class="parameters_annotations">
310 <td class="parameter_name"><p>info</p></td>
311 <td class="parameter_description"><p>A <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a></p></td>
312 <td class="parameter_annotations"> </td>
315 <td class="parameter_name"><p>invoker</p></td>
316 <td class="parameter_description"><p>Output invoker structure</p></td>
317 <td class="parameter_annotations"> </td>
320 <td class="parameter_name"><p>error</p></td>
321 <td class="parameter_description"><p>A <span class="type">GError</span></p></td>
322 <td class="parameter_annotations"> </td>
327 <div class="refsect3">
328 <a name="g-function-info-prep-invoker.returns"></a><h4>Returns</h4>
329 <p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> otherwise with <em class="parameter"><code>error</code></em>
334 <div class="refsect2">
335 <a name="g-function-invoker-new-for-address"></a><h3>g_function_invoker_new_for_address ()</h3>
336 <pre class="programlisting"><span class="returnvalue">gboolean</span>
337 g_function_invoker_new_for_address (<em class="parameter"><code><span class="type">gpointer</span> addr</code></em>,
338 <em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
339 <em class="parameter"><code><a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker"><span class="type">GIFunctionInvoker</span></a> *invoker</code></em>,
340 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
341 <p>Initialize the caller-allocated <em class="parameter"><code>invoker</code></em>
342 structure with a cache
343 of information needed to invoke the C function corresponding to
344 <em class="parameter"><code>info</code></em>
345 with the platform's default ABI.</p>
346 <p>A primary intent of this function is that a dynamic structure allocated
347 by a language binding could contain a <a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker"><span class="type">GIFunctionInvoker</span></a> structure
348 inside the binding's function mapping.</p>
349 <div class="refsect3">
350 <a name="g-function-invoker-new-for-address.parameters"></a><h4>Parameters</h4>
351 <div class="informaltable"><table class="informaltable" width="100%" border="0">
353 <col width="150px" class="parameters_name">
354 <col class="parameters_description">
355 <col width="200px" class="parameters_annotations">
359 <td class="parameter_name"><p>addr</p></td>
360 <td class="parameter_description"><p>The address</p></td>
361 <td class="parameter_annotations"> </td>
364 <td class="parameter_name"><p>info</p></td>
365 <td class="parameter_description"><p>A <a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a></p></td>
366 <td class="parameter_annotations"> </td>
369 <td class="parameter_name"><p>invoker</p></td>
370 <td class="parameter_description"><p>Output invoker structure</p></td>
371 <td class="parameter_annotations"> </td>
374 <td class="parameter_name"><p>error</p></td>
375 <td class="parameter_description"><p>A <span class="type">GError</span></p></td>
376 <td class="parameter_annotations"> </td>
381 <div class="refsect3">
382 <a name="g-function-invoker-new-for-address.returns"></a><h4>Returns</h4>
383 <p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> otherwise with <em class="parameter"><code>error</code></em>
388 <div class="refsect2">
389 <a name="g-function-invoker-destroy"></a><h3>g_function_invoker_destroy ()</h3>
390 <pre class="programlisting"><span class="returnvalue">void</span>
391 g_function_invoker_destroy (<em class="parameter"><code><a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker"><span class="type">GIFunctionInvoker</span></a> *invoker</code></em>);</pre>
392 <p>Release all resources allocated for the internals of <em class="parameter"><code>invoker</code></em>
394 are responsible for freeing any resources allocated for the structure
396 <div class="refsect3">
397 <a name="g-function-invoker-destroy.parameters"></a><h4>Parameters</h4>
398 <div class="informaltable"><table class="informaltable" width="100%" border="0">
400 <col width="150px" class="parameters_name">
401 <col class="parameters_description">
402 <col width="200px" class="parameters_annotations">
405 <td class="parameter_name"><p>invoker</p></td>
406 <td class="parameter_description"><p>A <a class="link" href="gi-girffi.html#GIFunctionInvoker" title="struct GIFunctionInvoker"><span class="type">GIFunctionInvoker</span></a></p></td>
407 <td class="parameter_annotations"> </td>
413 <div class="refsect2">
414 <a name="g-callable-info-prepare-closure"></a><h3>g_callable_info_prepare_closure ()</h3>
415 <pre class="programlisting"><span class="returnvalue">ffi_closure</span> *
416 g_callable_info_prepare_closure (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *callable_info</code></em>,
417 <em class="parameter"><code><span class="type">ffi_cif</span> *cif</code></em>,
418 <em class="parameter"><code><a class="link" href="gi-girffi.html#GIFFIClosureCallback" title="GIFFIClosureCallback ()"><span class="type">GIFFIClosureCallback</span></a> callback</code></em>,
419 <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
420 <p>Prepares a callback for ffi invocation.</p>
421 <div class="refsect3">
422 <a name="g-callable-info-prepare-closure.parameters"></a><h4>Parameters</h4>
423 <div class="informaltable"><table class="informaltable" width="100%" border="0">
425 <col width="150px" class="parameters_name">
426 <col class="parameters_description">
427 <col width="200px" class="parameters_annotations">
431 <td class="parameter_name"><p>callable_info</p></td>
432 <td class="parameter_description"><p>a callable info from a typelib</p></td>
433 <td class="parameter_annotations"> </td>
436 <td class="parameter_name"><p>cif</p></td>
437 <td class="parameter_description"><p>a ffi_cif structure</p></td>
438 <td class="parameter_annotations"> </td>
441 <td class="parameter_name"><p>callback</p></td>
442 <td class="parameter_description"><p>the ffi callback</p></td>
443 <td class="parameter_annotations"> </td>
446 <td class="parameter_name"><p>user_data</p></td>
447 <td class="parameter_description"><p>data to be passed into the callback</p></td>
448 <td class="parameter_annotations"> </td>
453 <div class="refsect3">
454 <a name="g-callable-info-prepare-closure.returns"></a><h4>Returns</h4>
455 <p> the ffi_closure or NULL on error. The return value
456 should be freed by calling <a class="link" href="gi-girffi.html#g-callable-info-free-closure" title="g_callable_info_free_closure ()"><code class="function">g_callable_info_free_closure()</code></a>.</p>
460 <div class="refsect2">
461 <a name="g-callable-info-free-closure"></a><h3>g_callable_info_free_closure ()</h3>
462 <pre class="programlisting"><span class="returnvalue">void</span>
463 g_callable_info_free_closure (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *callable_info</code></em>,
464 <em class="parameter"><code><span class="type">ffi_closure</span> *closure</code></em>);</pre>
465 <p>Frees a ffi_closure returned from <a class="link" href="gi-girffi.html#g-callable-info-prepare-closure" title="g_callable_info_prepare_closure ()"><code class="function">g_callable_info_prepare_closure()</code></a></p>
466 <div class="refsect3">
467 <a name="g-callable-info-free-closure.parameters"></a><h4>Parameters</h4>
468 <div class="informaltable"><table class="informaltable" width="100%" border="0">
470 <col width="150px" class="parameters_name">
471 <col class="parameters_description">
472 <col width="200px" class="parameters_annotations">
476 <td class="parameter_name"><p>callable_info</p></td>
477 <td class="parameter_description"><p>a callable info from a typelib</p></td>
478 <td class="parameter_annotations"> </td>
481 <td class="parameter_name"><p>closure</p></td>
482 <td class="parameter_description"><p>ffi closure</p></td>
483 <td class="parameter_annotations"> </td>
490 <div class="refsect1">
491 <a name="gi-girffi.other_details"></a><h2>Types and Values</h2>
492 <div class="refsect2">
493 <a name="GIFunctionInvoker"></a><h3>struct GIFunctionInvoker</h3>
494 <pre class="programlisting">struct GIFunctionInvoker {
496 gpointer native_address;
500 <div class="refsect3">
501 <a name="GIFunctionInvoker.members"></a><h4>Members</h4>
502 <div class="informaltable"><table class="informaltable" width="100%" border="0">
504 <col width="300px" class="struct_members_name">
505 <col class="struct_members_description">
506 <col width="200px" class="struct_members_annotations">
510 <td class="struct_member_name"><p><span class="type">ffi_cif</span> <em class="structfield"><code><a name="GIFunctionInvoker.cif"></a>cif</code></em>;</p></td>
511 <td class="struct_member_description"><p>the cif</p></td>
512 <td class="struct_member_annotations"> </td>
515 <td class="struct_member_name"><p><span class="type">gpointer</span> <em class="structfield"><code><a name="GIFunctionInvoker.native-address"></a>native_address</code></em>;</p></td>
516 <td class="struct_member_description"><p>the native address</p></td>
517 <td class="struct_member_annotations"> </td>
524 <div class="refsect2">
525 <a name="GIFFIReturnValue"></a><h3>GIFFIReturnValue</h3>
526 <pre class="programlisting">typedef GIArgument GIFFIReturnValue;
533 <hr>Generated by GTK-Doc V1.25.1</div>