From bca75f071153ddcaa5ceee0722e2152bacfedc78 Mon Sep 17 00:00:00 2001 From: Comrade Martin Miroslavovich Michalec Date: Sat, 25 Nov 2023 19:24:10 +0300 Subject: publish --- src/utils.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/utils.h (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..99765db --- /dev/null +++ b/src/utils.h @@ -0,0 +1,29 @@ +#ifndef UTILS_H +#define UTILS_H + +#define MAX(a, b) ({ \ + __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a > _b ? _a : _b; \ + }) + +#define MIN(a, b) ({ \ + __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a < _b ? _a : _b; \ + }) + +#define CTZ(X) __builtin_ctz (X) + +#define PAGEBREAK() puts ("\n ") +#define NEWLINE() putchar ('\n'); + +typedef unsigned int uint; + +int +input (const char *message, const char *regex, const char *template, ...); + +uint +log10ui (uint ui); + +#endif -- cgit v1.3.1