-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.h
22 lines (19 loc) · 940 Bytes
/
helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "dlb_types.h"
#define PANIC(format, ...) \
fprintf(stderr, "\n---[PANIC]----------------------------------------------------------------------\n" \
"Source file: %s:%d\n\n", __FILE__, __LINE__); \
fprintf(stderr, (format), __VA_ARGS__); \
fprintf(stderr, "--------------------------------------------------------------------------------\n"); \
UNUSED(getchar()); \
exit(1);
#define PANIC_FILE(f, format, ...) \
fprintf(stderr, "\n---[PANIC_FILE]-----------------------------------------------------------------\n" \
"Source file: %s:%d\n", __FILE__, __LINE__); \
file_debug_context(f); \
fprintf(stderr, (format), __VA_ARGS__); \
fprintf(stderr, "--------------------------------------------------------------------------------\n"); \
UNUSED(getchar()); \
exit(1);
const char *char_printable(const char *c);
bool str_contains_chr(const char *str, char c);