X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=door_daemon%2Fcommand_queue.h;h=1b26e3a2c9ac7ef19b24e2ae807cdbbe993004f0;hb=273898a7a155895de69cde048b96f6ffb5f1fc47;hp=0e87568cf398a4aa0dce992e70a074bcf141c353;hpb=b59052bce7db1296a8f567205036039c7c7cd121;p=svn42.git diff --git a/door_daemon/command_queue.h b/door_daemon/command_queue.h index 0e87568..1b26e3a 100644 --- a/door_daemon/command_queue.h +++ b/door_daemon/command_queue.h @@ -21,18 +21,24 @@ #ifndef _COMMAND_QUEUE_H_ #define _COMMAND_QUEUE_H_ -enum cmd_id_enum { OPEN, CLOSE, TOGGLE, RESET, STATUS, LOG }; +#include + +enum cmd_id_enum { OPEN, CLOSE, TOGGLE, RESET, STATUS, LOG , LISTEN }; typedef enum cmd_id_enum cmd_id_t; struct cmd_struct { int fd; cmd_id_t cmd; char* param; + int sent; + struct timeval tv_start; struct cmd_struct* next; }; typedef struct cmd_struct cmd_t; int cmd_push(cmd_t** first, int fd, cmd_id_t cmd, const char* param); +void cmd_sent(cmd_t* cmd); +int cmd_has_expired(cmd_t cmd); void cmd_pop(cmd_t** first); void cmd_clear(cmd_t** first);