Changeset 1936 for trunk/tools/database/mysql/mysql.h
- Timestamp:
- Dec 2, 1999, 2:06:05 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/mysql/mysql.h
r828 r1936 13 13 #include <sys/types.h> 14 14 typedef char my_bool; 15 #if !defined( __WIN32__) && !defined(WIN32)15 #if !defined(WIN32) 16 16 #define STDCALL 17 typedef char byte;18 17 #else 19 18 #define STDCALL __stdcall … … 37 36 #endif 38 37 39 #ifndef Socket_defined40 #ifdef __WIN32__41 #define Socket SOCKET42 #else 43 typedef int Socket;38 #ifndef my_socket_defined 39 #ifdef WIN32 40 #define my_socket SOCKET 41 #else 42 typedef int my_socket; 44 43 #endif 45 44 #endif … … 67 66 } MYSQL_FIELD; 68 67 69 typedef byte**MYSQL_ROW; /* return data as array of strings */68 typedef char **MYSQL_ROW; /* return data as array of strings */ 70 69 typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ 70 71 #if defined(NO_CLIENT_LONG_LONG) 72 typedef unsigned long my_ulonglong; 73 #elif defined (WIN32) 74 typedef unsigned __int64 my_ulonglong; 75 #else 76 typedef unsigned long long my_ulonglong; 77 #endif 78 79 #define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) 71 80 72 81 typedef struct st_mysql_rows { … … 78 87 79 88 typedef struct st_mysql_data { 80 unsigned introws;89 my_ulonglong rows; 81 90 unsigned int fields; 82 91 MYSQL_ROWS *data; 83 92 MEM_ROOT alloc; 84 93 } MYSQL_DATA; 94 95 struct st_mysql_options { 96 unsigned int connect_timeout,client_flag; 97 my_bool compress,named_pipe; 98 unsigned int port; 99 char *host,*init_command,*user,*password,*unix_socket,*db; 100 char *my_cnf_file,*my_cnf_group; 101 }; 102 103 enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, 104 MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND, 105 MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP }; 85 106 86 107 enum mysql_status { MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT, … … 95 116 unsigned int field_count; 96 117 unsigned long thread_id; /* Id for connection in server */ 97 unsigned long affected_rows; 98 unsigned long insert_id; /* id if insert on table with NEXTNR */ 99 unsigned long extra_info; /* Used by mysqlshow */ 118 my_ulonglong affected_rows; 119 my_ulonglong insert_id; /* id if insert on table with NEXTNR */ 120 my_ulonglong extra_info; /* Used by mysqlshow */ 121 unsigned long packet_length; 100 122 enum mysql_status status; 101 123 MYSQL_FIELD *fields; … … 103 125 my_bool free_me; /* If free in mysql_close */ 104 126 my_bool reconnect; /* set to 1 if automatic reconnect */ 127 struct st_mysql_options options; 105 128 } MYSQL; 106 129 107 130 108 131 typedef struct st_mysql_res { 109 unsignedlong row_count;132 my_ulonglong row_count; 110 133 unsigned int field_count, current_field; 111 134 MYSQL_FIELD *fields; … … 115 138 MYSQL_ROW row; /* If unbuffered read */ 116 139 MYSQL_ROW current_row; /* buffer to current row */ 117 unsigned int*lengths; /* column lengths of current row */140 unsigned long *lengths; /* column lengths of current row */ 118 141 MYSQL *handle; /* for unbuffered reads */ 119 142 my_bool eof; /* Used my mysql_fetch_row */ … … 124 147 #define mysql_num_fields(res) (res)->field_count 125 148 #define mysql_eof(res) (res)->eof 126 #define mysql_fetch_field_direct(res,fieldnr) ( (res)->fields[fieldnr])149 #define mysql_fetch_field_direct(res,fieldnr) (&(res)->fields[fieldnr]) 127 150 #define mysql_fetch_fields(res) (res)->fields 128 151 #define mysql_row_tell(res) (res)->data_cursor 129 152 #define mysql_field_tell(res) (res)->current_field 130 153 154 #define mysql_field_count(mysql) (mysql)->field_count 131 155 #define mysql_affected_rows(mysql) (mysql)->affected_rows 132 156 #define mysql_insert_id(mysql) (mysql)->insert_id … … 137 161 #define mysql_thread_id(mysql) (mysql)->thread_id 138 162 139 /* void STDCALL mysql_init(MYSQL *mysql); */ 163 MYSQL * STDCALL mysql_init(MYSQL *mysql); 140 164 MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, 141 165 const char *user, const char *passwd); … … 168 192 unsigned int refresh_options); 169 193 int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); 194 int STDCALL mysql_ping(MYSQL *mysql); 170 195 char * STDCALL mysql_stat(MYSQL *mysql); 171 196 char * STDCALL mysql_get_server_info(MYSQL *mysql); … … 180 205 MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); 181 206 MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); 207 int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, 208 const char *arg); 182 209 void STDCALL mysql_free_result(MYSQL_RES *result); 183 void STDCALL mysql_data_seek(MYSQL_RES * mysql,unsigned int offset);184 MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES * mysql, MYSQL_ROW_OFFSET);185 MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES * mysql,210 void STDCALL mysql_data_seek(MYSQL_RES *result,unsigned int offset); 211 MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET); 212 MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, 186 213 MYSQL_FIELD_OFFSET offset); 187 MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES * mysql);188 unsigned int * STDCALL mysql_fetch_lengths(MYSQL_RES *mysql);189 MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES * handle);214 MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); 215 unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); 216 MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); 190 217 unsigned int STDCALL mysql_escape_string(char *to,const char *from, 191 218 unsigned int from_length); 192 void STDCALL mysql_debug(c har *debug);219 void STDCALL mysql_debug(const char *debug); 193 220 194 221 /* new api functions */
Note:
See TracChangeset
for help on using the changeset viewer.