#ifndef _PENDING_COMMANDS_QUEUE_H #define _PENDING_COMMANDS_QUEUE_H #include #include "../scanner_module.h" /** \addtogroup PendingCommandsQueue PendingCommandsQueue The PendingCommandsQueue stores all commands generated by the ScannerUI. The queue is polled by the scan-job-manager which will then process commands. TODO: use generic queue-class from queue.h @{ */ /** Internal command-structure created by the ScannerUI::scanner_ui_write, stored in the PendingCommandsQueue and processed by the scan-job-manager. */ struct command_t { char *name; unsigned int argc; char **argv; }; struct pending_commands_queue_node{ struct rw_semaphore *lock; struct semaphore *queue_empty; struct list_head list; struct command_t *command; }; void pending_commands_queue_add(const char *cmd_str); struct command_t *pending_commands_queue_head(boolean may_sleep); void pending_commands_queue_clear(void); void delete_command(struct command_t *this); /** @} */ #endif