summaryrefslogtreecommitdiffstats
path: root/clock.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-28 15:56:30 +0200
committerMattias Andrée <maandree@kth.se>2021-03-28 15:56:30 +0200
commitc81d9bb46450ffbd7851e5bc38f7c7aabbc3b220 (patch)
treebcfbcbdb7cde6b01470fc5c68bf5104e30899d2d /clock.c
parentstopwatch: do not reset when saving lap time (diff)
downloadpdatools-c81d9bb46450ffbd7851e5bc38f7c7aabbc3b220.tar.gz
pdatools-c81d9bb46450ffbd7851e5bc38f7c7aabbc3b220.tar.bz2
pdatools-c81d9bb46450ffbd7851e5bc38f7c7aabbc3b220.tar.xz
Add counter
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'clock.c')
-rw-r--r--clock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/clock.c b/clock.c
index c656d8f..c3040f4 100644
--- a/clock.c
+++ b/clock.c
@@ -5,6 +5,7 @@
USAGE("[-u | -v | -w] [-2s]");
+#define INCLUDE_LARGE_COLON
#include "large.h"
@@ -152,7 +153,7 @@ display_clock(int timerfd)
printf("\033[H");
- if (x >= 6 * LARGE_XD + 2 * LARGE_XC && y > LARGE_Y + 1) {
+ if (x >= 6 * LARGE_X + 2 * LARGE_XC && y > LARGE_Y + 1) {
if (y > LARGE_Y + 6)
printf("\033[K\n");
digits[0] = large_digits[now->tm_hour / 10];
@@ -163,11 +164,11 @@ display_clock(int timerfd)
digits[5] = large_colon;
digits[6] = large_digits[now->tm_sec / 10];
digits[7] = large_digits[now->tm_sec % 10];
- width = 6 * LARGE_XD + 2 * LARGE_XC;
+ width = 6 * LARGE_X + 2 * LARGE_XC;
print_time(digits, (x - width) / 2, LARGE_Y);
printf("\033[K\n");
r = LARGE_Y + 1;
- } else if (with_small && x >= 6 * SMALL_XD + 2 * SMALL_XC && y > SMALL_Y + 1) {
+ } else if (with_small && x >= 6 * SMALL_X + 2 * SMALL_XC && y > SMALL_Y + 1) {
if (y > SMALL_Y + 6)
printf("\033[K\n");
digits[0] = small_digits[now->tm_hour / 10];
@@ -178,7 +179,7 @@ display_clock(int timerfd)
digits[5] = small_colon;
digits[6] = small_digits[now->tm_sec / 10];
digits[7] = small_digits[now->tm_sec % 10];
- width = 6 * SMALL_XD + 2 * SMALL_XC;
+ width = 6 * SMALL_X + 2 * SMALL_XC;
print_time(digits, (x - width) / 2, SMALL_Y);
printf("\033[K\n");
r = SMALL_Y + 1;