~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.h

  • Committer: Monty Taylor
  • Date: 2008-09-14 19:39:48 UTC
  • mfrom: (383.1.43 client-split)
  • Revision ID: monty@inaugust.com-20080914193948-ns2p0lts4qtsqx7n
Merged from client-split.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#endif /* DRIZZLE_SERVER_GLOBAL_H */
44
44
 
45
45
#include <libdrizzle/drizzle_com.h>
46
 
#include <mysys/drizzle_time.h>
47
46
 
48
47
extern unsigned int drizzle_port;
49
48
extern char *drizzle_unix_port;
87
86
typedef char **DRIZZLE_ROW;    /* return data as array of strings */
88
87
typedef unsigned int DRIZZLE_FIELD_OFFSET; /* offset to current field */
89
88
 
90
 
#include <mysys/typelib.h>
91
89
 
92
90
#define DRIZZLE_COUNT_ERROR (~(uint64_t) 0)
93
91
 
99
97
 
100
98
typedef DRIZZLE_ROWS *DRIZZLE_ROW_OFFSET;  /* offset to current row */
101
99
 
102
 
#include <mysys/my_alloc.h>
103
 
 
104
 
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
105
100
typedef struct st_drizzle_data {
106
101
  DRIZZLE_ROWS *data;
107
102
  struct embedded_query_result *embedded_info;
108
 
  MEM_ROOT alloc;
109
103
  uint64_t rows;
110
104
  unsigned int fields;
111
105
  /* extra info for embedded library */
116
110
{
117
111
  DRIZZLE_OPT_CONNECT_TIMEOUT, DRIZZLE_OPT_COMPRESS, DRIZZLE_OPT_NAMED_PIPE,
118
112
  DRIZZLE_INIT_COMMAND, DRIZZLE_READ_DEFAULT_FILE, DRIZZLE_READ_DEFAULT_GROUP,
119
 
  DRIZZLE_SET_CHARSET_DIR, DRIZZLE_SET_CHARSET_NAME, DRIZZLE_OPT_LOCAL_INFILE,
 
113
  DRIZZLE_OPT_LOCAL_INFILE,
120
114
  DRIZZLE_OPT_PROTOCOL, DRIZZLE_SHARED_MEMORY_BASE_NAME, DRIZZLE_OPT_READ_TIMEOUT,
121
115
  DRIZZLE_OPT_WRITE_TIMEOUT, DRIZZLE_OPT_USE_RESULT,
122
116
  DRIZZLE_OPT_USE_REMOTE_CONNECTION,
129
123
  unsigned int connect_timeout, read_timeout, write_timeout;
130
124
  unsigned int port, protocol;
131
125
  unsigned long client_flag;
132
 
  char *host,*user,*password,*unix_socket,*db;
133
 
  struct st_dynamic_array *init_commands;
134
 
  char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
 
126
  char *host,*user,*password,*db;
 
127
  char *my_cnf_file,*my_cnf_group;
135
128
  char *ssl_key;        /* PEM key file */
136
129
  char *ssl_cert;        /* PEM cert file */
137
130
  char *ssl_ca;          /* PEM CA file */
171
164
  DRIZZLE_PROTOCOL_TCP
172
165
};
173
166
 
174
 
typedef struct character_set
175
 
{
176
 
  unsigned int      number;     /* character set number              */
177
 
  unsigned int      state;      /* character set state               */
178
 
  const char        *csname;    /* collation name                    */
179
 
  const char        *name;      /* character set name                */
180
 
  const char        *comment;   /* comment                           */
181
 
  const char        *dir;       /* character set directory           */
182
 
  unsigned int      mbminlen;   /* min. length for multibyte strings */
183
 
  unsigned int      mbmaxlen;   /* max. length for multibyte strings */
184
 
} MY_CHARSET_INFO;
185
 
 
186
167
struct st_drizzle_methods;
187
168
struct st_drizzle_stmt;
188
169
 
192
173
  unsigned char  *connector_fd;    /* ConnectorFd for SSL */
193
174
  char    *host,*user,*passwd,*unix_socket,*server_version,*host_info;
194
175
  char          *info, *db;
195
 
  const struct charset_info_st *charset;
196
176
  DRIZZLE_FIELD  *fields;
197
 
  MEM_ROOT  field_alloc;
198
177
  uint64_t affected_rows;
199
178
  uint64_t insert_id;    /* id if insert on table with NEXTNR */
200
179
  uint64_t extra_info;    /* Not used */
240
219
  const struct st_drizzle_methods *methods;
241
220
  DRIZZLE_ROW  row;      /* If unbuffered read */
242
221
  DRIZZLE_ROW  current_row;    /* buffer to current row */
243
 
  MEM_ROOT  field_alloc;
244
222
  uint32_t  field_count, current_field;
245
223
  bool  eof;      /* Used by drizzle_fetch_row */
246
224
  /* drizzle_stmt_close() had to cancel this result */
286
264
 
287
265
const DRIZZLE_PARAMETERS * drizzle_get_parameters(void);
288
266
 
289
 
/*
290
 
  Set up and bring down a thread; these function should be called
291
 
  for each thread in an application which opens at least one MySQL
292
 
  connection.  All uses of the connection(s) should be between these
293
 
  function calls.
294
 
*/
295
 
bool drizzle_thread_init(void);
296
 
void drizzle_thread_end(void);
297
267
 
298
268
/*
299
269
  Functions to get information from the DRIZZLE and DRIZZLE_RES structures
338
308
DRIZZLE_RES * drizzle_store_result(DRIZZLE *drizzle);
339
309
DRIZZLE_RES * drizzle_use_result(DRIZZLE *drizzle);
340
310
 
341
 
void        drizzle_get_character_set_info(const DRIZZLE *drizzle,
342
 
                                                   MY_CHARSET_INFO *charset);
343
 
 
344
311
/* local infile support */
345
312
 
346
313
#define LOCAL_INFILE_ERROR_LEN 512
381
348
DRIZZLE_RES *     drizzle_list_fields(DRIZZLE *drizzle, const char *table, const char *wild);
382
349
uint32_t  drizzle_escape_string(char *to,const char *from, uint32_t from_length);
383
350
uint32_t  drizzle_hex_string(char *to,const char *from, uint32_t from_length);
384
 
uint32_t        drizzle_real_escape_string(DRIZZLE *drizzle, char *to, const char *from, uint32_t length);
385
 
void    myodbc_remove_escape(const DRIZZLE *drizzle, char *name);
386
 
uint32_t  drizzle_thread_safe(void);
387
 
bool    drizzle_embedded(void);
388
351
bool         drizzle_read_query_result(DRIZZLE *drizzle);
389
352
 
390
353