Imported Upstream version 1.8.0
[platform/upstream/augeas.git] / src / internal.h
index 130b423..e9dbd68 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * internal.h: Useful definitions
  *
- * Copyright (C) 2007-2016 David Lutterkort
+ * Copyright (C) 2007-2017 David Lutterkort
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -380,8 +380,10 @@ void api_exit(const struct augeas *aug);
  * file should have a need to mark nodes as dirty)
  *
  * The FILE flag is set for entries underneath /augeas/files that hold the
- * metadata for a file. It is only set by ADD_FILE_INFO and can not be set
- * by the user.
+ * metadata for a file by ADD_FILE_INFO. The FILE flag is set for entries
+ * underneath /files for the toplevel node corresponding to a file by
+ * TREE_FREPLACE and is used by AUG_SOURCE to find the file to which a node
+ * belongs.
  */
 struct tree {
     struct tree *next;
@@ -405,6 +407,8 @@ struct pathx;
 
 #define ROOT_P(t) ((t) != NULL && (t)->parent == (t)->parent->parent)
 
+#define TREE_HIDDEN(tree) ((tree)->label == NULL)
+
 /* Function: make_tree
  * Allocate a new tree node with the given LABEL, VALUE, and CHILDREN,
  * which are not copied. The new tree is marked as dirty