1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #pragma once |
4 | |
5 | #include <stddef.h> |
6 | |
7 | typedef struct _ipc ipc_t; |
8 | typedef struct _ipc_server ipc_server_t; |
9 | |
10 | void ipc_init(void); |
11 | |
12 | ipc_server_t *ipc_server_create(const char *name, size_t max_pending_connections); |
13 | |
14 | ipc_server_t *ipc_get_server(const char *name); |
15 | |
16 | ipc_t *ipc_server_accept(ipc_server_t *server); |
17 | |
18 | void ipc_server_close(ipc_server_t *server); |
19 | |
20 | ipc_t *ipc_connect_to_server(const char *name, size_t buffer_size); |
21 | |
22 | size_t ipc_client_read(ipc_t *ipc, void *buffer, size_t size); |
23 | size_t ipc_client_write(ipc_t *ipc, const void *buffer, size_t size); |
24 | size_t ipc_server_read(ipc_t *ipc, void *buffer, size_t size); |
25 | size_t ipc_server_write(ipc_t *ipc, const void *buffer, size_t size); |
26 | |
27 | void ipc_client_close_channel(ipc_t *ipc); |
28 | void ipc_server_close_channel(ipc_t *ipc); |
29 | |