i3
Data Structures | Defines | Typedefs | Functions | Variables
include/ipc.h File Reference
#include <ev.h>
#include <stdbool.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
#include "data.h"
#include "tree.h"
#include "i3/ipc.h"
Include dependency graph for ipc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ipc_client

Defines

#define IPC_HANDLER(name)

Typedefs

typedef struct ipc_client ipc_client
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.
void dump_node (yajl_gen gen, Con *con, bool inplace_restart)

Variables

char * current_socketpath

Define Documentation

#define IPC_HANDLER (   name)
Value:
static void handle_ ## name (int fd, uint8_t *message, \
                                     int size, uint32_t message_size, \
                                     uint32_t message_type)

Definition at line 50 of file ipc.h.


Typedef Documentation

typedef void(* handler_t)(int, uint8_t *, int, uint32_t, uint32_t)

Definition at line 47 of file ipc.h.

typedef struct ipc_client ipc_client

Function Documentation

void dump_node ( yajl_gen  gen,
Con con,
bool  inplace_restart 
)

Definition at line 174 of file ipc.c.

References BS_1PIXEL, BS_NONE, BS_NORMAL, Match::dock, dump_node(), dump_rect(), focused, HORIZ, Match::insert_where, NO_ORIENTATION, TAILQ_FOREACH, VERT, y, and ystr.

Referenced by dump_node(), IPC_HANDLER(), and store_restart_layout().

Here is the call graph for this function:

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 691 of file ipc.c.

References current_socketpath, DLOG, FREE, mkdirp(), path_exists(), resolve_tilde(), and sstrdup().

Referenced by main().

Here is the call graph for this function:

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 661 of file ipc.c.

References DLOG, ipc_receive_message(), scalloc(), and TAILQ_INSERT_TAIL.

Referenced by main().

Here is the call graph for this function:

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 107 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(), workspace_get(), workspace_show(), and workspace_update_urgent_flag().

Here is the call graph for this function:

void ipc_shutdown ( )

Calls shutdown() on each socket and closes it.

This function to be called when exiting or restarting only!

Definition at line 131 of file ipc.c.

References ipc_client::fd, and TAILQ_FOREACH.

Referenced by i3_restart().


Variable Documentation

Definition at line 24 of file ipc.c.

Referenced by ipc_create_socket(), and x_set_i3_atoms().