Improve Str8 macros ergonomics
This commit is contained in:
parent
358f61e556
commit
6119cf5c5f
@ -38,7 +38,7 @@ struct str8_list {
|
|||||||
* Utilities to be used with printf functions
|
* Utilities to be used with printf functions
|
||||||
*/
|
*/
|
||||||
#define WAPP_STR8_SPEC "%.*s"
|
#define WAPP_STR8_SPEC "%.*s"
|
||||||
#define wapp_str8_varg(STRING) (int)STRING.size, STRING.buf
|
#define wapp_str8_varg(STRING) (int)((STRING).size), (STRING).buf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Str8 stack buffers
|
* Str8 stack buffers
|
||||||
@ -106,7 +106,7 @@ Str8 *wapp_str8_join(const Allocator *allocator, const Str8List *list, Str8R
|
|||||||
* Str8 list utilities
|
* Str8 list utilities
|
||||||
*/
|
*/
|
||||||
#define wapp_str8_node_from_cstr(STRING) ((Str8Node){.string = &wapp_str8_lit(STRING)})
|
#define wapp_str8_node_from_cstr(STRING) ((Str8Node){.string = &wapp_str8_lit(STRING)})
|
||||||
#define wapp_str8_node_from_str8(STRING) ((Str8Node){.string = &STRING})
|
#define wapp_str8_node_from_str8(STRING) ((Str8Node){.string = &(STRING)})
|
||||||
Str8Node *wapp_str8_list_get(const Str8List *list, u64 index);
|
Str8Node *wapp_str8_list_get(const Str8List *list, u64 index);
|
||||||
void wapp_str8_list_push_front(Str8List *list, Str8Node *node);
|
void wapp_str8_list_push_front(Str8List *list, Str8Node *node);
|
||||||
void wapp_str8_list_push_back(Str8List *list, Str8Node *node);
|
void wapp_str8_list_push_back(Str8List *list, Str8Node *node);
|
||||||
|
Loading…
Reference in New Issue
Block a user