summaryrefslogtreecommitdiff
path: root/src/char/int_quest.c
diff options
context:
space:
mode:
authorshennetsind <notind@gmail.com>2013-06-10 17:53:37 -0700
committershennetsind <notind@gmail.com>2013-06-10 17:53:37 -0700
commit8821ff87533b037d5d4914db6dbdeacfa5fca4ce (patch)
tree5fd975f4501e8d71ff1b5b31d66a6b99bc813927 /src/char/int_quest.c
parent8f85487dbdc1a5f4bd3d01bc3fc75bba9b643124 (diff)
parent4d9a0a869c52f7acab6ca110d78aa006f76f70a5 (diff)
downloadhercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.tar.gz
hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.tar.bz2
hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.tar.xz
hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.zip
Merge pull request #42 from Earisu/master
Sql Statement interface
Diffstat (limited to 'src/char/int_quest.c')
-rw-r--r--src/char/int_quest.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index d771543cc..af8f83a5d 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -26,7 +26,7 @@ int mapif_quests_fromsql(int char_id, struct quest questlog[])
struct quest tmp_quest;
SqlStmt * stmt;
- stmt = SqlStmt_Malloc(sql_handle);
+ stmt = SQL->StmtMalloc(sql_handle);
if( stmt == NULL )
{
SqlStmt_ShowDebug(stmt);
@@ -35,21 +35,21 @@ int mapif_quests_fromsql(int char_id, struct quest questlog[])
memset(&tmp_quest, 0, sizeof(struct quest));
- if( SQL_ERROR == SqlStmt_Prepare(stmt, "SELECT `quest_id`, `state`, `time`, `count1`, `count2`, `count3` FROM `%s` WHERE `char_id`=? LIMIT %d", quest_db, MAX_QUEST_DB)
- || SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
- || SQL_ERROR == SqlStmt_Execute(stmt)
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL)
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 1, SQLDT_INT, &tmp_quest.state, 0, NULL, NULL)
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 2, SQLDT_UINT, &tmp_quest.time, 0, NULL, NULL)
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 3, SQLDT_INT, &tmp_quest.count[0], 0, NULL, NULL)
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 4, SQLDT_INT, &tmp_quest.count[1], 0, NULL, NULL)
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 5, SQLDT_INT, &tmp_quest.count[2], 0, NULL, NULL) )
+ if( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `quest_id`, `state`, `time`, `count1`, `count2`, `count3` FROM `%s` WHERE `char_id`=? LIMIT %d", quest_db, MAX_QUEST_DB)
+ || SQL_ERROR == SQL->StmtBindParam(stmt, 0, SQLDT_INT, &char_id, 0)
+ || SQL_ERROR == SQL->StmtExecute(stmt)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &tmp_quest.state, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UINT, &tmp_quest.time, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_INT, &tmp_quest.count[0], 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT, &tmp_quest.count[1], 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &tmp_quest.count[2], 0, NULL, NULL) )
SqlStmt_ShowDebug(stmt);
- for( i = 0; i < MAX_QUEST_DB && SQL_SUCCESS == SqlStmt_NextRow(stmt); ++i )
+ for( i = 0; i < MAX_QUEST_DB && SQL_SUCCESS == SQL->StmtNextRow(stmt); ++i )
memcpy(&questlog[i], &tmp_quest, sizeof(tmp_quest));
- SqlStmt_Free(stmt);
+ SQL->StmtFree(stmt);
return i;
}