move 'settings' struct

This commit is contained in:
randomuser 2021-06-14 12:51:16 -05:00
parent 0b0f635957
commit 0dc73354c9
1 changed files with 18 additions and 18 deletions

View File

@ -12,6 +12,24 @@ struct timer {
int (*p)(struct timer *t); /* pause check function */ 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 timerdec(struct timer *t) { if (t->s != 0) t->s--; }
void timerinc(struct timer *t) { t->s++; } void timerinc(struct timer *t) { t->s++; }
void timerupdate(struct timer *t) { if(t->u != NULL) t->u(t); } void timerupdate(struct timer *t) { if(t->u != NULL) t->u(t); }
@ -47,24 +65,6 @@ struct timer *timerinit(void) {
return t; 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) { int timerissettings(struct timer *t) {
if(t->s == 0) return 0; if(t->s == 0) return 0;
if(s.s == t->s) return 1; if(s.s == t->s) return 1;