1 Return-Path: <amthrax@drake.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 289C3431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 2 Mar 2012 21:20:34 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 9myX7vb4oA1y for <notmuch@notmuchmail.org>;
\r
16 Fri, 2 Mar 2012 21:20:32 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 201DA431FBF
\r
20 for <notmuch@notmuchmail.org>; Fri, 2 Mar 2012 21:20:32 -0800 (PST)
\r
21 X-AuditID: 1209190f-b7f8a6d000000914-03-4f51aa1ff30f
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 08.CF.02324.F1AA15F4; Sat, 3 Mar 2012 00:20:31 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q235KV6t017469;
\r
27 Sat, 3 Mar 2012 00:20:31 -0500
\r
28 Received: from drake.mit.edu
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q235KUhH022247
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Sat, 3 Mar 2012 00:20:31 -0500 (EST)
\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
36 (envelope-from <amthrax@drake.mit.edu>)
\r
37 id 1S3hOQ-0000h1-7Z; Sat, 03 Mar 2012 00:20:30 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 3/5] show: Convert mbox format to new self-recursive style
\r
41 Date: Sat, 3 Mar 2012 00:20:23 -0500
\r
42 Message-Id: <1330752025-2542-4-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.7.3
\r
44 In-Reply-To: <1330752025-2542-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1330752025-2542-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6nriu/KtDfYGmvtsX1mzOZHRg9nq26
\r
48 xRzAGMVlk5Kak1mWWqRvl8CVcfDHO/aCDuGK9++fsTQwfuftYuTkkBAwkZjb2skEYYtJXLi3
\r
49 nq2LkYtDSGAfo8Su+xvZQRJCAusZJU7vkodI3GOSuD/1HiOEM59R4seadkaQKjYBDYlt+5eD
\r
50 2SIC0hI7785m7WLk4GAWUJP406UCEhYW8JKYPuc8M4jNIqAqMf3wLiaQEl4Be4kDzxghjlCQ
\r
51 OLf6HNheTgEHiZbjx1ghbrCX+NHfyTKBkX8BI8MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXRO9
\r
52 3MwSvdSU0k2MoJDhlOTfwfjtoNIhRgEORiUe3ssvA/yFWBPLiitzDzFKcjApifKWLw/0F+JL
\r
53 yk+pzEgszogvKs1JLT7EKMHBrCTCu8wTKMebklhZlVqUD5OS5mBREudV03rnJySQnliSmp2a
\r
54 WpBaBJOV4eBQkuCNWgnUKFiUmp5akZaZU4KQZuLgBBnOAzTcA6SGt7ggMbc4Mx0if4pRUUqc
\r
55 VwskIQCSyCjNg+uFxfQrRnGgV4R5A0CqeIDpAK77FdBgJqDBiy/7gQwuSURISTUwTtgsI/rV
\r
56 btsNG9XHt4qCGsJCCw/Pnjw11TeYMSY8I/+dWG7+K7U37zl/+JV3l3/vb/p8cI0ER2Abezv3
\r
57 E/dFXxpOPfLf73Bzlkd35u8Q06aJ/wNvtKV86N9utio28O4ql9vfjrE8ehKkoTjtYMG9JbL9
\r
58 4tWby5+JaLU7hS9WVKj1sToQsvCFEktxRqKhFnNRcSIATQ3538QCAAA=
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Sat, 03 Mar 2012 05:20:34 -0000
\r
73 Given the lack of recursion, this is pretty easy.
\r
75 notmuch-show.c | 40 ++++++++++++++++++----------------------
\r
76 1 files changed, 18 insertions(+), 22 deletions(-)
\r
78 diff --git a/notmuch-show.c b/notmuch-show.c
\r
79 index b3a4550..72c141e 100644
\r
80 --- a/notmuch-show.c
\r
81 +++ b/notmuch-show.c
\r
82 @@ -45,25 +45,15 @@ static const notmuch_show_format_t format_json = {
\r
83 .message_set_end = "]"
\r
87 -format_message_mbox (const void *ctx,
\r
88 - notmuch_message_t *message,
\r
89 - unused (int indent));
\r
90 +static notmuch_status_t
\r
91 +format_part_mbox (const void *ctx, mime_node_t *node,
\r
92 + int indent, const notmuch_show_params_t *params);
\r
94 static const notmuch_show_format_t format_mbox = {
\r
96 - "", format_message_mbox,
\r
97 - "", NULL, NULL, "",
\r
108 + .message_set_start = "",
\r
109 + .part = format_part_mbox,
\r
110 + .message_set_sep = "",
\r
111 + .message_set_end = ""
\r
115 @@ -717,11 +707,12 @@ format_part_json_entry (const void *ctx, mime_node_t *node, unused (int indent),
\r
117 * http://qmail.org/qmail-manual-html/man5/mbox.html
\r
120 -format_message_mbox (const void *ctx,
\r
121 - notmuch_message_t *message,
\r
122 - unused (int indent))
\r
123 +static notmuch_status_t
\r
124 +format_part_mbox (const void *ctx, mime_node_t *node, unused (int indent),
\r
125 + unused (const notmuch_show_params_t *params))
\r
127 + notmuch_message_t *message = node->envelope_file;
\r
129 const char *filename;
\r
132 @@ -734,12 +725,15 @@ format_message_mbox (const void *ctx,
\r
137 + INTERNAL_ERROR ("format_part_mbox requires a root part");
\r
139 filename = notmuch_message_get_filename (message);
\r
140 file = fopen (filename, "r");
\r
141 if (file == NULL) {
\r
142 fprintf (stderr, "Failed to open %s: %s\n",
\r
143 filename, strerror (errno));
\r
145 + return NOTMUCH_STATUS_FILE_ERROR;
\r
148 from = notmuch_message_get_header (message, "from");
\r
149 @@ -760,6 +754,8 @@ format_message_mbox (const void *ctx,
\r
154 + return NOTMUCH_STATUS_SUCCESS;
\r
157 static notmuch_status_t
\r