Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-17 21:59:48 (GMT)
committer Colin Walters <walters@verbum.org>2009-02-17 21:59:48 (GMT)
commit8a82a34f3ef4d2bcfe4071b4666147359b81a9d6 (patch)
tree52a7bc868c58383b1fb7d1165a05c5858ff48121
parentca778d512f3605b2e177012e26d50720c0a110c5 (diff)
parent926c0ebda82f10f5b6db98f9968764427c0f7aba (diff)
Merge branch 'master' of ssh://walters@git.gnome.org/git/gobject-introspection
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac1
-rw-r--r--examples/Makefile.am5
-rw-r--r--examples/glib-print.c46
-rw-r--r--tests/scanner/Makefile.am2
6 files changed, 55 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index a161504..742cd66 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@ missing
stamp-h1
ylwrap
py-compile
+examples/glib-print
docs/reference/html
docs/reference/xml
gir/GIRepository-2.0.gir
diff --git a/Makefile.am b/Makefile.am
index 054ea14..0ef8325 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ endif
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = girepository giscanner tools gir tests
+SUBDIRS = girepository giscanner tools gir tests examples
DIST_SUBDIRS = m4 $(SUBDIRS)
man_MANS = \
diff --git a/configure.ac b/configure.ac
index 4182a9d..cbb0ec5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,7 @@ tests/offsets/Makefile
tests/scanner/Makefile
tests/repository/Makefile
tests/everything/Makefile
+examples/Makefile
docs/Makefile
docs/reference/Makefile
gobject-introspection-1.0.pc])
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..681a4ca
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,5 @@
+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)
diff --git a/examples/glib-print.c b/examples/glib-print.c
new file mode 100644
index 0000000..7f99ed1
--- /dev/null
+++ b/examples/glib-print.c
@@ -0,0 +1,46 @@
+#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;
+ }
+
+ g_base_info_unref (base_info);
+
+ return 0;
+}
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index d8c96fa..ec7b2b5 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -109,7 +109,7 @@ barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h
barapp_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la
barapp_LDFLAGS = -export-dynamic
BarApp-1.0.gir: barapp $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
-LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}:$(top_builddir)/girepository/.libs $(SCANNER) \
+ LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}:$(top_builddir)/girepository/.libs $(SCANNER) \
--include=GObject-2.0 \
--libtool="$(LIBTOOL)" \
--program=./barapp \