diff options
Diffstat (limited to 'src/cmd.h')
| -rw-r--r-- | src/cmd.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd.h b/src/cmd.h new file mode 100644 index 0000000..f9b3c6b --- /dev/null +++ b/src/cmd.h @@ -0,0 +1,19 @@ +#ifndef __CMD_H__ +#define __CMD_H__ + +struct cmd { + int argc; + char **argv; +}; + +int cmd_send(int fd, const struct cmd *); +int cmd_send_and_wait_for_result(int fd, const struct cmd *, int *result); + +typedef int (*cmd_handler)(const struct cmd *, void *arg); + +int cmd_recv(int fd, struct cmd *); +int cmd_recv_and_send_result(int fd, cmd_handler, void *arg); + +void cmd_free(const struct cmd *); + +#endif |
