diff options
| author | _ov4 <ov4@ov4.org> | 2026-09-01 00:39:44 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-09-01 00:39:44 +0000 |
| commit | 5e94ca9f060d2952ef08913234c500a815f734bf (patch) | |
| tree | 169e6c67289b70753aa76edb818f3b1f63112884 /include/util | |
| parent | 54261d62d47624e9ff4724c42aaa05eaf478e606 (diff) | |
refactor
Diffstat (limited to 'include/util')
| -rw-r--r-- | include/util/io.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/util/io.h b/include/util/io.h new file mode 100644 index 0000000..5bdbcbd --- /dev/null +++ b/include/util/io.h @@ -0,0 +1,36 @@ +#pragma once + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <ctype.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <errno.h> +#include <iostream> +#include <vector> +#include <string> + +#include "global.h" + +#define LOG !(ov4::GLOBAL_DEBUG && verbose) ? (void)0 : ov4::LogVoidify() & std::clog + +namespace ov4 +{ + +struct LogVoidify { void operator&(std::ostream&) const {} }; + +constexpr int DECIMAL = 10; +constexpr int LENGTH = 32; + +void atomic_print(char *s, bool ignore_wrap = false); +void atomic_print(int x); +void atomic_debug(char *s, bool ignore_wrap = false); +void atomic_debug(int x); +bool isnum(char *s); +void reverse(char str[], int length); +char *itoa(int num, char* str, int base); + +} |
