diff options
author | Evan Nemerson <evan@coeus-group.com> | 2010-10-02 15:00:05 -0700 |
---|---|---|
committer | Evan Nemerson <evan@coeus-group.com> | 2010-10-02 15:11:22 -0700 |
commit | d387b1c20d23e821083997164850011ecb4f1ccd (patch) | |
tree | 6faeccb8ab6511528091a7a9be0d4b8f8b9f216c /vapi/mysql.vapi | |
parent | bd104fbbd2f5fd9d03fb1d8cf7aa933053ac98af (diff) | |
download | vala-d387b1c20d23e821083997164850011ecb4f1ccd.tar.gz |
mysql: Automatically get length of arrays returned by Result methods.
Diffstat (limited to 'vapi/mysql.vapi')
-rw-r--r-- | vapi/mysql.vapi | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/vapi/mysql.vapi b/vapi/mysql.vapi index 4fdb85ba1..b0a0acbbc 100644 --- a/vapi/mysql.vapi +++ b/vapi/mysql.vapi @@ -223,12 +223,34 @@ namespace Mysql { public bool eof (); public Field* fetch_field (); public Field* fetch_field_direct (uint field_nbr); - [CCode (array_length = false)] - public unowned Field[] fetch_fields (); - [CCode (array_length = false)] - public unowned ulong[] fetch_lengths (); - [CCode (array_length = false)] - public unowned string[]? fetch_row (); + + [CCode (cname = "mysql_fetch_fields", array_length = false)] + public unowned Field[] _fetch_fields (); + [CCode (cname = "_vala_mysql_fetch_fields")] + public unowned Field[] fetch_fields () { + unowned Field[] fields = this._fetch_fields (); + fields.length = (int) this.num_fields (); + return fields; + } + + [CCode (cname = "mysql_fetch_lengths", array_length = false)] + public unowned ulong[] _fetch_lengths (); + [CCode (cname = "_vala_mysql_fetch_lengths")] + public unowned ulong[] fetch_lengths () { + unowned ulong[] lengths = this._fetch_lengths (); + lengths.length = (int) this.num_fields (); + return lengths; + } + + [CCode (cname = "mysql_fetch_row", array_length = false)] + public unowned string[]? _fetch_row (); + [CCode (cname = "_vala_mysql_fetch_row")] + public unowned string[]? fetch_row () { + unowned string[]? row = this._fetch_row (); + row.length = (int) this.num_fields (); + return row; + } + public uint fetch_count (); public uint num_fields (); public uint num_rows (); |