~drizzle-trunk/drizzle/development

« back to all changes in this revision

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