aboutsummaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)AuthorFilesLines
2026-01-06vis-marks: greatly simplify jumplist managementRandy Palamar1-18/+0
As far as I could tell from the code this was supposed to be a fixed size LRU cache of sets of selection regions. The structure had a maximum size member but it was never set or used. Furthermore there was some very complicated management of 2 parallel sets of regions. Instead of that mess just treat the cache as a circular buffer. Note that this is really not that useful at the moment. While the selection regions are saved and restored the editor mode is not. Therefore the selection is visible but not in any way usable. That will be fixed in the next commit.
2025-12-22move all standard library includes into util.hRandy Palamar1-4/+0
2025-12-16mark all functions in headers with VIS_EXPORT or VIS_INTERNALRandy Palamar1-1/+2
if vis actually wants to be a library exported symbols may need mark up depending on the platform (eg. __declspec(dllexport)). This needs to be hidden behind a macro because the way you export is not the same on every platform. I did this based on the assumption that vis.h was supposed to be the only interface to the "vis" library. Since nobody actually uses vis as a library I have no idea if this is actually correct. Anyway marking up all prototypes like this allows for one to convert all functions to static if a single translation unit is used by inserting at the start: #define VIS_INTERNAL static #define VIS_EXPORT static
2025-01-12array: delete onelinersRandy Palamar1-8/+0
same as buffer commit Array is completely visible
2020-10-10array: mark array_peek argument as constMarc André Tanner1-1/+1
2020-10-10array: mark array_capacity argument as constMarc André Tanner1-1/+1
2020-10-10array: mark array_init_from argument as constMarc André Tanner1-1/+1
2020-10-10array: mark array_get_ptr argument as constMarc André Tanner1-1/+1
2020-10-10array: mark array_get argument as constMarc André Tanner1-1/+1
2020-10-10array: mark array_length argument as constMarc André Tanner1-1/+1
2020-02-03array: make array_sort work for empty arraysMarc André Tanner1-1/+2
2018-04-10array: fix off by one error in array_removeMarc André Tanner1-1/+1
If the array was full, attempting to remove an element caused an out of bounds memory access. As an example this was triggered when reaching the capacity limit of the jumplist. It can be forced by repeatedly searching for something (i.e. `/.` and then holding down `n`).
2017-07-10array: add helper functions for LIFO usageMarc André Tanner1-0/+18
2017-06-15array: add array initialization utility functionMarc André Tanner1-0/+4
Reuses the element size from another array.
2017-06-15array: add array_sort utility functionMarc André Tanner1-0/+4
2017-04-19array: implement array_resizeMarc André Tanner1-0/+8
2017-04-19array: implement array_truncateMarc André Tanner1-0/+8
2017-04-18array: implement array_capacityMarc André Tanner1-0/+4
2016-12-27array: implement array_removeMarc André Tanner1-0/+12
2016-03-30array: allow arbitrarily sized array elementsMarc André Tanner1-7/+45
There exist two typical ways to use an array: 1) to hold pointers to externally allocated memory regions Use array_init(...) for initialization, an element has the size of a pointer. Use the functions suffixed with `_ptr' to manage your pointers. The cleanup function array_release_full must only be used with this type of array. 2) to hold arbitrary sized objects Use array_init_sized(...) to specify the size of a single element. Use the regular (i.e. without the `_ptr' suffix) functions to manage your objects. array_get will return a pointer to the object stored within the array.
2016-02-18Add a simple dynamically growing array data structureMarc André Tanner1-0/+75