[notmuch] regress option to messages iterator

2009-12-08 Thread ruben pollan
Attached to this email I add a small code that use this functions, as an
example.

On 10:41, Tue 08 Dec 09, meskio at sindominio.net 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
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
> 

-- 
Rub?n Poll?n  | jabber:meskio at jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Si luchas puedes perder
 Si no luchas estas perdido

-- next part --
A non-text attachment was scrubbed...
Name: foo.c
Type: text/x-csrc
Size: 886 bytes
Desc: not available
URL: 

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: 



[notmuch] regress option to messages iterator

2009-12-08 Thread mes...@sindominio.net
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.



Re: [notmuch] regress option to messages iterator

2009-12-08 Thread ruben pollan
Attached to this email I add a small code that use this functions, as an
example.

On 10:41, Tue 08 Dec 09, mes...@sindominio.net 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
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
> 

-- 
Rubén Pollán  | jabber:mes...@jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Si luchas puedes perder
 Si no luchas estas perdido

#include 
#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);
		}
	}
}


signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] regress option to messages iterator

2009-12-08 Thread meskio
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
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch