#include <sys/types.h>
Go to the source code of this file.
◆ ipc_process_func
| typedef void(* ipc_process_func) (struct ipc_context *, void *) |
◆ ipc_protocol
◆ ipc_relation
| Enumerator |
|---|
| IPC_MAIN | |
| IPC_CHILD | |
◆ ipc_add_context()
adds a given context to contexts
- Parameters
-
| ctxs | the context holder array to be used to add a new ctx |
| ctx | the context to be added to ctxs |
- Returns
- a pointer to the given ctxs or NULL on failure.
◆ ipc_close()
closes given context
- Parameters
-
- Returns
- -1 when context is either NULL or already closed or 0 on success.
◆ ipc_contexts_init()
initializes ipc_contexts with a given preallocated capacity.
- Parameters
-
| cap | to size to be preallocated, if 0 it will not preallocate but allocate on each enw entry. |
- Returns
- a heap initialized contexts or NULL on failure.
◆ ipc_destroy()
destroys given context
- Parameters
-
- Returns
- 0 on success, -1 on context null or failure to destroy
◆ ipc_destroy_contexts()
destroys given contexts
- Parameters
-
| ctxs | the context holder array to be destroyed. |
- Returns
- 0 on success or -1 on failure.
◆ ipc_exec_as_process()
runs given functions with the given protocol type.
- Parameters
-
| type | the protocol type to be initialized |
| exec_ctx | the execution context to be executed. |
- Returns
- a heap initialized context or NULL on failure.
◆ ipc_init()
initializes a new context.
- Parameters
-
| type | the protocol type to be initialized |
| relation | the relation of the context to be initialized when supported by the type. |
- Returns
- a heap initialized context or NULL on failure.
◆ ipc_retrieve()
retrieves data for the relation based on the context
- Parameters
-
| context | the ipc_context to be used; must be previously initialized via ipc_init. |
| to | the recieving direction of the message when it is supported by the given ipc_context. |
- Returns
- a heap initialized data or NULL
◆ ipc_send()
sends given msg to the target based on the given context
- Parameters
-
| context | the ipc_context to be used; must be previously initialized via ipc_init. |
| to | the target direction of the message when it is supported by the given ipc_context. |
| msg | the message to send |
| len | the length of msg |
- Returns
- bytes written, -2 when the context or msg or context type is unknown, -1 on write error