~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
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.
 
8
 *  the Free Software Foundation; version 2 of the License.
10
9
 *
11
10
 *  This program is distributed in the hope that it will be useful,
12
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
20
#ifndef _libdrizzle_drizzle_h
22
21
#define _libdrizzle_drizzle_h
23
22
 
24
 
#ifdef  __cplusplus
25
 
extern "C" {
26
 
#endif
27
23
 
28
24
#include <stdint.h>
29
 
#include <libdrizzle/drizzle_com.h>
 
25
#include <stdbool.h>
 
26
#include <drizzled/common.h>
30
27
#include <libdrizzle/drizzle_field.h>
31
28
#include <libdrizzle/drizzle_options.h>
32
29
#include <libdrizzle/drizzle_res.h>
 
30
#include <libdrizzle/net_serv.h>
33
31
 
 
32
#ifdef  __cplusplus
 
33
extern "C" {
 
34
#endif
34
35
 
35
36
struct st_drizzle_methods;
36
37
 
80
81
  void *extension;
81
82
} DRIZZLE;
82
83
 
83
 
uint32_t drizzle_field_count(const DRIZZLE *drizzle);
84
 
uint64_t drizzle_affected_rows(const DRIZZLE *drizzle);
85
 
uint64_t drizzle_insert_id(const DRIZZLE *drizzle);
86
 
uint32_t drizzle_errno(const DRIZZLE *drizzle);
87
 
const char * drizzle_error(const DRIZZLE *drizzle);
88
 
const char * drizzle_sqlstate(const DRIZZLE *drizzle);
89
 
uint32_t drizzle_warning_count(const DRIZZLE *drizzle);
90
 
const char * drizzle_info(const DRIZZLE *drizzle);
91
 
uint32_t drizzle_thread_id(const DRIZZLE *drizzle);
92
 
const char * drizzle_character_set_name(const DRIZZLE *drizzle);
93
 
int32_t          drizzle_set_character_set(DRIZZLE *drizzle, const char *csname);
94
 
 
95
84
DRIZZLE * drizzle_create(DRIZZLE *drizzle);
96
 
bool   drizzle_change_user(DRIZZLE *drizzle, const char *user,
97
 
            const char *passwd, const char *db);
98
85
DRIZZLE * drizzle_connect(DRIZZLE *drizzle, const char *host,
99
86
             const char *user,
100
87
             const char *passwd,
102
89
             uint32_t port,
103
90
             const char *unix_socket,
104
91
             uint32_t clientflag);
 
92
 
105
93
int32_t    drizzle_select_db(DRIZZLE *drizzle, const char *db);
106
94
int32_t    drizzle_query(DRIZZLE *drizzle, const char *q);
107
95
int32_t    drizzle_send_query(DRIZZLE *drizzle, const char *q, uint32_t length);
108
96
int32_t    drizzle_real_query(DRIZZLE *drizzle, const char *q, uint32_t length);
 
97
 
109
98
DRIZZLE_RES * drizzle_store_result(DRIZZLE *drizzle);
110
99
DRIZZLE_RES * drizzle_use_result(DRIZZLE *drizzle);
111
100
 
 
101
uint32_t drizzle_field_count(const DRIZZLE *drizzle);
 
102
uint64_t drizzle_affected_rows(const DRIZZLE *drizzle);
 
103
uint64_t drizzle_insert_id(const DRIZZLE *drizzle);
 
104
uint32_t drizzle_errno(const DRIZZLE *drizzle);
 
105
const char * drizzle_error(const DRIZZLE *drizzle);
 
106
const char * drizzle_sqlstate(const DRIZZLE *drizzle);
 
107
uint32_t drizzle_warning_count(const DRIZZLE *drizzle);
 
108
const char * drizzle_info(const DRIZZLE *drizzle);
 
109
uint32_t drizzle_thread_id(const DRIZZLE *drizzle);
 
110
const char * drizzle_character_set_name(const DRIZZLE *drizzle);
 
111
 
 
112
bool   drizzle_change_user(DRIZZLE *drizzle, const char *user,
 
113
                           const char *passwd, const char *db);
 
114
 
112
115
/* local infile support */
113
116
 
114
117
#define LOCAL_INFILE_ERROR_LEN 512
123
126
void
124
127
drizzle_set_local_infile_default(DRIZZLE *drizzle);
125
128
 
126
 
int32_t    drizzle_shutdown(DRIZZLE *drizzle, enum drizzle_enum_shutdown_level shutdown_level);
 
129
int32_t    drizzle_shutdown(DRIZZLE *drizzle);
127
130
int32_t    drizzle_dump_debug_info(DRIZZLE *drizzle);
128
131
int32_t    drizzle_refresh(DRIZZLE *drizzle, uint32_t refresh_options);
129
132
int32_t    drizzle_kill(DRIZZLE *drizzle, uint32_t pid);
130
 
int32_t    drizzle_set_server_option(DRIZZLE *drizzle, enum enum_drizzle_set_option option);
 
133
int32_t    drizzle_set_server_option(DRIZZLE *drizzle,
 
134
                                     enum enum_drizzle_set_option option);
131
135
int32_t    drizzle_ping(DRIZZLE *drizzle);
132
136
const char *  drizzle_stat(DRIZZLE *drizzle);
133
137
const char *  drizzle_get_server_info(const DRIZZLE *drizzle);
137
141
uint32_t  drizzle_get_proto_info(const DRIZZLE *drizzle);
138
142
DRIZZLE_RES *  drizzle_list_tables(DRIZZLE *drizzle,const char *wild);
139
143
DRIZZLE_RES *  drizzle_list_processes(DRIZZLE *drizzle);
140
 
int32_t    drizzle_options(DRIZZLE *drizzle,enum drizzle_option option, const void *arg);
141
 
DRIZZLE_RES *     drizzle_list_fields(DRIZZLE *drizzle, const char *table, const char *wild);
 
144
int32_t    drizzle_options(DRIZZLE *drizzle, enum drizzle_option option,
 
145
                           const void *arg);
 
146
DRIZZLE_RES *     drizzle_list_fields(DRIZZLE *drizzle, const char *table,
 
147
                                      const char *wild);
142
148
bool         drizzle_read_query_result(DRIZZLE *drizzle);
143
149
 
144
150
bool drizzle_commit(DRIZZLE *drizzle);
146
152
bool drizzle_autocommit(DRIZZLE *drizzle, bool auto_mode);
147
153
bool drizzle_more_results(const DRIZZLE *drizzle);
148
154
int drizzle_next_result(DRIZZLE *drizzle);
149
 
void drizzle_close(DRIZZLE *sock);
150
 
 
 
155
void drizzle_close(DRIZZLE *drizzle);
 
156
bool drizzle_reconnect(DRIZZLE *drizzle);
 
157
void drizzle_disconnect(DRIZZLE *drizzle);
151
158
 
152
159
bool
153
160
cli_advanced_command(DRIZZLE *drizzle, enum enum_server_command command,
154
 
                     const unsigned char *header, uint32_t header_length,
155
 
                     const unsigned char *arg, uint32_t arg_length, bool skip_check);
 
161
                     const unsigned char *header, uint32_t header_length,
 
162
                     const unsigned char *arg, uint32_t arg_length,
 
163
                     bool skip_check);
156
164
uint32_t cli_safe_read(DRIZZLE *drizzle);
157
165
DRIZZLE_FIELD * cli_list_fields(DRIZZLE *drizzle);
158
166
DRIZZLE_DATA * cli_read_rows(DRIZZLE *drizzle,DRIZZLE_FIELD *drizzle_fields,
159
 
                                   uint fields);
 
167
                             unsigned int fields);
160
168
int cli_unbuffered_fetch(DRIZZLE *drizzle, char **row);
161
169
const char * cli_read_statistics(DRIZZLE *drizzle);
162
170
int cli_read_change_user_result(DRIZZLE *drizzle);