Note that some of these are explained in much more detail in the tutorial. To get a rough overview of how to use the library you can see the following heavily commented examples: hello world - A program that just does a "Hello World".

cat - A program that just transfers information from stdin to stdout ... mmap() is never used.

nl - This does something similar to the Unix "nl" program. Each input line is printed along with a number. This uses the split functions to get each line.

hexdump - An ASCII hexdump utility, it prints in the "programmer" format of 16 bytes per line with Hex first, and then ASCII. High ASCII characters are printed, or not depending on a configuration. This also uses mmap() on the input files, if possible.

lookup_ip - A program that will change a DNS domain name (Ie. www.and.org) into an IPv4 address (or print an error). This uses the std. custom formatter for printing IPv4 addresses.

gmp_factorials - A program that will output each factorial leading upto a number supplied on the cmd line. This creates a custom formatter for printing GMP mpz_t variables. To get a better understanding, there are other example programs which aren't as heavily commented but should show how you can solve certain problems. They are: rot13 - This does a rot13 transform (or Caesar cipher) on the input, and then outputs it. This shows the different methods you can use for iterating through a string. You can also use it to measure the differences between those methods.

yes - This just shows text repeatedly, it does show the difference between the different methods of copying data between Vstr strings. You can use this program to measure those copying affects. One minor note is that it does allow you to use the string "--version" as the output ... which the GNU version doesn't (as of fileutils-2.0.12).

csv - This is a csv parser I wrote for a thread on comp.lang.c. I'll probably turn into a library function at some point, but for now it's useful on it's own.

monitor copy - This program will monitor a file as it gets bigger, and report Bytes per second etc. statistics. This is done through Vstr string custom formatter API calls, and should show how much simpler you can make your code using those features.

slowcat (this also requires the Timer_q library, and getopt_long) - This is like the cat program, except that you can specify a delay between blocks of output ... this is especially useful for ASCII art programs.

C to html converter - This program implements something similar to , but just for C, this is used to turn the tutorial examples into html.

Simple Server Side Includes processor - This program implements something similar to Apache httpd SSI, but it only does the include statement. I use this to generate some documentation.

HTTP/1.1 server - Serves static files over HTTP/1.1, this shows off Vstr how it was designed to be used ... as a non-blocking IO server.

Scatter gather comparison (this also requires the OpenSSL library) - This program times the usage of the MD5 or SHA1 functions from OpenSSL, with a all of: A single chunk of data, an iovec list of the data at the default buffer size, and an iovec list of the data at a configured buffer size. This was written to disprove the theory that iovec lists are always too slow to use, I believe I did this, assuming you have a chunk size that isn't tiny (and the default chunk size is probably good enough).

Adding data to Vstr comparison - This program times the overhead of adding data to a Vstr, in a few different ways. Note that the hand optimized way depends on internals that aren't guaranteed by the API, however the hand iovec method is basically as fast and only uses the documented API (this isn't surprising in my opinion, as the library was designed with the idea that the performance critical data would be comming in through iovecs). All of the examples can be seen HERE. For the truly adventurous the "make check" test suite root is HERE (NOTE: the test suite is written to try and break the Vstr string library, so although it uses all of the APIs it may not be code you want to copy and paste into your programs/libraries -- however given that everything in the test suite works, you know that those uses do work). However do note that a couple of the tests do use undocumentation members of structs etc., and you still shouldn't use those. There is also a "port" of the vsftpd FTP server to use the Vstr string library. It can be found here. This was mainly an experiment in how well/easily Vstr would work inside an application designed for a traditional String API model.