From e05f02acd583797ceb449fc501d371d45a4293c1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 17 Jul 2023 23:03:59 +0200 Subject: switch to JSON-RPC as message format Instead of the weird `struct msg` I had, I switched to the JSON-RPC format. It's basically the same, but has a well-defined semantics in case of errors. --- src/msg.h | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/msg.h (limited to 'src/msg.h') diff --git a/src/msg.h b/src/msg.h deleted file mode 100644 index 44ebf44..0000000 --- a/src/msg.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022 Egor Tensin - * This file is part of the "cimple" project. - * For details, see https://github.com/egor-tensin/cimple. - * Distributed under the MIT License. - */ - -#ifndef __MSG_H__ -#define __MSG_H__ - -#include - -struct msg; - -int msg_from_argv(struct msg **, const char **argv); -void msg_free(struct msg *); - -int msg_copy(struct msg **, const struct msg *); - -size_t msg_get_length(const struct msg *); -const char **msg_get_strings(const struct msg *); -const char *msg_get_first_string(const struct msg *); - -int msg_success(struct msg **); -int msg_error(struct msg **); - -int msg_is_success(const struct msg *); -int msg_is_error(const struct msg *); - -int msg_recv(int fd, struct msg **); - -int msg_send(int fd, const struct msg *); -int msg_send_argv(int fd, const char **argv); - -int msg_talk(int fd, const struct msg *, struct msg **response); -int msg_talk_argv(int fd, const char **argv, struct msg **response); - -int msg_connect_and_talk(const char *host, const char *port, const struct msg *, struct msg **); -int msg_connect_and_talk_argv(const char *host, const char *port, const char **argv, - struct msg **response); - -void msg_dump(const struct msg *); - -#endif -- cgit v1.3