X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=door_daemon%2Fcommand_queue.h;h=bc153fe69ba4f19c26695bdc5c7c722cd33524c6;hb=a037f5b9c6d8e1074d354d8fa14fd36f6dace6c3;hp=0e87568cf398a4aa0dce992e70a074bcf141c353;hpb=b59052bce7db1296a8f567205036039c7c7cd121;p=svn42.git diff --git a/door_daemon/command_queue.h b/door_daemon/command_queue.h index 0e87568..bc153fe 100644 --- a/door_daemon/command_queue.h +++ b/door_daemon/command_queue.h @@ -21,6 +21,8 @@ #ifndef _COMMAND_QUEUE_H_ #define _COMMAND_QUEUE_H_ +#include + enum cmd_id_enum { OPEN, CLOSE, TOGGLE, RESET, STATUS, LOG }; typedef enum cmd_id_enum cmd_id_t; @@ -28,11 +30,15 @@ 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);