From c426f9ab6deb3fe71767b8d83106b1913fc253bc Mon Sep 17 00:00:00 2001 From: Gregory Wells Date: Sun, 3 Aug 2025 15:28:59 -0400 Subject: [PATCH] more array list functions --- utils/lists/gryphn_array_list.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/lists/gryphn_array_list.h b/utils/lists/gryphn_array_list.h index 30267dc..1ad4da7 100644 --- a/utils/lists/gryphn_array_list.h +++ b/utils/lists/gryphn_array_list.h @@ -12,6 +12,7 @@ void type##ArrayListRemove(type##ArrayList list); \ void type##ArrayListPopHead(type##ArrayList list); \ uint32_t type##ArrayListCount(type##ArrayList list); \ type type##ArrayListAt(type##ArrayList list, int i); \ +type* type##ArrayListRefAt(type##ArrayList list, int i); \ type* type##ArrayListData(type##ArrayList list) #define GN_ARRAY_LIST_DEFINITION(type)\ @@ -67,6 +68,9 @@ uint32_t type##ArrayListCount(type##ArrayList list) { \ type type##ArrayListAt(type##ArrayList list, int i) { \ return list->data[i]; \ } \ +type* type##ArrayListRefAt(type##ArrayList list, int i) { \ + return &list->data[i]; \ +} \ type* type##ArrayListData(type##ArrayList list) { \ return &list->data[0]; \ }