|
|
|
@ -113,8 +113,8 @@ DOCUMENTATION |
|
|
|
|
Appends n uninitialized items onto array at the end. |
|
|
|
|
Returns a pointer to the first uninitialized item added. |
|
|
|
|
|
|
|
|
|
arraddnoff: |
|
|
|
|
size_t arraddnoff(T* a, int n) |
|
|
|
|
arraddnindex: |
|
|
|
|
size_t arraddnindex(T* a, int n) |
|
|
|
|
Appends n uninitialized items onto array at the end. |
|
|
|
|
Returns the index of the first uninitialized item added. |
|
|
|
|
|
|
|
|
@ -370,12 +370,14 @@ CREDITS |
|
|
|
|
Sean Barrett -- library, idea for dynamic array API/implementation |
|
|
|
|
Per Vognsen -- idea for hash table API/implementation |
|
|
|
|
Rafael Sachetto -- arrpop() |
|
|
|
|
github:HeroicKatora -- arraddn() reworking |
|
|
|
|
|
|
|
|
|
Bugfixes: |
|
|
|
|
Andy Durdin |
|
|
|
|
Shane Liesegang |
|
|
|
|
Vinh Truong |
|
|
|
|
Andreas Molzer |
|
|
|
|
github:hashitaku |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#ifdef STBDS_UNIT_TESTS |
|
|
|
@ -395,10 +397,9 @@ CREDITS |
|
|
|
|
#define arrpush stbds_arrput |
|
|
|
|
#define arrpop stbds_arrpop |
|
|
|
|
#define arrfree stbds_arrfree |
|
|
|
|
#define arraddn stbds_arraddn // deprecated, use one of the following instead:
|
|
|
|
|
#define arraddnptr stbds_arraddnptr |
|
|
|
|
#define arraddnoff stbds_arraddnoff |
|
|
|
|
// deprecated
|
|
|
|
|
#define arraddn stbds_arraddn |
|
|
|
|
#define arraddnindex stbds_arraddnindex |
|
|
|
|
#define arrsetlen stbds_arrsetlen |
|
|
|
|
#define arrlast stbds_arrlast |
|
|
|
|
#define arrins stbds_arrins |
|
|
|
@ -536,8 +537,7 @@ extern void * stbds_shmode_func(size_t elemsize, int mode); |
|
|
|
|
#define stbds_arrput(a,v) (stbds_arrmaybegrow(a,1), (a)[stbds_header(a)->length++] = (v)) |
|
|
|
|
#define stbds_arrpush stbds_arrput // synonym
|
|
|
|
|
#define stbds_arrpop(a) (stbds_header(a)->length--, (a)[stbds_header(a)->length]) |
|
|
|
|
// deprecated
|
|
|
|
|
#define stbds_arraddn(a,n) ((void)(stbds_arraddnoff(a, n))) |
|
|
|
|
#define stbds_arraddn(a,n) ((void)(stbds_arraddnoff(a, n))) // deprecated, use one of the following instead:
|
|
|
|
|
#define stbds_arraddnptr(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), &(a)[stbds_header(a)->length-(n)]) |
|
|
|
|
#define stbds_arraddnoff(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), stbds_header(a)->length-(n)) |
|
|
|
|
#define stbds_arrlast(a) ((a)[stbds_header(a)->length-1]) |
|
|
|
|