X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=blobdiff_plain;f=include%2Fload_layout.h;h=9205800f6fd3c4d390db4119010a702f3b6cd3d8;hp=8736a50cf46559dead850d0edb66a8e3717eab2a;hb=HEAD;hpb=679a5de8cfb9211afb1a1dd882e53bd672084754 diff --git a/include/load_layout.h b/include/load_layout.h index 8736a50c..9205800f 100644 --- a/include/load_layout.h +++ b/include/load_layout.h @@ -2,7 +2,7 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2014 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * * load_layout.c: Restore (parts of) the layout, for example after an inplace * restart. @@ -10,6 +10,8 @@ */ #pragma once +#include + typedef enum { // We could not determine the content of the JSON file. This typically // means it’s unreadable or contains garbage. @@ -29,6 +31,12 @@ typedef enum { * 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); +json_content_t json_determine_content(const char *buf, const size_t len); + +/** + * Returns true if the provided JSON could be parsed by yajl. + * + */ +bool json_validate(const char *buf, const size_t len); -void tree_append_json(Con *con, const char *filename, char **errormsg); +void tree_append_json(Con *con, const char *buf, const size_t len, char **errormsg);