Attached to this email I add a small code that use this functions, as an
example.

On 10:41, Tue 08 Dec 09, [email protected] wrote:
> Two patches for implement the regress functions on messages. With them 
> notmuch_messages_t can be use as an iterator forwards and backwards.
> 
> Up to now not really useful, nothing use them. I send them mainly to review.
> I'll do the same to threads and tags, so the UIs can use them.
> 
> PS: It's the first time I'm using git-send-email, I hope I do everything well.
> 
> _______________________________________________
> notmuch mailing list
> [email protected]
> http://notmuchmail.org/mailman/listinfo/notmuch
> 

-- 
Rubén Pollán  | jabber:[email protected]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Si luchas puedes perder
     Si no luchas estas perdido

#include <stdio.h>
#include "lib/notmuch.h"

void
show_message (notmuch_message_t *message)
{
	printf ("%s\n", notmuch_message_get_message_id (message));
}

int
main ()
{
	notmuch_database_t *database;
	notmuch_query_t *query;
	notmuch_messages_t *messages;
	notmuch_message_t *message;
	char ch = '\0';

	database = notmuch_database_open ("/home/meskio/Maildir", NOTMUCH_DATABASE_MODE_READ_ONLY);
	query = notmuch_query_create (database, "inbox");
	messages = notmuch_query_search_messages (query);

	while (ch != 'q')
	{
		message = notmuch_messages_get (messages);
		show_message (message);
		ch = getchar();
		if (ch == 'n')
		{
			notmuch_messages_advance (messages);
			if (!notmuch_messages_has_more (messages))
				notmuch_messages_regress (messages);
		}
		else if (ch == 'p')
		{
			if (!notmuch_messages_is_first (messages))
				notmuch_messages_regress (messages);
		}
	}
}

Attachment: signature.asc
Description: Digital signature

_______________________________________________
notmuch mailing list
[email protected]
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to