~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.h

  • Committer: Brian Aker
  • Date: 2008-08-10 17:18:41 UTC
  • mfrom: (287.3.13 codestyle)
  • Revision ID: brian@tangent.org-20080810171841-pkvi2ky94wbd0nt5
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
/** 
38
38
 * @TODO cleanup global.h and include only the necessary stuff here... 
39
39
 * 
40
 
 * Also, my_bool should go bye-bye...
41
40
 */
42
41
#ifndef DRIZZLE_SERVER_GLOBAL_H   /* If not standard header */
43
42
#include <sys/types.h>
44
 
typedef char my_bool;
45
 
#define STDCALL
46
 
 
47
43
#endif /* DRIZZLE_SERVER_GLOBAL_H */
48
44
 
49
45
#include <libdrizzle/drizzle_com.h>
74
70
  char *db;                   /* Database for table */
75
71
  char *catalog;        /* Catalog for table */
76
72
  char *def;                  /* Default value (set by drizzle_list_fields) */
77
 
  unsigned long length;       /* Width of column (create length) */
78
 
  unsigned long max_length;   /* Max width for selected set */
 
73
  uint32_t length;       /* Width of column (create length) */
 
74
  uint32_t max_length;   /* Max width for selected set */
79
75
  unsigned int name_length;
80
76
  unsigned int org_name_length;
81
77
  unsigned int table_length;
278
274
  work when linked against either the standard client library or the
279
275
  embedded server library, these functions should be called.
280
276
*/
281
 
void STDCALL drizzle_server_end(void);
 
277
void drizzle_server_end(void);
282
278
 
283
279
/*
284
280
  drizzle_server_init/end need to be called when using libdrizzle or
291
287
*/
292
288
#define drizzle_library_end drizzle_server_end
293
289
 
294
 
const DRIZZLE_PARAMETERS *STDCALL drizzle_get_parameters(void);
 
290
const DRIZZLE_PARAMETERS * drizzle_get_parameters(void);
295
291
 
296
292
/*
297
293
  Set up and bring down a thread; these function should be called
299
295
  connection.  All uses of the connection(s) should be between these
300
296
  function calls.
301
297
*/
302
 
bool STDCALL drizzle_thread_init(void);
303
 
void STDCALL drizzle_thread_end(void);
 
298
bool drizzle_thread_init(void);
 
299
void drizzle_thread_end(void);
304
300
 
305
301
/*
306
302
  Functions to get information from the DRIZZLE and DRIZZLE_RES structures
307
303
  Should definitely be used if one uses shared libraries.
308
304
*/
309
305
 
310
 
uint64_t STDCALL drizzle_num_rows(const DRIZZLE_RES *res);
311
 
unsigned int STDCALL drizzle_num_fields(const DRIZZLE_RES *res);
312
 
bool STDCALL drizzle_eof(const DRIZZLE_RES *res);
313
 
const DRIZZLE_FIELD *STDCALL drizzle_fetch_field_direct(const DRIZZLE_RES *res,
 
306
uint64_t drizzle_num_rows(const DRIZZLE_RES *res);
 
307
unsigned int drizzle_num_fields(const DRIZZLE_RES *res);
 
308
bool drizzle_eof(const DRIZZLE_RES *res);
 
309
const DRIZZLE_FIELD * drizzle_fetch_field_direct(const DRIZZLE_RES *res,
314
310
                unsigned int fieldnr);
315
 
const DRIZZLE_FIELD * STDCALL drizzle_fetch_fields(const DRIZZLE_RES *res);
316
 
DRIZZLE_ROW_OFFSET STDCALL drizzle_row_tell(const DRIZZLE_RES *res);
317
 
DRIZZLE_FIELD_OFFSET STDCALL drizzle_field_tell(const DRIZZLE_RES *res);
318
 
 
319
 
uint32_t STDCALL drizzle_field_count(const DRIZZLE *drizzle);
320
 
uint64_t STDCALL drizzle_affected_rows(const DRIZZLE *drizzle);
321
 
uint64_t STDCALL drizzle_insert_id(const DRIZZLE *drizzle);
322
 
uint32_t STDCALL drizzle_errno(const DRIZZLE *drizzle);
323
 
const char * STDCALL drizzle_error(const DRIZZLE *drizzle);
324
 
const char *STDCALL drizzle_sqlstate(const DRIZZLE *drizzle);
325
 
uint32_t STDCALL drizzle_warning_count(const DRIZZLE *drizzle);
326
 
const char * STDCALL drizzle_info(const DRIZZLE *drizzle);
327
 
uint32_t STDCALL drizzle_thread_id(const DRIZZLE *drizzle);
328
 
const char * STDCALL drizzle_character_set_name(const DRIZZLE *drizzle);
329
 
int32_t          STDCALL drizzle_set_character_set(DRIZZLE *drizzle, const char *csname);
330
 
 
331
 
DRIZZLE * STDCALL drizzle_create(DRIZZLE *drizzle);
332
 
bool   STDCALL drizzle_change_user(DRIZZLE *drizzle, const char *user,
 
311
const DRIZZLE_FIELD * drizzle_fetch_fields(const DRIZZLE_RES *res);
 
312
DRIZZLE_ROW_OFFSET drizzle_row_tell(const DRIZZLE_RES *res);
 
313
DRIZZLE_FIELD_OFFSET drizzle_field_tell(const DRIZZLE_RES *res);
 
314
 
 
315
uint32_t drizzle_field_count(const DRIZZLE *drizzle);
 
316
uint64_t drizzle_affected_rows(const DRIZZLE *drizzle);
 
317
uint64_t drizzle_insert_id(const DRIZZLE *drizzle);
 
318
uint32_t drizzle_errno(const DRIZZLE *drizzle);
 
319
const char * drizzle_error(const DRIZZLE *drizzle);
 
320
const char * drizzle_sqlstate(const DRIZZLE *drizzle);
 
321
uint32_t drizzle_warning_count(const DRIZZLE *drizzle);
 
322
const char * drizzle_info(const DRIZZLE *drizzle);
 
323
uint32_t drizzle_thread_id(const DRIZZLE *drizzle);
 
324
const char * drizzle_character_set_name(const DRIZZLE *drizzle);
 
325
int32_t          drizzle_set_character_set(DRIZZLE *drizzle, const char *csname);
 
326
 
 
327
DRIZZLE * drizzle_create(DRIZZLE *drizzle);
 
328
bool   drizzle_change_user(DRIZZLE *drizzle, const char *user,
333
329
            const char *passwd, const char *db);
334
 
DRIZZLE * STDCALL drizzle_connect(DRIZZLE *drizzle, const char *host,
 
330
DRIZZLE * drizzle_connect(DRIZZLE *drizzle, const char *host,
335
331
             const char *user,
336
332
             const char *passwd,
337
333
             const char *db,
338
334
             uint32_t port,
339
335
             const char *unix_socket,
340
336
             uint32_t clientflag);
341
 
int32_t    STDCALL drizzle_select_db(DRIZZLE *drizzle, const char *db);
342
 
int32_t    STDCALL drizzle_query(DRIZZLE *drizzle, const char *q);
343
 
int32_t    STDCALL drizzle_send_query(DRIZZLE *drizzle, const char *q, uint32_t length);
344
 
int32_t    STDCALL drizzle_real_query(DRIZZLE *drizzle, const char *q, uint32_t length);
345
 
DRIZZLE_RES * STDCALL drizzle_store_result(DRIZZLE *drizzle);
346
 
DRIZZLE_RES * STDCALL drizzle_use_result(DRIZZLE *drizzle);
 
337
int32_t    drizzle_select_db(DRIZZLE *drizzle, const char *db);
 
338
int32_t    drizzle_query(DRIZZLE *drizzle, const char *q);
 
339
int32_t    drizzle_send_query(DRIZZLE *drizzle, const char *q, uint32_t length);
 
340
int32_t    drizzle_real_query(DRIZZLE *drizzle, const char *q, uint32_t length);
 
341
DRIZZLE_RES * drizzle_store_result(DRIZZLE *drizzle);
 
342
DRIZZLE_RES * drizzle_use_result(DRIZZLE *drizzle);
347
343
 
348
 
void        STDCALL drizzle_get_character_set_info(const DRIZZLE *drizzle,
 
344
void        drizzle_get_character_set_info(const DRIZZLE *drizzle,
349
345
                                                   MY_CHARSET_INFO *charset);
350
346
 
351
347
/* local infile support */
362
358
void
363
359
drizzle_set_local_infile_default(DRIZZLE *drizzle);
364
360
 
365
 
int32_t    STDCALL drizzle_shutdown(DRIZZLE *drizzle, enum drizzle_enum_shutdown_level shutdown_level);
366
 
int32_t    STDCALL drizzle_dump_debug_info(DRIZZLE *drizzle);
367
 
int32_t    STDCALL drizzle_refresh(DRIZZLE *drizzle, uint32_t refresh_options);
368
 
int32_t    STDCALL drizzle_kill(DRIZZLE *drizzle, uint32_t pid);
369
 
int32_t    STDCALL drizzle_set_server_option(DRIZZLE *drizzle, enum enum_drizzle_set_option option);
370
 
int32_t    STDCALL drizzle_ping(DRIZZLE *drizzle);
371
 
const char *  STDCALL drizzle_stat(DRIZZLE *drizzle);
372
 
const char *  STDCALL drizzle_get_server_info(const DRIZZLE *drizzle);
373
 
const char *  STDCALL drizzle_get_client_info(void);
374
 
uint32_t  STDCALL drizzle_get_client_version(void);
375
 
const char *  STDCALL drizzle_get_host_info(const DRIZZLE *drizzle);
376
 
uint32_t  STDCALL drizzle_get_server_version(const DRIZZLE *drizzle);
377
 
uint32_t  STDCALL drizzle_get_proto_info(const DRIZZLE *drizzle);
378
 
DRIZZLE_RES *  STDCALL drizzle_list_tables(DRIZZLE *drizzle,const char *wild);
379
 
DRIZZLE_RES *  STDCALL drizzle_list_processes(DRIZZLE *drizzle);
380
 
int32_t    STDCALL drizzle_options(DRIZZLE *drizzle,enum drizzle_option option, const void *arg);
381
 
void    STDCALL drizzle_free_result(DRIZZLE_RES *result);
382
 
void    STDCALL drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
383
 
DRIZZLE_ROW_OFFSET STDCALL drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
384
 
DRIZZLE_FIELD_OFFSET STDCALL drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
385
 
DRIZZLE_ROW  STDCALL drizzle_fetch_row(DRIZZLE_RES *result);
386
 
uint32_t * STDCALL drizzle_fetch_lengths(DRIZZLE_RES *result);
387
 
DRIZZLE_FIELD *  STDCALL drizzle_fetch_field(DRIZZLE_RES *result);
388
 
DRIZZLE_RES *     STDCALL drizzle_list_fields(DRIZZLE *drizzle, const char *table, const char *wild);
389
 
uint32_t  STDCALL drizzle_escape_string(char *to,const char *from, uint32_t from_length);
390
 
uint32_t  STDCALL drizzle_hex_string(char *to,const char *from, uint32_t from_length);
391
 
uint32_t        STDCALL drizzle_real_escape_string(DRIZZLE *drizzle, char *to, const char *from, uint32_t length);
392
 
void    STDCALL myodbc_remove_escape(const DRIZZLE *drizzle, char *name);
393
 
uint32_t  STDCALL drizzle_thread_safe(void);
394
 
bool    STDCALL drizzle_embedded(void);
395
 
bool         STDCALL drizzle_read_query_result(DRIZZLE *drizzle);
 
361
int32_t    drizzle_shutdown(DRIZZLE *drizzle, enum drizzle_enum_shutdown_level shutdown_level);
 
362
int32_t    drizzle_dump_debug_info(DRIZZLE *drizzle);
 
363
int32_t    drizzle_refresh(DRIZZLE *drizzle, uint32_t refresh_options);
 
364
int32_t    drizzle_kill(DRIZZLE *drizzle, uint32_t pid);
 
365
int32_t    drizzle_set_server_option(DRIZZLE *drizzle, enum enum_drizzle_set_option option);
 
366
int32_t    drizzle_ping(DRIZZLE *drizzle);
 
367
const char *  drizzle_stat(DRIZZLE *drizzle);
 
368
const char *  drizzle_get_server_info(const DRIZZLE *drizzle);
 
369
const char *  drizzle_get_client_info(void);
 
370
uint32_t  drizzle_get_client_version(void);
 
371
const char *  drizzle_get_host_info(const DRIZZLE *drizzle);
 
372
uint32_t  drizzle_get_server_version(const DRIZZLE *drizzle);
 
373
uint32_t  drizzle_get_proto_info(const DRIZZLE *drizzle);
 
374
DRIZZLE_RES *  drizzle_list_tables(DRIZZLE *drizzle,const char *wild);
 
375
DRIZZLE_RES *  drizzle_list_processes(DRIZZLE *drizzle);
 
376
int32_t    drizzle_options(DRIZZLE *drizzle,enum drizzle_option option, const void *arg);
 
377
void    drizzle_free_result(DRIZZLE_RES *result);
 
378
void    drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
 
379
DRIZZLE_ROW_OFFSET drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
 
380
DRIZZLE_FIELD_OFFSET drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
 
381
DRIZZLE_ROW  drizzle_fetch_row(DRIZZLE_RES *result);
 
382
uint32_t * drizzle_fetch_lengths(DRIZZLE_RES *result);
 
383
DRIZZLE_FIELD *  drizzle_fetch_field(DRIZZLE_RES *result);
 
384
DRIZZLE_RES *     drizzle_list_fields(DRIZZLE *drizzle, const char *table, const char *wild);
 
385
uint32_t  drizzle_escape_string(char *to,const char *from, uint32_t from_length);
 
386
uint32_t  drizzle_hex_string(char *to,const char *from, uint32_t from_length);
 
387
uint32_t        drizzle_real_escape_string(DRIZZLE *drizzle, char *to, const char *from, uint32_t length);
 
388
void    myodbc_remove_escape(const DRIZZLE *drizzle, char *name);
 
389
uint32_t  drizzle_thread_safe(void);
 
390
bool    drizzle_embedded(void);
 
391
bool         drizzle_read_query_result(DRIZZLE *drizzle);
396
392
 
397
393
 
398
394
 
418
414
} DRIZZLE_METHODS;
419
415
 
420
416
 
421
 
bool STDCALL drizzle_commit(DRIZZLE *drizzle);
422
 
bool STDCALL drizzle_rollback(DRIZZLE *drizzle);
423
 
bool STDCALL drizzle_autocommit(DRIZZLE *drizzle, bool auto_mode);
424
 
bool STDCALL drizzle_more_results(const DRIZZLE *drizzle);
425
 
int STDCALL drizzle_next_result(DRIZZLE *drizzle);
426
 
void STDCALL drizzle_close(DRIZZLE *sock);
 
417
bool drizzle_commit(DRIZZLE *drizzle);
 
418
bool drizzle_rollback(DRIZZLE *drizzle);
 
419
bool drizzle_autocommit(DRIZZLE *drizzle, bool auto_mode);
 
420
bool drizzle_more_results(const DRIZZLE *drizzle);
 
421
int drizzle_next_result(DRIZZLE *drizzle);
 
422
void drizzle_close(DRIZZLE *sock);
427
423
 
428
424
 
429
425
/* status return codes */