Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 50AB5429E29 for ; Sun, 27 Nov 2011 18:21:28 -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 gEzaVNEAKSUY for ; Sun, 27 Nov 2011 18:21:26 -0800 (PST) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id 9960C429E30 for ; Sun, 27 Nov 2011 18:21:24 -0800 (PST) X-AuditID: 1209190f-b7f6e6d0000008df-fb-4ed2f0242a9e Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id CE.F5.02271.420F2DE4; Sun, 27 Nov 2011 21:21:24 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id pAS2LOpk020210; Sun, 27 Nov 2011 21:21:24 -0500 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pAS2LMCV020640 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 27 Nov 2011 21:21:23 -0500 (EST) Received: from amthrax by drake.mit.edu with local (Exim 4.76) (envelope-from ) id 1RUqqQ-0003vI-H0; Sun, 27 Nov 2011 21:21:22 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 1/4] show: Pass notmuch_message_t instead of path to show_message_body. Date: Sun, 27 Nov 2011 21:21:08 -0500 Message-Id: <1322446871-14986-2-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322446871-14986-1-git-send-email-amdragon@mit.edu> References: <1322446871-14986-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsUixCmqravy4ZKfwZoOPovW7s9MFle39rNb 7NnnZXH95kxmBxaPs93trB53T3N57Jx1l93j2apbzAEsUVw2Kak5mWWpRfp2CVwZZ75+Yypo E6pYs3ElYwPjVb4uRk4OCQETiXOtf1ggbDGJC/fWs3UxcnEICexjlGh7fpoJwtnAKLGms5kF wrnPJLH45XNGCGc+o8SchsmsIP1sAhoS2/YvZwSxRQSkJXbenQ0WZxaok+jceIa9i5GDQ1gg XOLeGx+QMIuAqsSree1gq3kFHCSeb1rFCnGGgsSvIxA2p4CjxNymLcwgthBQzbplR1knMPIv YGRYxSibklulm5uYmVOcmqxbnJyYl5dapGuil5tZopeaUrqJERxukvw7GL8dVDrEKMDBqMTD u/HyJT8h1sSy4srcQ4ySHExKorwv3gGF+JLyUyozEosz4otKc1KLDzFKcDArifD2HAXK8aYk VlalFuXDpKQ5WJTEeRt3OPgJCaQnlqRmp6YWpBbBZGU4OJQkeJPeAzUKFqWmp1akZeaUIKSZ ODhBhvMADRcBqeEtLkjMLc5Mh8ifYlSUEufVAUkIgCQySvPgemHp4BWjONArwrySIFU8wFQC 1/0KaDAT0GCOmRdABpckIqSkGhjT3t148bRj4eGAO7cnF53iYNry0j6WOW9HvlTjXfUXexgm VqVryB/pnHH7U+R2Nb1ZB4R1VW/4fylO3BC1q+97QZ5NfYKKm8CB9D3+sbO0NedvO7zvxuEZ Mz2ERWM98y+ncG4I/qkdckXbWjP6Qq/7Zp2c1WFxx5dN9D20f/L/muWXLdfPE9VWYinOSDTU Yi4qTgQAHMlZHuICAAA= Cc: dkg@fifthhorseman.net 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: Mon, 28 Nov 2011 02:21:28 -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 b50cb38..d7fb6ee 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 603992a..1dee3aa 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -753,8 +753,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.5.4