aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/cmd.h
blob: 9f519f665bc4a6ae6c230fb1695bbdc760608122 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef __CMD_H__
#define __CMD_H__

struct cmd {
	int argc;
	char **argv;
};

int cmd_from_argv(struct cmd *, const 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