GObjectification - GSoC progress as of June 16, 2013

Jorge Villaseñor salinasv at gmail.com
Tue Jun 18 12:03:53 EDT 2013

On Sun, Jun 16, 2013 at 7:59 AM, Ankit Vani <a at nevitus.org> wrote:

> Hi everyone
> As a part of Google Summer of Code 2013, I have been working on
> GObjectification. It has been 4 days since I started working, and I
> would like to share with the community of the changes I've been doing.
> Since I'm still learning and getting used to libpurple, I have started
> out with simpler entities. I hope to speed up as I keep learning. I
> would appreciate feedback and comments on how things can be done
> better. :)

Thanks for sharing the update!


> An example of using the HMAC cipher with the SHA1 hash (before
> gobjectification):
> PurpleCipherContext *hmac = purple_cipher_context_new_by_name("hmac",
> NULL);
> purple_cipher_context_set_option(hmac, "hash", "sha1");
> purple_cipher_context_set_key(hmac, key, key_len);
> purple_cipher_context_append(hmac, data, data_len);
> purple_cipher_context_digest(hmac, output, sizeof(output));
> purple_cipher_context_destroy(hmac);
> An example of using the HMAC cipher with the SHA1 hash (after
> gobjectification):
> PurpleHash *hash = purple_sha1_hash_new();
> PurpleCipher *hmac = purple_hmac_cipher_new(hash);
> purple_cipher_set_key(hmac, key, key_len);
> purple_cipher_append(hmac, data, data_len);
> purple_cipher_digest(hmac, output, sizeof(output));
> g_object_unref(hmac);
> g_object_unref(hash);

I would suggest a function name change from purple_sha1_hash_new() to
purple_hash_sha1_new() to keep the namespace/hierarchy more clear. The same
for the cipher functions. The convention so far have been in the lines of
the following template -> purple_module_submodule_specific()

> Some other changes
> ------------------
> - Entities in libpurple have reserved members such as void
> (*purple_reserved[4])(void), to make it easier to add new API without
> breaking the ABI for plugins compiled against older versions. Existing
> GObjectified entities such as PurpleTheme, PurpleThemeManager,
> PurpleThemeLoader, PurpleSoundTheme and PurpleSoundThemeLoader were
> missing these padding members, so I added those to them.
> - PurpleSmiley and PurpleMedia were already GObjects, but their
> structures were hidden. I exposed them in the header file so these can
> be subclassed. They do not have any methods that can be overridden
> yet.

Please someone correct me if I am wrong, but the we want to hide members to
avoid the need of that purple_reserved members. So we don't have to bump
the ABI when we add more than 4 more functions.

> Please suggest any improvements I can do. I will keep informing you
> all of my progress approximately every week. I hope for a GObjectified
> pidgin by the end of summer! :D
> Ankit Vani
Keep the good job. =)


A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20130618/04791292/attachment.html>

More information about the Devel mailing list