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 A2E366DE0A94
\r
6 for <notmuch@notmuchmail.org>; Sat, 9 Jan 2016 18:52:09 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.313 tagged_above=-999 required=5 tests=[AWL=0.238,
\r
12 RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id cFOhjkT2s6H3 for <notmuch@notmuchmail.org>;
\r
16 Sat, 9 Jan 2016 18:52:08 -0800 (PST)
\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id E40BA6DE119D
\r
19 for <notmuch@notmuchmail.org>; Sat, 9 Jan 2016 18:51:57 -0800 (PST)
\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)
\r
21 (envelope-from <bremner@tethera.net>)
\r
22 id 1aI66e-0007Dt-5A; Sat, 09 Jan 2016 21:51:48 -0500
\r
23 Received: (nullmailer pid 29646 invoked by uid 1000);
\r
24 Sun, 10 Jan 2016 02:51:47 -0000
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: notmuch@notmuchmail.org
\r
27 Subject: [WIP patch 4/9] lib: add and test function to retrieve current
\r
29 Date: Sat, 9 Jan 2016 22:51:36 -0400
\r
30 Message-Id: <1452394301-29499-5-git-send-email-david@tethera.net>
\r
31 X-Mailer: git-send-email 2.6.4
\r
32 In-Reply-To: <1452394301-29499-1-git-send-email-david@tethera.net>
\r
33 References: <1452394301-29499-1-git-send-email-david@tethera.net>
\r
34 X-BeenThere: notmuch@notmuchmail.org
\r
35 X-Mailman-Version: 2.1.20
\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: Sun, 10 Jan 2016 02:52:09 -0000
\r
49 lib/metadata.cc | 11 +++++++++++
\r
50 lib/notmuch.h | 7 +++++++
\r
51 test/T590-metadata.sh | 2 ++
\r
52 3 files changed, 20 insertions(+)
\r
54 diff --git a/lib/metadata.cc b/lib/metadata.cc
\r
55 index 20805e5..6236992 100644
\r
56 --- a/lib/metadata.cc
\r
57 +++ b/lib/metadata.cc
\r
58 @@ -227,4 +227,15 @@ notmuch_metadata_key (notmuch_metadata_t *metadata)
\r
62 +notmuch_metadata_value (notmuch_metadata_t *metadata)
\r
64 + const char *key = notmuch_metadata_key (metadata);
\r
66 + notmuch_status_t status;
\r
68 + status=notmuch_database_get_metadata (metadata->notmuch, metadata->mclass, key, &val);
\r
74 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
75 index 16d0973..dd359c8 100644
\r
78 @@ -1872,6 +1872,13 @@ notmuch_metadata_valid (notmuch_metadata_t *metadata);
\r
81 notmuch_metadata_key (notmuch_metadata_t *metadata);
\r
84 + * return value for current metadata pair
\r
87 +notmuch_metadata_value (notmuch_metadata_t *metadata);
\r
92 diff --git a/test/T590-metadata.sh b/test/T590-metadata.sh
\r
93 index 2c44746..d2326d4 100755
\r
94 --- a/test/T590-metadata.sh
\r
95 +++ b/test/T590-metadata.sh
\r
96 @@ -62,12 +62,14 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
\r
97 RUN(notmuch_database_get_all_metadata (db, NOTMUCH_METADATA_CONFIG, &meta));
\r
98 printf("valid = %d\n", notmuch_metadata_valid (meta));
\r
99 printf("key = %s\n", notmuch_metadata_key (meta));
\r
100 + printf("val = %s\n", notmuch_metadata_value (meta));
\r
103 cat <<'EOF' >EXPECTED
\r
110 test_expect_equal_file EXPECTED OUTPUT
\r