ex_hello_world.c
#define VSTR_COMPILE_INCLUDE 1
#include <vstr.h>
#include <errno.h>
#include <err.h>
#include <unistd.h>
int main(void)
{
Vstr_base *s1 = NULL;
if (!vstr_init())
err(EXIT_FAILURE, "init");
if (!(s1 = vstr_dup_cstr_buf(NULL, "Hello World\n")))
err(EXIT_FAILURE, "Create string");
while (s1->len)
if (!vstr_sc_write_fd(s1, 1, s1->len, STDOUT_FILENO, NULL))
{
if ((errno != EAGAIN) && (errno != EINTR))
err(EXIT_FAILURE, "write");
}
vstr_free_base(s1);
vstr_exit();
exit (EXIT_SUCCESS);
}