ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = girepository giscanner tools gir tests
+SUBDIRS = girepository giscanner tools gir tests examples
DIST_SUBDIRS = m4 $(SUBDIRS)
man_MANS = \
tests/scanner/Makefile
tests/repository/Makefile
tests/everything/Makefile
+examples/Makefile
docs/Makefile
docs/reference/Makefile
gobject-introspection-1.0.pc])
--- /dev/null
+noinst_PROGRAMS = glib-print
+
+glib_print_SOURCES = glib-print.c
+glib_print_CFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
+glib_print_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
--- /dev/null
+#include <girepository.h>
+
+int main(void)
+{
+ GIRepository *repository;
+ GError *error = NULL;
+ GIBaseInfo *base_info;
+ GArgument in_args[5];
+ GArgument 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);
+ 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");
+ 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 GArgument*)&in_args,
+ 5,
+ NULL,
+ 0,
+ &retval,
+ &error)) {
+ g_error("ERROR: %s\n", error->message);
+ return 1;
+ }
+
+ return 0;
+}