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