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>
This commit is contained in:
Henrik Brautaset Aronsen 2013-05-11 21:33:46 +02:00 committed by Dirk Hohndel
parent 5775905727
commit f5ef74202b
9 changed files with 4 additions and 89 deletions

12
file.c
View file

@ -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);