From 5c2fca262043992783551eceebc81c1f589b185b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 10 Nov 2011 21:42:37 -0200 Subject: [PATCH] Save cylinder O2/He content after the cylinder type description This changes the save format xml to be a bit more readable: instead of putting the gasmix first, put the cylinder type (size, workpressure and description) first, then gasmix, then pressure details. It makes no difference for machine parsing, but I think it's a lot more logical for humans that actually look at the xml file. And we really do want to make the xml file readable by humans. Signed-off-by: Linus Torvalds --- save-xml.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/save-xml.c b/save-xml.c index 4183b1c..d6c2497 100644 --- a/save-xml.c +++ b/save-xml.c @@ -202,16 +202,16 @@ static void save_cylinder_info(FILE *f, struct dive *dive) if (!o2 && !volume && !start && !end) return; fprintf(f, " type.workingpressure, " workpressure='", "'"); if (description && *description) fprintf(f, " description='%s'", description); + if (o2) { + fprintf(f, " o2='%u.%u%%'", FRACTION(o2, 10)); + if (he) + fprintf(f, " he='%u.%u%%'", FRACTION(he, 10)); + } show_pressure(f, cylinder->start, " start='", "'"); show_pressure(f, cylinder->end, " end='", "'"); fprintf(f, " />\n"); -- 2.45.2