--- trunk/src/gps.h 2009/08/12 19:18:53 53 +++ trunk/src/gps.h 2009/10/29 13:59:16 149 @@ -149,6 +149,13 @@ int *used; } gps_sat_t; +typedef void (*gps_cb)(struct gps_state *, gpointer data); +#define GPS_CB(f) ((gps_cb)(f)) + +typedef struct { + gps_cb cb; + gpointer data; +} gps_cb_t; typedef struct gps_state { #ifndef ENABLE_LIBLOCATION @@ -171,6 +178,9 @@ double heading, eph; gps_sat_t sats; #endif + + GSList *cb; + } gps_state_t; void gps_init(appdata_t *appdata); @@ -180,5 +190,7 @@ float gps_get_eph(appdata_t *appdata); gps_sat_t *gps_get_sats(appdata_t *appdata); +void *gps_register_callback(appdata_t *appdata, gps_cb cb, gpointer data); +void gps_unregister_callback(appdata_t *appdata, void *cb); #endif // GPS_H