summaryrefslogtreecommitdiff
path: root/tbl_qcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tbl_qcmd.c')
-rw-r--r--tbl_qcmd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tbl_qcmd.c b/tbl_qcmd.c
index b3b2a88..4af9de8 100644
--- a/tbl_qcmd.c
+++ b/tbl_qcmd.c
@@ -354,6 +354,35 @@ int tbl_qcmd_add_tok(tble_qcmd *tbl, irc_token *tk)
return 0;
}
+tble_qcmd* tbl_qcmd_match_id(tbl_qcmd *tbl, int idx)
+{
+ int i;
+
+ if (tbl == NULL)
+ {
+ PERM();
+ return NULL;
+ }
+
+ if (idx < 0)
+ {
+ PERM();
+ return NULL;
+ }
+
+ for (i=0;i<tbl->size;i++)
+ {
+ tble_qcmd *iter = tbl->cmd[i];
+
+ if (iter->id == idx)
+ {
+ return iter;
+ }
+ }
+
+ return NULL;
+}
+
int tbl_qcmd_resp(tbl_qcmd *tbl, tble_cmd_resp *resp)
{
int ret = -1;
@@ -492,6 +521,7 @@ int tbl_cmd_resp_print(tble_cmd_resp *resp)
return 0;
}
+//add to print token if its there
int tbl_qcmd_print_cmd(tble_qcmd *tbl, int flags)
{
if (tbl == NULL)