diff options
| author | Nakidai <nakidai@disroot.org> | 2025-08-30 15:16:25 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2025-08-30 15:16:25 +0300 |
| commit | 7a3999d7d809d6a3c25aeaa05f9acd17113b0709 (patch) | |
| tree | 8f6aa95411a9dd81cae7fa5cd01fc0e2d302bc52 /sami.h | |
| parent | 793f83080b8eb91f8c70fadc5911d0ea4f9829ff (diff) | |
| download | sami-7a3999d7d809d6a3c25aeaa05f9acd17113b0709.tar.gz sami-7a3999d7d809d6a3c25aeaa05f9acd17113b0709.zip | |
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()
Diffstat (limited to 'sami.h')
| -rw-r--r-- | sami.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sami.h b/sami.h index 53e5ad8..fdab71c 100644 --- a/sami.h +++ b/sami.h @@ -4,7 +4,6 @@ #include <stddef.h> #include <unistd.h> -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__ */ |