diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2005-12-11 10:50:33 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2005-12-11 10:50:33 +0000 |
commit | 13b33253bddd8f310842910235498da6be95e554 (patch) | |
tree | 4ae5dcd3d0b6359a9fdb81d6197e2d56d76badc6 /main.c | |
parent | 1b232a61aa70d24f3ed42e317b3724bfee3617e3 (diff) | |
download | navit-svn-13b33253bddd8f310842910235498da6be95e554.tar.gz |
Added support for gpsd
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@22 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,5 +1,6 @@ #include <locale.h> #include <stdio.h> +#include <glib.h> #include "coord.h" #include "vehicle.h" #include "cursor.h" @@ -33,6 +34,7 @@ int main(int argc, char **argv) CORBA_ORB orb; Map map_client = CORBA_OBJECT_NIL; char *retval; + char *gps; FILE *ior; setenv("LC_NUMERIC","C",1); @@ -46,12 +48,21 @@ int main(int argc, char **argv) map_data_default=load_maps(NULL); plugin_load(); co=gui_gtk_window(1300000,7000000,8192); - co->vehicle=vehicle_new("/tmp/gpsdata"); - co->cursor=cursor_new(co); + + gps=getenv("GPSDATA"); + if (gps) { + co->vehicle=vehicle_new(gps); + if (co->vehicle) { + co->cursor=cursor_new(co,co->vehicle); + } + } else { + g_warning("Environment-Variable GPSDATA not set - No gps tracking. Set it to file:filename or gpsd://host[:port]"); + } co->speech=speech_new(); speech_handle=co->speech; co->route=route_new(); - co->compass=compass_new(co); + if (co->vehicle) + co->compass=compass_new(co); route_mapdata_set(co->route, co->map_data); |