Get rid of all global variables

This commit is contained in:
Utkarsh Verma
2023-10-25 20:00:08 +05:30
parent bc84d094cd
commit 10f7d9b8db
13 changed files with 121 additions and 69 deletions

View File

@@ -2,13 +2,12 @@
#include <signal.h>
#include "block.h"
#include "config.h"
#include "util.h"
#define REFRESH_SIGNAL SIGUSR1
// Utilise C's adjacent string concatenation to count the number of blocks.
#define X(...) "."
extern block blocks[LEN(BLOCKS(X)) - 1];
enum { BLOCK_COUNT = LEN(BLOCKS(X)) - 1 };
#undef X
#define REFRESH_SIGNAL SIGUSR1