diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-09-26 11:04:50 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-09-26 11:04:50 -0700 |
commit | 85925afe43ff14fe44b919dbd2bc5f4570d105a0 (patch) | |
tree | 130898128371f78859a55037f54d09b0af3de065 /main.c | |
parent | fcfc5dd57c2fe8cca49e4e2f3296c49cc9308520 (diff) | |
parent | cb48db275e3877314c6da102990bed6c6980bd7f (diff) | |
download | subsurface-85925afe43ff14fe44b919dbd2bc5f4570d105a0.tar.gz |
Merge branch 'uemis-native'
This brings in the code to download dive information directly from a Uemis
Zurich dive computer.
The implementation contains a major hack that hooks the uemis code into
the same data structures used to setup libdivecomputer. This gives the
best result for the user, but is not something that I like as a long term
solution as it relies on internal libdivecomputer data structures.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -7,6 +7,11 @@ #include "dive.h" #include "divelist.h" +#ifdef DEBUGFILE +char *debugfilename; +FILE *debugfile; +#endif + struct units output_units; /* random helper functions, used here or elsewhere */ @@ -222,6 +227,13 @@ int main(int argc, char **argv) init_ui(&argc, &argv); +#ifdef DEBUGFILE + debugfilename = (char *)subsurface_default_filename(); + strncpy(debugfilename + strlen(debugfilename) - 3, "log", 3); + if (g_mkdir_with_parents(g_path_get_dirname(debugfilename), 0664) != 0 || + (debugfile = g_fopen(debugfilename, "w")) == NULL) + printf("oh boy, can't create debugfile"); +#endif for (i = 1; i < argc; i++) { const char *a = argv[i]; @@ -256,5 +268,9 @@ int main(int argc, char **argv) parse_xml_exit(); +#ifdef DEBUGFILE + if (debugfile) + fclose(debugfile); +#endif return 0; } |