From 0ae9dc3dfe4b1bd24a0d0385480d9ad7d07d0976 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sat, 18 Mar 2017 20:30:06 +0000 Subject: Basic response from 2 command, works for privatemessages --- tbl_qcmd.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tbl_qcmd.c') 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;isize;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) -- cgit v1.2.3