#include <location.h>
static GMainLoop *loop = NULL;
-GSource* nmea_src = NULL;
+GSource *nmea_src = NULL;
static gboolean
-exit_program (gpointer data)
+exit_program(gpointer data)
{
- g_main_loop_quit (loop);
- g_debug ("Quit g_main_loop");
+ g_main_loop_quit(loop);
+ g_debug("Quit g_main_loop");
return FALSE;
}
static void
-cb_service_updated (GObject *self,
- guint type,
- gpointer data,
- gpointer accuracy,
- gpointer userdata)
+cb_service_updated(GObject *self,
+ guint type,
+ gpointer data,
+ gpointer accuracy,
+ gpointer userdata)
{
g_debug("cb_service_updated: type(%d) userdata(0x%x)", type, (unsigned int)userdata);
}
static void
-cb_service_enabled (GObject *self,
- guint status,
- gpointer userdata)
+cb_service_enabled(GObject *self,
+ guint status,
+ gpointer userdata)
{
g_debug("cb_service_enabled: status(%d) userdata(0x%x)", status, (unsigned int)userdata);
}
static void
-cb_service_disabled (GObject *self,
- guint status,
- gpointer userdata)
+cb_service_disabled(GObject *self,
+ guint status,
+ gpointer userdata)
{
g_debug("cb_service_disabled: status(%d) userdata(0x%x)", status, (unsigned int)userdata);
}
int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
{
LocationObject *loc = NULL;
- location_init ();
+ location_init();
- loop = g_main_loop_new (NULL, TRUE);
+ loop = g_main_loop_new(NULL, TRUE);
- loc = location_new (LOCATION_METHOD_GPS);
+ loc = location_new(LOCATION_METHOD_GPS);
if (!loc) {
g_debug("location_new failed");
return -1;
}
- g_signal_connect (loc, "service-enabled", G_CALLBACK(cb_service_enabled), loc);
- g_signal_connect (loc, "service-disabled", G_CALLBACK(cb_service_disabled), loc);
- g_signal_connect (loc, "service-updated", G_CALLBACK(cb_service_updated), loc);
+ g_signal_connect(loc, "service-enabled", G_CALLBACK(cb_service_enabled), loc);
+ g_signal_connect(loc, "service-disabled", G_CALLBACK(cb_service_disabled), loc);
+ g_signal_connect(loc, "service-updated", G_CALLBACK(cb_service_updated), loc);
- if( LOCATION_ERROR_NONE != location_start (loc) ){
+ if (LOCATION_ERROR_NONE != location_start(loc)) {
g_debug("location_start failed");
return -1;
}
g_timeout_add_seconds(60, exit_program, NULL);
- g_main_loop_run (loop);
+ g_main_loop_run(loop);
- location_stop (loc);
- location_free (loc);
+ location_stop(loc);
+ location_free(loc);
return 0;
}