diff options
| author | iamcheeseman <[hidden email]> | 2026-03-01 11:10:54 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-03-01 11:10:54 -0500 |
| commit | 998cb175da5fc8b95151f4e632e3024791e3196d (patch) | |
| tree | 3a08682b9b6840f85ed6466efd6bc39369f396da /src | |
| parent | 6d17f1ca1f4e2c85e8aed05e6902196f1274cf87 (diff) | |
bring code up to standards
Diffstat (limited to 'src')
| -rw-r--r-- | src/bardata.c | 7 | ||||
| -rw-r--r-- | src/pipe.c | 17 | ||||
| -rw-r--r-- | src/pipe.h | 4 |
3 files changed, 15 insertions, 13 deletions
diff --git a/src/bardata.c b/src/bardata.c index 3a4484c..73b0cc2 100644 --- a/src/bardata.c +++ b/src/bardata.c @@ -1,9 +1,10 @@ -#include <stdio.h> -#include <string.h> +#include "bardata.h" + #include <inttypes.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> -#include "bardata.h" #include "pipe.h" int fontsize = 16; @@ -1,24 +1,25 @@ +#include "pipe.h" -#include <stdio.h> +#include <ctype.h> #include <fcntl.h> -#include <unistd.h> -#include <sys/stat.h> +#include <stdbool.h> +#include <stdio.h> #include <string.h> -#include <ctype.h> +#include <sys/stat.h> +#include <unistd.h> -#include "pipe.h" #include "bardata.h" FILE *named_pipe; -void init_pipe() { +void init_pipe(void) { mkfifo(PIPE_PATH, 0666); named_pipe = fopen(PIPE_PATH, "r"); } -void await_change() { +void await_change(void) { char buff[1024]; - while (1) { + while (true) { if (!fgets(buff, sizeof(buff), named_pipe)) { fclose(named_pipe); named_pipe = fopen(PIPE_PATH, "r"); // This blocks, 0% CPU, yay @@ -6,8 +6,8 @@ #define MAX_ARG_LEN 128 #define MAX_ARGS 16 -void init_pipe(); -void await_change(); +void init_pipe(void); +void await_change(void); void make_change(char[MAX_ARGS][MAX_ARG_LEN], int); #endif |
