From 7a3999d7d809d6a3c25aeaa05f9acd17113b0709 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sat, 30 Aug 2025 15:16:25 +0300 Subject: Change API - now there's no SAMI_recv(), but handler is called each time message is received - children can send messages to their parent, which is obtainable using SAMI_parent() --- sami.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sami.h') diff --git a/sami.h b/sami.h index 53e5ad8..fdab71c 100644 --- a/sami.h +++ b/sami.h @@ -4,7 +4,6 @@ #include #include -extern int SAMI__fd; struct SAMI { @@ -13,11 +12,11 @@ struct SAMI }; typedef struct SAMI SAMI; -typedef void SAMI_Handler(void *arg); +typedef int SAMI_Handler(const SAMI *sender, void *message, size_t length); -int SAMI_make(SAMI *actor, SAMI_Handler *handler, void *arg); +int SAMI_make(SAMI *actor, SAMI_Handler *handler); int SAMI_send(SAMI *actor, void *buf, size_t length); -int SAMI_recv(void *buf, size_t length); int SAMI_kill(SAMI *actor); +SAMI *SAMI_parent(void); #endif /* __SAMI_H__ */ -- cgit 1.4.1