From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D6E83429E35 for ; Sat, 24 Dec 2011 15:41:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m3Ht+z5NE5+C for ; Sat, 24 Dec 2011 15:41:48 -0800 (PST) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id BF375429E2E for ; Sat, 24 Dec 2011 15:41:40 -0800 (PST) X-AuditID: 1209190d-b7f576d0000008c4-ca-4ef6633427ea Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 83.24.02244.43366FE4; Sat, 24 Dec 2011 18:41:40 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pBONfdWm022740; Sat, 24 Dec 2011 18:41:39 -0500 Received: from drake.mit.edu (c-76-21-105-205.hsd1.ca.comcast.net [76.21.105.205]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pBONfbBs023829 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 24 Dec 2011 18:41:39 -0500 (EST) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1ReWiA-0007fp-HI; Sat, 24 Dec 2011 13:52:50 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v5 1/4] show: Pass notmuch_message_t instead of path to show_message_body. Date: Sat, 24 Dec 2011 13:52:43 -0500 Message-Id: <1324752766-29315-2-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1324752766-29315-1-git-send-email-amdragon@mit.edu> References: <1324698348-27620-1-git-send-email-amdragon@mit.edu> <1324752766-29315-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixG6nrmuS/M3P4GS7uMX1mzOZHRg9nq26 xRzAGMVlk5Kak1mWWqRvl8CV8ePtUraCNqGKFW/vsTQwXuXrYuTkkBAwkbj25hgrhC0mceHe erYuRi4OIYF9jBI7f/9ihXA2MEp8vbeTHcI5xySxadITKGc+o8TeO3fA+tkENCS27V/OCGKL CEhL7Lw7GyjOwcEsoCbxp0sFJCwsECXRdgJiHYuAqkTXgv9g5bwCDhK/bk9jhDhDQeLc6nPs IDangKPEtZbJbCC2kEC5xM7emSwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7My0st0jXSy80s 0UtNKd3ECAobTkneHYzvDiodYhTgYFTi4W1c+sVPiDWxrLgy9xCjJAeTkijvxLhvfkJ8Sfkp lRmJxRnxRaU5qcWHGCU4mJVEeDWTgMp5UxIrq1KL8mFS0hwsSuK8qlrv/IQE0hNLUrNTUwtS i2CyMhwcShK8J5KAhgoWpaanVqRl5pQgpJk4OEGG8wANXwJSw1tckJhbnJkOkT/FqCglzrsY JCEAksgozYPrhcX1K0ZxoFeEeftAqniAKQGu+xXQYCagwTFGIFcXlyQipKQaGCcGeM4Qd/2l fHJL689tqlfnbKgskDi2pu3avoKM295FQZ3f57ROVrj96MG+VlWPidoP3WxPM035cfbKY+fv J85Wf3OZOO89U+zWG2YXVrzT3cBf51N0vOeesfivByJLbFYcE52zp0B4j1mx/0R9r3fp3kFT svyO7BVbwvzaXKBLeoVax7s1YRVKLMUZiYZazEXFiQAbrCXtxgIAAA== X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2011 23:41:50 -0000 In addition to simplifying the code, we'll need the notmuch_message_t* in show_message_body shortly. --- notmuch-client.h | 2 +- notmuch-reply.c | 3 +-- notmuch-show.c | 3 +-- show-message.c | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index c602e2e..c521efa 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -162,7 +162,7 @@ char * query_string_from_args (void *ctx, int argc, char *argv[]); notmuch_status_t -show_message_body (const char *filename, +show_message_body (notmuch_message_t *message, const notmuch_show_format_t *format, notmuch_show_params_t *params); diff --git a/notmuch-reply.c b/notmuch-reply.c index 7ac879f..f8d5f64 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -546,8 +546,7 @@ notmuch_reply_format_default(void *ctx, notmuch_message_get_header (message, "date"), notmuch_message_get_header (message, "from")); - show_message_body (notmuch_message_get_filename (message), - format, params); + show_message_body (message, format, params); notmuch_message_destroy (message); } diff --git a/notmuch-show.c b/notmuch-show.c index 19fb49f..0200b9c 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -758,8 +758,7 @@ show_message (void *ctx, } if (format->part_content) - show_message_body (notmuch_message_get_filename (message), - format, params); + show_message_body (message, format, params); if (params->part <= 0) { fputs (format->body_end, stdout); diff --git a/show-message.c b/show-message.c index d83f04e..09fa607 100644 --- a/show-message.c +++ b/show-message.c @@ -175,7 +175,7 @@ show_message_part (GMimeObject *part, } notmuch_status_t -show_message_body (const char *filename, +show_message_body (notmuch_message_t *message, const notmuch_show_format_t *format, notmuch_show_params_t *params) { @@ -183,6 +183,7 @@ show_message_body (const char *filename, GMimeParser *parser = NULL; GMimeMessage *mime_message = NULL; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; + const char *filename = notmuch_message_get_filename (message); FILE *file = NULL; show_message_state_t state; -- 1.7.7.3