6 * asprintf - asprintf wrapper (and if necessary, implementation).
8 * This provides a convenient wrapper for asprintf, and also implements
9 * asprintf if necessary.
11 * Author: Rusty Russell <rusty@rustcorp.com.au>
16 * #include <ccan/asprintf/asprintf.h>
20 * int main(int argc, char *argv[])
22 * char *p = afmt("This program has %i arguments", argc);
25 * while ((ret = write(STDOUT_FILENO, p, strlen(p))) > 0) {
30 * err(1, "Writing to stdout");
33 int main(int argc, char *argv[])
35 /* Expect exactly one argument */
39 if (strcmp(argv[1], "depends") == 0) {
40 printf("ccan/compiler\n");