~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.h

  • Committer: Brian Aker
  • Date: 2008-07-31 19:57:34 UTC
  • mfrom: (236.1.27 codestyle)
  • Revision ID: brian@tangent.org-20080731195734-c7cu4gx70xgjr68o
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2003 DRIZZLE AB
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 MySQL
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
15
20
 
16
21
/*
17
22
  This file defines the client API to DRIZZLE and also the ABI of the
18
23
  dynamically linked libdrizzleclient.
19
24
 
20
 
  The ABI should never be changed in a released product of MySQL
21
 
  thus you need to take great care when changing the file. In case
22
 
  the file is changed so the ABI is broken, you must also
23
 
  update the SHAREDLIB_MAJOR_VERSION in configure.in .
 
25
  In case the file is changed so the ABI is broken, you must also
 
26
  update the SHAREDLIB_MAJOR_VERSION in configure.ac.
24
27
 
25
28
*/
26
29
 
27
 
#ifndef _drizzle_h
28
 
#define _drizzle_h
 
30
#ifndef _libdrizzle_drizzle_h
 
31
#define _libdrizzle_drizzle_h
29
32
 
30
33
#ifdef  __cplusplus
31
34
extern "C" {
93
96
 
94
97
#define DRIZZLE_COUNT_ERROR (~(uint64_t) 0)
95
98
 
96
 
/* backward compatibility define - to be removed eventually */
97
 
#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
98
 
 
99
99
typedef struct st_drizzle_rows {
100
100
  struct st_drizzle_rows *next;    /* list of rows */
101
101
  DRIZZLE_ROW data;
291
291
*/
292
292
#define drizzle_library_end drizzle_server_end
293
293
 
294
 
DRIZZLE_PARAMETERS *STDCALL drizzle_get_parameters(void);
 
294
const DRIZZLE_PARAMETERS *STDCALL drizzle_get_parameters(void);
295
295
 
296
296
/*
297
297
  Set up and bring down a thread; these function should be called
307
307
  Should definitely be used if one uses shared libraries.
308
308
*/
309
309
 
310
 
uint64_t STDCALL drizzle_num_rows(DRIZZLE_RES *res);
311
 
unsigned int STDCALL drizzle_num_fields(DRIZZLE_RES *res);
312
 
bool STDCALL drizzle_eof(DRIZZLE_RES *res);
313
 
DRIZZLE_FIELD *STDCALL drizzle_fetch_field_direct(DRIZZLE_RES *res,
 
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,
314
314
                unsigned int fieldnr);
315
 
DRIZZLE_FIELD * STDCALL drizzle_fetch_fields(DRIZZLE_RES *res);
316
 
DRIZZLE_ROW_OFFSET STDCALL DRIZZLE_ROW_tell(DRIZZLE_RES *res);
317
 
DRIZZLE_FIELD_OFFSET STDCALL drizzle_field_tell(DRIZZLE_RES *res);
 
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
318
 
319
 
uint32_t STDCALL drizzle_field_count(DRIZZLE *drizzle);
320
 
uint64_t STDCALL drizzle_affected_rows(DRIZZLE *drizzle);
321
 
uint64_t STDCALL drizzle_insert_id(DRIZZLE *drizzle);
322
 
uint32_t STDCALL drizzle_errno(DRIZZLE *drizzle);
323
 
const char * STDCALL drizzle_error(DRIZZLE *drizzle);
324
 
const char *STDCALL drizzle_sqlstate(DRIZZLE *drizzle);
325
 
uint32_t STDCALL drizzle_warning_count(DRIZZLE *drizzle);
326
 
const char * STDCALL drizzle_info(DRIZZLE *drizzle);
327
 
uint32_t STDCALL drizzle_thread_id(DRIZZLE *drizzle);
328
 
const char * STDCALL drizzle_character_set_name(DRIZZLE *drizzle);
 
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
329
int32_t          STDCALL drizzle_set_character_set(DRIZZLE *drizzle, const char *csname);
330
330
 
331
331
DRIZZLE * STDCALL drizzle_create(DRIZZLE *drizzle);
345
345
DRIZZLE_RES * STDCALL drizzle_store_result(DRIZZLE *drizzle);
346
346
DRIZZLE_RES * STDCALL drizzle_use_result(DRIZZLE *drizzle);
347
347
 
348
 
void        STDCALL drizzle_get_character_set_info(DRIZZLE *drizzle,
 
348
void        STDCALL drizzle_get_character_set_info(const DRIZZLE *drizzle,
349
349
                                                   MY_CHARSET_INFO *charset);
350
350
 
351
351
/* local infile support */
369
369
int32_t    STDCALL drizzle_set_server_option(DRIZZLE *drizzle, enum enum_drizzle_set_option option);
370
370
int32_t    STDCALL drizzle_ping(DRIZZLE *drizzle);
371
371
const char *  STDCALL drizzle_stat(DRIZZLE *drizzle);
372
 
const char *  STDCALL drizzle_get_server_info(DRIZZLE *drizzle);
 
372
const char *  STDCALL drizzle_get_server_info(const DRIZZLE *drizzle);
373
373
const char *  STDCALL drizzle_get_client_info(void);
374
374
uint32_t  STDCALL drizzle_get_client_version(void);
375
 
const char *  STDCALL drizzle_get_host_info(DRIZZLE *drizzle);
376
 
uint32_t  STDCALL drizzle_get_server_version(DRIZZLE *drizzle);
377
 
uint32_t  STDCALL drizzle_get_proto_info(DRIZZLE *drizzle);
 
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
378
DRIZZLE_RES *  STDCALL drizzle_list_dbs(DRIZZLE *drizzle,const char *wild);
379
379
DRIZZLE_RES *  STDCALL drizzle_list_tables(DRIZZLE *drizzle,const char *wild);
380
380
DRIZZLE_RES *  STDCALL drizzle_list_processes(DRIZZLE *drizzle);
390
390
uint32_t  STDCALL drizzle_escape_string(char *to,const char *from, uint32_t from_length);
391
391
uint32_t  STDCALL drizzle_hex_string(char *to,const char *from, uint32_t from_length);
392
392
uint32_t        STDCALL drizzle_real_escape_string(DRIZZLE *drizzle, char *to, const char *from, uint32_t length);
393
 
void    STDCALL myodbc_remove_escape(DRIZZLE *drizzle,char *name);
 
393
void    STDCALL myodbc_remove_escape(const DRIZZLE *drizzle, char *name);
394
394
uint32_t  STDCALL drizzle_thread_safe(void);
395
395
bool    STDCALL drizzle_embedded(void);
396
396
bool         STDCALL drizzle_read_query_result(DRIZZLE *drizzle);
415
415
  int32_t (*unbuffered_fetch)(DRIZZLE *drizzle, char **row);
416
416
  const char *(*read_statistics)(DRIZZLE *drizzle);
417
417
  bool (*next_result)(DRIZZLE *drizzle);
418
 
  int32_t (*read_change_user_result)(DRIZZLE *drizzle, char *buff, const char *passwd);
 
418
  int32_t (*read_change_user_result)(DRIZZLE *drizzle);
419
419
} DRIZZLE_METHODS;
420
420
 
421
421
 
422
422
bool STDCALL drizzle_commit(DRIZZLE *drizzle);
423
423
bool STDCALL drizzle_rollback(DRIZZLE *drizzle);
424
424
bool STDCALL drizzle_autocommit(DRIZZLE *drizzle, bool auto_mode);
425
 
bool STDCALL drizzle_more_results(DRIZZLE *drizzle);
 
425
bool STDCALL drizzle_more_results(const DRIZZLE *drizzle);
426
426
int STDCALL drizzle_next_result(DRIZZLE *drizzle);
427
427
void STDCALL drizzle_close(DRIZZLE *sock);
428
428
 
431
431
#define DRIZZLE_NO_DATA        100
432
432
#define DRIZZLE_DATA_TRUNCATED 101
433
433
 
 
434
 
 
435
#define DRIZZLE_PROTOCOL_NO_MORE_DATA 0xFE
 
436
 
434
437
#define drizzle_reload(drizzle) drizzle_refresh((drizzle),REFRESH_GRANT)
435
438
 
436
439
/*
446
449
}
447
450
#endif
448
451
 
449
 
#endif /* _drizzle_h */
 
452
#endif /* _libdrizzle_drizzle_h */