summaryrefslogtreecommitdiff
path: root/tbl_qcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tbl_qcmd.c')
-rw-r--r--tbl_qcmd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tbl_qcmd.c b/tbl_qcmd.c
index 4af9de8..deef61f 100644
--- a/tbl_qcmd.c
+++ b/tbl_qcmd.c
@@ -49,6 +49,24 @@ int tbl_exec_add(tbl_exec *tbl, tble_exec *cmd)
int tbl_exec_in_s(tbl_exec *tbl, char *cmd)
{
+ int i;
+ tble_exec *el=NULL;
+
+ if ((tbl == NULL) || (cmd == NULL))
+ {
+ PERM();
+ return -1;
+ }
+
+ for (i=0; i<tbl->size; i++)
+ {
+ el = tbl->cmd[i];
+ if (strncmp(el->cmd, cmd, strlen(el->cmd))==0)
+ {
+ return i;
+ }
+ }
+
return -1;
}