first commit
This commit is contained in:
58
src/ipc_c.h
Normal file
58
src/ipc_c.h
Normal file
@@ -0,0 +1,58 @@
|
||||
// Copyright (c) 2023 - present, Anton Anikin <anton@anikin.xyz>
|
||||
// All rights reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void
|
||||
ipc_init_default();
|
||||
|
||||
void
|
||||
ipc_init(const char* name, unsigned int mode);
|
||||
|
||||
void*
|
||||
ipc_create_default(int is_server, int verbose);
|
||||
|
||||
void*
|
||||
ipc_create(const char* name, int is_server, int verbose);
|
||||
|
||||
void
|
||||
ipc_destroy(void* ipc);
|
||||
|
||||
void
|
||||
ipc_start_external_default(const char* executable, int is_server);
|
||||
|
||||
void
|
||||
ipc_start_external(const char* executable, const char* ipc_name, int is_server);
|
||||
|
||||
void
|
||||
ipc_write_any(void* ipc, const void* data, size_t count, size_t size);
|
||||
|
||||
void
|
||||
ipc_read_any(void* ipc, void* data, size_t count, size_t size);
|
||||
|
||||
void
|
||||
ipc_write_string(void* ipc, const char* str);
|
||||
|
||||
void
|
||||
ipc_read_string(void* ipc, char* str);
|
||||
|
||||
#define _IPC_WRITE_FN_NAME(type) void ipc_write_ ## type (void* ipc, const type * data, size_t count)
|
||||
#define _IPC_READ_FN_NAME(type) void ipc_read_ ## type (void* ipc, type * data, size_t count)
|
||||
|
||||
_IPC_WRITE_FN_NAME(char);
|
||||
_IPC_WRITE_FN_NAME(int);
|
||||
_IPC_WRITE_FN_NAME(long);
|
||||
_IPC_WRITE_FN_NAME(double);
|
||||
|
||||
_IPC_READ_FN_NAME(char);
|
||||
_IPC_READ_FN_NAME(int);
|
||||
_IPC_READ_FN_NAME(long);
|
||||
_IPC_READ_FN_NAME(double);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user