@@ -286,9 +286,9 @@ int out_hint(struct formatter *f, const char *fmt, ...)
}
/*
- * Appends a comment
+ * The normal output function with comment
*/
-static int _out_comment(struct formatter *f, const char *comment, const char *fmt, ...)
+int out_text_with_comment(struct formatter *f, const char *comment, const char *fmt, ...)
{
va_list ap;
int r;
@@ -579,7 +579,7 @@ static int _print_lv(struct formatter *f, struct logical_volume *lv)
switch (lv->read_ahead) {
case DM_READ_AHEAD_NONE:
- _out_comment(f, "# None", "read_ahead = -1");
+ outfc(f, "# None", "read_ahead = -1");
break;
case DM_READ_AHEAD_AUTO:
/* No output - use default */
@@ -18,6 +18,7 @@
#define outsz(args...) do {if (!out_size(args)) return_0;} while (0)
#define outhnt(args...) do {if (!out_hint(args)) return_0;} while (0)
+#define outfc(args...) do {if (!out_text_with_comment(args)) return_0;} while (0)
#define outf(args...) do {if (!out_text(args)) return_0;} while (0)
#define outnl(f) do {if (!out_newline(f)) return_0;} while (0)
@@ -39,6 +40,9 @@ 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);
+int out_text_with_comment(struct formatter *f, const char* comment, const char *fmt, ...)
+ __attribute__ ((format(printf, 3, 4)));
+
void out_inc_indent(struct formatter *f);
void out_dec_indent(struct formatter *f);
int out_newline(struct formatter *f);