~mordred/drizzle-interface/cython-interface

« back to all changes in this revision

Viewing changes to interface/libdrizzle/con.i

  • Committer: Monty Taylor
  • Date: 2009-10-28 02:20:39 UTC
  • mfrom: (113.1.2 c-transition)
  • Revision ID: mordred@inaugust.com-20091028022039-a202c33y8nm06x5n
Merged in transition to C.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 * drizzle-interface: Interface Wrappers for Drizzle
5
 
 * Copyright (c) 2009 Sun Microsystems
6
 
 * All rights reserved.
7
 
 *
8
 
 * Redistribution and use in source and binary forms, with or without
9
 
 * modification, are permitted provided that the following conditions are met:
10
 
 *
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.
18
 
 *
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.
30
 
 */
31
 
 
32
 
%rename(Connection) drizzle_con;
33
 
 
34
 
class drizzle_con
35
 
{
36
 
private:
37
 
  drizzle_con();
38
 
};
39
 
 
40
 
%extend drizzle_con {
41
 
 
42
 
  ~drizzle_con() {
43
 
    drizzle_con_free($self);
44
 
  }
45
 
 
46
 
  drizzle_con *copy() {
47
 
    return drizzle_con_clone(drizzle_con_drizzle($self), NULL, $self);
48
 
  }
49
 
 
50
 
  /* Set options for a connection. */
51
 
  const char *host();
52
 
  in_port_t port();
53
 
 
54
 
  void set_tcp(char *host, in_port_t port);
55
 
  const char *uds();
56
 
  void set_uds(const char *uds);
57
 
  const char *user();
58
 
  const char *password();
59
 
  void set_auth(const char *user, const char *password);
60
 
  const char *db();
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);
66
 
 
67
 
  /* Connect to server. */
68
 
  drizzle_return_t connect();
69
 
 
70
 
  /* Close a connection. */
71
 
  void close();
72
 
 
73
 
  /* Get information on connection. */
74
 
  uint8_t protocol_version();
75
 
  const char *server_version();
76
 
  uint32_t server_version_number();
77
 
  uint32_t thread_id();
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();
83
 
 
84
 
}
85