noinst_LTLIBRARIES = libnavit.la
libnavit_la_SOURCES = attr.c cache.c callback.c compass.c coord.c country.c cursor.c data_window.c debug.c \
- event.c event_glib.c event_glib.h file.c graphics.c gui.c item.c layout.c log.c main.c map.c \
+ event.c event_glib.h file.c graphics.c gui.c item.c layout.c log.c main.c map.c \
mapset.c maptype.c menu.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \
profile.c projection.c route.c search.c speech.c transform.c track.c \
util.c vehicle.c xmlconfig.c attr.h attr_def.h cache.h callback.h color.h compass.h coord.h country.h \
osm2navit_SOURCES = osm2navit.c
osm2navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @POSTGRESQL_LIBS@
+if EVENT_GLIB
+ libnavit_la_SOURCES += event_glib.c
+endif
+
if !PLUGINS
navit_SOURCES += builtin.c
navit_LDADD += $(wildcard $(top_builddir)/navit/*/*/*.la)
#define __bswap_16 OSSwapInt16
#define __bswap_32 OSSwapInt32
#define __bswap_64 OSSwapInt64
+#elif if defined(_WIN32) || defined(__CEGCC__)
+ #define __BIG_ENDIAN 4321
+ #define __LITTLE_ENDIAN 1234
+ #define __BYTE_ORDER __LITTLE_ENDIAN
#else
#define __bswap_16(value) \
((((value) & 0xff) << 8) | ((value) >> 8))
<< 32) | \
(uint64_t)bswap_32((uint32_t)((value) >> 32)))
#endif
+#endif
-#if __BYTE_ORDER == __BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
#define le16_to_cpu(x) __bswap_16 (x)
#define le32_to_cpu(x) __bswap_32 (x)
#define le64_to_cpu(x) __bswap_64 (x)
#define cpu_to_le16(x) __bswap_16 (x)
#define cpu_to_le32(x) __bswap_32 (x)
#define cpu_to_le64(x) __bswap_64 (x)
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
#define le16_to_cpu(x) (x)
#define le32_to_cpu(x) (x)
#define cpu_to_le16(x) (x)
this_->self.u.navit=this_;
this_->attr_cbl=callback_list_new();
+#if !defined(_WIN32) && !defined(__CEGCC__)
f=popen("pidof /usr/bin/ipaq-sleep","r");
if (f) {
fscanf(f,"%d",&this_->pid);
dbg(1,"ipaq_sleep pid=%d\n", this_->pid);
pclose(f);
}
+#endif
this_->bookmarks_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
map_set_attr(map, &(struct attr ){attr_active,.u.num=0});
}
route_set_mapset(this_->route, ms);
+ route_set_projection(this_->route, transform_get_projection(this_->trans));
}
if (this_->tracking) {
tracking_set_mapset(this_->tracking, ms);
return 1;
case attr_route:
this_->route=attr->u.route;
- route_set_projection(this_->route, transform_get_projection(this_->trans));
break;
case attr_navigation:
this_->navigation=attr->u.navigation;
void
plugins_add_path(struct plugins *pls, struct attr **attrs) {
+#ifdef USE_PLUGINS
struct attr *path_attr, *attr;
struct file_wordexp *we;
int active=1; // default active
plugin_set_ondemand(pl, ondemand);
}
file_wordexp_destroy(we);
+#endif
}
void
#include <glib.h>
#include <getopt.h>
#include <libintl.h>
+#include "config.h"
#include "version.h"
#include "item.h"
#include "coord.h"
GList *list = NULL, *li;
+#ifdef HAVE_GLIB
event_glib_init();
+#endif
main_init(argv[0]);
main_init_nls();
debug_init(argv[0]);
} while (!file_exists(config_file));
g_list_free(list);
+#ifdef HAVE_GLIB
event_request_system("glib","start");
+#endif
+#ifdef __CEGCC__
+ config_file="\\Storage Card\\navit.xml";
+#endif
if (!config_load(config_file, &error)) {
printf(_("Error parsing '%s': %s\n"), config_file, error->message);
exit(1);
SUBDIRS=
+if SUPPORT_EZXML
+ SUBDIRS+=ezxml
+endif
+if SUPPORT_GLIB
+ SUBDIRS+=glib
+endif
if SUPPORT_WORDEXP
SUBDIRS+=wordexp
endif
#include <glib.h>
#include <ctype.h>
+#include <stdarg.h>
#include "util.h"
void
}
#if defined(_WIN32) || defined(__CEGCC__)
+#include <windows.h>
#include <stdio.h>
char *stristr(const char *String, const char *Pattern)
{
{
return getdelim (lineptr, n, '\n', stream);
}
+
+#if defined(_UNICODE)
+wchar_t* newSysString(const char *toconvert)
+{
+ int newstrlen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, toconvert, -1, 0, 0);
+ wchar_t *newstring = g_new(wchar_t,newstrlen);
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, toconvert, -1, newstring, newstrlen) ;
+ return newstring;
+}
+#else
+char * newSysString(const char *toconvert)
+{
+ return g_strdup(toconvert);
+}
+#endif
#endif
#include "xmlconfig.h"
#include "config.h"
-#define HAVE_GLIB
-
-#ifdef HAVE_GLIB
typedef GError xmlerror;
+#ifdef HAVE_GLIB
#define ATTR_DISTANCE 1
#else
#include "ezxml.h"
-typedef GError xmlerror;
#define ATTR_DISTANCE 2
+#define G_MARKUP_ERROR 0
+#define G_MARKUP_ERROR_INVALID_CONTENT 0
+#define G_MARKUP_ERROR_PARSE 0
+#define G_MARKUP_ERROR_UNKNOWN_ELEMENT 0
+typedef void * GMarkupParseContext;
#endif
struct xistate {
}
+#ifdef HAVE_GLIB
static const GMarkupParser parser = {
xi_start_element,
NULL
};
-#ifdef HAVE_GLIB
static gboolean
parse_file(struct xmldocument *document, xmlerror **error)
{