[Gtk-sharp-list] Re: gda-sharp (Gda.Value)

Mikkel Kruse Johnsen mikkel@linet.dk
Fri, 24 Sep 2004 12:48:06 +0200

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


I got Gda.Value working, juhuu.

The file "gda/generated/Value.cs" must have a layout like:

	public struct Value {

		[FieldOffset(0)] public Gda.ValueType Type;
		[FieldOffset(4)] public long VBigint;
		[FieldOffset(4)] public ulong VBiguint;
		[FieldOffset(4)] private IntPtr _v_binary;
		[FieldOffset(4)] public Gda.Blob VBlob;
		[FieldOffset(4)] public bool VBoolean;
		[FieldOffset(4)] public Gda.Date VDate;
		[FieldOffset(4)] public double VDouble;
		[FieldOffset(4)] public Gda.GeometricPoint VPoint;
		[FieldOffset(4)] private IntPtr _v_gobj;
		[FieldOffset(4)] public int VInteger;
		[FieldOffset(4)] private IntPtr _v_list;
		[FieldOffset(4)] public Gda.Money VMoney;
		[FieldOffset(4)] public Gda.Numeric VNumeric;
		[FieldOffset(4)] public float VSingle;
		[FieldOffset(4)] public short VSmallint;
		[FieldOffset(4)] public ushort VSmalluint;
		[FieldOffset(4)] public string VString;
		[FieldOffset(4)] public Gda.Time VTime;
		[FieldOffset(4)] public Gda.Timestamp VTimestamp;
		[FieldOffset(4)] public string VTinyint;
		[FieldOffset(4)] public byte VTinyuint;
		[FieldOffset(4)] public Gda.ValueType VType;
		[FieldOffset(4)] public uint VUinteger;
		[FieldOffset(8)] public long BinaryLength;

Because all the values (marked with FieldOffste(4)) is a union in the C


typedef GList GdaValueList;
typedef struct {
        GdaValueType type;
        union {
                gint64 v_bigint;
                guint64 v_biguint;
                gpointer v_binary;
                GdaBlob v_blob;
                gboolean v_boolean;
                GdaDate v_date;
                gdouble v_double;
                GdaGeometricPoint v_point;
                GObject *v_gobj;
                gint v_integer;
                GdaValueList *v_list;
                GdaMoney v_money;
                GdaNumeric v_numeric;
                gfloat v_single;
                gshort v_smallint;
                gushort v_smalluint;
                gchar *v_string;
                GdaTime v_time;
                GdaTimestamp v_timestamp;
                gchar v_tinyint;
                guchar v_tinyuint;
                GdaValueType v_type;
                guint v_uinteger;
        } value;
        glong binary_length;
} GdaValue;


But I don't know how to make a patch, it must be the C perl wrapper that
should take care of it, or mayby a xml fixup file later.=20

I could use some input, please ?


On Wed, 2004-09-22 at 23:23, Rodrigo Moya wrote:
> On Wed, 2004-09-22 at 21:23 +0200, Mikkel Kruse Johnsen wrote:
> > Hi Rodrigo
> >=20
> > Is there any development on gda-sharp. Gda.Value has been broken for
> > month (or never worked).
> >=20
> seems it never worked :(
> > Is there a way I can get data from the database (postgresql) without
> > using Gda.Value ?
> >=20
> no, since both get_row and get_value are failing in the C# bindings. You
> are not the first that reports this ->
> http://bugzilla.ximian.com/show_bug.cgi?id=3D58798
> > Is there anything I can do to help, have been looking at the code, but
> > don't know where to start.
> >
> seems to be a problem either in the generated code, or a problem in the
> GTK# code, not sure. You could try to look for a fix :) That would be
> great to have someone fixing it, since it's been around for months.

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.4 (GNU/Linux)