I'm looking for a C function library, which would contain a collection of simple and plain utility functions "missing" from C or POSIX standards. I found this earlier question, but answers there list only full frameworks or libraries designed to replace/duplicate standard libraries instead of seamlessly fill the gaps.
To give you an example of functions I'm often missing, and would like to find a lib with tested implementations:
afgets
,afread
: read a line or entire file, likefgets
andfread
, except really reads all and returns amalloc
ed buffer, in the spirit of GNUasprintf
.- A selection of string trimming functions
systemf
,popenf
: Likesystem
andpopen
, but takeprintf
-like format string for command.strjoin
: join multiple strings given as vararg/array (which is hard to do withsnprintf
)struct timeval
arithmetic
These are just examples of functions I often miss for quick stuff. Then some features I'd desire (not mandatory):
- Available on common Linux distros out-of-the-box, with man pages etc
- Works also on Windows/Visual C
- No extra dependencies, self-contained
- As usable as existing C lib functions in C++
- Preferably licensed under LGPL or BSD-like license, but GPL is ok too
Stuff which I am not looking for:
- A string library with its own string type
- A data structure library
- A framework library which has special initialization, maybe even event loop etc.
So the question is, what is out there? Library name, homepage link, github link, duplicate question link... If you've made your own and have it at public repo, feel free to link to that too, if you dare expose it to many eyes.