aboutsummaryrefslogtreecommitdiffstats
path: root/tbl_qcmd.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-03-16 23:12:46 +0000
committerFreeArtMan <dos21h@gmail.com>2017-03-16 23:12:46 +0000
commitb04419c4c7e485f164d6481470b2e6b0087dcac1 (patch)
tree94e07b978e28c46d4df0bb791ba9c24f5f09d5ca /tbl_qcmd.c
parentfbba9957124bde600e89e3720377f9c3ab78e3a0 (diff)
downloadagni-b04419c4c7e485f164d6481470b2e6b0087dcac1.tar.gz
agni-b04419c4c7e485f164d6481470b2e6b0087dcac1.zip
Add token to qcmd. Added needed functions to manage that
Diffstat (limited to 'tbl_qcmd.c')
-rw-r--r--tbl_qcmd.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/tbl_qcmd.c b/tbl_qcmd.c
index 6d7360d..e7d74ac 100644
--- a/tbl_qcmd.c
+++ b/tbl_qcmd.c
@@ -334,6 +334,26 @@ int tbl_qcmd_del(tbl_qcmd *tbl, int idx)
return ret;
}
+int tbl_qcmd_add_tok(tble_qcmd *tbl, irc_token *tk)
+{
+ if (tbl == NULL)
+ {
+ PERM();
+ return -1;
+ }
+
+ if (tk == NULL)
+ {
+ PERM();
+ return -1;
+ }
+
+ //just copy inside new token
+ tbl->tok = token_cpy_new(tk);
+
+ return 0;
+}
+
int tbl_qcmd_resp(tbl_qcmd *tbl, tble_cmd_resp *resp)
{
int ret = -1;
@@ -349,7 +369,9 @@ int tbl_qcmd_resp(tbl_qcmd *tbl, tble_cmd_resp *resp)
for (i=0;i<tbl->size;i++)
{
single_cmd = tbl->cmd[i];
- if ((single_cmd->id == resp->id))
+
+ //check this for particular checks
+ if ((single_cmd->cid == resp->qid))
{
return i;
}
@@ -558,6 +580,9 @@ int tbl_qcmd_destroy_cmd(tble_qcmd *tble)
return -1;
}
+ //?
+ //Free token list TODO
+
free(tble->cmd);
tble->cmd = NULL;