Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / e6 / 0a06c703354815d29a5243c7f03714603d40d2
1 Return-Path: <jani@nikula.org>\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 AC135431FBC\r
6         for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 11:57:35 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[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 y0CgQFvXVhNG for <notmuch@notmuchmail.org>;\r
17         Mon,  6 Feb 2012 11:57:31 -0800 (PST)\r
18 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
19         [209.85.215.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 C8B54431FAF\r
22         for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 11:57:30 -0800 (PST)\r
23 Received: by mail-lpp01m010-f53.google.com with SMTP id d3so3838995lah.26\r
24         for <notmuch@notmuchmail.org>; Mon, 06 Feb 2012 11:57:30 -0800 (PST)\r
25 Received: by 10.112.49.201 with SMTP id w9mr5234450lbn.23.1328558250377;\r
26         Mon, 06 Feb 2012 11:57:30 -0800 (PST)\r
27 Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
28         [84.248.80.253])\r
29         by mx.google.com with ESMTPS id i9sm13798872lbz.3.2012.02.06.11.57.28\r
30         (version=SSLv3 cipher=OTHER); Mon, 06 Feb 2012 11:57:29 -0800 (PST)\r
31 From: Jani Nikula <jani@nikula.org>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH v2 1/3] cli: use notmuch_bool_t for boolean fields in\r
34         notmuch_show_params_t\r
35 Date: Mon,  6 Feb 2012 21:57:21 +0200\r
36 Message-Id:\r
37  <dbebd4d256941d7e56e7c53582ed284d65365ace.1328558175.git.jani@nikula.org>\r
38 X-Mailer: git-send-email 1.7.5.4\r
39 In-Reply-To: <cover.1328558175.git.jani@nikula.org>\r
40 References:\r
41  <df2e9bd7682e9c81e1b205cc1d92a1526cdd1a9b.1328308635.git.jani@nikula.org>\r
42         <cover.1328558175.git.jani@nikula.org>\r
43 In-Reply-To: <cover.1328558175.git.jani@nikula.org>\r
44 References: <cover.1328558175.git.jani@nikula.org>\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Mon, 06 Feb 2012 19:57:36 -0000\r
58 \r
59 Use notmuch_bool_t instead of int for entire_thread, raw, and decrypt\r
60 boolean fields in notmuch_show_params_t. No functional changes.\r
61 \r
62 Signed-off-by: Jani Nikula <jani@nikula.org>\r
63 ---\r
64  notmuch-client.h |    6 +++---\r
65  notmuch-reply.c  |    7 +++----\r
66  notmuch-show.c   |   14 +++++++-------\r
67  3 files changed, 13 insertions(+), 14 deletions(-)\r
68 \r
69 diff --git a/notmuch-client.h b/notmuch-client.h\r
70 index e0eb594..60828aa 100644\r
71 --- a/notmuch-client.h\r
72 +++ b/notmuch-client.h\r
73 @@ -98,15 +98,15 @@ typedef struct notmuch_show_format {\r
74  } notmuch_show_format_t;\r
75  \r
76  typedef struct notmuch_show_params {\r
77 -    int entire_thread;\r
78 -    int raw;\r
79 +    notmuch_bool_t entire_thread;\r
80 +    notmuch_bool_t raw;\r
81      int part;\r
82  #ifdef GMIME_ATLEAST_26\r
83      GMimeCryptoContext* cryptoctx;\r
84  #else\r
85      GMimeCipherContext* cryptoctx;\r
86  #endif\r
87 -    int decrypt;\r
88 +    notmuch_bool_t decrypt;\r
89  } notmuch_show_params_t;\r
90  \r
91  /* There's no point in continuing when we've detected that we've done\r
92 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
93 index f55b1d2..6b244e6 100644\r
94 --- a/notmuch-reply.c\r
95 +++ b/notmuch-reply.c\r
96 @@ -661,7 +661,6 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])\r
97      notmuch_show_params_t params = { .part = -1 };\r
98      int format = FORMAT_DEFAULT;\r
99      int reply_all = TRUE;\r
100 -    notmuch_bool_t decrypt = FALSE;\r
101  \r
102      notmuch_opt_desc_t options[] = {\r
103         { NOTMUCH_OPT_KEYWORD, &format, "format", 'f',\r
104 @@ -672,7 +671,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])\r
105           (notmuch_keyword_t []){ { "all", TRUE },\r
106                                   { "sender", FALSE },\r
107                                   { 0, 0 } } },\r
108 -       { NOTMUCH_OPT_BOOLEAN, &decrypt, "decrypt", 'd', 0 },\r
109 +       { NOTMUCH_OPT_BOOLEAN, &params.decrypt, "decrypt", 'd', 0 },\r
110         { 0, 0, 0, 0, 0 }\r
111      };\r
112  \r
113 @@ -687,7 +686,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])\r
114      else\r
115         reply_format_func = notmuch_reply_format_default;\r
116  \r
117 -    if (decrypt) {\r
118 +    if (params.decrypt) {\r
119  #ifdef GMIME_ATLEAST_26\r
120         /* TODO: GMimePasswordRequestFunc */\r
121         params.cryptoctx = g_mime_gpg_context_new (NULL, "gpg");\r
122 @@ -697,8 +696,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])\r
123  #endif\r
124         if (params.cryptoctx) {\r
125             g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) params.cryptoctx, FALSE);\r
126 -           params.decrypt = TRUE;\r
127         } else {\r
128 +           params.decrypt = FALSE;\r
129             fprintf (stderr, "Failed to construct gpg context.\n");\r
130         }\r
131  #ifndef GMIME_ATLEAST_26\r
132 diff --git a/notmuch-show.c b/notmuch-show.c\r
133 index dec799c..e04b3cc 100644\r
134 --- a/notmuch-show.c\r
135 +++ b/notmuch-show.c\r
136 @@ -1063,11 +1063,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
137      int format_specified = 0;\r
138      int i;\r
139  \r
140 -    params.entire_thread = 0;\r
141 -    params.raw = 0;\r
142 +    params.entire_thread = FALSE;\r
143 +    params.raw = FALSE;\r
144      params.part = -1;\r
145      params.cryptoctx = NULL;\r
146 -    params.decrypt = 0;\r
147 +    params.decrypt = FALSE;\r
148  \r
149      argc--; argv++; /* skip subcommand argument */\r
150  \r
151 @@ -1082,13 +1082,13 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
152                 format = &format_text;\r
153             } else if (strcmp (opt, "json") == 0) {\r
154                 format = &format_json;\r
155 -               params.entire_thread = 1;\r
156 +               params.entire_thread = TRUE;\r
157             } else if (strcmp (opt, "mbox") == 0) {\r
158                 format = &format_mbox;\r
159                 mbox = 1;\r
160             } else if (strcmp (opt, "raw") == 0) {\r
161                 format = &format_raw;\r
162 -               params.raw = 1;\r
163 +               params.raw = TRUE;\r
164             } else {\r
165                 fprintf (stderr, "Invalid value for --format: %s\n", opt);\r
166                 return 1;\r
167 @@ -1097,7 +1097,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
168         } else if (STRNCMP_LITERAL (argv[i], "--part=") == 0) {\r
169             params.part = atoi(argv[i] + sizeof ("--part=") - 1);\r
170         } else if (STRNCMP_LITERAL (argv[i], "--entire-thread") == 0) {\r
171 -           params.entire_thread = 1;\r
172 +           params.entire_thread = TRUE;\r
173         } else if ((STRNCMP_LITERAL (argv[i], "--verify") == 0) ||\r
174                    (STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {\r
175             if (params.cryptoctx == NULL) {\r
176 @@ -1117,7 +1117,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
177  #endif\r
178             }\r
179             if (STRNCMP_LITERAL (argv[i], "--decrypt") == 0)\r
180 -               params.decrypt = 1;\r
181 +               params.decrypt = TRUE;\r
182         } else {\r
183             fprintf (stderr, "Unrecognized option: %s\n", argv[i]);\r
184             return 1;\r
185 -- \r
186 1.7.5.4\r
187 \r