~drizzle-trunk/drizzle/development

1712.1.1 by Monty Taylor
Merged libdrizzle directly into tree.
1
/*
2
 * Drizzle Client & Protocol Library
3
 *
4
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
5
 * All rights reserved.
6
 *
1971.2.1 by kalebral at gmail
update files that did not have license or had incorrect license structure
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
 *
1712.1.1 by Monty Taylor
Merged libdrizzle directly into tree.
35
 */
36
37
/**
38
 * @file
39
 * @brief Drizzle Declarations for Servers
40
 */
41
2449.1.2 by Brian Aker
Additional fixes for libdrizzle.
42
#pragma once
1712.1.1 by Monty Taylor
Merged libdrizzle directly into tree.
43
2449.1.2 by Brian Aker
Additional fixes for libdrizzle.
44
#include <libdrizzle-1.0/drizzle.h>
45
#include <libdrizzle-1.0/conn_server.h>
46
#include <libdrizzle-1.0/handshake_server.h>
47
#include <libdrizzle-1.0/command_server.h>
48
#include <libdrizzle-1.0/result_server.h>
49
#include <libdrizzle-1.0/column_server.h>
50
#include <libdrizzle-1.0/row_server.h>
51
#include <libdrizzle-1.0/field_server.h>
1712.1.1 by Monty Taylor
Merged libdrizzle directly into tree.
52
53
#ifdef __cplusplus
54
extern "C" {
55
#endif
56
57
/**
58
 * @defgroup drizzle_server_interface Drizzle Server Interface
59
 */
60
61
/**
62
 * @addtogroup drizzle_server Drizzle Declarations for Servers
63
 * @ingroup drizzle_server_interface
64
 * @{
65
 */
66
67
/**
68
 * Add TCP (IPv4 or IPv6) connection for listening with common arguments.
69
 *
70
 * @param[in] drizzle Drizzle structure previously initialized with
71
 *  drizzle_create() or drizzle_clone().
72
 * @param[in] con Caller allocated structure, or NULL to allocate one.
73
 * @param[in] host Host to listen on. This may be a hostname to resolve, an
74
 *  IPv4 address, or an IPv6 address. This is passed directly to getaddrinfo().
75
 * @param[in] port Port to connect to.
76
 * @param[in] backlog Number of backlog connections passed to listen().
77
 * @param[in] options Drizzle connection options to add.
78
 * @return Same return as drizzle_con_create().
79
 */
80
DRIZZLE_API
81
drizzle_con_st *drizzle_con_add_tcp_listen(drizzle_st *drizzle,
82
                                           drizzle_con_st *con,
83
                                           const char *host, in_port_t port,
84
                                           int backlog,
85
                                           drizzle_con_options_t options);
86
87
/**
88
 * Add unix domain socket connection for listening with common arguments.
89
 *
90
 * @param[in] drizzle Drizzle structure previously initialized with
91
 *  drizzle_create() or drizzle_clone().
92
 * @param[in] con Caller allocated structure, or NULL to allocate one.
93
 * @param[in] uds Path to unix domain socket to use for listening.
94
 * @param[in] backlog Number of backlog connections passed to listen().
95
 * @param[in] options Drizzle connection options to add.
96
 * @return Same return as drizzle_con_create().
97
 */
98
DRIZZLE_API
99
drizzle_con_st *drizzle_con_add_uds_listen(drizzle_st *drizzle,
100
                                           drizzle_con_st *con,
101
                                           const char *uds, int backlog,
102
                                           drizzle_con_options_t options);
103
104
/**
105
 * Get next connection marked for listening that is ready for I/O.
106
 *
107
 * @param[in] drizzle Drizzle structure previously initialized with
108
 *  drizzle_create() or drizzle_clone().
109
 * @return Connection that is ready to accept, or NULL if there are none.
110
 */
111
DRIZZLE_API
112
drizzle_con_st *drizzle_con_ready_listen(drizzle_st *drizzle);
113
114
/**
115
 * Accept a new connection and initialize the connection structure for it.
116
 *
117
 * @param[in] drizzle Drizzle structure previously initialized with
118
 *  drizzle_create() or drizzle_clone().
119
 * @param[in] con Caller allocated structure, or NULL to allocate one.
120
 * @param[out] ret_ptr Standard drizzle return value.
121
 * @return Same return as drizzle_con_create().
122
 */
123
DRIZZLE_API
124
drizzle_con_st *drizzle_con_accept(drizzle_st *drizzle, drizzle_con_st *con,
125
                                   drizzle_return_t *ret_ptr);
126
127
/** @} */
128
129
#ifdef  __cplusplus
130
}
131
#endif