Re: [Vala] Genie xmlrpc-c bindings test



Crickey I figured it out!

I changed the xmlrpc.vapi file

to

[CCode (cname="xmlrpc_struct_read_value")]
public void struct_read_value(Value stru, string key, out Value v);

instead of:

[CCode (cprefix="xmlrpc_")]
public void struct_read_value(Value stru, string key, out Value v);

for whatever reason vala was thinking the C library function was called xmlrpc_env_struct_read_value - but it is actually called xmlrpc_struct_read_value without the _env in there.

The cprefix="xmlrpc_" didn't seem to be working there is an earlier cprefix='xmlrpc_env" line above the Env Structure definition:

[CCode (cname ="xmlrpc_env", cprefix="xmlrpc_env_", free_function="", destroy_function="xmlrpc_env_clean")]
        public struct Env {

These methods within the Env struct do not seem to be taking the correct prefix.

It's my guess that all the struct functions/methods will not work I will test out and post a fixed up bindings now I know how to do it.

Sorry to clog the list with stuff that is perhaps not even mainstream vala. However, it might help anyone who comes after trying to do similar things.

Thanks Jan/Evan/Jamie/Pancake for getting me going with this.

Phil

On 15/09/10 04:54, Jan Hudec wrote:
On Tue, Sep 14, 2010 at 20:00:58 +1200, Phil Daintree wrote:
Thanks for taking a look Evan

If that is the case, then adding

[CCode (ref_function_void = true)]

to the class should do the trick/

I see a lot of these sorts of lines in the XML-RPC-C bindings of
pancake's and since there is no class in my genie code, I guess you
mean this code should go in here somewhere? Or do you mean inside
the xml-rpc-c code and recompile the library?

I fear I am too wet behind the ears to figure out what to do with
that line. I've pasted pancake's xmlrpc.vapi file below - maybe the
line

        [CCode (cprefix="xmlrpc_value_", cname = "xmlrpc_value",
ref_function="xmlrpc_INCREF", unref_function="xmlrpc_DECREF",
free_function="")]

has something to do with it?

It sure does. the ref_function_void=true should just be added to the argument
list. So change the line to:

        [CCode (cprefix="xmlrpc_value_", cname = "xmlrpc_value", ref_function="xmlrpc_INCREF", ref_function_void=true, 
unref_function="xmlrpc_DECREF", free_function="")]





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