aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/msg.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-08-23 23:01:32 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-08-23 23:01:32 +0200
commitb6d48ea5d51f09c6dd91a9f64f8e46bafab19a2a (patch)
tree12dcf8395e8083aebde80b262e154116febfb366 /src/msg.h
parentremove redundant code (diff)
downloadcimple-b6d48ea5d51f09c6dd91a9f64f8e46bafab19a2a.tar.gz
cimple-b6d48ea5d51f09c6dd91a9f64f8e46bafab19a2a.zip
cmd -> msg
This I feel better conveys the meaning.
Diffstat (limited to 'src/msg.h')
-rw-r--r--src/msg.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/msg.h b/src/msg.h
new file mode 100644
index 0000000..028aaa0
--- /dev/null
+++ b/src/msg.h
@@ -0,0 +1,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