83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen#ifndef IPC_CLIENT_H
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen#define IPC_CLIENT_H
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainenenum ipc_client_cmd_state {
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen IPC_CLIENT_CMD_STATE_REPLY,
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen IPC_CLIENT_CMD_STATE_OK,
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen IPC_CLIENT_CMD_STATE_ERROR
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen};
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainentypedef void ipc_client_callback_t(enum ipc_client_cmd_state state,
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen const char *data, void *context);
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainenstruct ipc_client *
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainenipc_client_init(const char *ipc_socket_path);
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainenvoid ipc_client_deinit(struct ipc_client **client);
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainenvoid ipc_client_cmd(struct ipc_client *client, const char *cmd,
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen ipc_client_callback_t *callback, void *context)
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen ATTR_NULL(4);
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen
83942ac160cdfb922c3a2f29ddfae2a13ebf8b5dTimo Sirainen#endif