prick_darr: PRICK_SHORTHAND

This commit is contained in:
2026-03-17 21:13:19 +00:00
parent 3bebc86991
commit bdd5b5c5a8

View File

@@ -9,6 +9,11 @@
#include "prick_darr.h"
in one of your code units.
To remove the `prick_` namespacing, please put:
#define PRICK_SHORTHAND
in any files before including prick_darr.h. Standard preprocesser rules apply
with regards to hierarchy.
This library defines a dynamic array purely on the heap. Both the raw data for
the array as well as the metadata are in one allocation. Consumers of the
library will only ever need to deal with the former component i.e. they'll only
@@ -25,7 +30,6 @@
Tasks:
- TODO: Implement ability to use a custom allocator.
- TODO: QoL shorthand macro.
*/
#ifndef PRICK_DARR_H
@@ -147,6 +151,21 @@ void prick_darr_clone(void **dest, void **src)
#endif
#ifdef PRICK_SHORTHAND
#endif
typedef prick_darr_t darr_t;
#define DARR_GET PRICK_DARR_GET
#define DARR_SIZE PRICK_DARR_SIZE
#define DARR_CAP PRICK_DARR_CAP
#define darr_make prick_darr_make
#define darr_free prick_darr_free
#define darr_append_byte prick_darr_append_byte
#define darr_append prick_darr_append
#define darr_clone prick_darr_clone
#define darr_ensure_remaining prick_darr_ensure_remaining
#endif
/* Copyright (C) 2024 Aryadev Chavali