1
/* Copyright (C) 2000-2003 DRIZZLE AB
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.
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.
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:
4
* Copyright (C) 2008 MySQL
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.
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.
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
17
22
This file defines the client API to DRIZZLE and also the ABI of the
18
23
dynamically linked libdrizzleclient.
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.
30
#ifndef _libdrizzle_drizzle_h
31
#define _libdrizzle_drizzle_h
307
307
Should definitely be used if one uses shared libraries.
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);
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);
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);
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);
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;
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);