$OpenBSD: patch-include_load_layout_h,v 1.1 2014/08/18 08:46:27 dcoppa Exp $

commit 679a5de8cfb9211afb1a1dd882e53bd672084754
Author: Michael Stapelberg <michael@stapelberg.de>
Date:   Tue Jul 15 10:15:04 2014 +0200

Bugfix: properly restore workspace containers

--- include/load_layout.h.orig	Sun Jun 15 19:12:43 2014
+++ include/load_layout.h	Mon Aug 18 08:25:05 2014
@@ -10,4 +10,25 @@
  */
 #pragma once
 
+typedef enum {
+    // We could not determine the content of the JSON file. This typically
+    // means it's 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);
