diff options
Diffstat (limited to 'src/gamma-dummy.c')
-rw-r--r-- | src/gamma-dummy.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/gamma-dummy.c b/src/gamma-dummy.c index ba62d93..25e723f 100644 --- a/src/gamma-dummy.c +++ b/src/gamma-dummy.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with Redshift. If not, see <http://www.gnu.org/licenses/>. - Copyright (c) 2013-2014 Jon Lund Steffensen <jonlst@gmail.com> + Copyright (c) 2013-2017 Jon Lund Steffensen <jonlst@gmail.com> */ #include <stdio.h> @@ -30,46 +30,59 @@ #include "redshift.h" -int -gamma_dummy_init(void *state) +static int +gamma_dummy_init(void **state) { + *state = NULL; return 0; } -int +static int gamma_dummy_start(void *state) { fputs(_("WARNING: Using dummy gamma method! Display will not be affected by this gamma method.\n"), stderr); return 0; } -void +static void gamma_dummy_restore(void *state) { } -void +static void gamma_dummy_free(void *state) { } -void +static void gamma_dummy_print_help(FILE *f) { fputs(_("Does not affect the display but prints the color temperature to the terminal.\n"), f); fputs("\n", f); } -int +static int gamma_dummy_set_option(void *state, const char *key, const char *value) { fprintf(stderr, _("Unknown method parameter: `%s'.\n"), key); return -1; } -int +static int gamma_dummy_set_temperature(void *state, const color_setting_t *setting) { printf(_("Temperature: %i\n"), setting->temperature); return 0; } + + +const gamma_method_t dummy_gamma_method = { + "dummy", 0, + (gamma_method_init_func *)gamma_dummy_init, + (gamma_method_start_func *)gamma_dummy_start, + (gamma_method_free_func *)gamma_dummy_free, + (gamma_method_print_help_func *)gamma_dummy_print_help, + (gamma_method_set_option_func *)gamma_dummy_set_option, + (gamma_method_restore_func *)gamma_dummy_restore, + (gamma_method_set_temperature_func *)gamma_dummy_set_temperature +}; |