You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
364 B
11 lines
364 B
2 years ago
|
#pragma once
|
||
|
|
||
|
#include <string.h>
|
||
|
|
||
|
// Custom helpers
|
||
|
#define streq(a, b) (strcmp((const char*)(a), (const char*)(b)) == 0)
|
||
|
#define strneq(a, b, n) (strncmp((const char*)(a), (const char*)(b), (n)) == 0)
|
||
|
#define strstarts(a, b) strneq((a), (b), (int)strlen((b)))
|
||
|
#define last_char_n(str, n) ((str))[strlen((str)) - (n)]
|
||
|
#define last_char(str) last_char_n((str), 1)
|