aboutsummaryrefslogtreecommitdiffstats
path: root/src/location-corelocation.m
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2017-10-11 20:04:29 -0700
committerJon Lund Steffensen <jonlst@gmail.com>2017-10-13 17:53:58 -0700
commit6531b8c73d1eb069e39804167c42948f5f6cd412 (patch)
treecc23f5d236d03473647233a9971765d3888f8f2d /src/location-corelocation.m
parentMerge pull request #536 from jonls/gtk-help-args (diff)
downloadredshift-ng-6531b8c73d1eb069e39804167c42948f5f6cd412.tar.gz
redshift-ng-6531b8c73d1eb069e39804167c42948f5f6cd412.tar.bz2
redshift-ng-6531b8c73d1eb069e39804167c42948f5f6cd412.tar.xz
Move module struct definitions to separate files
Diffstat (limited to 'src/location-corelocation.m')
-rw-r--r--src/location-corelocation.m27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/location-corelocation.m b/src/location-corelocation.m
index 5150839..17e0054 100644
--- a/src/location-corelocation.m
+++ b/src/location-corelocation.m
@@ -172,13 +172,13 @@ pipe_close_callback(
@end
-int
+static int
location_corelocation_init(location_corelocation_state_t *state)
{
return 0;
}
-int
+static int
location_corelocation_start(location_corelocation_state_t *state)
{
state->pipe_fd_read = -1;
@@ -215,7 +215,7 @@ location_corelocation_start(location_corelocation_state_t *state)
return 0;
}
-void
+static void
location_corelocation_free(location_corelocation_state_t *state)
{
if (state->pipe_fd_read != -1) {
@@ -225,14 +225,14 @@ location_corelocation_free(location_corelocation_state_t *state)
free(state->private);
}
-void
+static void
location_corelocation_print_help(FILE *f)
{
fputs(_("Use the location as discovered by the Corelocation provider.\n"), f);
fputs("\n", f);
}
-int
+static int
location_corelocation_set_option(
location_corelocation_state_t *state, const char *key, const char *value)
{
@@ -240,13 +240,14 @@ location_corelocation_set_option(
return -1;
}
-int
+static int
location_corelocation_get_fd(location_corelocation_state_t *state)
{
return state->pipe_fd_read;
}
-int location_corelocation_handle(
+static int
+location_corelocation_handle(
location_corelocation_state_t *state,
location_t *location, int *available)
{
@@ -265,3 +266,15 @@ int location_corelocation_handle(
return 0;
}
+
+
+const location_provider_t corelocation_location_provider = {
+ "corelocation",
+ (location_provider_init_func *)location_corelocation_init,
+ (location_provider_start_func *)location_corelocation_start,
+ (location_provider_free_func *)location_corelocation_free,
+ (location_provider_print_help_func *)location_corelocation_print_help,
+ (location_provider_set_option_func *)location_corelocation_set_option,
+ (location_provider_get_fd_func *)location_corelocation_get_fd,
+ (location_provider_handle_func *)location_corelocation_handle
+};