@@ -235,6 +235,24 @@ static int _sectors_to_units(uint64_t sectors, char *buffer, size_t s)
return dm_snprintf(buffer, s, "# %g %s", d, _units[i]) > 0;
}
+/* increment indention level */
+void out_inc_indent(struct formatter *f)
+{
+ _inc_indent(f);
+}
+
+/* decrement indention level */
+void out_dec_indent(struct formatter *f)
+{
+ _dec_indent(f);
+}
+
+/* insert new line */
+int out_newline(struct formatter *f)
+{
+ return f->nl(f);
+}
+
/*
* Appends a comment giving a size in more easily
* readable form (eg, 4M instead of 8096).
@@ -17,7 +17,7 @@
#define _LVM_TEXT_EXPORT_H
#define outf(args...) do {if (!out_text(args)) return_0;} while (0)
-#define outnl(f) do {if (!f->nl(f)) return_0;} while (0)
+#define outnl(f) do {if (!out_newline(f)) return_0;} while (0)
struct formatter;
struct lv_segment;
@@ -37,4 +37,8 @@ int out_config_node(struct formatter *f, const struct config_node *cn);
int out_areas(struct formatter *f, const struct lv_segment *seg,
const char *type);
+void out_inc_indent(struct formatter *f);
+void out_dec_indent(struct formatter *f);
+int out_newline(struct formatter *f);
+
#endif