Add missing include girffi-private.h
[gnome.gobject-introspection] / girepository / girffi.h
1 /* GObject introspection: Helper functions for ffi integration
2  *
3  * Copyright (C) 2008 Red Hat, Inc
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GIRFFI_H__
22 #define __GIRFFI_H__
23
24 #include <ffi.h>
25 #include "girepository.h"
26 #include "girffi-private.h"
27
28 G_BEGIN_DECLS
29
30 typedef void (*GIFFIClosureCallback) (ffi_cif *,
31                                       void *,
32                                       void **,
33                                       void *);
34
35 typedef struct _GIFunctionInvoker GIFunctionInvoker;
36
37 struct _GIFunctionInvoker {
38   ffi_cif cif;
39   gpointer native_address;
40   
41   gpointer padding[3];
42 };
43
44 ffi_type *    g_type_info_get_ffi_type            (GITypeInfo           *info);
45
46 gboolean      g_function_info_prep_invoker        (GIFunctionInfo       *info,
47                                                    GIFunctionInvoker    *invoker,
48                                                    GError              **error);
49                                                    
50 void          g_function_invoker_destroy          (GIFunctionInvoker    *invoker);
51
52
53 ffi_closure * g_callable_info_prepare_closure     (GICallableInfo       *callable_info,
54                                                    ffi_cif              *cif,
55                                                    GIFFIClosureCallback  callback,
56                                                    gpointer              user_data);
57 void          g_callable_info_free_closure        (GICallableInfo       *callable_info,
58                                                    ffi_closure          *closure);
59
60 G_END_DECLS
61
62 #endif /* __GIRFFI_H__ */