aboutsummaryrefslogtreecommitdiff
path: root/util.h
AgeCommit message (Collapse)AuthorFilesLines
2025-12-08util: replace memrchr with internal versionRandy Palamar1-11/+0
The amount of code we need to detect if this is present and handle the fallback is more than if we just provide it ourselves. Also we are passing in a difference of pointers so the argument type should be ptrdiff_t. This avoids a C brain damage of having unsigned size type which can wrap around if the caller is careful.
2017-05-11Move the #defines within the #include guardsParide Legovini1-5/+4
2017-05-11Fix compilation on GNU Hurd systemsParide Legovini1-0/+11
On GNU Hurd systems PIPE_BUF and PATH_MAX are not defined, and the compilation fails. This patch defines them if they aren't.
2017-04-09text: add mem{r,}chr(3) based byte search functionsMarc André Tanner1-0/+11
These are generally implemented efficiently in libc. While memrchr(3) is non-standard, it is a common extension. If it is not available, we use a simple C implementation from musl.
2017-02-20util: add overflow safe unsigned addition functionMarc André Tanner1-0/+14
2014-09-10Add comments where appropriateMarc André Tanner1-2/+2
2014-09-09Rename vis.[ch] to editor.[ch] and main.c to vis.cMarc André Tanner1-0/+5
2014-08-23Share common macros in util.hMarc André Tanner1-0/+7