diff options
Diffstat (limited to 'source/base/base_string.h')
| -rw-r--r-- | source/base/base_string.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/base/base_string.h b/source/base/base_string.h new file mode 100644 index 0000000..5f875e0 --- /dev/null +++ b/source/base/base_string.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef BASE_STRING_H | ||
| 2 | #define BASE_STRING_H | ||
| 3 | |||
| 4 | #define _StringCast (string) | ||
| 5 | #define StringCast { .data (u8 *)(string), .size = (sizeof((string)) - 1)} | ||
| 6 | #define PushString (Arena, Size) StringCast{.data = PushArray((arena), PushStruct(u8), (Size)), .size = (u64)(Size)} | ||
| 7 | |||
| 8 | typedef struct string string; | ||
| 9 | struct string | ||
| 10 | { | ||
| 11 | u8 *data; | ||
| 12 | u64 size; | ||
| 13 | }; | ||
| 14 | |||
| 15 | #endif /* BASE_STRING_H */ | ||
