~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/libdrizzle_priv.h

Removed/replaced DBUG symbols and standardized TRUE/FALSE

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
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; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
#ifndef _libdrizzle_libdrizzle_priv_h_
21
 
#define _libdrizzle_libdrizzle_priv_h_
22
 
 
23
 
#include <sys/socket.h>
24
 
#include <libdrizzle/drizzle.h>
25
 
 
26
 
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG |  \
27
 
                             CLIENT_TRANSACTIONS |                      \
28
 
                             CLIENT_SECURE_CONNECTION)
29
 
 
30
 
 
31
 
extern unsigned int drizzle_port;
32
 
 
33
 
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
34
 
#define __builtin_expect(x, expected_value) (x)
35
 
#endif
36
 
 
37
 
#define likely(x)       __builtin_expect((x),1)
38
 
#define unlikely(x)     __builtin_expect((x),0)
39
 
 
40
 
#ifndef __cplusplus
41
 
#define max(a, b)       ((a) > (b) ? (a) : (b))
42
 
#define min(a, b)       ((a) < (b) ? (a) : (b))
43
 
#endif
44
 
 
45
 
extern const char _dig_vec_upper[];
46
 
extern const char _dig_vec_lower[];
47
 
 
48
 
const char * sqlstate_get_unknown(void);
49
 
const char * sqlstate_get_not_error(void);
50
 
const char * sqlstate_get_cant_connect(void);
51
 
 
52
 
void drizzle_set_default_port(unsigned int port);
53
 
void drizzle_set_error(DRIZZLE *drizzle, int errcode, const char *sqlstate);
54
 
void drizzle_set_extended_error(DRIZZLE *drizzle, int errcode,
55
 
                                const char *sqlstate,
56
 
                                const char *format, ...);
57
 
void free_old_query(DRIZZLE *drizzle);
58
 
 
59
 
int connect_with_timeout(int fd, const struct sockaddr *name,
60
 
                         unsigned int namelen, int32_t timeout);
61
 
int wait_for_data(int fd, int32_t timeout);
62
 
 
63
 
void drizzle_close_free_options(DRIZZLE *drizzle);
64
 
void drizzle_close_free(DRIZZLE *drizzle);
65
 
 
66
 
/* Hook Methods */
67
 
bool cli_read_query_result(DRIZZLE *drizzle);
68
 
DRIZZLE_RES *cli_use_result(DRIZZLE *drizzle);
69
 
void cli_fetch_lengths(uint32_t *to, DRIZZLE_ROW column,
70
 
                       uint32_t field_count);
71
 
void cli_flush_use_result(DRIZZLE *drizzle);
72
 
 
73
 
#endif