~ubuntu-branches/debian/sid/unixodbc/sid

« back to all changes in this revision

Viewing changes to Drivers/MySQL/myutil.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2004-10-15 03:07:52 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041015030752-dzw4vhxlgycz3woj
Tags: 2.2.4-11
Brown paper bag me: conflicts do not write themselves just because
you add a line to the changelog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************  
 
2
 * Copyright (C) 1995-2002 MySQL AB, www.mysql.com                         *
 
3
 *                                                                         *
 
4
 * This program is free software; you can redistribute it and/or modify    *
 
5
 * it under the terms of the GNU General Public License as published by    *
 
6
 * the Free Software Foundation; either version 2 of the License, or       *
 
7
 * (at your option) any later version.                                     *
 
8
 *                                                                         *
 
9
 * This program is distributed in the hope that it will be useful,         *
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 
12
 * GNU General Public License for more details.                            *
 
13
 *                                                                         *
 
14
 * You should have received a copy of the GNU General Public License       *
 
15
 * along with this program; if not, write to the Free Software Foundation  *
 
16
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA           *
 
17
****************************************************************************/
 
18
 
 
19
/*************************************************************************** 
 
20
 * MYUTIL.H                                                                *
 
21
 *                                                                         *
 
22
 * @description: Prototype definations needed by the driver                *
 
23
 *                                                                         *
 
24
 * @author     : MySQL AB(monty@mysql.com, venu@mysql.com)                 *
 
25
 * @date       : 2001-Sep-22                                               *
 
26
 * @product    : myodbc3                                                   *
 
27
 *                                                                         *
 
28
****************************************************************************/
 
29
#ifndef __MYUTIL_H__
 
30
#define __MYUTIL_H__
 
31
 
 
32
/*
 
33
  utility function prototypes that share among files
 
34
*/
 
35
 
 
36
SQLRETURN my_SQLExecute(STMT FAR* stmt);
 
37
SQLRETURN my_SQLPrepare(SQLHSTMT hstmt,SQLCHAR FAR *szSqlStr,
 
38
                        SQLINTEGER cbSqlStr);
 
39
SQLRETURN SQL_API my_SQLFreeStmt(SQLHSTMT hstmt,SQLUSMALLINT fOption);
 
40
SQLRETURN SQL_API my_SQLAllocStmt(SQLHDBC hdbc,SQLHSTMT FAR *phstmt);
 
41
SQLRETURN do_query(STMT FAR *stmt,char *query);
 
42
char *insert_params(STMT FAR *stmt);
 
43
SQLRETURN odbc_stmt(DBC FAR *dbc, const char *query);
 
44
void mysql_link_fields(STMT *stmt,MYSQL_FIELD *fields,uint field_count);
 
45
void fix_result_types(STMT *stmt);
 
46
char *fix_str(char *to,char *from,int length);
 
47
char *dupp_str(char *from,int length);
 
48
bool empty_str(char *from,int length);
 
49
SQLRETURN my_pos_delete(STMT FAR *stmt,STMT FAR *stmtParam,
 
50
                        SQLUSMALLINT irow,DYNAMIC_STRING *dynStr);
 
51
SQLRETURN my_pos_update(STMT FAR *stmt,STMT FAR *stmtParam,
 
52
                        SQLUSMALLINT irow,DYNAMIC_STRING *dynStr);
 
53
my_bool check_if_positioned_cursor_exists(STMT FAR *stmt,
 
54
                                          STMT FAR **stmtNew);
 
55
char *insert_param(MYSQL *mysql, char *to,PARAM_BIND *param);
 
56
char *add_to_buffer(NET *net,char *to,char *from,ulong length);
 
57
SQLRETURN copy_lresult(DBC FAR *dbc,SQLCHAR FAR *rgbValue,
 
58
                       SQLINTEGER cbValueMax, SQLINTEGER FAR *pcbValue,
 
59
                       char *src,long src_length, long max_length,
 
60
                       long fill_length,long *offset,my_bool binary_data);
 
61
SQLRETURN copy_binary_result(DBC FAR *dbc,SQLCHAR FAR *rgbValue,
 
62
                             SQLINTEGER cbValueMax, SQLINTEGER FAR *pcbValue,
 
63
                             char *src, ulong src_length, ulong max_length,
 
64
                             ulong *offset);
 
65
SQLRETURN set_dbc_error(DBC FAR *dbc,char *state,char *message,uint errcode);
 
66
SQLRETURN set_stmt_error(STMT *stmt,char *state,char *message,uint errcode);
 
67
void translate_error(char *save_state,char *default_state,uint mysql_err);
 
68
int unireg_to_sql_datatype(STMT FAR *stmt, MYSQL_FIELD *field, char *buff,
 
69
                           ulong *transfer_length,ulong *precision,
 
70
                           ulong *display_size);
 
71
SQLRETURN SQL_API my_SQLBindParameter(SQLHSTMT hstmt,SQLUSMALLINT ipar,
 
72
                                      SQLSMALLINT fParamType,
 
73
                                      SQLSMALLINT fCType, SQLSMALLINT fSqlType,
 
74
                                      SQLUINTEGER cbColDef,
 
75
                                      SQLSMALLINT ibScale,
 
76
                                      SQLPOINTER  rgbValue,
 
77
                                      SQLINTEGER cbValueMax,
 
78
                                      SQLINTEGER FAR *pcbValue);
 
79
SQLRETURN SQL_API my_SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType,
 
80
                                      SQLINTEGER irow, SQLUINTEGER FAR *pcrow,
 
81
                                      SQLUSMALLINT FAR *rgfRowStatus);
 
82
SQLRETURN copy_stmt_error(STMT FAR *src, STMT FAR *dst);
 
83
int unireg_to_c_datatype(MYSQL_FIELD *field);
 
84
int default_c_type(int sql_data_type);
 
85
ulong bind_length(int sql_data_type,ulong length);
 
86
my_bool str_to_date(DATE_STRUCT *rgbValue, const char *str,uint length);
 
87
ulong str_to_time(const char *str,uint length);
 
88
void init_getfunctions(void);
 
89
void myodbc_init(void);
 
90
int check_if_server_is_alive(DBC FAR *dbc);
 
91
my_bool dynstr_append_quoted_name(DYNAMIC_STRING *str, const char *name);
 
92
SQLRETURN set_handle_error(SQLSMALLINT HandleType, SQLHANDLE handle,
 
93
                           myodbc_errid errid, SQLCHAR *errtext,
 
94
                           SQLINTEGER mysql_err);
 
95
SQLRETURN copy_str_data(SQLSMALLINT HandleType, SQLHANDLE Handle,
 
96
                        SQLCHAR FAR *rgbValue, SQLSMALLINT cbValueMax,
 
97
                        SQLSMALLINT FAR *pcbValue,char FAR *src);
 
98
SQLRETURN SQL_API my_SQLAllocEnv(SQLHENV FAR * phenv);
 
99
SQLRETURN SQL_API my_SQLAllocConnect(SQLHENV henv, SQLHDBC FAR *phdbc);
 
100
SQLRETURN SQL_API my_SQLFreeConnect(SQLHDBC hdbc);
 
101
SQLRETURN SQL_API my_SQLFreeEnv(SQLHENV henv);
 
102
SQLRETURN SQL_API my_SQLDisconnect(SQLHDBC hdbc);
 
103
SQLRETURN SQL_API my_SQLDriverConnect(SQLHDBC hdbc,SQLHWND hwnd,
 
104
                                      SQLCHAR FAR *szConnStrIn,
 
105
                                      SQLSMALLINT cbConnStrIn,
 
106
                                      SQLCHAR FAR *szConnStrOut,
 
107
                                      SQLSMALLINT cbConnStrOutMax,
 
108
                                      SQLSMALLINT FAR *pcbConnStrOut,
 
109
                                      SQLUSMALLINT fDriverCompletion);
 
110
char *extend_buffer(NET *net,char *to,ulong length);
 
111
void myodbc_end();
 
112
SQLRETURN set_dynamic_result(STMT FAR *stmt);
 
113
void set_current_cursor_data(STMT FAR *stmt,SQLUINTEGER irow);
 
114
#endif /* __MYUTIL_H__ */