summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-01-27 12:43:40 -0800
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-01-27 12:43:40 -0800
commitb1a747f537d1df8b9ea9f4caf55e568dd4c3a733 (patch)
tree104df7daa5b83548776be892ef65f5108bd6a34a /file.c
parentbea6637c03a90fbb9e754f5f63625fffb7cbaa69 (diff)
downloadsubsurface-b1a747f537d1df8b9ea9f4caf55e568dd4c3a733.tar.gz
Add some initial cochran CAN file parsing
It's broken, and currently only writes out a debug output file per dive. I'm not sure I'll ever really be able to decode the mess that is the Cochran ANalyst stuff, but I have a few test files, along with separate depth info from a couple of the dives in question, so in case this ever works I can at least validate it to some degree. The file format is definitely very intentionally obscured, though. Annoying. It's not like the Cochran software is actually all that good (it's really quite a horribly nasty Windows-only app, I'm told). Cochran Analyst is very much not the reason why people would buy those computers. So Cochran making their computers harder to use with other software is just stupid. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/file.c b/file.c
index 2e46f94fd..aff1d51f2 100644
--- a/file.c
+++ b/file.c
@@ -6,11 +6,7 @@
#include <errno.h>
#include "dive.h"
-
-struct memblock {
- void *buffer;
- size_t size;
-};
+#include "file.h"
static int readfile(const char *filename, struct memblock *mem)
{
@@ -104,6 +100,10 @@ static int open_by_filename(const char *filename, const char *fmt, struct memblo
if (!strcasecmp(fmt, "SDE"))
return try_to_open_suunto(filename, mem, error);
+ /* Truly nasty intentionally obfuscated Cochran Anal software */
+ if (!strcasecmp(fmt, "CAN"))
+ return try_to_open_cochran(filename, mem, error);
+
return 0;
}