summaryrefslogtreecommitdiff
path: root/src/map/mapreg_sql.c
diff options
context:
space:
mode:
authorSusu <bruant.bastien@gmail.com>2013-06-10 13:52:32 +0200
committerSusu <bruant.bastien@gmail.com>2013-06-10 13:52:32 +0200
commitba8b63be4b9d4df2a9f52bbf655e3ad5c3bf3b1c (patch)
tree77ce50012dd94d7a126e21bdcbfd0df37ae94e0a /src/map/mapreg_sql.c
parent31f9100638dfaf4db057a7653835f715ac8ae94e (diff)
downloadhercules-ba8b63be4b9d4df2a9f52bbf655e3ad5c3bf3b1c.tar.gz
hercules-ba8b63be4b9d4df2a9f52bbf655e3ad5c3bf3b1c.tar.bz2
hercules-ba8b63be4b9d4df2a9f52bbf655e3ad5c3bf3b1c.tar.xz
hercules-ba8b63be4b9d4df2a9f52bbf655e3ad5c3bf3b1c.zip
Added SqlStmt functions to the SQL interface
Diffstat (limited to 'src/map/mapreg_sql.c')
-rw-r--r--src/map/mapreg_sql.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index a42ec04f2..b6865c8fd 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -140,25 +140,25 @@ static void script_load_mapreg(void) {
| varname | index | value |
+-------------------------+
*/
- SqlStmt* stmt = SqlStmt_Malloc(mmysql_handle);
+ SqlStmt* stmt = SQL->StmtMalloc(mmysql_handle);
char varname[32+1];
int index;
char value[255+1];
uint32 length;
- if ( SQL_ERROR == SqlStmt_Prepare(stmt, "SELECT `varname`, `index`, `value` FROM `%s`", mapreg_table)
- || SQL_ERROR == SqlStmt_Execute(stmt)
+ if ( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `varname`, `index`, `value` FROM `%s`", mapreg_table)
+ || SQL_ERROR == SQL->StmtExecute(stmt)
) {
SqlStmt_ShowDebug(stmt);
- SqlStmt_Free(stmt);
+ SQL->StmtFree(stmt);
return;
}
- SqlStmt_BindColumn(stmt, 0, SQLDT_STRING, &varname[0], sizeof(varname), &length, NULL);
- SqlStmt_BindColumn(stmt, 1, SQLDT_INT, &index, 0, NULL, NULL);
- SqlStmt_BindColumn(stmt, 2, SQLDT_STRING, &value[0], sizeof(value), NULL, NULL);
+ SQL->StmtBindColumn(stmt, 0, SQLDT_STRING, &varname[0], sizeof(varname), &length, NULL);
+ SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &index, 0, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 2, SQLDT_STRING, &value[0], sizeof(value), NULL, NULL);
- while ( SQL_SUCCESS == SqlStmt_NextRow(stmt) ) {
+ while ( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) {
struct mapreg_save *m = NULL;
int s = add_str(varname);
int i = index;
@@ -187,7 +187,7 @@ static void script_load_mapreg(void) {
}
}
- SqlStmt_Free(stmt);
+ SQL->StmtFree(stmt);
mapreg_i_dirty = false;
mapreg_str_dirty = false;