X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Frfc822%2F_info;h=5a0a9c6a6080c050c35095867019026d0ce02ce5;hb=5dbd87b876434dd703dfcc30cb0503118aac2076;hp=7b8eda62ac3e976679ce6c4aa5dc8d8689723d65;hpb=49ac066464e0127e4b9924b150bf47473ab733ae;p=ccan diff --git a/ccan/rfc822/_info b/ccan/rfc822/_info index 7b8eda62..5a0a9c6a 100644 --- a/ccan/rfc822/_info +++ b/ccan/rfc822/_info @@ -20,10 +20,14 @@ * RFC822 compliant, don't SEGV and try to return as much useful * data as possible. * + * Define TAL_USE_TALLOC to use libtalloc as the allocator, otherwise + * it will use ccan/tal (usually done on the cmdline, as tal/str will need + * it too). + * * Example: - * // Given '' outputs 'body' - * // Given 'From' outputs ' ' - * // Given 'To' outputs ' ' + * // Outputs "body\n" + * // Given "From" outputs + * // Given "To" outputs * char buf[] = "From: \n" * "To: \n\n" * "body\n"; @@ -31,7 +35,7 @@ * struct bytestring out; * * msg = rfc822_start(NULL, buf, sizeof(buf)); - * if (!argv[1] || !argv[1][0]) + * if (!argv[1]) * out = rfc822_body(msg); * else { * struct rfc822_header *hdr; @@ -53,10 +57,15 @@ int main(int argc, char *argv[]) return 1; if (strcmp(argv[1], "depends") == 0) { - printf("ccan/talloc\n"); +#ifdef TAL_USE_TALLOC + printf("ccan/tal/talloc\n"); +#else + printf("ccan/tal\n"); +#endif printf("ccan/list\n"); printf("ccan/str\n"); printf("ccan/bytestring\n"); + printf("ccan/mem\n"); return 0; } @@ -64,6 +73,7 @@ int main(int argc, char *argv[]) printf("ccan/failtest\n"); printf("ccan/foreach\n"); printf("ccan/array_size\n"); + printf("ccan/tal/str\n"); return 0; }