aboutsummaryrefslogtreecommitdiff
path: root/buffer.h
AgeCommit message (Collapse)AuthorFilesLines
2025-12-22move all standard library includes into util.hRandy Palamar1-2/+0
2025-12-16mark all functions in headers with VIS_EXPORT or VIS_INTERNALRandy Palamar1-14/+14
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-02-28buffer: remove more unused exposed functionsRandy Palamar1-6/+0
NOTE: buffer-test.c now directly includes buffer.c so that it can continue to test functions which are defined as static/internal to buffer.c
2025-02-28buffer: remove buffer_printfRandy Palamar1-2/+0
There was only a single user of this function because buffer_appendf is significantly more useful. Change that caller and reduce the code.
2025-01-12buffer: drop buffer_move functionRandy Palamar1-7/+0
2025-01-11buffer: clear out one line functionsRandy Palamar1-13/+0
Buffer is fully exposed to the program, no need to rely on the linker to optimize useless code.
2025-01-11buffer: delete pointless buffer_init functionRandy Palamar1-2/+0
lets not make the code harder to read for no reason
2025-01-04remove duplicated read_buffer functionsRandy Palamar1-0/+3
When you take a pointer to a function in C that function is going to appear in full in the final binary. This means that there were 3 sections of the final binary with the exact same code. You could argue that in very high performance programs having that function closer to the current instruction when it is needed will give a performance boost but there are so many other places to gain more significant speed ups in vis before that would be remotely relevant. In fact, removing these allows the buffer_append call to inlined so that buffer_insert can be hopped to directly instead of including a useless hop in the middle.
2022-11-29fix miscellaneous spelling mistakesNick Hanley1-1/+1
2020-12-10fix typos in commentsMoesasji1-3/+3
2020-08-01doc: fix a couple of API doc warningsMarc André Tanner1-1/+1
In restructured text double backquotes are used for inline literals.
2017-05-03buffer: convert comments to doxygen formatMarc André Tanner1-29/+48
2017-02-20buffer: add buffer_growMarc André Tanner1-0/+2
2017-02-20buffer: rename buffer_grow to buffer_reserveMarc André Tanner1-1/+1
2017-01-07buffer: remove redundant functionMarc André Tanner1-2/+0
For some reason we ended up with two identical functions: buffer_{clear,terminate}.
2016-12-31buffer: implement buffer_moveMarc André Tanner1-0/+3
2016-12-23Apply format string attribute to printf style functionsMarc André Tanner1-2/+2
Not strictly C99 conform, but widely supported and easy enough to NOP for compilers which do not support it. Besides it was already used to mark certain functions as noreturn.
2016-12-20buffer: implement buffer_capacity utility functionMarc André Tanner1-0/+2
2016-12-20buffer: implement buffer_appendf to append formatted contentMarc André Tanner1-2/+3
2016-08-20buffer: add buffer_remove implementationMarc André Tanner1-0/+2
2016-05-18buffer: implement buffer_{v,}printf functionsMarc André Tanner1-0/+3
2016-05-18buffer: add utility function to NUL terminate bufferMarc André Tanner1-0/+2
2016-04-03buffer: add buffer_content0 utility functionMarc André Tanner1-0/+3
2016-04-03buffer: add buffer_content utility functionMarc André Tanner1-0/+2
2016-04-03buffer: add buffer_length utility functionMarc André Tanner1-0/+2
2016-02-25vis: ignore trailing NUL byte of register content by defaultMarc André Tanner1-0/+2
This is handy when editing registers used for macros.
2016-01-30Implement system clipboard registers "* and "+Marc André Tanner1-0/+2
Both registers are currently treated identically. The actual system integration is performed by two shell scripts vis-copy and vis-paste.
2015-11-19buffer: add some comments to clarify allocation strategyMarc André Tanner1-4/+6
Closes #116
2015-11-03buffer: add buffer_insert to insert data at an arbitrary positionMarc André Tanner1-0/+4
Use it to implement buffer_{pre,ap}pend.
2015-10-05buffer: add functions to prepend data to an existing bufferMarc André Tanner1-0/+3
2015-09-15buffer: add buffer_put0 to store a NUL terminated stringMarc André Tanner1-0/+2
2015-09-15buffer: add buffer_append0 to append NUL terminated stringsMarc André Tanner1-0/+2
2015-05-16Cleanup general purpose buffer APIMarc André Tanner1-6/+13
Introduce buffer_init to initialize a stack allocated buffer. Rename buffer_{alloc,free} functions because they do something different than the usual convention. They operate on the underlying buffer data but do not allocate/free an actual Buffer struct.
2015-01-02Constify buffer APIMarc André Tanner1-2/+2
2014-12-18Macro supportMarc André Tanner1-0/+20
At some point this should be optimized further at the moment there is some 20 byte overhead for each entered key.