Re: [PATCH] lib: update documentation for notmuch_database_get_directory
[notmuch-archives.git] / bc / a9e286cb2fd5c45b070dd3c36862f9325d6216
1 Return-Path: <dmitry.kurochkin@gmail.com>\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 DBEDE431FD0\r
6         for <notmuch@notmuchmail.org>; Fri,  9 Dec 2011 11:05:59 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 5twdQCPY93rg for <notmuch@notmuchmail.org>;\r
17         Fri,  9 Dec 2011 11:05:59 -0800 (PST)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 3004F431FB6\r
22         for <notmuch@notmuchmail.org>; Fri,  9 Dec 2011 11:05:59 -0800 (PST)\r
23 Received: by bkat8 with SMTP id t8so3503471bka.26\r
24         for <notmuch@notmuchmail.org>; Fri, 09 Dec 2011 11:05:57 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=ZBBxHMds7DmNU1+Aon40Lqr+y3JMPJ4vKYUM0Lz3OlI=;\r
29         b=KRPGBhix5qnW7d8rwy+I2bqrCBTN8wxWxxJEx8OYShrsFqa4Rij73hwNI04p8zChU2\r
30         O7mhWJN2tyRCgd1xq9ZJV7JZwnU5/nIVjsQpdXgJXCV5O2xH/bM/+mkHr/MziTayr5+L\r
31         cVRdhEkZu9etGFuHZdJFGgcAe8aRMsXM4lVAQ=\r
32 Received: by 10.204.148.76 with SMTP id o12mr4629961bkv.114.1323457557733;\r
33         Fri, 09 Dec 2011 11:05:57 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id zv9sm12029944bkb.0.2011.12.09.11.05.55\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Fri, 09 Dec 2011 11:05:56 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
40 Subject: Re: [PATCH 1/4] show: Pass notmuch_message_t instead of path to\r
41         show_message_body.\r
42 In-Reply-To: <1323027100-10307-2-git-send-email-amdragon@mit.edu>\r
43 References: <1322446871-14986-1-git-send-email-amdragon@mit.edu>\r
44         <1323027100-10307-1-git-send-email-amdragon@mit.edu>\r
45         <1323027100-10307-2-git-send-email-amdragon@mit.edu>\r
46 User-Agent: Notmuch/0.10.2+82~g96a629c (http://notmuchmail.org) Emacs/23.3.1\r
47         (x86_64-pc-linux-gnu)\r
48 Date: Fri, 09 Dec 2011 23:05:23 +0400\r
49 Message-ID: <87ty597eh8.fsf@gmail.com>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=us-ascii\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Fri, 09 Dec 2011 19:06:00 -0000\r
65 \r
66 On Sun,  4 Dec 2011 14:31:37 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
67 > In addition to simplifying the code, we'll need the notmuch_message_t*\r
68 > in show_message_body shortly.\r
69 > ---\r
70 >  notmuch-client.h |    2 +-\r
71 >  notmuch-reply.c  |    3 +--\r
72 >  notmuch-show.c   |    3 +--\r
73 >  show-message.c   |    3 ++-\r
74 >  4 files changed, 5 insertions(+), 6 deletions(-)\r
75\r
76 > diff --git a/notmuch-client.h b/notmuch-client.h\r
77 > index b50cb38..d7fb6ee 100644\r
78 > --- a/notmuch-client.h\r
79 > +++ b/notmuch-client.h\r
80 > @@ -162,7 +162,7 @@ char *\r
81 >  query_string_from_args (void *ctx, int argc, char *argv[]);\r
82 >  \r
83 >  notmuch_status_t\r
84 > -show_message_body (const char *filename,\r
85 > +show_message_body (notmuch_message_t *message,\r
86 >                  const notmuch_show_format_t *format,\r
87 >                  notmuch_show_params_t *params);\r
88 >  \r
89 > diff --git a/notmuch-reply.c b/notmuch-reply.c\r
90 > index 7ac879f..f8d5f64 100644\r
91 > --- a/notmuch-reply.c\r
92 > +++ b/notmuch-reply.c\r
93 > @@ -546,8 +546,7 @@ notmuch_reply_format_default(void *ctx,\r
94 >               notmuch_message_get_header (message, "date"),\r
95 >               notmuch_message_get_header (message, "from"));\r
96 >  \r
97 > -     show_message_body (notmuch_message_get_filename (message),\r
98 > -                        format, params);\r
99 > +     show_message_body (message, format, params);\r
100 >  \r
101 >       notmuch_message_destroy (message);\r
102 >      }\r
103 > diff --git a/notmuch-show.c b/notmuch-show.c\r
104 > index 603992a..1dee3aa 100644\r
105 > --- a/notmuch-show.c\r
106 > +++ b/notmuch-show.c\r
107 > @@ -753,8 +753,7 @@ show_message (void *ctx,\r
108 >      }\r
109 >  \r
110 >      if (format->part_content)\r
111 > -     show_message_body (notmuch_message_get_filename (message),\r
112 > -                        format, params);\r
113 > +     show_message_body (message, format, params);\r
114 >  \r
115 >      if (params->part <= 0) {\r
116 >       fputs (format->body_end, stdout);\r
117 > diff --git a/show-message.c b/show-message.c\r
118 > index d83f04e..09fa607 100644\r
119 > --- a/show-message.c\r
120 > +++ b/show-message.c\r
121 > @@ -175,7 +175,7 @@ show_message_part (GMimeObject *part,\r
122 >  }\r
123 >  \r
124 >  notmuch_status_t\r
125 > -show_message_body (const char *filename,\r
126 > +show_message_body (notmuch_message_t *message,\r
127 >                  const notmuch_show_format_t *format,\r
128 >                  notmuch_show_params_t *params)\r
129 \r
130 Is show_message_body() (or functions that it calls/would call) supposed\r
131 to modify the message structure?  If not, we should make it const.\r
132 \r
133 I would also make all pointers constant (i.e. const notmuch_message_t\r
134 *const message), but I can not insist since it is not common in notmuch.\r
135 \r
136 Regards,\r
137   Dmitry\r
138 \r
139 >  {\r
140 > @@ -183,6 +183,7 @@ show_message_body (const char *filename,\r
141 >      GMimeParser *parser = NULL;\r
142 >      GMimeMessage *mime_message = NULL;\r
143 >      notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;\r
144 > +    const char *filename = notmuch_message_get_filename (message);\r
145 >      FILE *file = NULL;\r
146 >      show_message_state_t state;\r
147 >  \r
148 > -- \r
149 > 1.7.5.4\r
150\r