]> git.tdb.fi Git - ext/subsurface.git/log
ext/subsurface.git
12 years agoStart moving some of the non-parsing stuff out of 'parse.c'
Linus Torvalds [Wed, 31 Aug 2011 01:40:25 +0000 (18:40 -0700)]
Start moving some of the non-parsing stuff out of 'parse.c'

Create a 'main.c' with the main routine and argument "parsing" etc.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoSplit up dive data structure declarations into 'dive.h'
Linus Torvalds [Wed, 31 Aug 2011 01:23:59 +0000 (18:23 -0700)]
Split up dive data structure declarations into 'dive.h'

The dive parser should eventually be just a part of the program, not the
whole thing. So start preparing for that.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoClean up dive reporting
Linus Torvalds [Wed, 31 Aug 2011 00:51:35 +0000 (17:51 -0700)]
Clean up dive reporting

Show date, max depth, and time by default.  The stuff that matters and
should always exist.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd some more parsing functions
Linus Torvalds [Wed, 31 Aug 2011 00:45:03 +0000 (17:45 -0700)]
Add some more parsing functions

.. and fix the 'duration' parsing: it can be either in seconds, or in
mm:ss format.  Floating point doesn't make any sense.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDon't report dives as they are parsed: sort them at the end and report them then
Linus Torvalds [Wed, 31 Aug 2011 00:18:33 +0000 (17:18 -0700)]
Don't report dives as they are parsed: sort them at the end and report them then

This makes it much easier to see the duplicates, but more importantly,
we do need to actually save the dives off to do any real work with them.

Also, require a verbosity level of 1 (-v) to show all the samples.
While (-vv) shows unparsed entries.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd 'datetime' parsing for libdivecomputer xml files
Linus Torvalds [Tue, 30 Aug 2011 23:59:03 +0000 (16:59 -0700)]
Add 'datetime' parsing for libdivecomputer xml files

I think this gets me dates on all my dives.  So now I could start
sorting them and removing duplicates.

But before I try to remove dups, I guess I should compare the
libdivecomputer ones against the suunto ones.  Because I bet they have
various "interesting" issues like using Bar vs Atm etc.

"But XML is portable". Crazy people.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix up temperature conversion
Linus Torvalds [Tue, 30 Aug 2011 23:58:07 +0000 (16:58 -0700)]
Fix up temperature conversion

Oops. No, the water temperature wasn't really 500 degC.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStart actually reporting the numbers we parsed
Linus Torvalds [Tue, 30 Aug 2011 23:42:05 +0000 (16:42 -0700)]
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>
12 years agoAdd 'verbose' flag
Linus Torvalds [Tue, 30 Aug 2011 23:28:59 +0000 (16:28 -0700)]
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>
12 years agoStart parsing numeric fields
Linus Torvalds [Tue, 30 Aug 2011 23:23:47 +0000 (16:23 -0700)]
Start parsing numeric fields

Depth, pressure, and sample times.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStart parsing dive dates
Linus Torvalds [Tue, 30 Aug 2011 22:22:48 +0000 (15:22 -0700)]
Start parsing dive dates

.. only the suunto XML format, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMove the "text" nodename hackery out of 'nodename()'
Linus Torvalds [Tue, 30 Aug 2011 21:38:39 +0000 (14:38 -0700)]
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>
12 years agoFix stupid mis-initialization of current sample
Linus Torvalds [Tue, 30 Aug 2011 21:36:34 +0000 (14:36 -0700)]
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>
12 years agoStart showing unparsed entries
Linus Torvalds [Tue, 30 Aug 2011 20:58:19 +0000 (13:58 -0700)]
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>
12 years agoFill in dummy parse target code
Linus Torvalds [Tue, 30 Aug 2011 20:48:05 +0000 (13:48 -0700)]
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>
12 years agoMove the parser closer to being usable
Linus Torvalds [Tue, 30 Aug 2011 04:32:27 +0000 (21:32 -0700)]
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>
12 years agoTurn the XML into something almost parseable.
Linus Torvalds [Tue, 30 Aug 2011 00:51:54 +0000 (17:51 -0700)]
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>
12 years agoMake the multi-dive files valid XML
Linus Torvalds [Mon, 29 Aug 2011 00:24:53 +0000 (17:24 -0700)]
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>
12 years agoAdd crazy (bad) xml parser thing
Linus Torvalds [Sun, 28 Aug 2011 23:58:26 +0000 (16:58 -0700)]
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>
12 years agoStart archiving the stupid XML files
Linus Torvalds [Sun, 28 Aug 2011 23:18:53 +0000 (16:18 -0700)]
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>