Commit graph

16914 commits

Author SHA1 Message Date
Linus Torvalds
716a680920 Fix up temperature conversion
Oops. No, the water temperature wasn't really 500 degC.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 16:58:07 -07:00
Linus Torvalds
f46e9f571e Start actually reporting the numbers we parsed
.. which also showed that the sampletime thing had gotten a bit too much
copy-paste from the temperature parsing ;)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 16:42:05 -07:00
Linus Torvalds
83e0bf8b52 Add 'verbose' flag
Now that we actually parse some of the dives, don't spam stdout with the
list of stuff we can't parse by default.

Add a 'verbose' flag, which enables that output when set.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 16:28:59 -07:00
Linus Torvalds
8a670bfb5c Start parsing numeric fields
Depth, pressure, and sample times.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 16:23:47 -07:00
Linus Torvalds
edbf68d805 Start parsing dive dates
.. only the suunto XML format, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 15:22:48 -07:00
Linus Torvalds
e1a939ac62 Move the "text" nodename hackery out of 'nodename()'
It's better to do it in the caller.  Debug users may well want the full
node name.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 14:38:39 -07:00
Linus Torvalds
4b3bd4b739 Fix stupid mis-initialization of current sample
.. nice compiler warning hidden by the crazy gcc pointer sign warnings
that nobody wants to see (yes, we really do want to do 'strlen()' even
on unsigned strings, don't complain, crazy bitch compiler).

So this also makes our CFLAGS set -Wno-pointer-sign.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 14:36:34 -07:00
Linus Torvalds
414565e000 Start showing unparsed entries
(ie all of them)

This also shows the type of entry, which makes it clear that I've
screwed up the sample matching.  Oh well.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 13:58:19 -07:00
Linus Torvalds
ee35716ec7 Fill in dummy parse target code
.. but don't actually parse anything yet.  But hey - now it tells you
how many samples it (hasn't) parsed.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30 13:48:05 -07:00
Linus Torvalds
a71e8dd777 Move the parser closer to being usable
Ok, so we have the dive split and the sample splits, so now we could
really just start filling in data.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-29 21:32:27 -07:00
Linus Torvalds
77ce61644b Turn the XML into something almost parseable.
Of course, now the problem is that the different XML files have
different node names, but at least we've turned it into a half-way sane
format, and have a nice callback place per value.

Soon we could use that to actually fill in useful information.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-29 17:51:54 -07:00
Linus Torvalds
fb214b2b39 Make the multi-dive files valid XML
They had multiple "root" entries (all called 'dive'), which makes baby
Jesus cry.

So just enclose them all in one root entry (called 'dives') that
magically turns it all into parseable xml.

Yeah, that really helps make the world a better place.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-28 17:24:53 -07:00
Linus Torvalds
ed45f7cb14 Add crazy (bad) xml parser thing
It only works for the Suunto "one xml file per dive" format, not for the
libdivecomputer one that just puts many dives in one file.

Maybe there is some way for libxml2 to handle concatenated xml files
(start again on errors), but I don't know it yet.

I need to get stinking drunk before I look at more xml mess.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-28 16:58:26 -07:00
Linus Torvalds
857e153070 Start archiving the stupid XML files
(and add a reminder of how they came to be)

Gaah.  XML is *stupid*.  It's not easy to parse for humans or for
computers, and some of these XML files are just disgusting.  But maybe
they can be turned into something usable with libxml.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-28 16:18:53 -07:00