Explorar o código

Add show_leaflist()

Serj Kalichev %!s(int64=3) %!d(string=hai) anos
pai
achega
8a5d4054e5
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/show.c

+ 4 - 0
src/show.c

@@ -89,7 +89,11 @@ static void show_leaf(const struct lyd_node *node, size_t level, uint32_t flags)
 
 static void show_leaflist(const struct lyd_node *node, size_t level, uint32_t flags)
 {
+	if (!node)
+		return;
 
+	printf("%*s%s %s\n", (int)(level * LEVEL_SPACES_NUM), "", node->schema->name,
+		lyd_get_value(node));
 }