diff options
| author | nasr <nsrddyn@gmail.com> | 2026-03-14 21:40:32 +0000 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-03-14 21:40:32 +0000 |
| commit | 53cd9c4c3408b5f2e54e891baf471c0d774ea2cd (patch) | |
| tree | 7fcdfdd25b7e163b40fe3d2961a605b3a2720ba4 /source/base/base_string.h | |
| parent | e51d57e2da70ea2688a72602aeb5f7c4040e72b7 (diff) | |
feature(base): ascii colors, error framework ( ai help ). testing idea meta program. refactor
Diffstat (limited to 'source/base/base_string.h')
| -rw-r--r-- | source/base/base_string.h | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/source/base/base_string.h b/source/base/base_string.h index ef2cf16..29ccf1e 100644 --- a/source/base/base_string.h +++ b/source/base/base_string.h | |||
| @@ -1,17 +1,7 @@ | |||
| 1 | #ifndef BASE_STRING_H | 1 | #ifndef BASE_STRING_H |
| 2 | #define BASE_STRING_H | 2 | #define BASE_STRING_H |
| 3 | 3 | ||
| 4 | #define StringLit(string) \ | 4 | #define PushString(arena, count) (string8){ .data = (PushArrayZero(arena, u8, (count))), .size = (count) } |
| 5 | (string8){ .data = (u8 *)(string), .size = (sizeof(string) - 1) } | ||
| 6 | |||
| 7 | #define PushString(arena, size) \ | ||
| 8 | ({ \ | ||
| 9 | string8 *result = PushStruct((arena), string8); \ | ||
| 10 | result->data = PushArray((arena), u8, (size)); \ | ||
| 11 | result->size = (u64)(size); \ | ||
| 12 | result; \ | ||
| 13 | }) | ||
| 14 | |||
| 15 | #define StringCast(data, size) (string8){(u8 *)(data), (u64)(size) } | 5 | #define StringCast(data, size) (string8){(u8 *)(data), (u64)(size) } |
| 16 | #define StringPCast(data, size) (string8 *){(u8 *)(data), (u64)(size) } | 6 | #define StringPCast(data, size) (string8 *){(u8 *)(data), (u64)(size) } |
| 17 | 7 | ||
