Skip to content

Commit

Permalink
Merge branch 'mx_mysql'
Browse files Browse the repository at this point in the history
* mx_mysql:
  mx_mysql: minor cleanup
  • Loading branch information
mariux committed May 21, 2015
2 parents 742e873 + ba454f1 commit 238bf36
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions mx_mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include <sys/resource.h>
#include <mysql.h>

//#include "mxq_util.h"

#include "mx_util.h"

#ifdef MX_NDEBUG_MYSQL
Expand All @@ -31,7 +29,6 @@
} \
} while (0)


struct mx_mysql {
MYSQL *mysql;

Expand Down Expand Up @@ -86,42 +83,6 @@ struct mx_mysql_stmt {
struct mx_mysql_bind param;
};

/*
#include <string.h>
static inline void mx_mysql_bind_string2(struct mx_mysql_bind *b, int index)
{
assert(index < b->count);
b->bind[index].buffer_type = MYSQL_TYPE_STRING;
b->bind[index].buffer = 0;
b->bind[index].buffer_length = 0;
b->bind[index].length = &(b->length[index]);
}
static inline void mx_mysql_bind_string3(struct mx_mysql_bind *b, int index, char *value)
{
assert(index < b->count);
b->bind[index].buffer_type = MYSQL_TYPE_STRING;
b->bind[index].buffer = value;
b->bind[index].buffer_length = strlen(value);
b->bind[index].length = &(b->bind[index].buffer_length);
}
#define MXQ_MYSQL_BIND_VARSTR(b, c, v) \
do { \
(b)[(c)].buffer_type = MYSQL_TYPE_STRING; \
(b)[(c)].buffer = 0; \
(b)[(c)].buffer_length = 0; \
(b)[(c)].length = (v); \
} while (0)
#define MXQ_MYSQL_BIND_STRING(b, c, v) \
do { \
(b)[(c)].buffer_type = MYSQL_TYPE_STRING; \
(b)[(c)].buffer = (v); \
(b)[(c)].buffer_length = strlen((v)); \
(b)[(c)].length = &((b)[(c)].buffer_length); \
} while (0)
*/
#ifndef MX_MYSQL_FAIL_WAIT_DEFAULT
# ifdef MX_CALLOC_FAIL_WAIT_DEFAULT
# define MX_MYSQL_FAIL_WAIT_DEFAULT MX_CALLOC_FAIL_WAIT_DEFAULT
Expand Down Expand Up @@ -168,7 +129,6 @@ int mx_mysql_statement_close(struct mx_mysql_stmt **stmt);

#define mx_mysql_statement_param_bind(s, i, t, p) mx_mysql_bind_##t(&((s)->param), (i), (p))

//int mx_mysql_bind_validate(struct mx_mysql_bind *b);
int mx_mysql_bind_string(struct mx_mysql_bind *b, unsigned int index, char **value);

int mx_mysql_bind_int8(struct mx_mysql_bind *b, unsigned int index, int8_t *value);
Expand All @@ -181,6 +141,4 @@ int mx_mysql_bind_uint16(struct mx_mysql_bind *b, unsigned int index, uint16_t *
int mx_mysql_bind_uint32(struct mx_mysql_bind *b, unsigned int index, uint32_t *value);
int mx_mysql_bind_uint64(struct mx_mysql_bind *b, unsigned int index, uint64_t *value);



#endif

0 comments on commit 238bf36

Please sign in to comment.