Ensure all *.[ch] files include config.h

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.
This commit is contained in:
Michael Stapelberg
2016-10-11 09:13:35 +02:00
parent c2bd10c482
commit f354f53435
134 changed files with 230 additions and 149 deletions

View File

@ -10,8 +10,9 @@
* compile-time.
*
*/
#ifndef I3_ALL_H
#define I3_ALL_H
#pragma once
#include <config.h>
#include <assert.h>
#include <stdbool.h>
@ -81,5 +82,3 @@
#include "display_version.h"
#include "restore_layout.h"
#include "main.h"
#endif

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Checks the list of assignments for the given window and runs all matching
* ones (unless they have already been run for this specific window).

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
extern pid_t command_error_nagbar_pid;
/**

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* The button press X callback. This function determines whether the floating
* modifier is pressed and where the user clicked (decoration, border, inside

View File

@ -9,4 +9,6 @@
*/
#pragma once
#include <config.h>
char *parse_cmd(const char *new);

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "commands_parser.h"
/** The beginning of the prototype for every cmd_ function. */

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <yajl/yajl_gen.h>
/*

View File

@ -11,6 +11,8 @@
*/
#pragma once
#include <config.h>
/**
* Create a new container (and attach it to the given parent, if not NULL).
* This function only initializes the data structures.

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "config_parser.h"
/**

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <yajl/yajl_gen.h>
SLIST_HEAD(variables_head, Variable);

View File

@ -12,10 +12,11 @@
*/
#pragma once
#include "libi3.h"
#include <stdbool.h>
#include "queue.h"
#include "i3.h"
#include "libi3.h"
typedef struct Config Config;
typedef struct Barconfig Barconfig;

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include "libi3.h"
#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launcher.h>
@ -17,7 +19,6 @@
#include <pcre.h>
#include <sys/time.h>
#include "libi3.h"
#include "queue.h"
/*

View File

@ -10,4 +10,6 @@
*/
#pragma once
#include <config.h>
int handle_event(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e);

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Connects to i3 to find out the currently running version. Useful since it
* might be different from the version compiled into this binary (maybe the

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Updates _NET_CURRENT_DESKTOP with the current desktop number.
*

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
/**
* Creates outputs according to the given specification.
* The specification must be in the format wxh+x+y, for example 1024x768+0+0,

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "tree.h"
/** Callback for dragging */

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <xcb/randr.h>
extern int randr_base;

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <sys/time.h>
#include <sys/resource.h>

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <ev.h>
#include <stdbool.h>
#include <yajl/yajl_gen.h>

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* There was a key press. We compare this key code with our bindings table and pass
* the bound action to parse_command().

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <stdbool.h>
#include <stdarg.h>
#include <stdio.h>

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
typedef enum {
// We could not determine the content of the JSON file. This typically
// means its unreadable or contains garbage.

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Enable or disable the main X11 event handling function.
* This is used by drag_pointer() which has its own, modal event handler, which

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
/**

View File

@ -13,6 +13,8 @@
*/
#pragma once
#include <config.h>
/*
* Initializes the Match data structure. This function is necessary because the
* members representing boolean values (like dock) need to be initialized with

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Moves the given container in the given direction (TOK_LEFT, TOK_RIGHT,
* TOK_UP, TOK_DOWN from cmdparse.l)

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Returns the output container below the given output container.
*

View File

@ -11,6 +11,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
#include <xcb/randr.h>

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Creates a new 'regex' struct containing the given pattern and a PCRE
* compiled regular expression. Also, calls pcre_study because this regex will

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
/* This is used to keep a state to pass around when rendering a con in render_con(). */
typedef struct render_params {
/* A copy of the coordinates of the container which is being rendered. */

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction);
int resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event);

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
/**
* Opens a separate connection to X11 for placeholder windows when restoring
* layouts. This is done as a safety measure (users can xkill a placeholder

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Moves the specified window to the __i3_scratch workspace, making it floating
* and setting the appropriate scratchpad_state.

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <stdint.h>
#if !defined(__OpenBSD__)
#include <pthread.h>

View File

@ -11,6 +11,8 @@
*/
#pragma once
#include <config.h>
/**
* Setup signal handlers to safely handle SIGSEGV and SIGFPE
*

View File

@ -12,6 +12,8 @@
*/
#pragma once
#include <config.h>
#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-monitor.h>

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
extern Con *croot;
/* TODO: i am not sure yet how much access to the focused container should
* be permitted to source files */

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <err.h>
#include "data.h"

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Frees an i3Window and all its members.
*

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
#include "tree.h"
#include "randr.h"

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
/** Stores the X11 window ID of the currently focused window */
extern xcb_window_t focused_id;

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
#include "xcursor.h"

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <xcb/xcb_cursor.h>
enum xcursor_cursor_t {

View File

@ -11,6 +11,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
/**

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>