public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/lib/format_text export.c text_export.h
@ 2009-11-03 11:00 zkabelac
0 siblings, 0 replies; only message in thread
From: zkabelac @ 2009-11-03 11:00 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2009-11-03 11:00:47
Modified files:
lib/format_text: export.c text_export.h
Log message:
Export functions out_inc_indent(), out_dec_indent() for creating
indented metadata lines.
Macro outnl() is using exported out_newline() instead of direct
call f->fn(), that required the visibility of the internal
struct formatter.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_export.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6
--- LVM2/lib/format_text/export.c 2009/10/16 17:41:51 1.70
+++ LVM2/lib/format_text/export.c 2009/11/03 11:00:46 1.71
@@ -235,6 +235,24 @@
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).
--- LVM2/lib/format_text/text_export.h 2009/10/16 17:41:51 1.5
+++ LVM2/lib/format_text/text_export.h 2009/11/03 11:00:46 1.6
@@ -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_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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-03 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-03 11:00 LVM2/lib/format_text export.c text_export.h zkabelac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).