summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMark Doffman <mark.doffman@codethink.co.uk>2014-03-27 20:50:21 +0000
committerMark Doffman <mark.doffman@codethink.co.uk>2014-03-27 20:50:21 +0000
commit68ff94340891f1ae4ea24546acdbbc39c4dcbcd0 (patch)
tree46f02cba671bcb321482c7961acd91aeee57ced5 /examples
parent19da3f81593614198206c45527f973a22cdd621e (diff)
parent89e84d06dffbc732bac26a105244b7270c42e3ec (diff)
downloadgobject-introspection-68ff94340891f1ae4ea24546acdbbc39c4dcbcd0.tar.gz
Merge tag 'GOBJECT_INTROSPECTION_1_39_90' into baserock/markdoffman/1_39_90-mergebaserock/markdoffman/1_39_90-merge
Tag 1_39_90 Conflicts: autogen.sh configure.ac
Diffstat (limited to 'examples')
-rw-r--r--examples/glib-print.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/examples/glib-print.c b/examples/glib-print.c
index f187f76c..4e117d9d 100644
--- a/examples/glib-print.c
+++ b/examples/glib-print.c
@@ -1,46 +1,48 @@
#include <girepository.h>
-int main(void)
+int
+main (void)
{
- GIRepository *repository;
- GError *error = NULL;
- GIBaseInfo *base_info;
- GIArgument in_args[5];
- GIArgument retval;
-
- g_type_init();
-
- repository = g_irepository_get_default();
- g_irepository_require(repository, "GLib", "2.0", 0, &error);
- if (error) {
- g_error("ERROR: %s\n", error->message);
+ GIRepository *repository;
+ GError *error = NULL;
+ GIBaseInfo *base_info;
+ GIArgument in_args[5];
+ GIArgument retval;
+
+ repository = g_irepository_get_default ();
+ g_irepository_require (repository, "GLib", "2.0", 0, &error);
+ if (error)
+ {
+ g_error ("ERROR: %s\n", error->message);
return 1;
}
- base_info = g_irepository_find_by_name(repository, "GLib", "assertion_message");
- if (!base_info) {
- g_error("ERROR: %s\n", "Could not find GLib.warn_message");
+ base_info = g_irepository_find_by_name (repository, "GLib", "assertion_message");
+ if (!base_info)
+ {
+ g_error ("ERROR: %s\n", "Could not find GLib.warn_message");
return 1;
}
- in_args[0].v_pointer = "domain";
- in_args[1].v_pointer = "glib-print.c";
- in_args[2].v_pointer = "30";
- in_args[3].v_pointer = "main";
- in_args[4].v_pointer = "hello world";
-
- if (!g_function_info_invoke ((GIFunctionInfo *)base_info,
- (const GIArgument*)&in_args,
- 5,
- NULL,
- 0,
- &retval,
- &error)) {
- g_error("ERROR: %s\n", error->message);
+ in_args[0].v_pointer = "domain";
+ in_args[1].v_pointer = "glib-print.c";
+ in_args[2].v_pointer = "30";
+ in_args[3].v_pointer = "main";
+ in_args[4].v_pointer = "hello world";
+
+ if (!g_function_info_invoke ((GIFunctionInfo *) base_info,
+ (const GIArgument *) &in_args,
+ 5,
+ NULL,
+ 0,
+ &retval,
+ &error))
+ {
+ g_error ("ERROR: %s\n", error->message);
return 1;
}
- g_base_info_unref (base_info);
+ g_base_info_unref (base_info);
- return 0;
+ return 0;
}