[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / 83 / b44f7d0541f96d135077155877cb0b76ce17e4
1 Return-Path: <amthrax@drake.mit.edu>\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 ECBBC429E36\r
6         for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 11:31: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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 L3k4rJXmWMrz for <notmuch@notmuchmail.org>;\r
16         Sun,  4 Dec 2011 11:31:57 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
18         [18.7.68.37])\r
19         by olra.theworths.org (Postfix) with ESMTP id 05E27429E28\r
20         for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 11:31:56 -0800 (PST)\r
21 X-AuditID: 12074425-b7f116d0000008fe-ed-4edbcaac2d78\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 84.36.02302.CAACBDE4; Sun,  4 Dec 2011 14:31:56 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id pB4JVuBO006826; \r
27         Sun, 4 Dec 2011 14:31:56 -0500\r
28 Received: from drake.mit.edu\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pB4JVs9c029484\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Sun, 4 Dec 2011 14:31:55 -0500 (EST)\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.76)\r
36         (envelope-from <amthrax@drake.mit.edu>)\r
37         id 1RXHn0-0002j5-TW; Sun, 04 Dec 2011 14:31:54 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH 3/4] Utility function to seek in MIME trees in depth-first\r
41         order.\r
42 Date: Sun,  4 Dec 2011 14:31:39 -0500\r
43 Message-Id: <1323027100-10307-4-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.5.4\r
45 In-Reply-To: <1323027100-10307-1-git-send-email-amdragon@mit.edu>\r
46 References: <1322446871-14986-1-git-send-email-amdragon@mit.edu>\r
47         <1323027100-10307-1-git-send-email-amdragon@mit.edu>\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsUixCmqrLvm1G0/g4bZ2hat3Z+ZLK5u7We3\r
50         2LPPy+L6zZnMDiweZ7vbWT3unuby2DnrLrvHs1W3mANYorhsUlJzMstSi/TtErgyOqdNYC2Y\r
51         zFuxb9Z0lgbGtVxdjBwcEgImEl/2B3QxcgKZYhIX7q1n62Lk4hAS2McosfdKMwuEs55R4mbn\r
52         JFYI5x6TxKzbx6Gc+YwS859tYgXpZxPQkNi2fzkjiC0iIC2x8+5ssDizQJ1E58Yz7CC2sECg\r
53         xPc5r5hAbBYBVYmWxq1sIDavgIPEzqs3GCHuUJD4dWQVK8h5nAKOEjdvWYKEhQTKJe627Web\r
54         wMi/gJFhFaNsSm6Vbm5iZk5xarJucXJiXl5qka6FXm5miV5qSukmRlCwsbuo7mCccEjpEKMA\r
55         B6MSD2/miVt+QqyJZcWVuYcYJTmYlER5n5y87SfEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhDdj\r
56         MVCONyWxsiq1KB8mJc3BoiTO+3qHg5+QQHpiSWp2ampBahFMVoaDQ0mC9ynIUMGi1PTUirTM\r
57         nBKENBMHJ8hwHqDhCqdAhhcXJOYWZ6ZD5E8x6nKcvNt/hlGIJS8/L1VKnJcDpEgApCijNA9u\r
58         DixJvGIUB3pLmPcVyDoeYIKBm/QKaAkT0BLFxhsgS0oSEVJSDYzbntjpP6q+PDf9g+6n5eUb\r
59         2GbGephd0fZ/5xG/PGrnwuO/18tdz5svKvRx74k2QRUtyyjlU5N+ccRxL076L9p1Woep2GnT\r
60         PjP7An9P/WS5xXZPtjQ+lk1yavrvYj29gLH9mwLjinPqCjuVsvj28btYnFgcKnDv2mcX2b8u\r
61         T+QeC0xUXHhwwnolluKMREMt5qLiRABU1Wrv7QIAAA==\r
62 Cc: dkg@fifthhorseman.net\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Sun, 04 Dec 2011 19:32:00 -0000\r
76 \r
77 This function matches how we number parts for the --part argument to\r
78 show.  It will allow us to jump directly to the desired part, rather\r
79 than traversing the entire tree and carefully tracking whether or not\r
80 we're "in the zone".\r
81 ---\r
82  mime-node.c      |   25 +++++++++++++++++++++++++\r
83  notmuch-client.h |    5 +++++\r
84  2 files changed, 30 insertions(+), 0 deletions(-)\r
85 \r
86 diff --git a/mime-node.c b/mime-node.c\r
87 index a8e4a59..207818e 100644\r
88 --- a/mime-node.c\r
89 +++ b/mime-node.c\r
90 @@ -232,3 +232,28 @@ mime_node_child (const mime_node_t *parent, int child)\r
91                         g_type_name (G_OBJECT_TYPE (parent->part)));\r
92      }\r
93  }\r
94 +\r
95 +static mime_node_t *\r
96 +_mime_node_seek_dfs_walk (mime_node_t *node, int *n)\r
97 +{\r
98 +    mime_node_t *ret = NULL;\r
99 +    int i;\r
100 +\r
101 +    if (*n <= 0)\r
102 +       return node;\r
103 +\r
104 +    *n = *n - 1;\r
105 +    for (i = 0; i < node->children && !ret; i++) {\r
106 +       mime_node_t *child = mime_node_child (node, i);\r
107 +       ret = _mime_node_seek_dfs_walk (child, n);\r
108 +       if (!ret)\r
109 +           talloc_free (child);\r
110 +    }\r
111 +    return ret;\r
112 +}\r
113 +\r
114 +mime_node_t *\r
115 +mime_node_seek_dfs (mime_node_t *node, int n)\r
116 +{\r
117 +    return _mime_node_seek_dfs_walk (node, &n);\r
118 +}\r
119 diff --git a/notmuch-client.h b/notmuch-client.h\r
120 index 752c234..5482969 100644\r
121 --- a/notmuch-client.h\r
122 +++ b/notmuch-client.h\r
123 @@ -318,4 +318,9 @@ mime_node_open (const void *ctx, notmuch_message_t *message,\r
124  mime_node_t *\r
125  mime_node_child (const mime_node_t *parent, int child);\r
126  \r
127 +/* Return the nth child of node in a depth-first traversal.  If n is\r
128 + * 0, returns node itself.  Returns NULL if there is no such part. */\r
129 +mime_node_t *\r
130 +mime_node_seek_dfs (mime_node_t *node, int n);\r
131 +\r
132  #endif\r
133 -- \r
134 1.7.5.4\r
135 \r