bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] Getting started with mailutils as a library (GNU Guile b


From: Amirouche
Subject: [bug-mailutils] Getting started with mailutils as a library (GNU Guile bindings)
Date: Sun, 30 Apr 2017 13:28:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Héllo,

I am looking for stable featured imap client to bind in GNU Guile, I found GNU mailutils.

The library part is not documented yet, nonetheless there is plenty of use of the library
in mailutils itself.

Like I said I am primarily interested on the imap client. It seems to me that the general workflow is to send request to using `mu_imap_*` functions found in mailutils/imap.h and listen for response using `mu_imap_register_callback_function`. Is this correct?

For instance, there is the example code in libproto/imap/mbox.c [1] that does the following:

static int
_imap_fetch_with_callback (mu_imap_t imap, mu_msgset_t msgset, char *items,
               mu_imap_callback_t cb, void *data)
{
  int rc;

  mu_imap_register_callback_function (imap, MU_IMAP_CB_FETCH, cb, data);
  rc = mu_imap_fetch (imap, 0, msgset, items);
  mu_imap_register_callback_function (imap, MU_IMAP_CB_FETCH, NULL, NULL);
  return rc;
}

AFAIU the callback is unregistred immediatly after being registred. How can this properly work?

What's the purpose of:

void mu_imap_callback (mu_imap_t imap, int code, size_t sdat, void *pdat);

Thanks in advance!

[1] http://git.savannah.gnu.org/cgit/mailutils.git/tree/libproto/imap/mbox.c#n61



reply via email to

[Prev in Thread] Current Thread [Next in Thread]