Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 8f / f7d7c4e709a512492722d5e81a2ac7a1eed896
1 Return-Path: <bremner@tethera.net>\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 arlo.cworth.org (Postfix) with ESMTP id C46E56DE02D7\r
6  for <notmuch@notmuchmail.org>; Tue, 29 Mar 2016 19:10:38 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.021\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.021 tagged_above=-999 required=5\r
12  tests=[AWL=-0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id s4adbW6V0gz7 for <notmuch@notmuchmail.org>;\r
17  Tue, 29 Mar 2016 19:10:31 -0700 (PDT)\r
18 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id 424AA6DE02CA\r
20  for <notmuch@notmuchmail.org>; Tue, 29 Mar 2016 19:10:23 -0700 (PDT)\r
21 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
22  (envelope-from <bremner@tethera.net>)\r
23  id 1al5az-0000AK-7u; Tue, 29 Mar 2016 22:10:57 -0400\r
24 Received: (nullmailer pid 32049 invoked by uid 1000);\r
25  Wed, 30 Mar 2016 02:10:18 -0000\r
26 From: David Bremner <david@tethera.net>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH 1/2] CLI: add print_status_database\r
29 Date: Tue, 29 Mar 2016 23:10:13 -0300\r
30 Message-Id: <1459303814-31988-2-git-send-email-david@tethera.net>\r
31 X-Mailer: git-send-email 2.8.0.rc3\r
32 In-Reply-To: <1459303814-31988-1-git-send-email-david@tethera.net>\r
33 References: <1459303814-31988-1-git-send-email-david@tethera.net>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.20\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38  <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
40  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Wed, 30 Mar 2016 02:10:39 -0000\r
47 \r
48 This could probably be used at quite a few places in the existing code,\r
49 but in the immediate future I plan to use in some new code in\r
50 notmuch-dump\r
51 ---\r
52  notmuch-client.h |  5 +++++\r
53  status.c         | 17 +++++++++++++++++\r
54  2 files changed, 22 insertions(+)\r
55 \r
56 diff --git a/notmuch-client.h b/notmuch-client.h\r
57 index 18e6c60..b3d0b66 100644\r
58 --- a/notmuch-client.h\r
59 +++ b/notmuch-client.h\r
60 @@ -462,6 +462,11 @@ print_status_query (const char *loc,\r
61                     const notmuch_query_t *query,\r
62                     notmuch_status_t status);\r
63  \r
64 +notmuch_status_t\r
65 +print_status_database (const char *loc,\r
66 +                      const notmuch_database_t *database,\r
67 +                      notmuch_status_t status);\r
68 +\r
69  #include "command-line-arguments.h"\r
70  \r
71  extern char *notmuch_requested_db_uuid;\r
72 diff --git a/status.c b/status.c\r
73 index 8fa81cb..45d3fb4 100644\r
74 --- a/status.c\r
75 +++ b/status.c\r
76 @@ -19,3 +19,20 @@ print_status_query (const char *loc,\r
77      }\r
78      return status;\r
79  }\r
80 +\r
81 +notmuch_status_t\r
82 +print_status_database (const char *loc,\r
83 +                   const notmuch_database_t *notmuch,\r
84 +                   notmuch_status_t status)\r
85 +{\r
86 +    if (status) {\r
87 +       const char *msg;\r
88 +\r
89 +       fprintf (stderr, "%s: %s\n", loc,\r
90 +                notmuch_status_to_string (status));\r
91 +       msg = notmuch_database_status_string (notmuch);\r
92 +       if (msg)\r
93 +           fputs (msg, stderr);\r
94 +    }\r
95 +    return status;\r
96 +}\r
97 -- \r
98 2.8.0.rc3\r
99 \r