~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-07 22:27:02 UTC
  • mfrom: (2449.1.4 drizzle-build)
  • Revision ID: me@mark.atwood.name-20111107222702-crj09kujv9awkylo
mergeĀ lp:~brianaker/drizzle/libdrizzle-update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Drizzle Client & Protocol Library
3
3
 *
 
4
 * Copyright (C) 2011 Brian Aker (brian@tangent.org)
4
5
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
5
6
 * All rights reserved.
6
7
 *
34
35
 *
35
36
 */
36
37
 
 
38
#pragma once
 
39
 
37
40
/**
38
41
 * @file
39
42
 * @brief Defines, typedefs, enums, and macros
40
43
 */
41
44
 
42
 
#ifndef __DRIZZLE_CONSTANTS_H
43
 
#define __DRIZZLE_CONSTANTS_H
44
 
 
45
45
#include <stdint.h>
46
46
 
47
47
#ifdef __cplusplus
92
92
/**
93
93
 * Return codes.
94
94
 */
95
 
typedef enum
 
95
enum drizzle_return_t
96
96
{
97
97
  DRIZZLE_RETURN_OK,
98
98
  DRIZZLE_RETURN_IO_WAIT,
119
119
  DRIZZLE_RETURN_NO_ACTIVE_CONNECTIONS,
120
120
  DRIZZLE_RETURN_HANDSHAKE_FAILED,
121
121
  DRIZZLE_RETURN_TIMEOUT,
 
122
  DRIZZLE_RETURN_INVALID_ARGUMENT,
122
123
  DRIZZLE_RETURN_MAX /* Always add new codes to the end before this one. */
123
 
} drizzle_return_t;
 
124
};
 
125
 
 
126
#ifndef __cplusplus
 
127
typedef enum drizzle_return_t drizzle_return_t
 
128
#endif
124
129
 
125
130
/**
126
131
 * Verbosity levels.
127
132
 */
128
 
typedef enum
 
133
enum drizzle_verbose_t
129
134
{
130
135
  DRIZZLE_VERBOSE_NEVER,
131
136
  DRIZZLE_VERBOSE_FATAL,
134
139
  DRIZZLE_VERBOSE_DEBUG,
135
140
  DRIZZLE_VERBOSE_CRAZY,
136
141
  DRIZZLE_VERBOSE_MAX
137
 
} drizzle_verbose_t;
 
142
};
 
143
 
 
144
#ifndef __cplusplus
 
145
typedef enum drizzle_verbose_t drizzle_verbose_t;
 
146
#endif
138
147
 
139
148
/** @} */
140
149
 
142
151
 * @ingroup drizzle
143
152
 * Options for drizzle_st.
144
153
 */
145
 
typedef enum
 
154
enum drizzle_options_t
146
155
{
147
156
  DRIZZLE_NONE=            0,
148
157
  DRIZZLE_ALLOCATED=       (1 << 0),
149
158
  DRIZZLE_NON_BLOCKING=    (1 << 1),
150
159
  DRIZZLE_FREE_OBJECTS=    (1 << 2),
151
160
  DRIZZLE_ASSERT_DANGLING= (1 << 3)
152
 
} drizzle_options_t;
 
161
};
 
162
 
 
163
#ifndef __cplusplus
 
164
typedef enum drizzle_options_t drizzle_options_t;
 
165
#endif
153
166
 
154
167
/**
155
168
 * @ingroup drizzle_con
156
169
 * Options for drizzle_con_st.
157
170
 */
158
 
typedef enum
 
171
enum drizzle_con_options_t
159
172
{
160
173
  DRIZZLE_CON_NONE=             0,
161
174
  DRIZZLE_CON_ALLOCATED=        (1 << 0),
171
184
  DRIZZLE_CON_INTERACTIVE=      (1 << 11),
172
185
  DRIZZLE_CON_MULTI_STATEMENTS= (1 << 12),
173
186
  DRIZZLE_CON_AUTH_PLUGIN=      (1 << 13)
174
 
} drizzle_con_options_t;
 
187
};
 
188
 
 
189
#ifndef __cplusplus
 
190
typedef enum drizzle_con_options_t drizzle_con_options_t;
 
191
#endif
175
192
 
176
193
/**
177
194
 * @ingroup drizzle_con
178
195
 * Socket types for drizzle_con_st.
179
196
 */
180
 
typedef enum
 
197
enum drizzle_con_socket_t
181
198
{
182
199
  DRIZZLE_CON_SOCKET_TCP= 0,
183
200
  DRIZZLE_CON_SOCKET_UDS= (1 << 0)
184
 
} drizzle_con_socket_t;
 
201
};
 
202
 
 
203
#ifndef __cplusplus
 
204
typedef enum drizzle_con_socket_t drizzle_con_socket_t;
 
205
#endif
185
206
 
186
207
/**
187
208
 * @ingroup drizzle_con
188
209
 * Status flags for drizle_con_st.
189
210
 */
190
 
typedef enum
 
211
enum drizzle_con_status_t
191
212
{
192
213
  DRIZZLE_CON_STATUS_NONE=                     0,
193
214
  DRIZZLE_CON_STATUS_IN_TRANS=                 (1 << 0),
200
221
  DRIZZLE_CON_STATUS_DB_DROPPED=               (1 << 8),
201
222
  DRIZZLE_CON_STATUS_NO_BACKSLASH_ESCAPES=     (1 << 9),
202
223
  DRIZZLE_CON_STATUS_QUERY_WAS_SLOW=           (1 << 10)
203
 
} drizzle_con_status_t;
 
224
};
 
225
 
 
226
#ifndef __cplusplus
 
227
typedef enum drizzle_con_status_t drizzle_con_status_t;
 
228
#endif
204
229
 
205
230
/**
206
231
 * @ingroup drizzle_con
207
232
 * Capabilities for drizzle_con_st.
208
233
 */
209
 
typedef enum
 
234
enum drizzle_capabilities_t
210
235
{
211
236
  DRIZZLE_CAPABILITIES_NONE=                   0,
212
237
  DRIZZLE_CAPABILITIES_LONG_PASSWORD=          (1 << 0),
239
264
                                DRIZZLE_CAPABILITIES_TRANSACTIONS |
240
265
                                DRIZZLE_CAPABILITIES_PROTOCOL_41 |
241
266
                                DRIZZLE_CAPABILITIES_SECURE_CONNECTION)
242
 
} drizzle_capabilities_t;
 
267
};
 
268
 
 
269
#ifndef __cplusplus
 
270
typedef enum drizzle_capabilities_t drizzle_capabilities_t;
 
271
#endif
243
272
 
244
273
/**
245
274
 * @ingroup drizzle_command 
246
275
 * Commands for drizzle_command functions.
247
276
 */
248
 
typedef enum
 
277
enum drizzle_command_t
249
278
{
250
279
  DRIZZLE_COMMAND_SLEEP,               /* Not used currently. */
251
280
  DRIZZLE_COMMAND_QUIT,
278
307
  DRIZZLE_COMMAND_STMT_FETCH,          /* Not used currently. */
279
308
  DRIZZLE_COMMAND_DAEMON,              /* Not used currently. */
280
309
  DRIZZLE_COMMAND_END                  /* Not used currently. */
281
 
} drizzle_command_t;
 
310
};
 
311
 
 
312
#ifndef __cplusplus
 
313
typedef enum drizzle_command_t drizzle_command_t;
 
314
#endif
282
315
 
283
316
/**
284
317
 * @ingroup drizzle_command 
285
318
 * Commands for the Drizzle protocol functions.
286
319
 */
287
 
typedef enum
 
320
enum drizzle_command_drizzle_t
288
321
{
289
322
  DRIZZLE_COMMAND_DRIZZLE_SLEEP,
290
323
  DRIZZLE_COMMAND_DRIZZLE_QUIT,
295
328
  DRIZZLE_COMMAND_DRIZZLE_PING,
296
329
  DRIZZLE_COMMAND_DRIZZLE_KILL,
297
330
  DRIZZLE_COMMAND_DRIZZLE_END
298
 
} drizzle_command_drizzle_t;
 
331
};
 
332
 
 
333
#ifndef __cplusplus
 
334
typedef enum drizzle_command_drizzle_t drizzle_command_drizzle_t;
 
335
#endif
299
336
 
300
337
/**
301
338
 * @ingroup drizzle_query
302
339
 * Options for drizzle_query_st.
303
340
 */
304
 
typedef enum
 
341
enum drizzle_query_options_t
305
342
{
306
343
  DRIZZLE_QUERY_NONE,
307
344
  DRIZZLE_QUERY_ALLOCATED= (1 << 0)
308
 
} drizzle_query_options_t;
 
345
};
 
346
 
 
347
#ifndef __cplusplus
 
348
typedef enum drizzle_query_options_t drizzle_query_options_t;
 
349
#endif
309
350
 
310
351
/**
311
352
 * @ingroup drizzle_query
312
353
 * States for drizle_query_st.
313
354
 */
314
 
typedef enum
 
355
enum drizzle_query_state_t
315
356
{
316
357
  DRIZZLE_QUERY_STATE_INIT,
317
358
  DRIZZLE_QUERY_STATE_QUERY,
318
359
  DRIZZLE_QUERY_STATE_RESULT,
319
360
  DRIZZLE_QUERY_STATE_DONE
320
 
} drizzle_query_state_t;
 
361
};
 
362
 
 
363
#ifndef __cplusplus
 
364
enum drizzle_query_state_t drizzle_query_state_t;
 
365
#endif
321
366
 
322
367
/**
323
368
 * @ingroup drizzle_result
324
369
 * Options for drizzle_result_st.
325
370
 */
326
 
typedef enum
 
371
enum drizzle_result_options_t
327
372
{
328
373
  DRIZZLE_RESULT_NONE=          0,
329
374
  DRIZZLE_RESULT_ALLOCATED=     (1 << 0),
332
377
  DRIZZLE_RESULT_BUFFER_ROW=    (1 << 3),
333
378
  DRIZZLE_RESULT_EOF_PACKET=    (1 << 4),
334
379
  DRIZZLE_RESULT_ROW_BREAK=     (1 << 5)
335
 
} drizzle_result_options_t;
 
380
};
 
381
 
 
382
#ifndef __cplusplus
 
383
typedef enum drizzle_result_options_t drizzle_result_options_t;
 
384
#endif
336
385
 
337
386
/**
338
387
 * @ingroup drizzle_column
339
388
 * Options for drizzle_column_st.
340
389
 */
341
 
typedef enum
 
390
enum drizzle_column_options_t
342
391
{
343
392
  DRIZZLE_COLUMN_ALLOCATED= (1 << 0)
344
 
} drizzle_column_options_t;
 
393
};
 
394
 
 
395
#ifndef __cplusplus
 
396
typedef enum drizzle_column_options_t drizzle_column_options_t;
 
397
#endif
345
398
 
346
399
/**
347
400
 * @ingroup drizzle_column
348
401
 * Types for drizzle_column_st.
349
402
 */
350
 
typedef enum
 
403
enum drizzle_column_type_t
351
404
{
352
405
  DRIZZLE_COLUMN_TYPE_DECIMAL,
353
406
  DRIZZLE_COLUMN_TYPE_TINY,
376
429
  DRIZZLE_COLUMN_TYPE_VAR_STRING=  253,
377
430
  DRIZZLE_COLUMN_TYPE_STRING=      254,
378
431
  DRIZZLE_COLUMN_TYPE_GEOMETRY=    255
379
 
} drizzle_column_type_t;
 
432
};
 
433
 
 
434
#ifndef __cplusplus
 
435
typedef enum drizzle_column_type_t drizzle_column_type_t;
 
436
#endif
380
437
 
381
438
/**
382
439
 * @ingroup drizzle_column
383
440
 * Types for drizzle_column_st for Drizzle.
384
441
 */
385
 
typedef enum
 
442
enum drizzle_column_type_drizzle_t
386
443
{
387
444
  DRIZZLE_COLUMN_TYPE_DRIZZLE_TINY,
388
445
  DRIZZLE_COLUMN_TYPE_DRIZZLE_LONG,
401
458
  DRIZZLE_COLUMN_TYPE_DRIZZLE_UUID,
402
459
  DRIZZLE_COLUMN_TYPE_DRIZZLE_MICROTIME,
403
460
  DRIZZLE_COLUMN_TYPE_DRIZZLE_MAX=DRIZZLE_COLUMN_TYPE_DRIZZLE_MICROTIME
404
 
} drizzle_column_type_drizzle_t;
 
461
};
 
462
 
 
463
#ifndef __cplusplus
 
464
typedef enum drizzle_column_type_drizzle_t drizzle_column_type_drizzle_t;
 
465
#endif
405
466
 
406
467
/**
407
468
 * @ingroup drizzle_column
408
469
 * Flags for drizzle_column_st.
409
470
 */
410
 
typedef enum
 
471
enum drizzle_column_flags_t
411
472
{
412
473
  DRIZZLE_COLUMN_FLAGS_NONE=             0,
413
474
  DRIZZLE_COLUMN_FLAGS_NOT_NULL=         (1 << 0),
433
494
  DRIZZLE_COLUMN_FLAGS_IN_PART_FUNC=     (1 << 19),
434
495
  DRIZZLE_COLUMN_FLAGS_IN_ADD_INDEX=     (1 << 20),
435
496
  DRIZZLE_COLUMN_FLAGS_RENAMED=          (1 << 21)
436
 
} drizzle_column_flags_t;
 
497
};
 
498
 
 
499
#ifndef __cplusplus
 
500
typedef enum drizzle_column_flags_t drizzle_column_flags_t;
 
501
#endif
437
502
 
438
503
/**
439
504
 * @addtogroup drizzle_types Types
570
635
#ifdef __cplusplus
571
636
}
572
637
#endif
573
 
 
574
 
#endif /* __DRIZZLE_CONSTANTS_H */