Vstr string library 1.0.15 review
DownloadVstr is a safe and fast string library for C
|
|
Vstr is a safe and fast string library for C. Vstr string library is designed for network communication. Its design uses chunks of ptr+length data, so adding, substituting, and deleting data are all fast operations.
This model also allows it to do automatic referencing for mmap() areas of memory. Shortcut APIs are included to mmap() a file into a Vstr string, and read()/write() data to/from a Vstr string. Another big feature of the library is a POSIX and ISO 9899:1999 compliant printf() like function, which can also be extended with user supplied formatters that are gcc warning compatible.
The total API is over 280 functions, but laid out in a easy to remember manner, including data parsing functions, a non-destructive split() function, and conversion functions (among others).
Here are some key features of "Vstr string library":
a printf like function that is fully ISO 9899:1999 (C99) compliant, also having %m as standard and POSIX i18n parameter number modifiers. It also allows gcc warning compatible customer format specifiers (and includes pre-written custom format specifiers for ipv4 and ipv6 addresses, Vstr strings and more)
splitting of strings into parameter/record chunks (a la perl).
substituting data in a Vstr string
moving data from one Vstr string to another (or within a Vstr string).
comparing strings (without regard for case, or taking into account version information)
searching for data in strings (with or without regard for case).
counting spans of data in a string (the equivalent of strspn() in ISO C).
converting data in a Vstr (Ie. delete/substitute unprintable characters or making a Vstr string lowercase/uppercase).
parsing data from a Vstr string (Ie. numbers, or ipv4 addresses).
easily parsing and wrapping outgoing data in netstrings, for fast and simple (and hence less error prone) network communication
the ability to cache aspects of data about a Vstr string, to both simplify and speedup use of the string.
the ability to have empty data as part of the string, this is somewhat useful for representing file transfers as a string as you can represent the file data as empty data in the string.
What's New in This Release:
Bytemap functions were added to accelerate parsing.
Custom formatters were sped up with a hash.
Workarounds were added for a hidden Linux UIO 2GB limit and GCC 4.x symbol aliasing brain damage.
Solaris build fixes were made along with a fix for a problem with loading zero-sized files with vstr_sc_*_file() and a couple of other minor problems.
Vstr string library 1.0.15 keywords