From 5d1ac7d1d351c6f122ddaa44d3c82ec68d45178c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 24 Dec 2011 13:52:45 -0500 Subject: Utility function to seek in MIME trees in depth-first order. This function matches how we number parts for the --part argument to show. It will allow us to jump directly to the desired part, rather than traversing the entire tree and carefully tracking whether or not we're "in the zone". --- notmuch-client.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'notmuch-client.h') diff --git a/notmuch-client.h b/notmuch-client.h index 64b255c7..517c010a 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -324,5 +324,10 @@ mime_node_open (const void *ctx, notmuch_message_t *message, mime_node_t * mime_node_child (const mime_node_t *parent, int child); +/* Return the nth child of node in a depth-first traversal. If n is + * 0, returns node itself. Returns NULL if there is no such part. */ +mime_node_t * +mime_node_seek_dfs (mime_node_t *node, int n); + #include "command-line-arguments.h" #endif -- cgit v1.2.3