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>GIFunctionInfo</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GObject Introspection Reference Manual">
8 <link rel="up" href="gi-repository-structs.html" title="GIRepository structs">
9 <link rel="prev" href="gi-GIBaseInfo.html" title="GIBaseInfo">
10 <link rel="next" href="gi-GICallableInfo.html" title="GICallableInfo">
11 <meta name="generator" content="GTK-Doc V1.18.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="2">
17 <td><a accesskey="p" href="gi-GIBaseInfo.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gi-repository-structs.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">GObject Introspection Reference Manual</th>
21 <td><a accesskey="n" href="gi-GICallableInfo.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="#gi-GIFunctionInfo.synopsis" class="shortcut">Top</a>
26 <a href="#gi-GIFunctionInfo.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gi-GIFunctionInfo"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gi-GIFunctionInfo.top_of_page"></a>GIFunctionInfo</span></h2>
34 <p>GIFunctionInfo — Struct representing a function</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gi-GIFunctionInfo.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">#define <a class="link" href="gi-GIFunctionInfo.html#GI-IS-FUNCTION-INFO:CAPS" title="GI_IS_FUNCTION_INFO()">GI_IS_FUNCTION_INFO</a> (info)
41 typedef <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo">GIFunctionInfo</a>;
42 enum <a class="link" href="gi-GIFunctionInfo.html#GInvokeError" title="enum GInvokeError">GInvokeError</a>;
43 enum <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfoFlags" title="enum GIFunctionInfoFlags">GIFunctionInfoFlags</a>;
44 #define <a class="link" href="gi-GIFunctionInfo.html#G-INVOKE-ERROR:CAPS" title="G_INVOKE_ERROR">G_INVOKE_ERROR</a>
45 const <span class="returnvalue">gchar</span> * <a class="link" href="gi-GIFunctionInfo.html#g-function-info-get-symbol" title="g_function_info_get_symbol ()">g_function_info_get_symbol</a> (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);
46 <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfoFlags" title="enum GIFunctionInfoFlags"><span class="returnvalue">GIFunctionInfoFlags</span></a> <a class="link" href="gi-GIFunctionInfo.html#g-function-info-get-flags" title="g_function_info_get_flags ()">g_function_info_get_flags</a> (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);
47 <a class="link" href="gi-GIPropertyInfo.html#GIPropertyInfo" title="GIPropertyInfo"><span class="returnvalue">GIPropertyInfo</span></a> * <a class="link" href="gi-GIFunctionInfo.html#g-function-info-get-property" title="g_function_info_get_property ()">g_function_info_get_property</a> (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);
48 <a class="link" href="gi-GIVFuncInfo.html#GIVFuncInfo" title="GIVFuncInfo"><span class="returnvalue">GIVFuncInfo</span></a> * <a class="link" href="gi-GIFunctionInfo.html#g-function-info-get-vfunc" title="g_function_info_get_vfunc ()">g_function_info_get_vfunc</a> (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);
49 <span class="returnvalue">gboolean</span> <a class="link" href="gi-GIFunctionInfo.html#g-function-info-invoke" title="g_function_info_invoke ()">g_function_info_invoke</a> (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>,
50 <em class="parameter"><code>const <span class="type">GIArgument</span> *in_args</code></em>,
51 <em class="parameter"><code><span class="type">int</span> n_in_args</code></em>,
52 <em class="parameter"><code>const <span class="type">GIArgument</span> *out_args</code></em>,
53 <em class="parameter"><code><span class="type">int</span> n_out_args</code></em>,
54 <em class="parameter"><code><span class="type">GIArgument</span> *return_value</code></em>,
55 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);
58 <div class="refsect1">
59 <a name="gi-GIFunctionInfo.description"></a><h2>Description</h2>
61 GIFunctionInfo represents a function, method or constructor.
62 To find out what kind of entity a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> represents, call
63 <a class="link" href="gi-GIFunctionInfo.html#g-function-info-get-flags" title="g_function_info_get_flags ()"><code class="function">g_function_info_get_flags()</code></a>.
66 See also <a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> for information on how to retreive arguments and
71 <div class="refsect1">
72 <a name="gi-gifunctioninfo.struct-hierarchy"></a><h2>Struct hierarchy</h2>
73 <pre class="synopsis">
74 <a class="link" href="gi-GIBaseInfo.html" title="GIBaseInfo">GIBaseInfo</a>
75 +----<a class="link" href="gi-GICallableInfo.html" title="GICallableInfo">GICallableInfo</a>
77 +----<a class="link" href="gi-GISignalInfo.html" title="GISignalInfo">GISignalInfo</a>
78 +----<a class="link" href="gi-GIVFuncInfo.html" title="GIVFuncInfo">GIVFuncInfo</a>
84 <div class="refsect1">
85 <a name="gi-GIFunctionInfo.details"></a><h2>Details</h2>
86 <div class="refsect2">
87 <a name="GI-IS-FUNCTION-INFO:CAPS"></a><h3>GI_IS_FUNCTION_INFO()</h3>
88 <pre class="programlisting">#define GI_IS_FUNCTION_INFO(info)</pre>
91 <div class="refsect2">
92 <a name="GIFunctionInfo"></a><h3>GIFunctionInfo</h3>
93 <pre class="programlisting">typedef GIBaseInfo GIFunctionInfo;
96 Represents a function, eg arguments and return value.
100 <div class="refsect2">
101 <a name="GInvokeError"></a><h3>enum GInvokeError</h3>
102 <pre class="programlisting">typedef enum {
103 G_INVOKE_ERROR_FAILED,
104 G_INVOKE_ERROR_SYMBOL_NOT_FOUND,
105 G_INVOKE_ERROR_ARGUMENT_MISMATCH
109 An error occuring while invoking a function via
110 <a class="link" href="gi-GIFunctionInfo.html#g-function-info-invoke" title="g_function_info_invoke ()"><code class="function">g_function_info_invoke()</code></a>.
112 <div class="variablelist"><table border="0">
113 <col align="left" valign="top">
116 <td><p><a name="G-INVOKE-ERROR-FAILED:CAPS"></a><span class="term"><code class="literal">G_INVOKE_ERROR_FAILED</code></span></p></td>
117 <td>invokation failed, unknown error.
121 <td><p><a name="G-INVOKE-ERROR-SYMBOL-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">G_INVOKE_ERROR_SYMBOL_NOT_FOUND</code></span></p></td>
122 <td>symbol couldn't be found in any of the
123 libraries associated with the typelib of the function.
127 <td><p><a name="G-INVOKE-ERROR-ARGUMENT-MISMATCH:CAPS"></a><span class="term"><code class="literal">G_INVOKE_ERROR_ARGUMENT_MISMATCH</code></span></p></td>
128 <td>the arguments provided didn't match
129 the expected arguments for the functions type signature.
136 <div class="refsect2">
137 <a name="GIFunctionInfoFlags"></a><h3>enum GIFunctionInfoFlags</h3>
138 <pre class="programlisting">typedef enum {
139 GI_FUNCTION_IS_METHOD = 1 << 0,
140 GI_FUNCTION_IS_CONSTRUCTOR = 1 << 1,
141 GI_FUNCTION_IS_GETTER = 1 << 2,
142 GI_FUNCTION_IS_SETTER = 1 << 3,
143 GI_FUNCTION_WRAPS_VFUNC = 1 << 4,
144 GI_FUNCTION_THROWS = 1 << 5
145 } GIFunctionInfoFlags;
148 Flags for a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> struct.
150 <div class="variablelist"><table border="0">
151 <col align="left" valign="top">
154 <td><p><a name="GI-FUNCTION-IS-METHOD:CAPS"></a><span class="term"><code class="literal">GI_FUNCTION_IS_METHOD</code></span></p></td>
159 <td><p><a name="GI-FUNCTION-IS-CONSTRUCTOR:CAPS"></a><span class="term"><code class="literal">GI_FUNCTION_IS_CONSTRUCTOR</code></span></p></td>
160 <td>is a constructor.
164 <td><p><a name="GI-FUNCTION-IS-GETTER:CAPS"></a><span class="term"><code class="literal">GI_FUNCTION_IS_GETTER</code></span></p></td>
165 <td>is a getter of a <a class="link" href="gi-GIPropertyInfo.html#GIPropertyInfo" title="GIPropertyInfo"><span class="type">GIPropertyInfo</span></a>.
169 <td><p><a name="GI-FUNCTION-IS-SETTER:CAPS"></a><span class="term"><code class="literal">GI_FUNCTION_IS_SETTER</code></span></p></td>
170 <td>is a setter of a <a class="link" href="gi-GIPropertyInfo.html#GIPropertyInfo" title="GIPropertyInfo"><span class="type">GIPropertyInfo</span></a>.
174 <td><p><a name="GI-FUNCTION-WRAPS-VFUNC:CAPS"></a><span class="term"><code class="literal">GI_FUNCTION_WRAPS_VFUNC</code></span></p></td>
175 <td>represents a virtual function.
179 <td><p><a name="GI-FUNCTION-THROWS:CAPS"></a><span class="term"><code class="literal">GI_FUNCTION_THROWS</code></span></p></td>
180 <td>the function may throw an error.
187 <div class="refsect2">
188 <a name="G-INVOKE-ERROR:CAPS"></a><h3>G_INVOKE_ERROR</h3>
189 <pre class="programlisting">#define G_INVOKE_ERROR (g_invoke_error_quark ())
193 <div class="refsect2">
194 <a name="g-function-info-get-symbol"></a><h3>g_function_info_get_symbol ()</h3>
195 <pre class="programlisting">const <span class="returnvalue">gchar</span> * g_function_info_get_symbol (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);</pre>
197 Obtain the symbol of the function. The symbol is the name of the
198 exported function, suitable to be used as an argument to
199 <code class="function">g_module_symbol()</code>.
201 <div class="variablelist"><table border="0">
202 <col align="left" valign="top">
205 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
206 <td>a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>
210 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
217 <div class="refsect2">
218 <a name="g-function-info-get-flags"></a><h3>g_function_info_get_flags ()</h3>
219 <pre class="programlisting"><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfoFlags" title="enum GIFunctionInfoFlags"><span class="returnvalue">GIFunctionInfoFlags</span></a> g_function_info_get_flags (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);</pre>
221 Obtain the <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfoFlags" title="enum GIFunctionInfoFlags"><span class="type">GIFunctionInfoFlags</span></a> for the <em class="parameter"><code>info</code></em>.
223 <div class="variablelist"><table border="0">
224 <col align="left" valign="top">
227 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
228 <td>a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>
232 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
239 <div class="refsect2">
240 <a name="g-function-info-get-property"></a><h3>g_function_info_get_property ()</h3>
241 <pre class="programlisting"><a class="link" href="gi-GIPropertyInfo.html#GIPropertyInfo" title="GIPropertyInfo"><span class="returnvalue">GIPropertyInfo</span></a> * g_function_info_get_property (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);</pre>
243 Obtain the property associated with this <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>.
244 Only <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> with the flag <a class="link" href="gi-GIFunctionInfo.html#GI-FUNCTION-IS-GETTER:CAPS"><code class="literal">GI_FUNCTION_IS_GETTER</code></a> or
245 <a class="link" href="gi-GIFunctionInfo.html#GI-FUNCTION-IS-SETTER:CAPS"><code class="literal">GI_FUNCTION_IS_SETTER</code></a> have a property set. For other cases,
246 <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> will be returned.
248 <div class="variablelist"><table border="0">
249 <col align="left" valign="top">
252 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
253 <td>a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>
257 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
258 <td>the property or <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> if not set. Free it with
259 <a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
266 <div class="refsect2">
267 <a name="g-function-info-get-vfunc"></a><h3>g_function_info_get_vfunc ()</h3>
268 <pre class="programlisting"><a class="link" href="gi-GIVFuncInfo.html#GIVFuncInfo" title="GIVFuncInfo"><span class="returnvalue">GIVFuncInfo</span></a> * g_function_info_get_vfunc (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>);</pre>
270 Obtain the virtual function associated with this <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>.
271 Only <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> with the flag <a class="link" href="gi-GIFunctionInfo.html#GI-FUNCTION-WRAPS-VFUNC:CAPS"><code class="literal">GI_FUNCTION_WRAPS_VFUNC</code></a> has
272 a virtual function set. For other cases, <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> will be returned.
274 <div class="variablelist"><table border="0">
275 <col align="left" valign="top">
278 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
279 <td>a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>
283 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
284 <td>the virtual function or <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> if not set.
285 Free it by calling <a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
292 <div class="refsect2">
293 <a name="g-function-info-invoke"></a><h3>g_function_info_invoke ()</h3>
294 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_function_info_invoke (<em class="parameter"><code><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> *info</code></em>,
295 <em class="parameter"><code>const <span class="type">GIArgument</span> *in_args</code></em>,
296 <em class="parameter"><code><span class="type">int</span> n_in_args</code></em>,
297 <em class="parameter"><code>const <span class="type">GIArgument</span> *out_args</code></em>,
298 <em class="parameter"><code><span class="type">int</span> n_out_args</code></em>,
299 <em class="parameter"><code><span class="type">GIArgument</span> *return_value</code></em>,
300 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
302 Invokes the function described in <em class="parameter"><code>info</code></em> with the given
303 arguments. Note that inout parameters must appear in both
304 argument lists. This function uses <code class="function">dlsym()</code> to obtain a pointer
305 to the function, so the library or shared object containing the
306 described function must either be linked to the caller, or must
307 have been <code class="function">g_module_symbol()</code>ed before calling this function.
309 <div class="variablelist"><table border="0">
310 <col align="left" valign="top">
313 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
314 <td>a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> describing the function to invoke</td>
317 <td><p><span class="term"><em class="parameter"><code>in_args</code></em> :</span></p></td>
318 <td>an array of <span class="type">GIArgument</span>s, one for each in
319 parameter of <em class="parameter"><code>info</code></em>. If there are no in parameter, <em class="parameter"><code>in_args</code></em>
320 can be <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
324 <td><p><span class="term"><em class="parameter"><code>n_in_args</code></em> :</span></p></td>
325 <td>the length of the <em class="parameter"><code>in_args</code></em> array</td>
328 <td><p><span class="term"><em class="parameter"><code>out_args</code></em> :</span></p></td>
329 <td>an array of <span class="type">GIArgument</span>s, one for each out
330 parameter of <em class="parameter"><code>info</code></em>. If there are no out parameters, <em class="parameter"><code>out_args</code></em>
331 may be <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
335 <td><p><span class="term"><em class="parameter"><code>n_out_args</code></em> :</span></p></td>
336 <td>the length of the <em class="parameter"><code>out_args</code></em> array</td>
339 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
340 <td>return location for the return value of the
341 function. If the function returns void, <em class="parameter"><code>return_value</code></em> may be
342 <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
346 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
347 <td>return location for detailed error information, or <a href="/src/build/jhbuild/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
351 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
353 <code class="literal">TRUE</code> if the function has been invoked, <code class="literal">FALSE</code> if an
363 Generated by GTK-Doc V1.18.1</div>