Re: [Vala] Mixing C with vala



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 09/24/2015 07:17 AM, Abderrahim Kitouni wrote:
Hello,

Le mer 23 sept. 2015 23:21, Daniel Brendle <grindhold skarphed org>
a écrit :
The second gist is a gist that contains a main.vala, and a 
gereon-page.c and a gereon-page.h . those files are generated by
vala with the -C and -h-flags. Additionally there is a
gereon.vapi that describes the methods of Page towards the
vala-compiler. This example does not work beacause the
unreferencing methods in the C-stage of main.vala is
"gereon_page_unref()" instead of "g_object_unref()". Why is
that?

https://gist.github.com/grindhold/f2a39dab2dd1c172b355

Thanks in advance. I'd really like to understand what happens.

The problem is the vapi. It should be public class Page :
GLib.Object {

One more thing: You don't need to keep the Vala generated code and
modify it; a better solution would be to declare the methods you
want to implement in C as extern and implement them in another
file

HTH, Abderrahim


Ah that was the problem. It works. Thanks for the tip with the extern
keyword.

Yours, Grindhold
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWBI07AAoJEBuqgJs6izSEDqEQAIExkAlaUcsCOeyALWYa16FV
lehYoNlZKPHWkQIJlaOfcl/GVq7DmMS7U/tqlkqWk7zQ7dNDvYC8ScGKRSFa6Kze
ocryeFtk1X8kZiDEh7yyMpb30jhSl1sazc3Un5EP5sXiC/lMwDSPtMzxjq8MResH
GS2c4BZ/osoTWu5rNM7edOCjR3Yw8V4/fpsKEaDldfs00WZXFUKTwyNg3KR/Yhyl
xf4LkESsKmxWY0JFlWd0Nv4xFxtD2125SR2NDPoAEvl/jTKU14edvGKuwXUxkBHT
m0MGnDz9ui/k2t7PMDCASNcSBWEhiZlQWm3pxyg5LLdChEZlJa2vRFvKg+inD6In
jdJAoxnEaPSybxphf49EOOeVBBiV9J7/ilnxbi8r0lH1BWs7+O6B4eAKfmN6eySh
cewXR7I2iHtqvKkZMu2y+Ra+DaRl+IX8zQScILucNUM00WEenZ0cHBoJxGUckfAH
UeXyWtT0+hMDuADNl48H2K3d0sSstafCDFj8B1rYib/5BNLNl+czzWCFgHHJGhSw
52Kr4OB+7Rubm0BD6rNrDQaYUqqihPvpT+vI+vXi6HJQwPaqoGXDGf7KPcXy3l4G
6pgNWUuOqmkXXK/jmg/ZODOVpOiKCDq9+IiYjO9ocNu3UTzoffXSWLb2eWWJJ1kD
E53/5i4Mu2PmYwWjv8GD
=9o0u
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]