~drizzle-trunk/drizzle/development

206.3.1 by Patrick Galbraith
Most everything working with client rename
1
/* Copyright (C) 2000-2003 DRIZZLE AB
1 by brian
clean slate
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 */
15
16
/*
206.3.1 by Patrick Galbraith
Most everything working with client rename
17
  This file defines the client API to DRIZZLE and also the ABI of the
18
  dynamically linked libdrizzleclient.
1 by brian
clean slate
19
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 .
24
25
*/
26
206.3.1 by Patrick Galbraith
Most everything working with client rename
27
#ifndef _drizzle_h
28
#define _drizzle_h
1 by brian
clean slate
29
206.3.1 by Patrick Galbraith
Most everything working with client rename
30
#ifdef  __cplusplus
1 by brian
clean slate
31
extern "C" {
32
#endif
33
206.3.1 by Patrick Galbraith
Most everything working with client rename
34
#ifndef _global_h        /* If not standard header */
1 by brian
clean slate
35
#include <sys/types.h>
36
typedef char my_bool;
37
#define STDCALL
38
39
#ifndef my_socket_defined
40
typedef int my_socket;
41
#endif /* my_socket_defined */
42
#endif /* _global_h */
43
77.1.39 by Monty Taylor
More mysql->drizzle renaming.
44
#include "drizzle_version.h"
45
#include "drizzle_com.h"
46
#include "drizzle_time.h"
1 by brian
clean slate
47
212.5.28 by Monty Taylor
Moved my_bit and my_list
48
#include <mysys/my_list.h> /* for LISTs used in 'MYSQL' */
1 by brian
clean slate
49
206.3.1 by Patrick Galbraith
Most everything working with client rename
50
extern unsigned int drizzle_port;
51
extern char *drizzle_unix_port;
52
53
#define CLIENT_NET_READ_TIMEOUT    365*24*3600  /* Timeout on read */
54
#define CLIENT_NET_WRITE_TIMEOUT  365*24*3600  /* Timeout on write */
55
56
#define IS_PRI_KEY(n)  ((n) & PRI_KEY_FLAG)
57
#define IS_NOT_NULL(n)  ((n) & NOT_NULL_FLAG)
58
#define IS_BLOB(n)  ((n) & BLOB_FLAG)
222 by Brian Aker
Remove YEAR field type
59
#define IS_NUM(t)  ((t) <= DRIZZLE_TYPE_LONGLONG || (t) == DRIZZLE_TYPE_NEWDECIMAL)
206.3.1 by Patrick Galbraith
Most everything working with client rename
60
#define IS_NUM_FIELD(f)   ((f)->flags & NUM_FLAG)
222 by Brian Aker
Remove YEAR field type
61
#define INTERNAL_NUM_FIELD(f) (((f)->type <= DRIZZLE_TYPE_LONGLONG && ((f)->type != DRIZZLE_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)))
212.2.2 by Patrick Galbraith
Renamed FIELD_TYPE to DRIZZLE_TYPE
62
#define IS_LONGDATA(t) ((t) >= DRIZZLE_TYPE_TINY_BLOB && (t) <= DRIZZLE_TYPE_STRING)
1 by brian
clean slate
63
64
206.3.1 by Patrick Galbraith
Most everything working with client rename
65
typedef struct st_drizzle_field {
1 by brian
clean slate
66
  char *name;                 /* Name of column */
67
  char *org_name;             /* Original column name, if an alias */
68
  char *table;                /* Table of column if column was a field */
69
  char *org_table;            /* Org table name, if table was an alias */
70
  char *db;                   /* Database for table */
206.3.1 by Patrick Galbraith
Most everything working with client rename
71
  char *catalog;        /* Catalog for table */
72
  char *def;                  /* Default value (set by drizzle_list_fields) */
1 by brian
clean slate
73
  unsigned long length;       /* Width of column (create length) */
74
  unsigned long max_length;   /* Max width for selected set */
75
  unsigned int name_length;
76
  unsigned int org_name_length;
77
  unsigned int table_length;
78
  unsigned int org_table_length;
79
  unsigned int db_length;
80
  unsigned int catalog_length;
81
  unsigned int def_length;
82
  unsigned int flags;         /* Div flags */
83
  unsigned int decimals;      /* Number of decimals in field */
84
  unsigned int charsetnr;     /* Character set */
206.3.1 by Patrick Galbraith
Most everything working with client rename
85
  enum enum_field_types type; /* Type of field. See drizzle_com.h for types */
1 by brian
clean slate
86
  void *extension;
206.3.1 by Patrick Galbraith
Most everything working with client rename
87
} DRIZZLE_FIELD;
1 by brian
clean slate
88
206.3.1 by Patrick Galbraith
Most everything working with client rename
89
typedef char **DRIZZLE_ROW;    /* return data as array of strings */
90
typedef unsigned int DRIZZLE_FIELD_OFFSET; /* offset to current field */
1 by brian
clean slate
91
212.5.32 by Monty Taylor
Moved typelib to mysys.
92
#include <mysys/typelib.h>
1 by brian
clean slate
93
206.3.1 by Patrick Galbraith
Most everything working with client rename
94
#define DRIZZLE_COUNT_ERROR (~(uint64_t) 0)
1 by brian
clean slate
95
96
/* backward compatibility define - to be removed eventually */
97
#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
98
206.3.1 by Patrick Galbraith
Most everything working with client rename
99
typedef struct st_drizzle_rows {
100
  struct st_drizzle_rows *next;    /* list of rows */
101
  DRIZZLE_ROW data;
1 by brian
clean slate
102
  unsigned long length;
206.3.1 by Patrick Galbraith
Most everything working with client rename
103
} DRIZZLE_ROWS;
1 by brian
clean slate
104
206.3.1 by Patrick Galbraith
Most everything working with client rename
105
typedef DRIZZLE_ROWS *DRIZZLE_ROW_OFFSET;  /* offset to current row */
1 by brian
clean slate
106
212.5.8 by Monty Taylor
Moved my_alloc.h to mysys.
107
#include <mysys/my_alloc.h>
1 by brian
clean slate
108
109
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
206.3.1 by Patrick Galbraith
Most everything working with client rename
110
typedef struct st_drizzle_data {
111
  DRIZZLE_ROWS *data;
1 by brian
clean slate
112
  struct embedded_query_result *embedded_info;
113
  MEM_ROOT alloc;
155 by Brian Aker
Removing a few "additional" ways of saying uint64_t
114
  uint64_t rows;
1 by brian
clean slate
115
  unsigned int fields;
116
  /* extra info for embedded library */
117
  void *extension;
206.3.1 by Patrick Galbraith
Most everything working with client rename
118
} DRIZZLE_DATA;
1 by brian
clean slate
119
206.3.1 by Patrick Galbraith
Most everything working with client rename
120
enum drizzle_option
1 by brian
clean slate
121
{
206.3.1 by Patrick Galbraith
Most everything working with client rename
122
  DRIZZLE_OPT_CONNECT_TIMEOUT, DRIZZLE_OPT_COMPRESS, DRIZZLE_OPT_NAMED_PIPE,
123
  DRIZZLE_INIT_COMMAND, DRIZZLE_READ_DEFAULT_FILE, DRIZZLE_READ_DEFAULT_GROUP,
124
  DRIZZLE_SET_CHARSET_DIR, DRIZZLE_SET_CHARSET_NAME, DRIZZLE_OPT_LOCAL_INFILE,
125
  DRIZZLE_OPT_PROTOCOL, DRIZZLE_SHARED_MEMORY_BASE_NAME, DRIZZLE_OPT_READ_TIMEOUT,
126
  DRIZZLE_OPT_WRITE_TIMEOUT, DRIZZLE_OPT_USE_RESULT,
127
  DRIZZLE_OPT_USE_REMOTE_CONNECTION, DRIZZLE_OPT_USE_EMBEDDED_CONNECTION,
128
  DRIZZLE_OPT_GUESS_CONNECTION, DRIZZLE_SET_CLIENT_IP, DRIZZLE_SECURE_AUTH,
129
  DRIZZLE_REPORT_DATA_TRUNCATION, DRIZZLE_OPT_RECONNECT,
130
  DRIZZLE_OPT_SSL_VERIFY_SERVER_CERT
1 by brian
clean slate
131
};
132
206.3.1 by Patrick Galbraith
Most everything working with client rename
133
struct st_drizzle_options {
1 by brian
clean slate
134
  unsigned int connect_timeout, read_timeout, write_timeout;
135
  unsigned int port, protocol;
136
  unsigned long client_flag;
137
  char *host,*user,*password,*unix_socket,*db;
138
  struct st_dynamic_array *init_commands;
139
  char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
206.3.1 by Patrick Galbraith
Most everything working with client rename
140
  char *ssl_key;        /* PEM key file */
141
  char *ssl_cert;        /* PEM cert file */
142
  char *ssl_ca;          /* PEM CA file */
143
  char *ssl_capath;        /* PEM directory of CA-s? */
144
  char *ssl_cipher;        /* cipher to use */
1 by brian
clean slate
145
  char *shared_memory_base_name;
146
  unsigned long max_allowed_packet;
206.3.1 by Patrick Galbraith
Most everything working with client rename
147
  my_bool use_ssl;        /* if to use SSL or not */
1 by brian
clean slate
148
  my_bool compress,named_pipe;
149
  my_bool unused1;
150
  my_bool unused2;
151
  my_bool unused3;
152
  my_bool unused4;
206.3.1 by Patrick Galbraith
Most everything working with client rename
153
  enum drizzle_option methods_to_use;
1 by brian
clean slate
154
  char *client_ip;
155
  /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
156
  my_bool secure_auth;
157
  /* 0 - never report, 1 - always report (default) */
158
  my_bool report_data_truncation;
159
160
  /* function pointers for local infile support */
161
  int (*local_infile_init)(void **, const char *, void *);
162
  int (*local_infile_read)(void *, char *, unsigned int);
163
  void (*local_infile_end)(void *);
164
  int (*local_infile_error)(void *, char *, unsigned int);
165
  void *local_infile_userdata;
166
  void *extension;
167
};
168
206.3.1 by Patrick Galbraith
Most everything working with client rename
169
enum drizzle_status
1 by brian
clean slate
170
{
206.3.1 by Patrick Galbraith
Most everything working with client rename
171
  DRIZZLE_STATUS_READY,DRIZZLE_STATUS_GET_RESULT,DRIZZLE_STATUS_USE_RESULT
1 by brian
clean slate
172
};
173
206.3.1 by Patrick Galbraith
Most everything working with client rename
174
enum drizzle_protocol_type
1 by brian
clean slate
175
{
206.3.1 by Patrick Galbraith
Most everything working with client rename
176
  DRIZZLE_PROTOCOL_DEFAULT, DRIZZLE_PROTOCOL_TCP, DRIZZLE_PROTOCOL_SOCKET,
177
  DRIZZLE_PROTOCOL_PIPE, DRIZZLE_PROTOCOL_MEMORY
1 by brian
clean slate
178
};
179
180
typedef struct character_set
181
{
182
  unsigned int      number;     /* character set number              */
183
  unsigned int      state;      /* character set state               */
184
  const char        *csname;    /* collation name                    */
185
  const char        *name;      /* character set name                */
186
  const char        *comment;   /* comment                           */
187
  const char        *dir;       /* character set directory           */
188
  unsigned int      mbminlen;   /* min. length for multibyte strings */
189
  unsigned int      mbmaxlen;   /* max. length for multibyte strings */
190
} MY_CHARSET_INFO;
191
206.3.1 by Patrick Galbraith
Most everything working with client rename
192
struct st_drizzle_methods;
193
struct st_drizzle_stmt;
1 by brian
clean slate
194
206.3.1 by Patrick Galbraith
Most everything working with client rename
195
typedef struct st_drizzle
1 by brian
clean slate
196
{
206.3.1 by Patrick Galbraith
Most everything working with client rename
197
  NET    net;      /* Communication parameters */
198
  unsigned char  *connector_fd;    /* ConnectorFd for SSL */
199
  char    *host,*user,*passwd,*unix_socket,*server_version,*host_info;
1 by brian
clean slate
200
  char          *info, *db;
201
  struct charset_info_st *charset;
206.3.1 by Patrick Galbraith
Most everything working with client rename
202
  DRIZZLE_FIELD  *fields;
203
  MEM_ROOT  field_alloc;
155 by Brian Aker
Removing a few "additional" ways of saying uint64_t
204
  uint64_t affected_rows;
206.3.1 by Patrick Galbraith
Most everything working with client rename
205
  uint64_t insert_id;    /* id if insert on table with NEXTNR */
206
  uint64_t extra_info;    /* Not used */
207
  uint32_t thread_id;    /* Id for connection in server */
164 by Brian Aker
Commit cleanup of export types.
208
  uint32_t packet_length;
206.3.1 by Patrick Galbraith
Most everything working with client rename
209
  uint32_t  port;
164 by Brian Aker
Commit cleanup of export types.
210
  uint32_t client_flag,server_capabilities;
206.3.1 by Patrick Galbraith
Most everything working with client rename
211
  uint32_t  protocol_version;
212
  uint32_t  field_count;
213
  uint32_t  server_status;
164 by Brian Aker
Commit cleanup of export types.
214
  uint32_t  server_language;
206.3.1 by Patrick Galbraith
Most everything working with client rename
215
  uint32_t  warning_count;
216
  struct st_drizzle_options options;
217
  enum drizzle_status status;
218
  bool  free_me;    /* If free in drizzle_close */
219
  bool  reconnect;    /* set to 1 if automatic reconnect */
1 by brian
clean slate
220
221
  /* session-wide random string */
206.3.1 by Patrick Galbraith
Most everything working with client rename
222
  char          scramble[SCRAMBLE_LENGTH+1];
164 by Brian Aker
Commit cleanup of export types.
223
  bool unused1;
1 by brian
clean slate
224
  void *unused2, *unused3, *unused4, *unused5;
225
226
  LIST  *stmts;                     /* list of all statements */
206.3.1 by Patrick Galbraith
Most everything working with client rename
227
  const struct st_drizzle_methods *methods;
1 by brian
clean slate
228
  void *thd;
229
  /*
206.3.1 by Patrick Galbraith
Most everything working with client rename
230
    Points to boolean flag in DRIZZLE_RES  or MYSQL_STMT. We set this flag
231
    from drizzle_stmt_close if close had to cancel result set of this object.
1 by brian
clean slate
232
  */
164 by Brian Aker
Commit cleanup of export types.
233
  bool *unbuffered_fetch_owner;
1 by brian
clean slate
234
  /* needed for embedded server - no net buffer to store the 'info' */
235
  char *info_buffer;
236
  void *extension;
206.3.1 by Patrick Galbraith
Most everything working with client rename
237
} DRIZZLE;
238
239
240
typedef struct st_drizzle_res {
155 by Brian Aker
Removing a few "additional" ways of saying uint64_t
241
  uint64_t  row_count;
206.3.1 by Patrick Galbraith
Most everything working with client rename
242
  DRIZZLE_FIELD  *fields;
243
  DRIZZLE_DATA  *data;
244
  DRIZZLE_ROWS  *data_cursor;
245
  uint32_t *lengths;    /* column lengths of current row */
246
  DRIZZLE *handle;    /* for unbuffered reads */
247
  const struct st_drizzle_methods *methods;
248
  DRIZZLE_ROW  row;      /* If unbuffered read */
249
  DRIZZLE_ROW  current_row;    /* buffer to current row */
250
  MEM_ROOT  field_alloc;
251
  uint32_t  field_count, current_field;
252
  bool  eof;      /* Used by drizzle_fetch_row */
253
  /* drizzle_stmt_close() had to cancel this result */
254
  bool       unbuffered_fetch_cancelled; 
1 by brian
clean slate
255
  void *extension;
206.3.1 by Patrick Galbraith
Most everything working with client rename
256
} DRIZZLE_RES;
1 by brian
clean slate
257
258
259
#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
260
#define MYSQL_CLIENT
261
#endif
262
263
206.3.1 by Patrick Galbraith
Most everything working with client rename
264
typedef struct st_drizzle_parameters
1 by brian
clean slate
265
{
164 by Brian Aker
Commit cleanup of export types.
266
  uint32_t *p_max_allowed_packet;
267
  uint32_t *p_net_buffer_length;
1 by brian
clean slate
268
  void *extension;
206.3.1 by Patrick Galbraith
Most everything working with client rename
269
} DRIZZLE_PARAMETERS;
1 by brian
clean slate
270
271
#if !defined(MYSQL_SERVER)
206.3.1 by Patrick Galbraith
Most everything working with client rename
272
#define max_allowed_packet (*drizzle_get_parameters()->p_max_allowed_packet)
273
#define net_buffer_length (*drizzle_get_parameters()->p_net_buffer_length)
1 by brian
clean slate
274
#endif
275
276
/*
277
  Set up and bring down the server; to ensure that applications will
278
  work when linked against either the standard client library or the
279
  embedded server library, these functions should be called.
280
*/
206.3.1 by Patrick Galbraith
Most everything working with client rename
281
void STDCALL drizzle_server_end(void);
1 by brian
clean slate
282
283
/*
206.3.1 by Patrick Galbraith
Most everything working with client rename
284
  drizzle_server_init/end need to be called when using libdrizzle or
285
  libdrizzleclient (exactly, drizzle_server_init() is called by drizzle_init() so
1 by brian
clean slate
286
  you don't need to call it explicitely; but you need to call
206.3.1 by Patrick Galbraith
Most everything working with client rename
287
  drizzle_server_end() to free memory). The names are a bit misleading
288
  (drizzle_SERVER* to be used when using libdrizzleCLIENT). So we add more general
289
  names which suit well whether you're using libdrizzled or libdrizzleclient. We
290
  intend to promote these aliases over the drizzle_server* ones.
1 by brian
clean slate
291
*/
206.3.1 by Patrick Galbraith
Most everything working with client rename
292
#define drizzle_library_end drizzle_server_end
1 by brian
clean slate
293
206.3.1 by Patrick Galbraith
Most everything working with client rename
294
DRIZZLE_PARAMETERS *STDCALL drizzle_get_parameters(void);
1 by brian
clean slate
295
296
/*
297
  Set up and bring down a thread; these function should be called
298
  for each thread in an application which opens at least one MySQL
299
  connection.  All uses of the connection(s) should be between these
300
  function calls.
301
*/
207.2.3 by Toru Maesaka
Merge from trunk and conflicts resolved
302
bool STDCALL drizzle_thread_init(void);
206.3.1 by Patrick Galbraith
Most everything working with client rename
303
void STDCALL drizzle_thread_end(void);
1 by brian
clean slate
304
305
/*
206.3.1 by Patrick Galbraith
Most everything working with client rename
306
  Functions to get information from the DRIZZLE and DRIZZLE_RES structures
1 by brian
clean slate
307
  Should definitely be used if one uses shared libraries.
308
*/
309
206.3.1 by Patrick Galbraith
Most everything working with client rename
310
uint64_t STDCALL drizzle_num_rows(DRIZZLE_RES *res);
311
unsigned int STDCALL drizzle_num_fields(DRIZZLE_RES *res);
207.2.3 by Toru Maesaka
Merge from trunk and conflicts resolved
312
bool STDCALL drizzle_eof(DRIZZLE_RES *res);
206.3.1 by Patrick Galbraith
Most everything working with client rename
313
DRIZZLE_FIELD *STDCALL drizzle_fetch_field_direct(DRIZZLE_RES *res,
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);
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);
329
int32_t          STDCALL drizzle_set_character_set(DRIZZLE *drizzle, const char *csname);
330
202.2.4 by Monty Taylor
Merged from Patrick.
331
DRIZZLE * STDCALL drizzle_create(DRIZZLE *drizzle);
207.2.3 by Toru Maesaka
Merge from trunk and conflicts resolved
332
bool   STDCALL drizzle_change_user(DRIZZLE *drizzle, const char *user,
206.3.1 by Patrick Galbraith
Most everything working with client rename
333
            const char *passwd, const char *db);
334
DRIZZLE * STDCALL drizzle_connect(DRIZZLE *drizzle, const char *host,
335
             const char *user,
336
             const char *passwd,
337
             const char *db,
338
             uint32_t port,
339
             const char *unix_socket,
340
             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);
347
348
void        STDCALL drizzle_get_character_set_info(DRIZZLE *drizzle,
202.2.4 by Monty Taylor
Merged from Patrick.
349
                                                   MY_CHARSET_INFO *charset);
1 by brian
clean slate
350
351
/* local infile support */
352
353
#define LOCAL_INFILE_ERROR_LEN 512
354
355
void
206.3.1 by Patrick Galbraith
Most everything working with client rename
356
drizzle_set_local_infile_handler(DRIZZLE *drizzle,
357
        int (*local_infile_init)(void **, const char *, void *),
358
        int (*local_infile_read)(void *, char *, unsigned int),
359
        void (*local_infile_end)(void *),int (*local_infile_error)
360
        (void *, char*, unsigned int), void *);
1 by brian
clean slate
361
362
void
206.3.1 by Patrick Galbraith
Most everything working with client rename
363
drizzle_set_local_infile_default(DRIZZLE *drizzle);
364
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(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(DRIZZLE *drizzle);
376
uint32_t  STDCALL drizzle_get_server_version(DRIZZLE *drizzle);
377
uint32_t  STDCALL drizzle_get_proto_info(DRIZZLE *drizzle);
378
DRIZZLE_RES *  STDCALL drizzle_list_dbs(DRIZZLE *drizzle,const char *wild);
379
DRIZZLE_RES *  STDCALL drizzle_list_tables(DRIZZLE *drizzle,const char *wild);
380
DRIZZLE_RES *  STDCALL drizzle_list_processes(DRIZZLE *drizzle);
381
int32_t    STDCALL drizzle_options(DRIZZLE *drizzle,enum drizzle_option option, const void *arg);
382
void    STDCALL drizzle_free_result(DRIZZLE_RES *result);
383
void    STDCALL drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
384
DRIZZLE_ROW_OFFSET STDCALL drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
385
DRIZZLE_FIELD_OFFSET STDCALL drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
386
DRIZZLE_ROW  STDCALL drizzle_fetch_row(DRIZZLE_RES *result);
387
uint32_t * STDCALL drizzle_fetch_lengths(DRIZZLE_RES *result);
388
DRIZZLE_FIELD *  STDCALL drizzle_fetch_field(DRIZZLE_RES *result);
389
DRIZZLE_RES *     STDCALL drizzle_list_fields(DRIZZLE *drizzle, const char *table, const char *wild);
390
uint32_t  STDCALL drizzle_escape_string(char *to,const char *from, uint32_t from_length);
391
uint32_t  STDCALL drizzle_hex_string(char *to,const char *from, uint32_t from_length);
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);
394
uint32_t  STDCALL drizzle_thread_safe(void);
207.2.3 by Toru Maesaka
Merge from trunk and conflicts resolved
395
bool    STDCALL drizzle_embedded(void);
396
bool         STDCALL drizzle_read_query_result(DRIZZLE *drizzle);
206.3.1 by Patrick Galbraith
Most everything working with client rename
397
398
399
400
typedef struct st_drizzle_methods
1 by brian
clean slate
401
{
206.3.1 by Patrick Galbraith
Most everything working with client rename
402
  bool (*read_query_result)(DRIZZLE *drizzle);
403
  bool (*advanced_command)(DRIZZLE *drizzle,
164 by Brian Aker
Commit cleanup of export types.
404
                           enum enum_server_command command,
405
                           const unsigned char *header,
406
                           uint32_t header_length,
407
                           const unsigned char *arg,
408
                           uint32_t arg_length,
409
                           bool skip_check);
206.3.1 by Patrick Galbraith
Most everything working with client rename
410
  DRIZZLE_DATA *(*read_rows)(DRIZZLE *drizzle,DRIZZLE_FIELD *drizzle_fields, uint32_t fields);
411
  DRIZZLE_RES * (*use_result)(DRIZZLE *drizzle);
412
  void (*fetch_lengths)(uint32_t *to, DRIZZLE_ROW column, uint32_t field_count);
413
  void (*flush_use_result)(DRIZZLE *drizzle);
414
  DRIZZLE_FIELD * (*list_fields)(DRIZZLE *drizzle);
415
  int32_t (*unbuffered_fetch)(DRIZZLE *drizzle, char **row);
416
  const char *(*read_statistics)(DRIZZLE *drizzle);
417
  bool (*next_result)(DRIZZLE *drizzle);
418
  int32_t (*read_change_user_result)(DRIZZLE *drizzle, char *buff, const char *passwd);
419
} DRIZZLE_METHODS;
420
421
207.2.3 by Toru Maesaka
Merge from trunk and conflicts resolved
422
bool STDCALL drizzle_commit(DRIZZLE *drizzle);
423
bool STDCALL drizzle_rollback(DRIZZLE *drizzle);
424
bool STDCALL drizzle_autocommit(DRIZZLE *drizzle, bool auto_mode);
425
bool STDCALL drizzle_more_results(DRIZZLE *drizzle);
206.3.1 by Patrick Galbraith
Most everything working with client rename
426
int STDCALL drizzle_next_result(DRIZZLE *drizzle);
427
void STDCALL drizzle_close(DRIZZLE *sock);
1 by brian
clean slate
428
429
430
/* status return codes */
206.3.1 by Patrick Galbraith
Most everything working with client rename
431
#define DRIZZLE_NO_DATA        100
432
#define DRIZZLE_DATA_TRUNCATED 101
1 by brian
clean slate
433
206.3.1 by Patrick Galbraith
Most everything working with client rename
434
#define drizzle_reload(drizzle) drizzle_refresh((drizzle),REFRESH_GRANT)
1 by brian
clean slate
435
436
/*
206.3.1 by Patrick Galbraith
Most everything working with client rename
437
  The following functions are mainly exported because of binlog;
1 by brian
clean slate
438
  They are not for general usage
439
*/
440
206.3.1 by Patrick Galbraith
Most everything working with client rename
441
#define simple_command(drizzle, command, arg, length, skip_check) \
442
  (*(drizzle)->methods->advanced_command)(drizzle, command, 0,  \
50 by Brian Aker
Remaining major pieces of PS removed
443
                                        0, arg, length, skip_check)
1 by brian
clean slate
444
206.3.1 by Patrick Galbraith
Most everything working with client rename
445
#ifdef  __cplusplus
1 by brian
clean slate
446
}
447
#endif
448
206.3.1 by Patrick Galbraith
Most everything working with client rename
449
#endif /* _drizzle_h */