Re: [Vala] Generating vapi file for a simple struct



"Michael 'Mickey' Lauer" <mickey vanille-media de> wrote:

Watch out for the usage of cprefix and clower_case_prefix
annotations, e.g. try setting both of them to "" for your
example.

Thanks, but it does not seem to solve the problem. It does change
it somewhat, though.

My vapi now looks like this:

[CCode (cheader_filename = "oslib/os.h")]
namespace OSLib
{
  //[SimpleType]
  //[Compact]
  [CCode (cname = "os_error", cprefix = "", clower_case_prefix = "")]
  public struct OSError {
    public int errnum;
    public char[252] errmess;
  }
}

and the resulting code becomes:

void test_main (char** args, int args_length1) {
        os_error _tmp0_ = {0};
        os_error osError;
        osError = (memset (&_tmp0_, 0, sizeof (os_error)), _tmp0_);
        osError.errnum = 4;
        destroy (&osError);
}

This still calls a function called "destroy" which is not defined
anywhere.

Cheers,
Jan-Jaap



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