~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-2.0/constants.h

  • Committer: Mark Atwood
  • Date: 2011-11-30 07:06:47 UTC
  • mfrom: (2463.1.6 drizzle-include)
  • Revision ID: me@mark.atwood.name-20111130070647-ixp7oalp70hkbt6l
mergeĀ lp:~brianaker/drizzle/libdrizzle-2.0-not-install

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 * @brief Defines, typedefs, enums, and macros
43
43
 */
44
44
 
45
 
#include <stdint.h>
46
 
 
47
45
#ifdef __cplusplus
48
46
 
49
47
#include <vector>
66
64
#define DRIZZLE_DEFAULT_UDS              "/tmp/drizzle.sock"
67
65
#define DRIZZLE_DEFAULT_UDS_MYSQL        "/tmp/mysql.sock"
68
66
#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_SCHEMA_SIZE          64
73
 
#define DRIZZLE_MAX_DB_SIZE              DRIZZLE_MAX_SCHEMA_SIZE
74
 
#define DRIZZLE_MAX_INFO_SIZE            2048
75
 
#define DRIZZLE_MAX_SQLSTATE_SIZE        5
76
 
#define DRIZZLE_MAX_CATALOG_SIZE         128
77
 
#define DRIZZLE_MAX_TABLE_SIZE           128
78
 
#define DRIZZLE_MAX_COLUMN_NAME_SIZE     2048
79
 
#define DRIZZLE_MAX_DEFAULT_VALUE_SIZE   2048
80
 
#define DRIZZLE_MAX_PACKET_SIZE          UINT32_MAX
81
 
#define DRIZZLE_MAX_BUFFER_SIZE          32768
82
67
#define DRIZZLE_BUFFER_COPY_THRESHOLD    8192
83
 
#define DRIZZLE_MAX_SERVER_VERSION_SIZE  32
84
 
#define DRIZZLE_MAX_SERVER_EXTRA_SIZE    32
85
 
#define DRIZZLE_MAX_SCRAMBLE_SIZE        20
 
68
#define DRIZZLE_ROW_GROW_SIZE            8192
86
69
#define DRIZZLE_STATE_STACK_SIZE         8
87
 
#define DRIZZLE_ROW_GROW_SIZE            8192
88
70
#define DRIZZLE_DEFAULT_SOCKET_TIMEOUT   10
89
71
#define DRIZZLE_DEFAULT_SOCKET_SEND_SIZE 32768
90
72
#define DRIZZLE_DEFAULT_SOCKET_RECV_SIZE 32768
91
73
#define DRIZZLE_MYSQL_PASSWORD_HASH      41
92
74
 
93
 
/**
94
 
 * Return codes.
95
 
 */
96
 
enum drizzle_return_t
97
 
{
98
 
  DRIZZLE_RETURN_OK,
99
 
  DRIZZLE_RETURN_IO_WAIT,
100
 
  DRIZZLE_RETURN_PAUSE,
101
 
  DRIZZLE_RETURN_ROW_BREAK,
102
 
  DRIZZLE_RETURN_MEMORY,
103
 
  DRIZZLE_RETURN_ERRNO,
104
 
  DRIZZLE_RETURN_INTERNAL_ERROR,
105
 
  DRIZZLE_RETURN_GETADDRINFO,
106
 
  DRIZZLE_RETURN_NOT_READY,
107
 
  DRIZZLE_RETURN_BAD_PACKET_NUMBER,
108
 
  DRIZZLE_RETURN_BAD_HANDSHAKE_PACKET,
109
 
  DRIZZLE_RETURN_BAD_PACKET,
110
 
  DRIZZLE_RETURN_PROTOCOL_NOT_SUPPORTED,
111
 
  DRIZZLE_RETURN_UNEXPECTED_DATA,
112
 
  DRIZZLE_RETURN_NO_SCRAMBLE,
113
 
  DRIZZLE_RETURN_AUTH_FAILED,
114
 
  DRIZZLE_RETURN_NULL_SIZE,
115
 
  DRIZZLE_RETURN_ERROR_CODE,
116
 
  DRIZZLE_RETURN_TOO_MANY_COLUMNS,
117
 
  DRIZZLE_RETURN_ROW_END,
118
 
  DRIZZLE_RETURN_LOST_CONNECTION,
119
 
  DRIZZLE_RETURN_COULD_NOT_CONNECT,
120
 
  DRIZZLE_RETURN_NO_ACTIVE_CONNECTIONS,
121
 
  DRIZZLE_RETURN_HANDSHAKE_FAILED,
122
 
  DRIZZLE_RETURN_TIMEOUT,
123
 
  DRIZZLE_RETURN_INVALID_ARGUMENT,
124
 
  DRIZZLE_RETURN_MAX /* Always add new codes to the end before this one. */
125
 
};
126
 
 
127
 
#ifndef __cplusplus
128
 
typedef enum drizzle_return_t drizzle_return_t
129
 
#endif
130
 
 
131
 
/**
132
 
 * Verbosity levels.
133
 
 */
134
 
enum drizzle_verbose_t
135
 
{
136
 
  DRIZZLE_VERBOSE_NEVER,
137
 
  DRIZZLE_VERBOSE_FATAL,
138
 
  DRIZZLE_VERBOSE_ERROR,
139
 
  DRIZZLE_VERBOSE_INFO,
140
 
  DRIZZLE_VERBOSE_DEBUG,
141
 
  DRIZZLE_VERBOSE_CRAZY,
142
 
  DRIZZLE_VERBOSE_MAX
143
 
};
144
 
 
145
 
#ifndef __cplusplus
146
 
typedef enum drizzle_verbose_t drizzle_verbose_t;
147
 
#endif
 
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>
148
80
 
149
81
/** @} */
150
82
 
151
83
/**
152
 
 * @ingroup drizzle
153
 
 * Options for drizzle_st.
154
 
 */
155
 
enum drizzle_options_t
156
 
{
157
 
  DRIZZLE_NONE=            0,
158
 
  DRIZZLE_ALLOCATED=       (1 << 0),
159
 
  DRIZZLE_NON_BLOCKING=    (1 << 1),
160
 
  DRIZZLE_FREE_OBJECTS=    (1 << 2),
161
 
  DRIZZLE_ASSERT_DANGLING= (1 << 3)
162
 
};
163
 
 
164
 
#ifndef __cplusplus
165
 
typedef enum drizzle_options_t drizzle_options_t;
166
 
#endif
167
 
 
168
 
/**
169
84
 * @ingroup drizzle_con
170
85
 * Options for drizzle_con_st.
171
86
 */
172
87
enum drizzle_con_options_t
173
88
{
174
89
  DRIZZLE_CON_NONE=             0,
175
 
  DRIZZLE_CON_ALLOCATED=        (1 << 0),
 
90
  DRIZZLE_CON_ALLOCATED=        (1 << 0), // DEPRECATED
176
91
  DRIZZLE_CON_MYSQL=            (1 << 1),
177
92
  DRIZZLE_CON_RAW_PACKET=       (1 << 2),
178
93
  DRIZZLE_CON_RAW_SCRAMBLE=     (1 << 3),
272
187
#endif
273
188
 
274
189
/**
275
 
 * @ingroup drizzle_command 
276
 
 * Commands for drizzle_command functions.
277
 
 */
278
 
enum drizzle_command_t
279
 
{
280
 
  DRIZZLE_COMMAND_SLEEP,               /* Not used currently. */
281
 
  DRIZZLE_COMMAND_QUIT,
282
 
  DRIZZLE_COMMAND_INIT_DB,
283
 
  DRIZZLE_COMMAND_QUERY,
284
 
  DRIZZLE_COMMAND_FIELD_LIST,          /* Deprecated. */
285
 
  DRIZZLE_COMMAND_CREATE_DB,           /* Deprecated. */
286
 
  DRIZZLE_COMMAND_DROP_DB,             /* Deprecated. */
287
 
  DRIZZLE_COMMAND_REFRESH,
288
 
  DRIZZLE_COMMAND_SHUTDOWN,
289
 
  DRIZZLE_COMMAND_STATISTICS,
290
 
  DRIZZLE_COMMAND_PROCESS_INFO,        /* Deprecated. */
291
 
  DRIZZLE_COMMAND_CONNECT,             /* Not used currently. */
292
 
  DRIZZLE_COMMAND_PROCESS_KILL,        /* Deprecated. */
293
 
  DRIZZLE_COMMAND_DEBUG,
294
 
  DRIZZLE_COMMAND_PING,
295
 
  DRIZZLE_COMMAND_TIME,                /* Not used currently. */
296
 
  DRIZZLE_COMMAND_DELAYED_INSERT,      /* Not used currently. */
297
 
  DRIZZLE_COMMAND_CHANGE_USER,
298
 
  DRIZZLE_COMMAND_BINLOG_DUMP,         /* Not used currently. */
299
 
  DRIZZLE_COMMAND_TABLE_DUMP,          /* Not used currently. */
300
 
  DRIZZLE_COMMAND_CONNECT_OUT,         /* Not used currently. */
301
 
  DRIZZLE_COMMAND_REGISTER_SLAVE,      /* Not used currently. */
302
 
  DRIZZLE_COMMAND_STMT_PREPARE,        /* Not used currently. */
303
 
  DRIZZLE_COMMAND_STMT_EXECUTE,        /* Not used currently. */
304
 
  DRIZZLE_COMMAND_STMT_SEND_LONG_DATA, /* Not used currently. */
305
 
  DRIZZLE_COMMAND_STMT_CLOSE,          /* Not used currently. */
306
 
  DRIZZLE_COMMAND_STMT_RESET,          /* Not used currently. */
307
 
  DRIZZLE_COMMAND_SET_OPTION,          /* Not used currently. */
308
 
  DRIZZLE_COMMAND_STMT_FETCH,          /* Not used currently. */
309
 
  DRIZZLE_COMMAND_DAEMON,              /* Not used currently. */
310
 
  DRIZZLE_COMMAND_END                  /* Not used currently. */
311
 
};
312
 
 
313
 
#ifndef __cplusplus
314
 
typedef enum drizzle_command_t drizzle_command_t;
315
 
#endif
316
 
 
317
 
/**
318
 
 * @ingroup drizzle_command 
319
 
 * Commands for the Drizzle protocol functions.
320
 
 */
321
 
enum drizzle_command_drizzle_t
322
 
{
323
 
  DRIZZLE_COMMAND_DRIZZLE_SLEEP,
324
 
  DRIZZLE_COMMAND_DRIZZLE_QUIT,
325
 
  DRIZZLE_COMMAND_DRIZZLE_INIT_DB,
326
 
  DRIZZLE_COMMAND_DRIZZLE_QUERY,
327
 
  DRIZZLE_COMMAND_DRIZZLE_SHUTDOWN,
328
 
  DRIZZLE_COMMAND_DRIZZLE_CONNECT,
329
 
  DRIZZLE_COMMAND_DRIZZLE_PING,
330
 
  DRIZZLE_COMMAND_DRIZZLE_KILL,
331
 
  DRIZZLE_COMMAND_DRIZZLE_END
332
 
};
333
 
 
334
 
#ifndef __cplusplus
335
 
typedef enum drizzle_command_drizzle_t drizzle_command_drizzle_t;
336
 
#endif
337
 
 
338
 
/**
339
 
 * @ingroup drizzle_query
340
 
 * Options for drizzle_query_st.
341
 
 */
342
 
enum drizzle_query_options_t
343
 
{
344
 
  DRIZZLE_QUERY_NONE,
345
 
  DRIZZLE_QUERY_ALLOCATED= (1 << 0)
346
 
};
347
 
 
348
 
#ifndef __cplusplus
349
 
typedef enum drizzle_query_options_t drizzle_query_options_t;
350
 
#endif
351
 
 
352
 
/**
353
190
 * @ingroup drizzle_query
354
191
 * States for drizle_query_st.
355
192
 */
372
209
enum drizzle_result_options_t
373
210
{
374
211
  DRIZZLE_RESULT_NONE=          0,
375
 
  DRIZZLE_RESULT_ALLOCATED=     (1 << 0),
 
212
  DRIZZLE_RESULT_ALLOCATED=     (1 << 0), // DEPRECATED
376
213
  DRIZZLE_RESULT_SKIP_COLUMN=   (1 << 1),
377
214
  DRIZZLE_RESULT_BUFFER_COLUMN= (1 << 2),
378
215
  DRIZZLE_RESULT_BUFFER_ROW=    (1 << 3),
390
227
 */
391
228
enum drizzle_column_options_t
392
229
{
393
 
  DRIZZLE_COLUMN_ALLOCATED= (1 << 0)
 
230
  DRIZZLE_COLUMN_ALLOCATED= (1 << 0) // DEPRECATED
394
231
};
395
232
 
396
233
#ifndef __cplusplus