diff options
Diffstat (limited to 'prb_string.h')
-rw-r--r-- | prb_string.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/prb_string.h b/prb_string.h new file mode 100644 index 0000000..85496cb --- /dev/null +++ b/prb_string.h @@ -0,0 +1,22 @@ +#ifndef PRB_STRING_H +#define PRB_STRING_H + +#define str8lit(s) str8((U8 *)(s), sizeof(s)-1) +#define str8expand(s) (int)((s).length), ((s).ptr) + +Str8 str8(U8 *ptr, U64 length); +Str8 str8_range(U8 *start, U8 *end); +Str8 str8_from_cstr(char *cstr); +char *str8_to_cstr(Arena *arena, Str8 s); +Str8 str8_chop_end(Str8 s, U64 count); +Str8 str8_chop_start(Str8 s, U64 count); +Str8 str8_pushfv(Arena *arena, char *fmt, va_list args); +Str8 str8_pushf(Arena *arena, char *fmt, ...); +void str8print(Str8 s); + +Str8List *str8_list(Arena *arena); +void str8_list_push(Arena *arena, Str8List *list, Str8 str, B32 to_front); +void str8_list_pushf(Arena *arena, Str8List *list, B32 to_front, char *fmt, ...); +void str8_list_print(Str8List *list); + +#endif /* PRB_STRING_H */ |