diff options
Diffstat (limited to 'tbl_qcmd.h')
-rw-r--r-- | tbl_qcmd.h | 34 |
1 files changed, 32 insertions, 2 deletions
@@ -5,6 +5,7 @@ #include <stdlib.h> #include <mqueue.h> #include <string.h> +#include <time.h> #include "debug.h" #include "util.h" @@ -44,6 +45,8 @@ typedef struct tbl_exec tble_exec **cmd; } tbl_exec; +#define QCMD_DEFAULT_TIMEOUT 10 //default amount of seconds to wait replay + #define QCMD_NONE 0 //nothing happening with this command #define QCMD_TIMEOUT 1 //command running to long without result #define QCMD_DONE 2 //comand finsihed execution @@ -262,7 +265,7 @@ Output: int tbl_qcmd_chk(tbl_qcmd *tbl); /* -delete command from the list +delete command from the list, by command position in array Input: tbl - array of executed commands idx - index in array that should be removed @@ -270,7 +273,20 @@ Output: 0 - if everything whent ok -1 - if there was some kind of mistake */ -int tbl_qcmd_del(tbl_qcmd *tbl, int idx); +int tbl_qcmd_del_by_idx(tbl_qcmd *tbl, int idx); + +/* +delete command from the list, search command id in the list and delete +Input: + tbl - array of executed commands + idx - command id that should be deleted +Output: + 1 - command found and removed + 0 - command havent been found or deleted + -1 - if there was some kind of error +*/ +int tbl_qcmd_del_by_id(tbl_qcmd *tbl, int idx); + /* @@ -370,6 +386,8 @@ Output: */ int tbl_qcmd_print_tbl(tbl_qcmd *tbl, int flags); + + /* Input: Output: @@ -386,6 +404,18 @@ Output: */ int tbl_qcmd_destroy_table(tbl_qcmd *tbl); +/* +Check table of commands, remove timedout commands if there was no response. +Input: + tbl - name of command table to use +Output: + 1 0 how many commands where affected, state changes, removed commands and so on + 0 - if everything whent ok + -1 - some kind of error +*/ +int tbl_qcmd_mng_states(tbl_qcmd *tbl); + + /*mvar things*/ //shitty macro |