From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Add transfer annotation to argv parameter of library init functions.
---
libvirt-designer/libvirt-designer-main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libvirt-designer/libvirt-designer-main.c
b/libvirt-designer/libvirt-designer-main.c
index 927eb21..ce69024 100644
--- a/libvirt-designer/libvirt-designer-main.c
+++ b/libvirt-designer/libvirt-designer-main.c
@@ -33,7 +33,9 @@
/**
* gvir_designer_init:
* @argc: (inout): pointer to application's argc
- * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
+ * @argv: (inout) (array length=argc) (allow-none) (transfer none): Address of the
+ * <parameter>argv</parameter> parameter of main(), or %NULL. Any
options
+ * understood by GTK+ are stripped before return.
*/
void gvir_designer_init(int *argc,
char ***argv)
@@ -57,7 +59,9 @@ static void gvir_log_handler(const gchar *log_domain G_GNUC_UNUSED,
/**
* gvir_designer_init_check:
* @argc: (inout): pointer to application's argc
- * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
+ * @argv: (inout) (array length=argc) (allow-none) (transfer none): Address of the
+ * <parameter>argv</parameter> parameter of main(), or %NULL. Any
options
+ * understood by GTK+ are stripped before return.
* @err: pointer to a #GError to which a message will be posted on error
*/
gboolean gvir_designer_init_check(int *argc,
--
1.8.1.4
Show replies by thread
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
This is mostly (modified) copy&paste from libvirt-glib.
---
Makefile.am | 2 +-
configure.ac | 37 +++++++++++++++++++++++++++++++++++++
vapi/Makefile.am | 27 +++++++++++++++++++++++++++
vapi/libvirt-designer-1.0.deps | 2 ++
4 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 vapi/Makefile.am
create mode 100644 vapi/libvirt-designer-1.0.deps
diff --git a/Makefile.am b/Makefile.am
index 7801b63..b928f83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = libvirt-designer examples docs
+SUBDIRS = libvirt-designer vapi examples docs
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index a9c5c34..c999826 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,10 +71,46 @@ if test "x$enable_examples" != "xno" ; then
fi
AM_CONDITIONAL(WITH_EXAMPLES, [test "x$enable_examples" = "xyes"])
+AC_ARG_ENABLE([vala],
+ AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
+ [], [enable_vala=check])
+if test "x$enable_introspection" = "xyes" ; then
+ if test "x$enable_vala" != "xno" ; then
+ AC_PATH_PROG(VAPIGEN, vapigen, no)
+ if test "x$VAPIGEN" == "xno"; then
+ if test "x$enable_vala" == "xcheck" ; then
+ enable_vala=no
+ else
+ AC_MSG_ERROR([Cannot find the "vapigen" binary
in your PATH])
+ fi
+ fi
+ AC_SUBST(VAPIGEN)
+ fi
+ if test "x$enable_vala" != "xno" ; then
+ AC_MSG_CHECKING([$VAPIGEN support for --metadatadir])
+ $VAPIGEN --help | grep metadatadir 1>/dev/null 2>&1
+ if test $? != 0 ; then
+ if test "x$enable_vala" == "xcheck" ; then
+ enable_vala=no
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_ERROR(["vapigen" binary in your PATH is
too old (< 0.13)])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+ if test "x$enable_vala" = "xcheck" ; then
+ enable_vala=yes
+ fi
+fi
+AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"])
+
AC_OUTPUT(Makefile
libvirt-designer/Makefile
libvirt-designer.spec
libvirt-designer-1.0.pc
+ vapi/Makefile
docs/Makefile
examples/Makefile)
@@ -83,6 +119,7 @@ AC_MSG_NOTICE([Configuration summary])
AC_MSG_NOTICE([=====================])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([])
+AC_MSG_NOTICE([ Vala API: $enable_vala])
AC_MSG_NOTICE([ examples: $enable_examples])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([])
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
new file mode 100644
index 0000000..db54019
--- /dev/null
+++ b/vapi/Makefile.am
@@ -0,0 +1,27 @@
+NULL =
+
+if WITH_VALA
+vapidir = $(datadir)/vala/vapi
+vapi_DATA = \
+ libvirt-designer-1.0.deps \
+ libvirt-designer-1.0.vapi \
+ $(NULL)
+
+libvirt-designer-1.0.vapi: $(top_builddir)/libvirt-designer/LibvirtDesigner-1.0.gir
+ $(AM_V_GEN)$(VAPIGEN) \
+ --vapidir=$(builddir) \
+ --pkg gio-2.0 \
+ --pkg libosinfo-1.0 \
+ --pkg libvirt-gconfig-1.0 \
+ --library libvirt-designer-1.0 \
+ --metadatadir=$(srcdir) \
+ $<
+endif
+
+CLEANFILES = \
+ libvirt-designer-1.0.vapi \
+ $(NULL)
+
+EXTRA_DIST = \
+ libvirt-designer-1.0.deps \
+ $(NULL)
diff --git a/vapi/libvirt-designer-1.0.deps b/vapi/libvirt-designer-1.0.deps
new file mode 100644
index 0000000..ba30bfd
--- /dev/null
+++ b/vapi/libvirt-designer-1.0.deps
@@ -0,0 +1,2 @@
+libosinfo-1.0
+libvirt-gconfig-1.0
--
1.8.1.4