On Sat, Apr 10, 2010 at 04:58:06PM -0700, Darren Warner wrote:
I'm creating a vapi for libexif (using vala-gen-introspect) which
includes a function that returns a structure:
typedef struct {ExifLong numerator; ExifLong denominator; }ExifRational;
ExifRational exif_get_rational (const unsigned char *b,
ExifByteOrder order);
If I don't alter ExifRational in my .metadata, the C compiler
complains about assigning ExifRational to ExifRational * when I try
to use the function.
If I set ExifRational is_value_type="1", which I believe I should
be, valac is generating an additional parameter (a pointer to a
temporary ExifRational) when calling exif_get_rational() - of course
the compiler complains at this also.
This seems like a newbie question, but I've been unable to find any
similar examples in the existing bindings, so any help would be
appreciated.
I might be wrong but it looks like it's used like a simple type.
Try adding [SimpleType] to your struct binding, e.g.:
namespace Exif
{
[SimpleType]
public struct Rational
{
Long numerator;
Long denominator;
}
}
--
http://www.debian.org - The Universal Operating System
Attachment:
signature.asc
Description: Digital signature