#include <sys/types.h>#include <string.h>#include <stdio.h>#include <mvp_refmem.h>#include <cmyth.h>#include <cmyth_local.h>Go to the source code of this file.
Data Structures | |
| struct | cmyth_mysql_query_s |
| Hold in-progress query. More... | |
Defines | |
| #define | CMYTH_ULONG_STRLEN ((sizeof(long)*3)+1) |
| #define | CMYTH_LONG_STRLEN (CMYTH_ULONG_STRLEN+1) |
Functions | |
| static void | query_destroy (void *p) |
| Internal only! Registered as callback to de-allocate actual buffer if the query is de-allocated. | |
| cmyth_mysql_query_t * | cmyth_mysql_query_create (cmyth_database_t db, const char *query_string) |
| Allocate a dynamic query string to have parameters added to it. | |
| void | cmyth_mysql_query_reset (cmyth_mysql_query_t *query) |
| static int | query_buffer_check_len (cmyth_mysql_query_t *query, int len) |
| static int | query_buffer_add (cmyth_mysql_query_t *query, const char *buf, int len) |
| static int | query_buffer_add_str (cmyth_mysql_query_t *query, const char *str) |
| static int | query_buffer_add_escape_str (cmyth_mysql_query_t *query, const char *str) |
| static int | query_begin_next_param (cmyth_mysql_query_t *query) |
| static int | query_buffer_add_long (cmyth_mysql_query_t *query, long param) |
| static int | query_buffer_add_ulong (cmyth_mysql_query_t *query, long param) |
| int | cmyth_mysql_query_param_long (cmyth_mysql_query_t *query, long param) |
| Add a long integer parameter. | |
| int | cmyth_mysql_query_param_ulong (cmyth_mysql_query_t *query, unsigned long param) |
| Add an unsigned long integer parameter. | |
| int | cmyth_mysql_query_param_int (cmyth_mysql_query_t *query, int param) |
| Add an integer parameter. | |
| int | cmyth_mysql_query_param_uint (cmyth_mysql_query_t *query, int param) |
| Add an unsigned integer parameter. | |
| int | cmyth_mysql_query_param_unixtime (cmyth_mysql_query_t *query, time_t param) |
| Add, and convert a unixtime to mysql date/timestamp. | |
| int | cmyth_mysql_query_param_str (cmyth_mysql_query_t *query, const char *param) |
| Add (including adding quotes), and escape a string parameter. | |
| char * | cmyth_mysql_query_string (cmyth_mysql_query_t *query) |
| Get the completed query string. | |
| MYSQL_RES * | cmyth_mysql_query_result (cmyth_mysql_query_t *query) |
|
|
Definition at line 28 of file mysql_query.c. Referenced by query_buffer_add_long(). |
|
|
Definition at line 27 of file mysql_query.c. Referenced by query_buffer_add_ulong(). |
|
||||||||||||
|
Allocate a dynamic query string to have parameters added to it.
Definition at line 73 of file mysql_query.c. References query_destroy(), ref_alloc, ref_hold(), ref_release(), and ref_set_destroy(). Referenced by cmyth_get_bookmark_mark(), cmyth_get_bookmark_offset(), cmyth_mysql_get_commbreak_list(), cmyth_mysql_get_guide(), cmyth_mysql_query_commbreak_count(), cmyth_tuner_type_check(), and cmyth_update_bookmark_setting(). |
|
||||||||||||
|
Add an integer parameter.
Definition at line 239 of file mysql_query.c. References cmyth_mysql_query_param_long(). Referenced by cmyth_mysql_get_commbreak_list(), and cmyth_mysql_query_commbreak_count(). |
|
||||||||||||
|
Add a long integer parameter.
Definition at line 209 of file mysql_query.c. References query_begin_next_param(), and query_buffer_add_long(). Referenced by cmyth_get_bookmark_mark(), cmyth_get_bookmark_offset(), cmyth_mysql_query_param_int(), and cmyth_update_bookmark_setting(). |
|
||||||||||||
|
Add (including adding quotes), and escape a string parameter.
Definition at line 283 of file mysql_query.c. References query_begin_next_param(), query_buffer_add_escape_str(), and query_buffer_add_str(). Referenced by cmyth_get_bookmark_mark(), cmyth_get_bookmark_offset(), cmyth_mysql_get_commbreak_list(), cmyth_mysql_query_commbreak_count(), and cmyth_update_bookmark_setting(). |
|
||||||||||||
|
Add an unsigned integer parameter.
Definition at line 250 of file mysql_query.c. References cmyth_mysql_query_param_ulong(). Referenced by cmyth_tuner_type_check(). |
|
||||||||||||
|
Add an unsigned long integer parameter.
Definition at line 224 of file mysql_query.c. References query_begin_next_param(), and query_buffer_add_ulong(). Referenced by cmyth_mysql_query_param_uint(). |
|
||||||||||||
|
Add, and convert a unixtime to mysql date/timestamp.
Definition at line 261 of file mysql_query.c. References query_begin_next_param(), query_buffer_add_long(), and query_buffer_add_str(). Referenced by cmyth_mysql_get_guide(). |
|
|
Definition at line 101 of file mysql_query.c. References cmyth_mysql_query_s::buf_used, cmyth_mysql_query_s::source, and cmyth_mysql_query_s::source_pos. Referenced by query_buffer_check_len(). |
|
|
Definition at line 324 of file mysql_query.c. References cmyth_db_get_connection(), cmyth_dbg(), CMYTH_DBG_ERROR, cmyth_mysql_query_string(), cmyth_mysql_query_s::db, and ref_release(). Referenced by cmyth_get_bookmark_mark(), cmyth_get_bookmark_offset(), cmyth_mysql_get_commbreak_list(), cmyth_mysql_get_guide(), cmyth_mysql_query_commbreak_count(), cmyth_tuner_type_check(), and cmyth_update_bookmark_setting(). |
|
|
Get the completed query string.
Definition at line 307 of file mysql_query.c. References cmyth_mysql_query_s::buf, query_buffer_add_str(), ref_hold(), cmyth_mysql_query_s::source, cmyth_mysql_query_s::source_len, and cmyth_mysql_query_s::source_pos. Referenced by cmyth_mysql_query_result(). |
|
|
Definition at line 174 of file mysql_query.c. References query_buffer_add(), and cmyth_mysql_query_s::source_pos. Referenced by cmyth_mysql_query_param_long(), cmyth_mysql_query_param_str(), cmyth_mysql_query_param_ulong(), and cmyth_mysql_query_param_unixtime(). |
|
||||||||||||||||
|
Definition at line 130 of file mysql_query.c. References cmyth_mysql_query_s::buf, cmyth_mysql_query_s::buf_used, and query_buffer_check_len(). Referenced by query_begin_next_param(), and query_buffer_add_str(). |
|
||||||||||||
|
Definition at line 148 of file mysql_query.c. References cmyth_mysql_query_s::buf, cmyth_mysql_query_s::buf_used, cmyth_db_get_connection(), cmyth_mysql_query_s::db, and query_buffer_check_len(). Referenced by cmyth_mysql_query_param_str(). |
|
||||||||||||
|
Definition at line 188 of file mysql_query.c. References CMYTH_LONG_STRLEN, and query_buffer_add_str(). Referenced by cmyth_mysql_query_param_long(), and cmyth_mysql_query_param_unixtime(). |
|
||||||||||||
|
Definition at line 142 of file mysql_query.c. References query_buffer_add(). Referenced by cmyth_mysql_query_param_str(), cmyth_mysql_query_param_unixtime(), cmyth_mysql_query_string(), query_buffer_add_long(), and query_buffer_add_ulong(). |
|
||||||||||||
|
Definition at line 196 of file mysql_query.c. References CMYTH_ULONG_STRLEN, and query_buffer_add_str(). Referenced by cmyth_mysql_query_param_ulong(). |
|
||||||||||||
|
Definition at line 108 of file mysql_query.c. References cmyth_mysql_query_s::buf, cmyth_mysql_query_s::buf_size, cmyth_mysql_query_s::buf_used, cmyth_mysql_query_reset(), ref_realloc(), and cmyth_mysql_query_s::source_len. Referenced by query_buffer_add(), and query_buffer_add_escape_str(). |
|
|
Internal only! Registered as callback to de-allocate actual buffer if the query is de-allocated.
Definition at line 49 of file mysql_query.c. References cmyth_mysql_query_s::buf, cmyth_mysql_query_s::buf_size, cmyth_mysql_query_s::db, and ref_release(). Referenced by cmyth_mysql_query_create(). |
1.4.6