1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* drizzle-interface: Interface Wrappers for Drizzle
5
* Copyright (c) 2009 Sun Microsystems
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are met:
11
* 1. Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* 2. Redistributions in binary form must reproduce the above copyright
14
* notice, this list of conditions and the following disclaimer in the
15
* documentation and/or other materials provided with the distribution.
16
* 3. The name of the author may not be used to endorse or promote products
17
* derived from this software without specific prior written permission.
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
%rename(Connection) drizzle_con;
43
drizzle_con_free($self);
47
return drizzle_con_clone(drizzle_con_drizzle($self), NULL, $self);
50
/* Set options for a connection. */
54
void set_tcp(char *host, in_port_t port);
56
void set_uds(const char *uds);
58
const char *password();
59
void set_auth(const char *user, const char *password);
61
void set_db(char *db);
62
drizzle_con_options_t options();
63
void set_options(drizzle_con_options_t options);
64
void add_options(drizzle_con_options_t options);
65
void remove_options(drizzle_con_options_t options);
67
/* Connect to server. */
68
drizzle_return_t connect();
70
/* Close a connection. */
73
/* Get information on connection. */
74
uint8_t protocol_version();
75
const char *server_version();
76
uint32_t server_version_number();
78
const uint8_t *scramble();
79
drizzle_capabilities_t capabilities();
80
drizzle_charset_t charset();
81
drizzle_con_status_t status();
82
uint32_t max_packet_size();