61
#define DRIZZLE_DEFAULT_TCP_HOST "localhost"
63
#define DRIZZLE_DEFAULT_TCP_HOST "127.0.0.1"
62
64
#define DRIZZLE_DEFAULT_TCP_PORT 4427
63
65
#define DRIZZLE_DEFAULT_TCP_PORT_MYSQL 4427
64
66
#define DRIZZLE_DEFAULT_UDS "/tmp/drizzle.sock"
65
67
#define DRIZZLE_DEFAULT_UDS_MYSQL "/tmp/mysql.sock"
66
68
#define DRIZZLE_DEFAULT_BACKLOG 64
69
#define DRIZZLE_MAX_ERROR_SIZE 2048
70
#define DRIZZLE_MAX_USER_SIZE 64
71
#define DRIZZLE_MAX_PASSWORD_SIZE 32
72
#define DRIZZLE_MAX_DB_SIZE 64
73
#define DRIZZLE_MAX_INFO_SIZE 2048
74
#define DRIZZLE_MAX_SQLSTATE_SIZE 5
75
#define DRIZZLE_MAX_CATALOG_SIZE 128
76
#define DRIZZLE_MAX_TABLE_SIZE 128
77
#define DRIZZLE_MAX_COLUMN_NAME_SIZE 2048
78
#define DRIZZLE_MAX_DEFAULT_VALUE_SIZE 2048
79
#define DRIZZLE_MAX_PACKET_SIZE UINT32_MAX
80
#define DRIZZLE_MAX_BUFFER_SIZE 32768
67
81
#define DRIZZLE_BUFFER_COPY_THRESHOLD 8192
82
#define DRIZZLE_MAX_SERVER_VERSION_SIZE 32
83
#define DRIZZLE_MAX_SERVER_EXTRA_SIZE 32
84
#define DRIZZLE_MAX_SCRAMBLE_SIZE 20
85
#define DRIZZLE_STATE_STACK_SIZE 8
68
86
#define DRIZZLE_ROW_GROW_SIZE 8192
69
#define DRIZZLE_STATE_STACK_SIZE 8
70
87
#define DRIZZLE_DEFAULT_SOCKET_TIMEOUT 10
71
88
#define DRIZZLE_DEFAULT_SOCKET_SEND_SIZE 32768
72
89
#define DRIZZLE_DEFAULT_SOCKET_RECV_SIZE 32768
73
90
#define DRIZZLE_MYSQL_PASSWORD_HASH 41
75
#include <libdrizzle-2.0/deprecated_enum.h>
76
#include <libdrizzle-2.0/return.h>
77
#include <libdrizzle-2.0/command.h>
78
#include <libdrizzle-2.0/verbose.h>
79
#include <libdrizzle-2.0/limits.h>
98
DRIZZLE_RETURN_IO_WAIT,
100
DRIZZLE_RETURN_ROW_BREAK,
101
DRIZZLE_RETURN_MEMORY,
102
DRIZZLE_RETURN_ERRNO,
103
DRIZZLE_RETURN_INTERNAL_ERROR,
104
DRIZZLE_RETURN_GETADDRINFO,
105
DRIZZLE_RETURN_NOT_READY,
106
DRIZZLE_RETURN_BAD_PACKET_NUMBER,
107
DRIZZLE_RETURN_BAD_HANDSHAKE_PACKET,
108
DRIZZLE_RETURN_BAD_PACKET,
109
DRIZZLE_RETURN_PROTOCOL_NOT_SUPPORTED,
110
DRIZZLE_RETURN_UNEXPECTED_DATA,
111
DRIZZLE_RETURN_NO_SCRAMBLE,
112
DRIZZLE_RETURN_AUTH_FAILED,
113
DRIZZLE_RETURN_NULL_SIZE,
114
DRIZZLE_RETURN_ERROR_CODE,
115
DRIZZLE_RETURN_TOO_MANY_COLUMNS,
116
DRIZZLE_RETURN_ROW_END,
117
DRIZZLE_RETURN_LOST_CONNECTION,
118
DRIZZLE_RETURN_COULD_NOT_CONNECT,
119
DRIZZLE_RETURN_NO_ACTIVE_CONNECTIONS,
120
DRIZZLE_RETURN_HANDSHAKE_FAILED,
121
DRIZZLE_RETURN_TIMEOUT,
122
DRIZZLE_RETURN_INVALID_ARGUMENT,
123
DRIZZLE_RETURN_MAX /* Always add new codes to the end before this one. */
127
typedef enum drizzle_return_t drizzle_return_t
133
enum drizzle_verbose_t
135
DRIZZLE_VERBOSE_NEVER,
136
DRIZZLE_VERBOSE_FATAL,
137
DRIZZLE_VERBOSE_ERROR,
138
DRIZZLE_VERBOSE_INFO,
139
DRIZZLE_VERBOSE_DEBUG,
140
DRIZZLE_VERBOSE_CRAZY,
145
typedef enum drizzle_verbose_t drizzle_verbose_t;
152
* Options for drizzle_st.
154
enum drizzle_options_t
157
DRIZZLE_ALLOCATED= (1 << 0),
158
DRIZZLE_NON_BLOCKING= (1 << 1),
159
DRIZZLE_FREE_OBJECTS= (1 << 2),
160
DRIZZLE_ASSERT_DANGLING= (1 << 3)
164
typedef enum drizzle_options_t drizzle_options_t;
84
168
* @ingroup drizzle_con
85
169
* Options for drizzle_con_st.
87
171
enum drizzle_con_options_t
89
173
DRIZZLE_CON_NONE= 0,
90
DRIZZLE_CON_ALLOCATED= (1 << 0), // DEPRECATED
174
DRIZZLE_CON_ALLOCATED= (1 << 0),
91
175
DRIZZLE_CON_MYSQL= (1 << 1),
92
176
DRIZZLE_CON_RAW_PACKET= (1 << 2),
93
177
DRIZZLE_CON_RAW_SCRAMBLE= (1 << 3),
274
* @ingroup drizzle_command
275
* Commands for drizzle_command functions.
277
enum drizzle_command_t
279
DRIZZLE_COMMAND_SLEEP, /* Not used currently. */
280
DRIZZLE_COMMAND_QUIT,
281
DRIZZLE_COMMAND_INIT_DB,
282
DRIZZLE_COMMAND_QUERY,
283
DRIZZLE_COMMAND_FIELD_LIST, /* Deprecated. */
284
DRIZZLE_COMMAND_CREATE_DB, /* Deprecated. */
285
DRIZZLE_COMMAND_DROP_DB, /* Deprecated. */
286
DRIZZLE_COMMAND_REFRESH,
287
DRIZZLE_COMMAND_SHUTDOWN,
288
DRIZZLE_COMMAND_STATISTICS,
289
DRIZZLE_COMMAND_PROCESS_INFO, /* Deprecated. */
290
DRIZZLE_COMMAND_CONNECT, /* Not used currently. */
291
DRIZZLE_COMMAND_PROCESS_KILL, /* Deprecated. */
292
DRIZZLE_COMMAND_DEBUG,
293
DRIZZLE_COMMAND_PING,
294
DRIZZLE_COMMAND_TIME, /* Not used currently. */
295
DRIZZLE_COMMAND_DELAYED_INSERT, /* Not used currently. */
296
DRIZZLE_COMMAND_CHANGE_USER,
297
DRIZZLE_COMMAND_BINLOG_DUMP, /* Not used currently. */
298
DRIZZLE_COMMAND_TABLE_DUMP, /* Not used currently. */
299
DRIZZLE_COMMAND_CONNECT_OUT, /* Not used currently. */
300
DRIZZLE_COMMAND_REGISTER_SLAVE, /* Not used currently. */
301
DRIZZLE_COMMAND_STMT_PREPARE, /* Not used currently. */
302
DRIZZLE_COMMAND_STMT_EXECUTE, /* Not used currently. */
303
DRIZZLE_COMMAND_STMT_SEND_LONG_DATA, /* Not used currently. */
304
DRIZZLE_COMMAND_STMT_CLOSE, /* Not used currently. */
305
DRIZZLE_COMMAND_STMT_RESET, /* Not used currently. */
306
DRIZZLE_COMMAND_SET_OPTION, /* Not used currently. */
307
DRIZZLE_COMMAND_STMT_FETCH, /* Not used currently. */
308
DRIZZLE_COMMAND_DAEMON, /* Not used currently. */
309
DRIZZLE_COMMAND_END /* Not used currently. */
313
typedef enum drizzle_command_t drizzle_command_t;
317
* @ingroup drizzle_command
318
* Commands for the Drizzle protocol functions.
320
enum drizzle_command_drizzle_t
322
DRIZZLE_COMMAND_DRIZZLE_SLEEP,
323
DRIZZLE_COMMAND_DRIZZLE_QUIT,
324
DRIZZLE_COMMAND_DRIZZLE_INIT_DB,
325
DRIZZLE_COMMAND_DRIZZLE_QUERY,
326
DRIZZLE_COMMAND_DRIZZLE_SHUTDOWN,
327
DRIZZLE_COMMAND_DRIZZLE_CONNECT,
328
DRIZZLE_COMMAND_DRIZZLE_PING,
329
DRIZZLE_COMMAND_DRIZZLE_KILL,
330
DRIZZLE_COMMAND_DRIZZLE_END
334
typedef enum drizzle_command_drizzle_t drizzle_command_drizzle_t;
338
* @ingroup drizzle_query
339
* Options for drizzle_query_st.
341
enum drizzle_query_options_t
344
DRIZZLE_QUERY_ALLOCATED= (1 << 0)
348
typedef enum drizzle_query_options_t drizzle_query_options_t;
190
352
* @ingroup drizzle_query
191
353
* States for drizle_query_st.
382
543
/* Function types. */
383
typedef void (drizzle_context_free_fn)(drizzle_st *drizzle, void *context);
384
typedef void (drizzle_log_fn)(const char *line, drizzle_verbose_t verbose, void *context);
544
typedef void (drizzle_context_free_fn)(drizzle_st *drizzle,
546
typedef void (drizzle_log_fn)(const char *line, drizzle_verbose_t verbose,
385
548
typedef drizzle_return_t (drizzle_state_fn)(drizzle_con_st *con);
386
typedef void (drizzle_con_context_free_fn)(drizzle_con_st *con, void *context);
387
typedef void (drizzle_query_context_free_fn)(drizzle_query_st *query, void *context);
549
typedef void (drizzle_con_context_free_fn)(drizzle_con_st *con,
551
typedef void (drizzle_query_context_free_fn)(drizzle_query_st *query,
389
554
* Custom function to register or deregister interest in file descriptor
390
555
* events. See drizzle_set_event_watch_fn().