GIR writer: Write parent_instace and priv fields
[vala-gnome.git] / vapi / mysql.vapi
blob8e21ac01b541b140ee9b02977d05fbcbae4ee6a3
1 /* mysql.vala
2  *
3  * Copyright (C) 2008 Jukka-Pekka Iivonen
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Jukka-Pekka Iivonen <jp0409@jippii.fi>
21  */
23 [CCode (lower_case_cprefix = "mysql_", cheader_filename = "mysql/mysql.h")]
24 namespace Mysql {
25         /* Database Connection Handle */
26         [Compact]
27         [CCode (free_function = "mysql_close", cname = "MYSQL", cprefix = "mysql_")]
28         public class Database {
29                 [CCode (cname = "mysql_init")]
30                 public Database (Database? mysql = null);
32                 public ulong affected_rows ();
33                 public bool autocommit (bool mode);
34                 public bool change_user (string username, string passwd, string dbname);
35                 public weak string character_set_name ();
36                 public bool commit ();
37                 public int dump_debug_info ();
38                 public uint errno ();
39                 public weak string error ();
40                 public weak string get_host_info ();
41                 public uint get_proto_info ();
42                 public weak string get_server_info ();
43                 public ulong get_server_version ();
44                 public weak string get_ssl_cipher ();
45                 public weak string info ();
46                 public ulong insert_id ();
47                 public int kill (ulong pid);
48                 public Result list_dbs (string wild);
49                 public Result list_fields (string table, string wild);
50                 public Result list_processes ();
51                 public Result list_tables (string wild);
52                 public bool more_results ();
53                 public int next_result ();
54                 public int options (int option, string arg);
55                 public int ping ();
56                 public int query (string stmt_str);
57                 public bool real_connect (string host, string username, string passwd, string dbname, uint port, string? unix_socket, ulong client_flag);
58                 public ulong real_escape_string (string to, string from, ulong length);
59                 public int real_query (string query, ulong len);
60                 public int reload ();
61                 public bool rollback ();
62                 public int select_db (string dbname);
63                 public int set_character_set (string csname);
64                 public void set_local_infile_default ();
65                 public int set_server_option (int option);
66                 public weak string sqlstate ();
67                 public int shutdown (int shutdown_level);
68                 public bool ssl_set (string key, string cert, string ca, string capath, string cipher);
69                 public weak string stat ();
70                 public Result? store_result ();
71                 public ulong thread_id ();
72                 public Result use_result ();
73                 public uint warning_count ();
74         }
75         [Compact]
76         [CCode (free_function = "mysql_free_result", cname = "MYSQL_RES", cprefix = "mysql_")]
77         public class Result {
78                 public bool eof ();
79                 public Field fetch_field ();
80                 public Field fetch_field_direct (uint field_nbr);
81                 public Field[] fetch_fields ();
82                 public ulong[] fetch_lengths ();
83                 [CCode (array_length = false)]
84                 public weak string[]? fetch_row ();             
85                 public uint fetch_count ();
86                 public uint num_fields ();
87                 public uint num_rows ();
88                 
89                 public bool data_seek (ulong offset);
90         }
91         [CCode (cname = "MYSQL_FIELD")]
92         public struct Field {
93         }
94         
95         public weak string get_client_info ();
96         public ulong get_client_version ();
97         public void debug (string msg);
98         public ulong hex_string (string to, string from, ulong length);
99         public void library_end ();
100         public int library_init (int argc, string[] argv, string[] groups);
101         public void server_end ();
102         public int server_init (int argc, string[] argv, string[] groups);
103         public void thread_end ();
104         public bool thread_init ();
105         public uint thread_safe ();