📄 mysql.h
字号:
typedef struct st_mysql_manager{ NET net; char *host,*user,*passwd; unsigned int port; my_bool free_me; my_bool eof; int cmd_status; int last_errno; char* net_buf,*net_buf_pos,*net_data_end; int net_buf_size; char last_error[MAX_MYSQL_MANAGER_ERR];} MYSQL_MANAGER;typedef struct st_mysql_parameters{ unsigned long *p_max_allowed_packet; unsigned long *p_net_buffer_length;} MYSQL_PARAMETERS;#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)#endif/* Set up and bring down the server; to ensure that applications will work when linked against either the standard client library or the embedded server library, these functions should be called.*/int STDCALL mysql_server_init(int argc, char **argv, char **groups);void STDCALL mysql_server_end(void);MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);/* Set up and bring down a thread; these function should be called for each thread in an application which opens at least one MySQL connection. All uses of the connection(s) should be between these function calls.*/my_bool STDCALL mysql_thread_init(void);void STDCALL mysql_thread_end(void);/* Functions to get information from the MYSQL and MYSQL_RES structures Should definitely be used if one uses shared libraries.*/my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);my_bool STDCALL mysql_eof(MYSQL_RES *res);MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, unsigned int fieldnr);MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res);MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res);unsigned int STDCALL mysql_field_count(MYSQL *mysql);my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);unsigned int STDCALL mysql_errno(MYSQL *mysql);const char * STDCALL mysql_error(MYSQL *mysql);const char * STDCALL mysql_info(MYSQL *mysql);unsigned long STDCALL mysql_thread_id(MYSQL *mysql);const char * STDCALL mysql_character_set_name(MYSQL *mysql);MYSQL * STDCALL mysql_init(MYSQL *mysql);int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher);my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db);MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned int clientflag);void STDCALL mysql_close(MYSQL *sock);int STDCALL mysql_select_db(MYSQL *mysql, const char *db);int STDCALL mysql_query(MYSQL *mysql, const char *q);int STDCALL mysql_send_query(MYSQL *mysql, const char *q, unsigned long length);int STDCALL mysql_read_query_result(MYSQL *mysql);int STDCALL mysql_real_query(MYSQL *mysql, const char *q, unsigned long length);/* perform query on master */int STDCALL mysql_master_query(MYSQL *mysql, const char *q, unsigned long length);int STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, unsigned long length);/* perform query on slave */ int STDCALL mysql_slave_query(MYSQL *mysql, const char *q, unsigned long length);int STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, unsigned long length);/* enable/disable parsing of all queries to decide if they go on master or slave*/void STDCALL mysql_enable_rpl_parse(MYSQL* mysql);void STDCALL mysql_disable_rpl_parse(MYSQL* mysql);/* get the value of the parse flag */ int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql);/* enable/disable reads from master */void STDCALL mysql_enable_reads_from_master(MYSQL* mysql);void STDCALL mysql_disable_reads_from_master(MYSQL* mysql);/* get the value of the master read flag */ int STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len); /* discover the master and its slaves */ int STDCALL mysql_rpl_probe(MYSQL* mysql);/* set the master, close/free the old one, if it is not a pivot */int STDCALL mysql_set_master(MYSQL* mysql, const char* host, unsigned int port, const char* user, const char* passwd);int STDCALL mysql_add_slave(MYSQL* mysql, const char* host, unsigned int port, const char* user, const char* passwd);int STDCALL mysql_shutdown(MYSQL *mysql);int STDCALL mysql_dump_debug_info(MYSQL *mysql);int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options);int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);int STDCALL mysql_ping(MYSQL *mysql);const char * STDCALL mysql_stat(MYSQL *mysql);const char * STDCALL mysql_get_server_info(MYSQL *mysql);const char * STDCALL mysql_get_client_info(void);unsigned long STDCALL mysql_get_client_version(void);const char * STDCALL mysql_get_host_info(MYSQL *mysql);unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql);MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild);MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg);void STDCALL mysql_free_result(MYSQL_RES *result);void STDCALL mysql_data_seek(MYSQL_RES *result, my_ulonglong offset);MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET offset);MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset);MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result);unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result);unsigned long STDCALL mysql_escape_string(char *to,const char *from, unsigned long from_length);unsigned long STDCALL mysql_hex_string(char *to,const char *from, unsigned long from_length);unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, unsigned long length);void STDCALL mysql_debug(const char *debug);char * STDCALL mysql_odbc_escape_string(MYSQL *mysql, char *to, unsigned long to_length, const char *from, unsigned long from_length, void *param, char * (*extend_buffer) (void *, char *to, unsigned long *length));void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);unsigned int STDCALL mysql_thread_safe(void);MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con); MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, const char* host, const char* user, const char* passwd, unsigned int port);void STDCALL mysql_manager_close(MYSQL_MANAGER* con);int STDCALL mysql_manager_command(MYSQL_MANAGER* con, const char* cmd, int cmd_len);int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf, int res_buf_size);#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)#ifdef USE_OLD_FUNCTIONSMYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd);int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)#endif#define HAVE_MYSQL_REAL_CONNECT/* The following functions are mainly exported because of mysqlbinlog; They are not for general usage*/int simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg, unsigned long length, my_bool skipp_check);unsigned long net_safe_read(MYSQL* mysql);int mysql_once_init(void);extern my_bool server_inited;#ifdef __NETWARE__#pragma pack(pop) /* restore alignment */#endif#ifdef __cplusplus}#endif#endif /* _mysql_h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -