~linuxjedi/libdrizzle/5.1-optimize

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle_client.h

  • Committer: Andrew Hutchings
  • Date: 2012-09-03 18:38:34 UTC
  • Revision ID: git-v1:e936672f2f2e4af2b54de08ebf06d53ca1dc6872
The "it compiles!" version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Drizzle Client & Protocol Library
 
3
 *
 
4
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
 
5
 * All rights reserved.
 
6
 *
 
7
 * Redistribution and use in source and binary forms, with or without
 
8
 * modification, are permitted provided that the following conditions are
 
9
 * met:
 
10
 *
 
11
 *     * Redistributions of source code must retain the above copyright
 
12
 * notice, this list of conditions and the following disclaimer.
 
13
 *
 
14
 *     * Redistributions in binary form must reproduce the above
 
15
 * copyright notice, this list of conditions and the following disclaimer
 
16
 * in the documentation and/or other materials provided with the
 
17
 * distribution.
 
18
 *
 
19
 *     * The names of its contributors may not be used to endorse or
 
20
 * promote products derived from this software without specific prior
 
21
 * written permission.
 
22
 *
 
23
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
24
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
25
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
26
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
27
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
28
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
29
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
30
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
31
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
32
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
33
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
34
 *
 
35
 */
 
36
 
 
37
 
 
38
/**
 
39
 * @file
 
40
 * @brief Drizzle Declarations for Clients
 
41
 */
 
42
 
 
43
#pragma once
 
44
 
 
45
#include "config.h"
 
46
#include <libdrizzle/drizzle.h>
 
47
#include <libdrizzle/conn_client.h>
 
48
#include <libdrizzle/handshake_client.h>
 
49
#include <libdrizzle/command_client.h>
 
50
#include <libdrizzle/query.h>
 
51
#include <libdrizzle/result_client.h>
 
52
#include <libdrizzle/column_client.h>
 
53
#include <libdrizzle/row_client.h>
 
54
#include <libdrizzle/field_client.h>
 
55
#include <libdrizzle/error.h>
 
56
#include <libdrizzle/ssl.h>
 
57
 
 
58
#ifdef __cplusplus
 
59
extern "C" {
 
60
#endif
 
61
 
 
62
/**
 
63
 * @defgroup drizzle_client_interface Drizzle Client Interface
 
64
 */
 
65
 
 
66
/**
 
67
 * @addtogroup drizzle_client Drizzle Declarations for Clients
 
68
 * @ingroup drizzle_client_interface
 
69
 * @{
 
70
 */
 
71
 
 
72
/**
 
73
 * Add TCP (IPv4 or IPv6) connection with common arguments.
 
74
 *
 
75
 * @param[in] drizzle Drizzle structure previously initialized with
 
76
 *  drizzle_create() or drizzle_clone().
 
77
 * @param[in] con Caller allocated structure, or NULL to allocate one.
 
78
 * @param[in] host Host to connect to. This may be a hostname to resolve, an
 
79
 *  IPv4 address, or an IPv6 address. This is passed directly to getaddrinfo().
 
80
 * @param[in] port Remote port to connect to.
 
81
 * @param[in] user User to use while establishing the connection.
 
82
 * @param[in] password Password to use while establishing the connection.
 
83
 * @param[in] db Initial database to connect to.
 
84
 * @param[in] options Drizzle connection options to add.
 
85
 * @return Same return as drizzle_con_create().
 
86
 */
 
87
DRIZZLE_API
 
88
drizzle_con_st *drizzle_con_add_tcp(drizzle_st *drizzle, drizzle_con_st *con,
 
89
                                    const char *host, in_port_t port,
 
90
                                    const char *user, const char *password,
 
91
                                    const char *db,
 
92
                                    drizzle_con_options_t options);
 
93
 
 
94
/**
 
95
 * Add unix domain socket connection with common arguments.
 
96
 *
 
97
 * @param[in] drizzle Drizzle structure previously initialized with
 
98
 *  drizzle_create() or drizzle_clone().
 
99
 * @param[in] con Caller allocated structure, or NULL to allocate one.
 
100
 * @param[in] uds Path to unix domain socket to use for connection.
 
101
 * @param[in] user User to use while establishing the connection.
 
102
 * @param[in] password Password to use while establishing the connection.
 
103
 * @param[in] db Initial database to connect to.
 
104
 * @param[in] options Drizzle connection options to add.
 
105
 * @return Same return as drizzle_con_create().
 
106
 */
 
107
DRIZZLE_API
 
108
drizzle_con_st *drizzle_con_add_uds(drizzle_st *drizzle, drizzle_con_st *con,
 
109
                                    const char *uds, const char *user,
 
110
                                    const char *password, const char *db,
 
111
                                    drizzle_con_options_t options);
 
112
 
 
113
/** @} */
 
114
 
 
115
#ifdef  __cplusplus
 
116
}
 
117
#endif