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

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

int msg_from_argv(struct msg *, const char *argv[]);

int msg_send(int fd, const struct msg *);
int msg_send_and_wait_for_result(int fd, const struct msg *, int *result);

typedef int (*msg_handler)(const struct msg *, void *arg);

int msg_recv(int fd, struct msg *);
int msg_recv_and_send_result(int fd, msg_handler, void *arg);

void msg_free(const struct msg *);

#endif