]> git.ozlabs.org Git - ccan/blob - ccan/rfc822/_info
rfc822: Rename bad-header test
[ccan] / ccan / rfc822 / _info
1 #include "config.h"
2 #include <stdio.h>
3 #include <string.h>
4
5 /**
6  * rfc822 - Parsing of RFC822 emails
7  *
8  * This code allows easy processing of RFC822/RFC2822/RFC5322
9  * formatted email messages.  For now only read-only operation is
10  * supported.
11  *
12  * The important design goals are these:
13  * - Be lazy.  Don't compute immediately compute fancy indexes for the
14  *   message.  Just reading messages into the system and then sending
15  *   them out again should not incur a serious performance hit.
16  * - But cache.  Once the user does request data that needs parsing,
17  *   cache the results in suitable data structures so that if lots
18  *   more lookups are done they're then fast.
19  * - Cope with ill-formatted messages.  Even if the input is not
20  *   RFC822 compliant, don't SEGV and try to return as much useful
21  *   data as possible.
22  *
23  * Example:
24  *      char buf[] = "From: <from@example.com>\n"
25  *                   "To: <to@example.com>\n\n"
26  *                   "body\n";
27  *      struct rfc822_msg *msg;
28  *      struct bytestring body;
29  *
30  *      msg = rfc822_start(NULL, buf, sizeof(buf));
31  *      body = rfc822_body(msg);
32  *      fwrite(body.ptr, 1, body.len, stdout);
33  *
34  * License: LGPL (v2.1 or any later version)
35  *
36  * Ccanlint:
37  *      // The failtest module is only used for tests: ccanlint is overzealous
38  *      license_depends_compat FAIL
39  */
40 int main(int argc, char *argv[])
41 {
42         /* Expect exactly one argument */
43         if (argc != 2)
44                 return 1;
45
46         if (strcmp(argv[1], "depends") == 0) {
47                 printf("ccan/array_size\n");
48                 printf("ccan/talloc\n");
49                 printf("ccan/list\n");
50                 printf("ccan/foreach\n");
51                 printf("ccan/failtest\n");
52                 printf("ccan/str\n");
53                 printf("ccan/bytestring\n");
54                 return 0;
55         }
56
57         return 1;
58 }