Re: [Vala] Post vapi



Hi,

On Fri, 2008-10-10 at 17:32 +0000, Tonatiuh Morales wrote:
[...]
      [Compact]
      [CCode (cheader_filename = "shapefil.h")]
      public class DBFHandle {
      }
      [Compact]
      [CCode (cheader_filename = "shapefil.h")]
      public class DBFInfo {

I'm not familiar with shapefil, but a quick look tells me DBFHandle is
typedef for DBFInfo*. I would maybe consider writing something manual
like bellow and see how far you get with that.

[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename =
"shapefil.h")]
namespace ShapeFil {
        [Compact]
        public class DBFInfo {
                [CCode (cname = "DBFAddField")]
                public int AddField (string pszFieldName, ShapeFil.DBFFieldType
eType, int nWidth, int nDecimals);

        }
}

Namespaces in vala are commonly used to prefix the generated C structs
and functions, so when there is no common prefix make sure to clear it
in the cprefix attributes.
Also take a look at some of the other manual written vapi files in the
repository, they have proven to be useful source of information for me.

Regards,
Hans




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