#include <ev.h>
#include "i3/ipc.h"
Go to the source code of this file.
Data Structures | |
struct | ipc_client |
Defines | |
#define | IPC_HANDLER(name) |
Typedefs | |
typedef void(* | handler_t )(int, uint8_t *, int, uint32_t, uint32_t) |
Functions | |
void | ipc_new_client (EV_P_ struct ev_io *w, int revents) |
Handler for activity on the listening socket, meaning that a new client has just connected and we should accept() him. | |
int | ipc_create_socket (const char *filename) |
Creates the UNIX domain socket at the given path, sets it to non-blocking mode, bind()s and listen()s on it. | |
void | ipc_send_event (const char *event, uint32_t message_type, const char *payload) |
Sends the specified event to all IPC clients which are currently connected and subscribed to this kind of event. | |
void | ipc_shutdown () |
Calls shutdown() on each socket and closes it. |
#define IPC_HANDLER | ( | name | ) |
typedef void(* handler_t)(int, uint8_t *, int, uint32_t, uint32_t) |
int ipc_create_socket | ( | const char * | filename | ) |
Creates the UNIX domain socket at the given path, sets it to non-blocking mode, bind()s and listen()s on it.
Definition at line 502 of file ipc.c.
References DLOG, glob_path(), mkdirp(), path_exists(), and sstrdup().
Referenced by main().
void ipc_new_client | ( | EV_P_ struct ev_io * | w, | |
int | revents | |||
) |
Handler for activity on the listening socket, meaning that a new client has just connected and we should accept() him.
Sets up the event handler for activity on the new connection and inserts the file descriptor into the list of clients.
Definition at line 472 of file ipc.c.
References DLOG, ipc_receive_message(), scalloc(), and TAILQ_INSERT_TAIL.
Referenced by main().
void ipc_send_event | ( | const char * | event, | |
uint32_t | message_type, | |||
const char * | payload | |||
) |
Sends the specified event to all IPC clients which are currently connected and subscribed to this kind of event.
Definition at line 121 of file ipc.c.
References ipc_client::events, ipc_client::fd, ipc_send_message(), ipc_client::num_events, and TAILQ_FOREACH.
Referenced by handle_screen_change(), handle_unmap_notify_event(), initialize_output(), parse_command(), workspace_assign_to(), workspace_get(), workspace_show(), and workspace_update_urgent_flag().
void ipc_shutdown | ( | ) |
Calls shutdown() on each socket and closes it.
This function to be called when exiting or restarting only!
Definition at line 145 of file ipc.c.
References ipc_client::fd, and TAILQ_FOREACH.
Referenced by i3_restart(), and parse_command().