diff options
| author | Carson Fleming <[email protected]> | 2026-01-25 03:49:51 -0500 |
|---|---|---|
| committer | Carson Fleming <[email protected]> | 2026-01-25 03:49:51 -0500 |
| commit | aecec4204b5830fcb97ab93a56a6a29018519ca2 (patch) | |
| tree | 0088101660e2160b6ab13d96f537d6f66e4f31b0 /array.h | |
| parent | eaba8182af646204294546a10a84e8f8165ba589 (diff) | |
| download | safec-aecec4204b5830fcb97ab93a56a6a29018519ca2.tar.gz | |
more intuitive interface
Diffstat (limited to 'array.h')
| -rw-r--r-- | array.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -8,16 +8,20 @@ typedef struct { void* __data; } array_t; -void array_set(array_t* array, size_t idx, void* val); -void* array_get(const array_t* array, size_t idx); +void* array_at(const array_t* array, size_t idx); typedef struct { size_t length; char* __data; } str_t; -void str_set(str_t* str, size_t idx, char val); -char str_get(const str_t* str, size_t idx); -/* TODO: I would like to implement string slicing as part of this */ +char* str_at(const str_t* str, size_t idx); +str_t str_slice(const str_t* str, size_t start, size_t length); +void str_c_str( + char* dst, + size_t dst_size, + const str_t* src +); + /* TODO: reimplement string.h functions for this new string construct */ #endif |
