~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to include/drizzle.h

  • Committer: Brian Aker
  • Date: 2008-07-15 08:57:01 UTC
  • Revision ID: brian@tangent.org-20080715085701-h7i77in02mqsg2sv
Commit cleanup of export types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
  uint64_t affected_rows;
208
208
  uint64_t insert_id;           /* id if insert on table with NEXTNR */
209
209
  uint64_t extra_info;          /* Not used */
210
 
  unsigned long thread_id;              /* Id for connection in server */
211
 
  unsigned long packet_length;
212
 
  unsigned int  port;
213
 
  unsigned long client_flag,server_capabilities;
214
 
  unsigned int  protocol_version;
215
 
  unsigned int  field_count;
216
 
  unsigned int  server_status;
217
 
  unsigned int  server_language;
218
 
  unsigned int  warning_count;
 
210
  uint32_t thread_id;           /* Id for connection in server */
 
211
  uint32_t packet_length;
 
212
  uint32_t      port;
 
213
  uint32_t client_flag,server_capabilities;
 
214
  uint32_t      protocol_version;
 
215
  uint32_t      field_count;
 
216
  uint32_t      server_status;
 
217
  uint32_t  server_language;
 
218
  uint32_t      warning_count;
219
219
  struct st_mysql_options options;
220
220
  enum mysql_status status;
221
 
  my_bool       free_me;                /* If free in mysql_close */
222
 
  my_bool       reconnect;              /* set to 1 if automatic reconnect */
 
221
  bool  free_me;                /* If free in mysql_close */
 
222
  bool  reconnect;              /* set to 1 if automatic reconnect */
223
223
 
224
224
  /* session-wide random string */
225
225
  char          scramble[SCRAMBLE_LENGTH+1];
226
 
  my_bool unused1;
 
226
  bool unused1;
227
227
  void *unused2, *unused3, *unused4, *unused5;
228
228
 
229
229
  LIST  *stmts;                     /* list of all statements */
233
233
    Points to boolean flag in MYSQL_RES  or MYSQL_STMT. We set this flag 
234
234
    from mysql_stmt_close if close had to cancel result set of this object.
235
235
  */
236
 
  my_bool *unbuffered_fetch_owner;
 
236
  bool *unbuffered_fetch_owner;
237
237
  /* needed for embedded server - no net buffer to store the 'info' */
238
238
  char *info_buffer;
239
239
  void *extension;
245
245
  MYSQL_FIELD   *fields;
246
246
  MYSQL_DATA    *data;
247
247
  MYSQL_ROWS    *data_cursor;
248
 
  unsigned long *lengths;               /* column lengths of current row */
 
248
  uint32_t *lengths;            /* column lengths of current row */
249
249
  MYSQL         *handle;                /* for unbuffered reads */
250
250
  const struct st_mysql_methods *methods;
251
251
  MYSQL_ROW     row;                    /* If unbuffered read */
252
252
  MYSQL_ROW     current_row;            /* buffer to current row */
253
253
  MEM_ROOT      field_alloc;
254
 
  unsigned int  field_count, current_field;
255
 
  my_bool       eof;                    /* Used by mysql_fetch_row */
 
254
  uint32_t      field_count, current_field;
 
255
  bool  eof;                    /* Used by mysql_fetch_row */
256
256
  /* mysql_stmt_close() had to cancel this result */
257
 
  my_bool       unbuffered_fetch_cancelled;  
 
257
  bool       unbuffered_fetch_cancelled;  
258
258
  void *extension;
259
259
} MYSQL_RES;
260
260
 
266
266
 
267
267
typedef struct st_mysql_parameters
268
268
{
269
 
  unsigned long *p_max_allowed_packet;
270
 
  unsigned long *p_net_buffer_length;
 
269
  uint32_t *p_max_allowed_packet;
 
270
  uint32_t *p_net_buffer_length;
271
271
  void *extension;
272
272
} MYSQL_PARAMETERS;
273
273
 
321
321
MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res);
322
322
MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res);
323
323
 
324
 
unsigned int STDCALL mysql_field_count(MYSQL *mysql);
 
324
uint32_t STDCALL mysql_field_count(MYSQL *mysql);
325
325
uint64_t STDCALL mysql_affected_rows(MYSQL *mysql);
326
326
uint64_t STDCALL mysql_insert_id(MYSQL *mysql);
327
 
unsigned int STDCALL mysql_errno(MYSQL *mysql);
 
327
uint32_t STDCALL mysql_errno(MYSQL *mysql);
328
328
const char * STDCALL mysql_error(MYSQL *mysql);
329
329
const char *STDCALL mysql_sqlstate(MYSQL *mysql);
330
 
unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
 
330
uint32_t STDCALL mysql_warning_count(MYSQL *mysql);
331
331
const char * STDCALL mysql_info(MYSQL *mysql);
332
 
unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
 
332
uint32_t STDCALL mysql_thread_id(MYSQL *mysql);
333
333
const char * STDCALL mysql_character_set_name(MYSQL *mysql);
334
 
int          STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
 
334
int32_t          STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
335
335
 
336
336
MYSQL *         STDCALL mysql_init(MYSQL *mysql);
337
 
my_bool         STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
338
 
                                      const char *cert, const char *ca,
339
 
                                      const char *capath, const char *cipher);
340
 
const char *    STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
341
337
my_bool         STDCALL mysql_change_user(MYSQL *mysql, const char *user, 
342
338
                                          const char *passwd, const char *db);
343
339
MYSQL *         STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
344
340
                                           const char *user,
345
341
                                           const char *passwd,
346
342
                                           const char *db,
347
 
                                           unsigned int port,
 
343
                                           uint32_t port,
348
344
                                           const char *unix_socket,
349
 
                                           unsigned long clientflag);
350
 
int             STDCALL mysql_select_db(MYSQL *mysql, const char *db);
351
 
int             STDCALL mysql_query(MYSQL *mysql, const char *q);
352
 
int             STDCALL mysql_send_query(MYSQL *mysql, const char *q,
353
 
                                         unsigned long length);
354
 
int             STDCALL mysql_real_query(MYSQL *mysql, const char *q,
355
 
                                        unsigned long length);
 
345
                                           uint32_t clientflag);
 
346
int32_t         STDCALL mysql_select_db(MYSQL *mysql, const char *db);
 
347
int32_t         STDCALL mysql_query(MYSQL *mysql, const char *q);
 
348
int32_t         STDCALL mysql_send_query(MYSQL *mysql, const char *q, uint32_t length);
 
349
int32_t         STDCALL mysql_real_query(MYSQL *mysql, const char *q, uint32_t length);
356
350
MYSQL_RES *     STDCALL mysql_store_result(MYSQL *mysql);
357
351
MYSQL_RES *     STDCALL mysql_use_result(MYSQL *mysql);
358
352
 
377
371
void
378
372
mysql_set_local_infile_default(MYSQL *mysql);
379
373
 
380
 
int             STDCALL mysql_shutdown(MYSQL *mysql,
381
 
                                       enum mysql_enum_shutdown_level
382
 
                                       shutdown_level);
383
 
int             STDCALL mysql_dump_debug_info(MYSQL *mysql);
384
 
int             STDCALL mysql_refresh(MYSQL *mysql,
385
 
                                     unsigned int refresh_options);
386
 
int             STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
387
 
int             STDCALL mysql_set_server_option(MYSQL *mysql,
388
 
                                                enum enum_mysql_set_option
389
 
                                                option);
390
 
int             STDCALL mysql_ping(MYSQL *mysql);
 
374
int32_t         STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
 
375
int32_t         STDCALL mysql_dump_debug_info(MYSQL *mysql);
 
376
int32_t         STDCALL mysql_refresh(MYSQL *mysql, uint32_t refresh_options);
 
377
int32_t         STDCALL mysql_kill(MYSQL *mysql, uint32_t pid);
 
378
int32_t         STDCALL mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option);
 
379
int32_t         STDCALL mysql_ping(MYSQL *mysql);
391
380
const char *    STDCALL mysql_stat(MYSQL *mysql);
392
381
const char *    STDCALL mysql_get_server_info(MYSQL *mysql);
393
382
const char *    STDCALL mysql_get_client_info(void);
394
 
unsigned long   STDCALL mysql_get_client_version(void);
 
383
uint32_t        STDCALL mysql_get_client_version(void);
395
384
const char *    STDCALL mysql_get_host_info(MYSQL *mysql);
396
 
unsigned long   STDCALL mysql_get_server_version(MYSQL *mysql);
397
 
unsigned int    STDCALL mysql_get_proto_info(MYSQL *mysql);
 
385
uint32_t        STDCALL mysql_get_server_version(MYSQL *mysql);
 
386
uint32_t        STDCALL mysql_get_proto_info(MYSQL *mysql);
398
387
MYSQL_RES *     STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
399
388
MYSQL_RES *     STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
400
389
MYSQL_RES *     STDCALL mysql_list_processes(MYSQL *mysql);
401
 
int             STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
402
 
                                      const void *arg);
 
390
int32_t         STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg);
403
391
void            STDCALL mysql_free_result(MYSQL_RES *result);
404
 
void            STDCALL mysql_data_seek(MYSQL_RES *result,
405
 
                                        uint64_t offset);
406
 
MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result,
407
 
                                                MYSQL_ROW_OFFSET offset);
408
 
MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
409
 
                                           MYSQL_FIELD_OFFSET offset);
 
392
void            STDCALL mysql_data_seek(MYSQL_RES *result, uint64_t offset);
 
393
MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET offset);
 
394
MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset);
410
395
MYSQL_ROW       STDCALL mysql_fetch_row(MYSQL_RES *result);
411
 
unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
 
396
uint32_t * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
412
397
MYSQL_FIELD *   STDCALL mysql_fetch_field(MYSQL_RES *result);
413
 
MYSQL_RES *     STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
414
 
                                          const char *wild);
415
 
unsigned long   STDCALL mysql_escape_string(char *to,const char *from,
416
 
                                            unsigned long from_length);
417
 
unsigned long   STDCALL mysql_hex_string(char *to,const char *from,
418
 
                                         unsigned long from_length);
419
 
unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
420
 
                                               char *to,const char *from,
421
 
                                               unsigned long length);
 
398
MYSQL_RES *     STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild);
 
399
uint32_t        STDCALL mysql_escape_string(char *to,const char *from, uint32_t from_length);
 
400
uint32_t        STDCALL mysql_hex_string(char *to,const char *from, uint32_t from_length);
 
401
uint32_t        STDCALL mysql_real_escape_string(MYSQL *mysql, char *to, const char *from, uint32_t length);
422
402
void            STDCALL mysql_debug(const char *debug);
423
403
void            STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
424
 
unsigned int    STDCALL mysql_thread_safe(void);
 
404
uint32_t        STDCALL mysql_thread_safe(void);
425
405
my_bool         STDCALL mysql_embedded(void);
426
406
my_bool         STDCALL mysql_read_query_result(MYSQL *mysql);
427
407
 
429
409
 
430
410
typedef struct st_mysql_methods
431
411
{
432
 
  my_bool (*read_query_result)(MYSQL *mysql);
433
 
  my_bool (*advanced_command)(MYSQL *mysql,
434
 
                              enum enum_server_command command,
435
 
                              const unsigned char *header,
436
 
                              unsigned long header_length,
437
 
                              const unsigned char *arg,
438
 
                              unsigned long arg_length,
439
 
                              my_bool skip_check);
440
 
  MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
441
 
                           unsigned int fields);
 
412
  bool (*read_query_result)(MYSQL *mysql);
 
413
  bool (*advanced_command)(MYSQL *mysql,
 
414
                           enum enum_server_command command,
 
415
                           const unsigned char *header,
 
416
                           uint32_t header_length,
 
417
                           const unsigned char *arg,
 
418
                           uint32_t arg_length,
 
419
                           bool skip_check);
 
420
  MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, uint32_t fields);
442
421
  MYSQL_RES * (*use_result)(MYSQL *mysql);
443
 
  void (*fetch_lengths)(unsigned long *to, 
444
 
                        MYSQL_ROW column, unsigned int field_count);
 
422
  void (*fetch_lengths)(uint32_t *to, MYSQL_ROW column, uint32_t field_count);
445
423
  void (*flush_use_result)(MYSQL *mysql);
446
424
  MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
447
 
  int (*unbuffered_fetch)(MYSQL *mysql, char **row);
 
425
  int32_t (*unbuffered_fetch)(MYSQL *mysql, char **row);
448
426
  const char *(*read_statistics)(MYSQL *mysql);
449
 
  my_bool (*next_result)(MYSQL *mysql);
450
 
  int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
 
427
  bool (*next_result)(MYSQL *mysql);
 
428
  int32_t (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
451
429
} MYSQL_METHODS;
452
430
 
453
431
 
465
443
 
466
444
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
467
445
 
468
 
#ifdef USE_OLD_FUNCTIONS
469
 
MYSQL *         STDCALL mysql_connect(MYSQL *mysql, const char *host,
470
 
                                      const char *user, const char *passwd);
471
 
int             STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
472
 
int             STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
473
 
#endif
474
 
#define HAVE_MYSQL_REAL_CONNECT
475
 
 
476
446
/*
477
447
  The following functions are mainly exported because of mysqlbinlog;
478
448
  They are not for general usage