From 0612bfa57649c4bffea0ca6e436539d8c3193a80 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Sat, 22 Mar 2025 14:09:55 +0300 Subject: Added json serializer/parser --- include/container.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index 1401162..5f40e4a 100644 --- a/include/container.h +++ b/include/container.h @@ -130,6 +130,8 @@ typedef void*(*memcpy_t)(void* restrict, const void*, size_t); } while(0) /* Removes last element from the array */ #define array_pop(array) --array_header(array)->size +/* get last element of an array */ +#define array_last(array) (array)[array_header((array))->size - 1] /* Reserve length elements so that subsequent (length - current_size) pushes require no reallocation */ #define array_reserve(array, length) do { array = _memreserve_dynarray(array, length); } while (0) /* Change size of an array. the capacity is set to lowest power of 2 that is greater than length */ -- cgit v1.2.3-70-g09d2