[gpgme] Moving from 0.3 to 1.0

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Thu Oct 7 15:15:39 CEST 2004

At Thu, 7 Oct 2004 12:15:40 +0100,
Anthony Metcalf <anthony.metcalf at anferny.ath.cx> wrote:
> [1  <multipart/signed (7bit)>]
> [1.1  <text/plain; US-ASCII (7bit)>]
> Hi all,
> 	I am attempting to help move sylpheed from using gpgme0.3 to
> 1.0.
> I am having trouble with the GpgmeRecipients. I notice from the 0.4.1
> announce that this is removed, and that I should use "NULL-Terminated
> lists of keys". How do I go about doing this? 
> At the moment I see 
> GpgmeRecipients gpgmegtk-recipient-selection(GSList *recipients);
> what should this return?

Well, you need to change this a bit around.

A NULL-terminated list of keys is really a NULL-terminated array of
keys, something like this:

gpgme_key_t rset[5] = { key1, key2, key3, key4, NULL };

In the case of sylpheed, the first thing you have to do is to change
the struct select_key_s to return such an array instead GpgmeRecipient
in RSET.  malloc and realloc are your friends.  I am sorry that it is
a bit more work than calling gpgme_recipients_add* in select_btn_cb,
but it's not that hard.

Once you did that, you can return a pointer to this array from
gpgmegtk_recipient_selection.  Instead gpgme_recipients_release() the
caller of that function just needs to call free() on the malloc'ed
block then.

That's all I think.  The main work will be to handle the allocation of
the key-list array.  The listing of the keys etc is already in there,
so it's not much to do (about this single issue).

Keep us in touch with your experiences.  It's interesting to hear for
me how moving from 0.3.x to 1.0.x is for you.


More information about the Gnupg-devel mailing list