Get rid of all global variables

This commit is contained in:
Utkarsh Verma 2023-10-25 20:00:08 +05:30
commit 10f7d9b8db
No known key found for this signature in database
GPG key ID: 7A4885A7162BDF20
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