diff options
Diffstat (limited to 'tbl_qcmd.c')
-rw-r--r-- | tbl_qcmd.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; } |