#ifndef PRB_STRING_H #define PRB_STRING_H /* NOTE(pryazha): I don't know wheter it's a good idea * to keep regular and fixed-length strings together, but * seems reasonable at the time. */ /* NOTE(pryazha): Null-terminated strings */ void sys_vprintf(const char *fmt, va_list args); void sys_printf(const char *fmt, ...); /* NOTE(pryazha): Fixed-length strings */ #define FLSLIT(s) fls((U8 *)(s), sizeof(s)-1) #define FLSEXP(s) (int)((s).len), ((s).p) FLS fls(U8 *p, U64 len); FLS flsfromcstr(const char *cstr); char *flstocstr(Arena *a, FLS s); FLS flsrange(U8 *start, U8 *end); FLS flschopend(FLS s, U64 cnt); FLS flschopstart(FLS s, U64 cnt); FLS flspushfv(Arena *a, const char *fmt, va_list args); FLS flspushf(Arena *a, const char *fmt, ...); void flsprint(FLS s); FLSList *flslist(Arena *a); void flslistpush(Arena *a, FLSList *l, FLS s, B32 front); void flslistpushf(Arena *a, FLSList *l, B32 front, const char *fmt, ...); void flslistprint(FLSList *l); #endif /* PRB_STRING_H */