summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2013-05-11 21:33:46 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-11 22:02:24 -0700
commitf5ef74202b8295400e5f26d1fa80b90223f822da (patch)
treea513e68f368055bf2f194dc662fb4d87d2d2a889 /file.c
parent5775905727150b4f2f5556b84814acdc46e2d717 (diff)
downloadsubsurface-f5ef74202b8295400e5f26d1fa80b90223f822da.tar.gz
Require libzip, xslt and osm-gps-map in all builds
Conditional inclusion of libzip, xslt and osm-gps-map just makes testing more cumbersome, since testers might lack Subsurface features without knowing. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/file.c b/file.c
index 401bd5c36..0e71a5801 100644
--- a/file.c
+++ b/file.c
@@ -5,6 +5,7 @@
#include <string.h>
#include <errno.h>
#include <glib/gi18n.h>
+#include <zip.h>
#include "dive.h"
#include "file.h"
@@ -59,8 +60,6 @@ out:
return ret;
}
-#ifdef LIBZIP
-#include <zip.h>
static void zip_read(struct zip_file *file, GError **error, const char *filename)
{
@@ -76,12 +75,10 @@ static void zip_read(struct zip_file *file, GError **error, const char *filename
parse_xml_buffer(filename, mem, read, &dive_table, error);
free(mem);
}
-#endif
static int try_to_open_zip(const char *filename, struct memblock *mem, GError **error)
{
int success = 0;
-#ifdef LIBZIP
/* Grr. libzip needs to re-open the file, it can't take a buffer */
struct zip *zip = zip_open(filename, ZIP_CHECKCONS, NULL);
@@ -97,16 +94,13 @@ static int try_to_open_zip(const char *filename, struct memblock *mem, GError **
}
zip_close(zip);
}
-#endif
return success;
}
-#ifdef SQLITE3
static int try_to_open_db(const char *filename, struct memblock *mem, GError **error)
{
return parse_dm4_buffer(filename, mem->buffer, mem->size, &dive_table, error);
}
-#endif
static timestamp_t parse_date(const char *date)
{
@@ -266,9 +260,7 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, GError
void parse_file(const char *filename, GError **error)
{
struct memblock mem;
-#ifdef SQLITE3
char *fmt;
-#endif
if (readfile(filename, &mem) < 0) {
/* we don't want to display an error if this was the default file */
@@ -286,7 +278,6 @@ void parse_file(const char *filename, GError **error)
return;
}
-#ifdef SQLITE3
fmt = strrchr(filename, '.');
if (fmt && (!strcasecmp(fmt + 1, "DB") || !strcasecmp(fmt + 1, "BAK"))) {
if (!try_to_open_db(filename, &mem, error)) {
@@ -294,7 +285,6 @@ void parse_file(const char *filename, GError **error)
return;
}
}
-#endif
parse_file_buffer(filename, &mem, error);
free(mem.buffer);