From 0dc73354c9220d16e3dd3dc9be35dd65db1b2f06 Mon Sep 17 00:00:00 2001 From: randomuser Date: Mon, 14 Jun 2021 12:51:16 -0500 Subject: [PATCH] move 'settings' struct --- c/timer.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/c/timer.c b/c/timer.c index b2c45e5..87178d2 100644 --- a/c/timer.c +++ b/c/timer.c @@ -12,6 +12,24 @@ struct timer { int (*p)(struct timer *t); /* pause check function */ }; +struct settings { + int e:1; /* use escape (v assumed) */ + int v:1; /* verbose */ + int d:1; /* count down/up (1/0) */ + int b:1; /* ascii bel when done */ + int f:1; /* display hours */ + int t:1; /* tomato timer */ + int s; /* seconds */ +} s = { + .e = 0, + .v = 0, + .d = 0, + .b = 0, + .f = 0, + .t = 0, + .s = 0 +}; + void timerdec(struct timer *t) { if (t->s != 0) t->s--; } void timerinc(struct timer *t) { t->s++; } void timerupdate(struct timer *t) { if(t->u != NULL) t->u(t); } @@ -47,24 +65,6 @@ struct timer *timerinit(void) { return t; } -struct settings { - int e:1; /* use escape (v assumed) */ - int v:1; /* verbose */ - int d:1; /* count down/up (1/0) */ - int b:1; /* ascii bel when done */ - int f:1; /* display hours */ - int t:1; /* tomato timer */ - int s; /* seconds */ -} s = { - .e = 0, - .v = 0, - .d = 0, - .b = 0, - .f = 0, - .t = 0, - .s = 0 -}; - int timerissettings(struct timer *t) { if(t->s == 0) return 0; if(s.s == t->s) return 1;