]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add MySQL bindings, patch by Jukka-Pekka Iivonen, fixes bug 567342
authorJürg Billeter <j@bitron.ch>
Fri, 16 Jan 2009 16:37:55 +0000 (16:37 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 16 Jan 2009 16:37:55 +0000 (16:37 +0000)
2009-01-16  Jürg Billeter  <j@bitron.ch>

* vapi/Makefile.am:
* vapi/mysql.vapi:

Add MySQL bindings, patch by Jukka-Pekka Iivonen, fixes bug 567342

svn path=/trunk/; revision=2358

ChangeLog
THANKS
vapi/Makefile.am
vapi/mysql.vapi [new file with mode: 0644]

index 36f6bfca276d82da24b770b248404c1b1f348c0b..260c9f50763336ebf927a235df353a9493e3fa14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-16  Jürg Billeter  <j@bitron.ch>
+
+       * vapi/Makefile.am:
+       * vapi/mysql.vapi:
+
+       Add MySQL bindings, patch by Jukka-Pekka Iivonen, fixes bug 567342
+
 2009-01-16  Jürg Billeter  <j@bitron.ch>
 
        * vala/valastruct.vala:
diff --git a/THANKS b/THANKS
index bb4019afc089ecf68b65c3422414836ac97a0c6e..10da1711c374011d124d7c0279040f3cd5e2dde3 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -44,6 +44,7 @@ Johannes Schmid
 John Carr
 Jorn Baayen
 Juan Carlos Girardi
+Jukka-Pekka Iivonen
 Kyle Ambroff
 Levi Bard
 Maciej Piechotka
index d4b28e124198a3a70db36a315ddcf596b0a1f432..e1a5651d4ba7d41007f0123a7502d3c8b521df84 100644 (file)
@@ -107,6 +107,7 @@ dist_vapi_DATA = \
        libwnck-1.0.vapi \
        libxml-2.0.vapi \
        loudmouth-1.0.vapi \
+       mysql.vapi \
        pango.deps \
        pango.vapi \
        pangocairo.deps \
diff --git a/vapi/mysql.vapi b/vapi/mysql.vapi
new file mode 100644 (file)
index 0000000..8843068
--- /dev/null
@@ -0,0 +1,107 @@
+/* mysql.vala
+ *
+ * Copyright (C) 2008 Jukka-Pekka Iivonen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ *
+ * Author:
+ *     Jukka-Pekka Iivonen <jp0409@jippii.fi>
+ */
+
+[CCode (lower_case_cprefix = "mysql_", cheader_filename = "mysql/mysql.h")]
+namespace Mysql {
+       /* Database Connection Handle */
+       [Compact]
+       [CCode (free_function = "mysql_close", cname = "MYSQL", cprefix = "mysql_")]
+       public class Database {
+               [CCode (argument0 = "NULL", cname = "mysql_init")]
+               public void init ();
+
+               public ulong affected_rows ();
+               public bool autocommit (bool mode);
+               public bool change_user (string username, string passwd, string dbname);
+               public weak string character_set_name ();
+               public bool commit ();
+               public int dump_debug_info ();
+               public uint errno ();
+               public weak string error ();
+               public weak string get_host_info ();
+               public uint get_proto_info ();
+               public weak string get_server_info ();
+               public ulong get_server_version ();
+               public weak string get_ssl_cipher ();
+               public weak string info ();
+               public ulong insert_id ();
+               public int kill (ulong pid);
+               public Result list_dbs (string wild);
+               public Result list_fields (string table, string wild);
+               public Result list_processes ();
+               public Result list_tables (string wild);
+               public bool more_results ();
+               public int next_result ();
+               public int options (int option, string arg);
+               public int ping ();
+               public int query (string stmt_str);
+               public bool real_connect (string host, string username, string passwd, string dbname, uint port, string? unix_socket, ulong client_flag);
+               public ulong real_escape_string (string to, string from, ulong length);
+               public int real_query (string query, ulong len);
+               public int reload ();
+               public bool rollback ();
+               public int select_db (string dbname);
+               public int set_character_set (string csname);
+               public void set_local_infile_default ();
+               public int set_server_option (int option);
+               public weak string sqlstate ();
+               public int shutdown (int shutdown_level);
+               public bool ssl_set (string key, string cert, string ca, string capath, string cipher);
+               public weak string stat ();
+               public Result? store_result ();
+               public ulong thread_id ();
+               public Result use_result ();
+               public uint warning_count ();
+       }
+       [Compact]
+       [CCode (free_function = "mysql_free_result", cname = "MYSQL_RES", cprefix = "mysql_")]
+       public class Result {
+               public bool eof ();
+               public Field fetch_field ();
+               public Field fetch_field_direct (uint field_nbr);
+               public Field[] fetch_fields ();
+               public ulong[] fetch_lengths ();
+               [CCode (array_length = false)]
+               public weak string[]? fetch_row ();             
+               public uint fetch_count ();
+               public uint num_fields ();
+               public uint num_rows ();
+               
+               public bool data_seek (ulong offset);
+       }
+       [CCode (cname = "MYSQL_FIELD")]
+       public struct Field {
+       }
+       
+       public weak string get_client_info ();
+       public ulong get_client_version ();
+       public void debug (string msg);
+       public ulong hex_string (string to, string from, ulong length);
+       public void library_end ();
+       public int library_init (int argc, string[] argv, string[] groups);
+       public void server_end ();
+       public int server_init (int argc, string[] argv, string[] groups);
+       public void thread_end ();
+       public bool thread_init ();
+       public uint thread_safe ();
+}
+