aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorLibravatar Comrade Martin Miroslavovich Michalec <martin@michalec.dev>2023-11-25 16:24:10 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-07 02:12:00 +0000
commitbca75f071153ddcaa5ceee0722e2152bacfedc78 (patch)
tree7c42e4aa83103aa9813151e4251d2ffb4023ffbe /src/utils.h
downloadlab-01-bca75f071153ddcaa5ceee0722e2152bacfedc78.tar.gz
publishHEADmaster
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h29
1 files changed, 29 insertions, 0 deletions
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 @@
1#ifndef UTILS_H
2#define UTILS_H
3
4#define MAX(a, b) ({ \
5 __typeof__ (a) _a = (a); \
6 __typeof__ (b) _b = (b); \
7 _a > _b ? _a : _b; \
8 })
9
10#define MIN(a, b) ({ \
11 __typeof__ (a) _a = (a); \
12 __typeof__ (b) _b = (b); \
13 _a < _b ? _a : _b; \
14 })
15
16#define CTZ(X) __builtin_ctz (X)
17
18#define PAGEBREAK() puts ("\n ")
19#define NEWLINE() putchar ('\n');
20
21typedef unsigned int uint;
22
23int
24input (const char *message, const char *regex, const char *template, ...);
25
26uint
27log10ui (uint ui);
28
29#endif