[PATCH] configure: add --without-docs switch
[notmuch-archives.git] / 0b / eb6d656e22c0cd5722213c5899cfbe330f60de
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id CA81B431FC4\r
6         for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 15:08:17 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 1UbJDQi0ahld for <notmuch@notmuchmail.org>;\r
16         Thu, 12 Jul 2012 15:08:16 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 61701431FAE\r
20         for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 15:08:16 -0700 (PDT)\r
21 X-AuditID: 12074422-b7f1f6d00000090b-97-4fff4acfa785\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 3B.A7.02315.FCA4FFF4; Thu, 12 Jul 2012 18:08:15 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q6CM8FcE024815; \r
27         Thu, 12 Jul 2012 18:08:15 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6CM8Ee2029131\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Thu, 12 Jul 2012 18:08:14 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SpRYU-0004sR-1R; Thu, 12 Jul 2012 18:08:14 -0400\r
37 Date: Thu, 12 Jul 2012 18:08:14 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: craven@gmx.net\r
40 Subject: Re: [PATCH v4 1/3] Add support for structured output formatters.\r
41 Message-ID: <20120712220814.GJ7332@mit.edu>\r
42 References: <87d34hsdx8.fsf@awakening.csail.mit.edu>\r
43         <1342079004-5300-1-git-send-email-craven@gmx.net>\r
44         <1342079004-5300-2-git-send-email-craven@gmx.net>\r
45 MIME-Version: 1.0\r
46 Content-Type: text/plain; charset=us-ascii\r
47 Content-Disposition: inline\r
48 In-Reply-To: <1342079004-5300-2-git-send-email-craven@gmx.net>\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42IRYrdT0T3v9d/fYPk6C4u9De2MFtdvzmR2\r
52         YPJYvGk/m8ezVbeYA5iiuGxSUnMyy1KL9O0SuDIebrjLVHBXpqLpwRzWBsZtYl2MnBwSAiYS\r
53         j491sEDYYhIX7q1n62Lk4hAS2McoceXcGlYIZwOjxLmvexghnJNMEk/bjzFDOEsYJZY3T2cE\r
54         6WcRUJVY8X4DG4jNJqAhsW3/crC4iICQxKQvr8B2MAtIS3z73cwEYgsLeEqcOt0KFucV0JbY\r
55         vXgJC8TQOYwSEzsfsUIkBCVOznwC1awlcePfS6BmDrBBy/9xgIQ5BewkTk3/D7ZLVEBFYsrJ\r
56         bWwTGIVmIemehaR7FkL3AkbmVYyyKblVurmJmTnFqcm6xcmJeXmpRbqmermZJXqpKaWbGMGh\r
57         7aK0g/HnQaVDjAIcjEo8vDvX/fUXYk0sK67MPcQoycGkJMpr7frfX4gvKT+lMiOxOCO+qDQn\r
58         tfgQowQHs5II7zp7oBxvSmJlVWpRPkxKmoNFSZz3WspNfyGB9MSS1OzU1ILUIpisDAeHkgTv\r
59         Fk+gRsGi1PTUirTMnBKENBMHJ8hwHqDhs0BqeIsLEnOLM9Mh8qcYFaXEeW+CJARAEhmleXC9\r
60         sNTzilEc6BVh3jsgVTzAtAXX/QpoMBPI4J//QAaXJCKkpBoYUw7cWa4gn3aZI7Ex6syqaVsU\r
61         php4lZYde5kuGenatdz0sYyQpVmQzqy22TM+ZbZFnjeI3r94Ddu9tef+f2C2n3Dr5+sf9RdN\r
62         bxS969q5/9qOWp8oGy3pFUzlsR+/hJ+4wrcyp0TjzPZL/NMEP0ce3xt4UOH+I5fQloIy3tRJ\r
63         1rZrGmfoudfVKLEUZyQaajEXFScCAItFvqMYAwAA\r
64 Cc: notmuch@notmuchmail.org\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Thu, 12 Jul 2012 22:08:17 -0000\r
78 \r
79 Quoth craven@gmx.net on Jul 12 at  9:43 am:\r
80 > This patch adds a new type sprinter_t, which is used for structured\r
81 > formatting, e.g. JSON or S-Expressions. The structure printer is the\r
82 > code from Austin Clements (id:87d34hsdx8.fsf@awakening.csail.mit.edu).\r
83\r
84 > The structure printer contains the following function pointers:\r
85\r
86 > /* start a new map/dictionary structure.\r
87 >  */\r
88 > void (*begin_map) (struct sprinter *);\r
89\r
90 > /* start a new list/array structure\r
91 >  */\r
92 > void (*begin_list) (struct sprinter *);\r
93\r
94 > /* end the last opened list or map structure\r
95 >  */\r
96 > void (*end) (struct sprinter *);\r
97\r
98 > /* print one string/integer/boolean/null element (possibly inside a\r
99 >  * list or map\r
100 >  */\r
101 > void (*string) (struct sprinter *, const char *);\r
102 > void (*integer) (struct sprinter *, int);\r
103 > void (*boolean) (struct sprinter *, notmuch_bool_t);\r
104 > void (*null) (struct sprinter *);\r
105\r
106 > /* print the key of a map's key/value pair.\r
107 >  */\r
108 > void (*map_key) (struct sprinter *, const char *);\r
109\r
110 > /* print a frame delimiter (such as a newline or extra whitespace)\r
111 >  */\r
112 > void (*frame) (struct sprinter *);\r
113\r
114 > The printer can (and should) use internal state to insert delimiters and\r
115 > syntax at the correct places.\r
116\r
117 > Example:\r
118\r
119 > format->begin_map(format);\r
120 > format->map_key(format, "foo");\r
121 > format->begin_list(format);\r
122 > format->integer(format, 1);\r
123 > format->integer(format, 2);\r
124 > format->integer(format, 3);\r
125 > format->end(format);\r
126 > format->map_key(format, "bar");\r
127 > format->begin_map(format);\r
128 > format->map_key(format, "baaz");\r
129 > format->string(format, "hello world");\r
130 > format->end(format);\r
131 > format->end(format);\r
132\r
133 > would output JSON as follows:\r
134\r
135 > {"foo": [1, 2, 3], "bar": { "baaz": "hello world"}}\r
136 > ---\r
137 >  sprinter.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++\r
138 >  1 file changed, 49 insertions(+)\r
139 >  create mode 100644 sprinter.h\r
140\r
141 > diff --git a/sprinter.h b/sprinter.h\r
142 > new file mode 100644\r
143 > index 0000000..1dad9a0\r
144 > --- /dev/null\r
145 > +++ b/sprinter.h\r
146 > @@ -0,0 +1,49 @@\r
147 > +#ifndef NOTMUCH_SPRINTER_H\r
148 > +#define NOTMUCH_SPRINTER_H\r
149 > +\r
150 > +/* for notmuch_bool_t */\r
151 > +#include "notmuch-client.h"\r
152 > +\r
153 > +/* Structure printer interface */\r
154 > +typedef struct sprinter\r
155 > +{\r
156 > +    /* start a new map/dictionary structure.\r
157 > +     */\r
158 > +    void (*begin_map) (struct sprinter *);\r
159 > +\r
160 > +    /* start a new list/array structure\r
161 > +     */\r
162 > +    void (*begin_list) (struct sprinter *);\r
163 > +\r
164 > +    /* end the last opened list or map structure\r
165 > +     */\r
166 > +    void (*end) (struct sprinter *);\r
167 > +\r
168 > +    /* print one string/integer/boolean/null element (possibly inside a\r
169 > +     * list or map\r
170 > +     */\r
171 > +    void (*string) (struct sprinter *, const char *);\r
172 \r
173 Oh, also, the documentation for string should mention the string\r
174 argument should be UTF-8 encoded.\r
175 \r
176 > +    void (*integer) (struct sprinter *, int);\r
177 > +    void (*boolean) (struct sprinter *, notmuch_bool_t);\r
178 > +    void (*null) (struct sprinter *);\r
179 > +\r
180 > +    /* print the key of a map's key/value pair.\r
181 > +     */\r
182 > +    void (*map_key) (struct sprinter *, const char *);\r
183 > +\r
184 > +    /* print a frame delimiter (such as a newline or extra whitespace)\r
185 > +     */\r
186 > +    void (*frame) (struct sprinter *);\r
187 > +} sprinter_t;\r
188 > +\r
189 > +/* Create a new structure printer that emits JSON */\r
190 > +struct sprinter *\r
191 > +sprinter_json_new(const void *ctx, FILE *stream);\r
192 > +\r
193 > +/* A dummy structure printer that signifies that standard text output is\r
194 > + * to be used instead of any structured format.\r
195 > + */\r
196 > +struct sprinter *\r
197 > +sprinter_text;\r
198 > +\r
199 > +#endif // NOTMUCH_SPRINTER_H\r