i3/include/load_layout.h
Michael Stapelberg f354f53435 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.
2016-10-23 21:09:24 +02:00

37 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
*
* load_layout.c: Restore (parts of) the layout, for example after an inplace
* restart.
*
*/
#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.
JSON_CONTENT_UNKNOWN = 0,
// The JSON file contains a “normal” container, i.e. a container to be
// appended to an existing workspace (or split container!).
JSON_CONTENT_CON = 1,
// The JSON file contains a workspace container, which needs to be appended
// to the output (next to the other workspaces) with special care to avoid
// naming conflicts and ensuring that the workspace _has_ a name.
JSON_CONTENT_WORKSPACE = 2,
} json_content_t;
/* Parses the given JSON file until it encounters the first “type” property to
* determine whether the file contains workspaces or regular containers, which
* is important to know when deciding where (and how) to append the contents.
* */
json_content_t json_determine_content(const char *filename);
void tree_append_json(Con *con, const char *filename, char **errormsg);