diff --git a/src/teleport-app.c b/src/teleport-app.c index 03c7988..c947dc8 100644 --- a/src/teleport-app.c +++ b/src/teleport-app.c @@ -169,7 +169,7 @@ teleport_app_activate (GApplication *app) { create_finished_notification ("USER", 2000, "FILENAME", value); */ run_http_server(); - run_avahi_publish_service((char *) g_get_host_name()); + teleport_publish_run ((gchar *) g_get_host_name()); teleport_browser_run_avahi_service(peerList); } diff --git a/src/teleport-publish.c b/src/teleport-publish.c index c872eb2..21c9482 100644 --- a/src/teleport-publish.c +++ b/src/teleport-publish.c @@ -64,7 +64,7 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, /* Some kind of failure happened while we were registering our services */ //avahi_simple_poll_quit(simple_poll); - shutdown_avahi_publish_service(); + teleport_publish_shutdown(); break; case AVAHI_ENTRY_GROUP_UNCOMMITED: @@ -137,7 +137,7 @@ collision: fail: //avahi_simple_poll_quit(simple_poll); - shutdown_avahi_publish_service(); + teleport_publish_shutdown(); } static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata) { @@ -157,7 +157,7 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN fprintf(stderr, "Client failure: %s\n", avahi_strerror(avahi_client_errno(c))); //avahi_simple_poll_quit(simple_poll); - shutdown_avahi_publish_service(); + teleport_publish_shutdown(); break; @@ -184,7 +184,8 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN } } -extern void update_service(char * service_name) { +void +teleport_publish_update (char *service_name) { avahi_free(name); name = avahi_strdup(service_name); @@ -201,7 +202,8 @@ extern void update_service(char * service_name) { } } -int run_avahi_publish_service(char * service_name) { +int +teleport_publish_run (gchar *service_name) { int error; if (!(threaded_poll = avahi_threaded_poll_new())) { @@ -225,9 +227,9 @@ int run_avahi_publish_service(char * service_name) { return 0; } -void shutdown_avahi_publish_service(void) { - /* Call this when the app shuts down */ - +/* Call this when the app shuts down */ +void +teleport_publish_shutdown (void) { avahi_threaded_poll_stop(threaded_poll); avahi_client_free(client); avahi_threaded_poll_free(threaded_poll); diff --git a/src/teleport-publish.h b/src/teleport-publish.h index 14cf5e1..daa1cd2 100644 --- a/src/teleport-publish.h +++ b/src/teleport-publish.h @@ -1,9 +1,8 @@ #ifndef __TELEPORT_PUBLISH_H #define __TELEPORT_PUBLISH_H - -extern int run_avahi_publish_service(char *); -extern void shutdown_avahi_publish_service(void); -extern void update_service(char *); +int teleport_publish_run (gchar *); +void teleport_publish_shutdown (void); +void teleport_publish_update (gchar *); #endif /* __TELEPORT_PUBLISH_H */