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 951E9429E29
\r
6 for <notmuch@notmuchmail.org>; Tue, 6 Mar 2012 10:48:56 -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 uOy6m6sqRnGl for <notmuch@notmuchmail.org>;
\r
16 Tue, 6 Mar 2012 10:48:55 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 4DAC0431FD4
\r
20 for <notmuch@notmuchmail.org>; Tue, 6 Mar 2012 10:48:52 -0800 (PST)
\r
21 X-AuditID: 1209190e-b7f7c6d0000008c3-54-4f565c13afc6
\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
23 by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 06.70.02243.31C565F4; Tue, 6 Mar 2012 13:48:51 -0500 (EST)
\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 q26ImpUK023814;
\r
27 Tue, 6 Mar 2012 13:48:51 -0500
\r
28 Received: from drake.mit.edu (firewall.royalsociety.org [193.63.75.2])
\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 q26Immga016465
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 6 Mar 2012 13:48:50 -0500 (EST)
\r
34 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amthrax@drake.mit.edu>)
\r
36 id 1S4zRI-0003pS-A7; Tue, 06 Mar 2012 18:48:48 +0000
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v2 5/8] show: Convert mbox format to new self-recursive style
\r
40 Date: Tue, 6 Mar 2012 18:48:41 +0000
\r
41 Message-Id: <1331059724-14653-6-git-send-email-amdragon@mit.edu>
\r
42 X-Mailer: git-send-email 1.7.7.3
\r
43 In-Reply-To: <1331059724-14653-1-git-send-email-amdragon@mit.edu>
\r
44 References: <1330752025-2542-1-git-send-email-amdragon@mit.edu>
\r
45 <1331059724-14653-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsUixG6noiscE+Zv8G27pcWefV4W12/OZHZg
\r
48 8rh7msvj2apbzAFMUVw2Kak5mWWpRfp2CVwZB3+8Yy/oEK54//4ZSwPjd94uRk4OCQETidae
\r
49 /2wQtpjEhXvrgWwuDiGBfYwSf+/NYYZw1jNKzNg/gQnCOcgkMfXtdhaQFiGB+YwSvy6Jgths
\r
50 AhoS2/YvZwSxRQSkJXbenc3axcjBwSzgJNHW5gUSFhbwlWhrfQBWwiKgKrH/3j2wMbwCDhLb
\r
51 Ds6CukJB4tzqc+wgNqeAo8Sep5sYIVaVSVy6eYFlAiP/AkaGVYyyKblVurmJmTnFqcm6xcmJ
\r
52 eXmpRbrGermZJXqpKaWbGEFBxCnJt4Px60GlQ4wCHIxKPLwX9cP8hVgTy4orcw8xSnIwKYny
\r
53 5kQBhfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwfnsf6i/Em5JYWZValA+TkuZgURLnVdN65yck
\r
54 kJ5YkpqdmlqQWgSTleHgUJLgzYgGGipYlJqeWpGWmVOCkGbi4AQZzgM03Aikhre4IDG3ODMd
\r
55 In+KUVFKnNcPJCEAksgozYPrhUX5K0ZxoFeEeR1BqniACQKu+xXQYCagwW3KwSCDSxIRUlIN
\r
56 jPVX/qbp1yhu0BfpmnrhQEvP71VWLf/+f5BgyXLf6/lV13jv58wJj2ec19F+zrub6/M326rM
\r
57 AyLMm4y2C8z79aAhoMt3bZX9r9n+vRWhjIdYT1XVG1VNbOEsdv7hUVW4ck/b517XlidmRsuf
\r
58 6/OxR8hLpLJkNVjG//9ooeuUFsF96uW9MJlXSizFGYmGWsxFxYkAKEq4os0CAAA=
\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: Tue, 06 Mar 2012 18:48:57 -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