f354f53435
Including config.h is necessary to get e.g. the _GNU_SOURCE define and any other definitions that autoconf declares. Hence, config.h needs to be included as the first header in each file. This is done either via: 1. Including "common.h" (i3bar) 2. Including "libi3.h" 3. Including "all.h" (i3) 4. Including <config.h> directly Also remove now-unused I3__FILE__, add copyright/license statement where missing and switch include/all.h to #pragma once.
41 lines
720 B
C
41 lines
720 B
C
/*
|
|
* vim:ts=4:sw=4:expandtab
|
|
*
|
|
* i3bar - an xcb-based status- and ws-bar for i3
|
|
* © 2010 Axel Wagner and contributors (see also: LICENSE)
|
|
*
|
|
* ipc.c: Communicating with i3
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#include <config.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
/*
|
|
* Initiate a connection to i3.
|
|
* socket_path must be a valid path to the ipc_socket of i3
|
|
*
|
|
*/
|
|
int init_connection(const char *socket_path);
|
|
|
|
/*
|
|
* Destroy the connection to i3.
|
|
*
|
|
*/
|
|
void destroy_connection(void);
|
|
|
|
/*
|
|
* Sends a message to i3.
|
|
* type must be a valid I3_IPC_MESSAGE_TYPE (see i3/ipc.h for further information)
|
|
*
|
|
*/
|
|
int i3_send_msg(uint32_t type, const char *payload);
|
|
|
|
/*
|
|
* Subscribe to all the i3-events, we need
|
|
*
|
|
*/
|
|
void subscribe_events(void);
|