[Vala] Iterate in VAPI bindings
Hi, I'm trying to write Vala bindings for pkg(8), FreeBSD's packages manager. But I encounter weird behaviour in while loop. Currently I try to display name of repositories (FreeBSD and Xfce). My simple C program [1] works fine (expected result). If I use same while loop in my Vala program, I get an infinite loop. So I use for loop [2], but it's only FreeBSD which is displayed. I wonder how to iterate in loop. Traduction of related pkg_repo* methods is here [3], and corresponding C [4]. Regards, [1] https://bitbucket.org/olivierduchateau/scripts/src/1f34246a6bc9/pkg/repos.c?at=default [2] https://bitbucket.org/olivierduchateau/libpkg-vapi/src/cc552a344dac/test.vala?at=default [3] https://bitbucket.org/olivierduchateau/libpkg-vapi/src/cc552a344dac/pkg.vapi?at=default=file-view-default#pkg.vapi-146 [4] https://github.com/freebsd/pkg/blob/1.9.4/libpkg/pkg.h.in#L1501 -- olivier ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] How to re-use external C function with pointer
Hi, I find this code in Vala program [1]. But under FreeBSD, prctl() doesn't exist. So I use setproctitle(3) [2] (see attachment), but I get this error message: /usr/ports/x11-toolkits/granite/work/granite-0.2/lib/Application.vala:95.67-95.6 7: error: syntax error, expected `)' protected extern static void setproctitle (const char *fmt); ^ Compilation failed: 1 error(s), 0 warning(s) *** Error code 1 [1] http://bazaar.launchpad.net/~elementary-pantheon/granite/0.2/view/head:/lib/Application.vala#L70 [2] http://www.freebsd.org/cgi/man.cgi?query=setproctitlesektion=3apropos=0manpath=FreeBSD+9.1-RELEASE -- olivier patch-lib__Application.vala Description: Binary data ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Check conditionals versions of Vala
On Wed, 06 Feb 2013 19:50:40 +0100 JM interfl...@gmx.net wrote: There is conditional compilation: https://live.gnome.org/Vala/ConditionalCompilationSample You can check vala version and set flags in your configure script or something equivalent. You can modify the following to match your demands and use it to set flags for your conditional compilation: AC_PATH_PROG([VALAC], [valac], []) AS_IF([test -z $VALAC], [AC_MSG_WARN([No Vala compiler found. Build uses C files only. While this is fine, you will not be able to compile changed .vala source files.])], [AS_IF([test -n $VALA_REQUIRED], [AC_MSG_CHECKING([$VALAC is at least version $VALA_REQUIRED]) am__vala_version=`$VALAC --version | sed 's/Vala *//'` AS_VERSION_COMPARE([$VALA_REQUIRED], [$am__vala_version], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_WARN([Vala $VALA_REQUIRED not found. Your vala version is too old! Build uses C files only. While this is fine, you will not be able to compile changed .vala source files.]) VALAC=])])]) AM_CONDITIONAL(USE_VALA, [test -n $VALAC]) AC_SUBST(USE_VALA) Thanks Am Mittwoch, den 06.02.2013, 19:09 + schrieb Olivier Duchateau: Hi, I wonder, if it exists preprocessors in Vala, or if it exists macro like GLIB_CHECK_VERSION, but known by valac ? I don't find any responses. ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list -- olivier ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] How to substitude header_free_param_list() with Vala 0.12.x
Hi, With Vala = 0.14.x and libsoup-2.4 there's method, which calls 'header_free_param_list()'. I wonder how I can replace this method under Vala 0.12.x. I can't see a 'free' method for this old version of Vala. I can't upgrade Vala, because it's official version in FreeBSD's ports tree. Regards -- olivier ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list