29 } __attribute__ ((packed));
35 class ipc_error :
public std::runtime_error {
using std::runtime_error::runtime_error; };
113 buf_t(uint32_t payload_size);
127 int32_t
i3_connect(
const std::string& socket_path);
void i3_disconnect(const int32_t sockfd)
Close the connection.
std::shared_ptr< buf_t > i3_msg(const int32_t sockfd, const ClientMessageType type, const std::string &payload=std::string())
Pack, send a message and receiv a reply.
ReplyType
Replies, that can be sended from the i3 to the client.
Definition: ipc-util.hpp:80
ClientMessageType
Messages (requests), that can be sended from the client.
Definition: ipc-util.hpp:65
char * payload
Message payload.
Definition: ipc-util.hpp:111
Definition: ipc-util.hpp:12
header_t * header
i3 IPC message header
Definition: ipc-util.hpp:104
std::shared_ptr< buf_t > i3_pack(const ClientMessageType type, const std::string &payload)
Pack a buffer of message.
int32_t i3_connect(const std::string &socket_path)
Connect to the i3 socket.
void realloc_payload_to_header()
Resize payload to the payload_size in the header.
If any error occured, while using C-functions.
Definition: ipc-util.hpp:55
uint8_t * data
Pointer to the message.
Definition: ipc-util.hpp:97
If something wrong in a payload of i3's reply.
Definition: ipc-util.hpp:50
Socket return EOF, but expected a data.
Definition: ipc-util.hpp:45
Base class of i3 IPC errors.
Definition: ipc-util.hpp:35
void i3_send(const int32_t sockfd, const buf_t &buff)
Send message to the socket.
i3 IPC message buffer
Definition: ipc-util.hpp:95
uint32_t size
Size of whole buffer.
Definition: ipc-util.hpp:96
std::shared_ptr< buf_t > i3_recv(const int32_t sockfd)
Recive a message from i3.