From: Kaj-Michael Lang Date: Tue, 19 Jun 2007 11:48:56 +0000 (+0300) Subject: Start to add track storage things. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9da4e19c65d6c22732d5d000fa7cd0e620cbc356;p=mapper Start to add track storage things. --- diff --git a/src/track.h b/src/track.h index 309ec1d..4b4ab6f 100644 --- a/src/track.h +++ b/src/track.h @@ -1,10 +1,25 @@ #ifndef _MAPPER_TRACK_H #define _MAPPER_TRACK_H +#include +#include + void track_add(time_t time, gboolean newly_fixed); void track_insert_break(void); gboolean track_insert_mark(void); gboolean track_save(void); gboolean track_open(void); +#define TRACK_SQL_SELECT_TRACKS "select id,name,sloc,eloc,sdate,edate from tracks order by sdate" +#define TRACK_SQL_INSERT_TRACK "insert into tracks (id,name,sloc,sdate) values (?,?,?,?); +#define TRACK_SQL_INSERT_TRACK_POINT "insert into trackpoints (tid,dt,lat,lon,alt,hdop,vdop,pdop,sat,fix) values (?,?,?,?,?,?,?,?,?,?)" +#define TRACK_SQL_SELECT_TRACK_POINTS "select tid,dt,lat,lon,alt,hdop,vdop,pdop,sat,fix from trackpoints where tid=? order by dt" + +struct { + sqlite3_stmt *_insert_track; + sqlite3_stmt *_select_tracks; + sqlite3_stmt *_insert_track_point; + sqlite3_stmt *_select_track_points; +} track_sql; + #endif