1 Return-Path: <bremner@tesseract.cs.unb.ca>
\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 8416C429E26
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Mar 2015 10:05:14 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5
\r
12 tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id mfCIvlBhkBo8 for <notmuch@notmuchmail.org>;
\r
16 Sat, 14 Mar 2015 10:05:13 -0700 (PDT)
\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net
\r
19 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 895D8429E2E
\r
22 for <notmuch@notmuchmail.org>; Sat, 14 Mar 2015 10:05:12 -0700 (PDT)
\r
23 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim
\r
24 4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
25 id 1YWpUC-00028e-Cn; Sat, 14 Mar 2015 17:04:28 +0000
\r
26 Received: (nullmailer pid 4989 invoked by uid 1000); Sat, 14 Mar 2015
\r
28 From: David Bremner <david@tethera.net>
\r
29 To: notmuch@notmuchmail.org
\r
30 Subject: [Patch v4 5/9] lib/database: add field for last error string
\r
31 Date: Sat, 14 Mar 2015 18:02:30 +0100
\r
32 Message-Id: <1426352554-4383-6-git-send-email-david@tethera.net>
\r
33 X-Mailer: git-send-email 2.1.4
\r
34 In-Reply-To: <1426352554-4383-1-git-send-email-david@tethera.net>
\r
35 References: <1426352554-4383-1-git-send-email-david@tethera.net>
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.13
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Sat, 14 Mar 2015 17:05:14 -0000
\r
50 The idea is to have a logging function setting this string instead of
\r
53 lib/database-private.h | 4 ++++
\r
54 lib/database.cc | 7 +++++++
\r
55 lib/notmuch.h | 7 +++++++
\r
56 3 files changed, 18 insertions(+)
\r
58 diff --git a/lib/database-private.h b/lib/database-private.h
\r
59 index 6d6fa2c..24243db 100644
\r
60 --- a/lib/database-private.h
\r
61 +++ b/lib/database-private.h
\r
62 @@ -154,6 +154,10 @@ struct _notmuch_database {
\r
63 unsigned int last_doc_id;
\r
64 uint64_t last_thread_id;
\r
66 + /* error reporting; this value persists only until the
\r
67 + * next library call. May be NULL */
\r
68 + char *status_string;
\r
70 Xapian::QueryParser *query_parser;
\r
71 Xapian::TermGenerator *term_gen;
\r
72 Xapian::ValueRangeProcessor *value_range_processor;
\r
73 diff --git a/lib/database.cc b/lib/database.cc
\r
74 index b774edc..48a830f 100644
\r
75 --- a/lib/database.cc
\r
76 +++ b/lib/database.cc
\r
77 @@ -873,6 +873,7 @@ notmuch_database_open_verbose (const char *path,
\r
79 notmuch = talloc_zero (NULL, notmuch_database_t);
\r
80 notmuch->exception_reported = FALSE;
\r
81 + notmuch->status_string = NULL;
\r
82 notmuch->path = talloc_strdup (notmuch, path);
\r
84 if (notmuch->path[strlen (notmuch->path) - 1] == '/')
\r
85 @@ -2558,3 +2559,9 @@ notmuch_database_get_all_tags (notmuch_database_t *db)
\r
91 +notmuch_database_status_string (notmuch_database_t *notmuch)
\r
93 + return notmuch->status_string;
\r
95 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
96 index c671d82..20c4e01 100644
\r
99 @@ -302,6 +302,13 @@ notmuch_database_open_verbose (const char *path,
\r
100 char **error_message);
\r
103 + * Retrieve last status string for given database.
\r
107 +notmuch_database_status_string (notmuch_database_t *notmuch);
\r
110 * Commit changes and close the given notmuch database.
\r
112 * After notmuch_database_close has been called, calls to other
\r