Changes from 2.2 to 2.4

Changes from 2.2 to 2.4 — Changes made between version 2.2 and version 2.4

Changes from 2.2 to 2.4

GMime 2.4 has had a number of API changes since GMime 2.2. To start, ALL public APIs that used to use off_t in GMime 2.2 now use gint64 so that the API and ABI do not change based on whether or not large file support is enabled.

In addition, all of the functions marked as deprecated in 2.0 and 2.2 were removed (usually they had equivalent functionality in a parent class).

Many functions have also been renamed for better clarity and/or consistency. For convenience, GMime 2.4 source packages include a shell-script to aid in porting applications using GMime 2.2 (should work for most GMime 2.0 applications as well) to the 2.4 API. You can find this script under the tools/ directory, named `'.

This script won't fix everything, but it should help quite a bit.

Beyond that, a few methods have changed in other ways:

  • g_mime_cipher_context_sign() still returns int, but if the value isn't -1 (failure), then it will represent a GMimeCipherHash that it used for signing. This is useful, for example, when the requested hash was GMIME_CIPHER_HASH_DEFAULT.

  • g_mime_cipher_context_decrypt() now returns a GMimeSignatureValidty on success and NULL on failure. This is needed in case the encrypted stream was also signed.

  • g_mime_multipart_encrypted_encrypt() now takes a boolean 'sign' argument to allow the caller to request encrypting and signing in a single pass.

Several structs have also been rewritten to subclass GObject like GMimeContentType and GMimeContentDisposition as well as InternetAddress and InternetAddressList.

Not only have InternetAddress and InternetAddressList been ported to GObject, but they have also undergone other design changes. InternetAddress is now a base class for InternetAddressMailbox and InternetAddressGroup, meaning that InternetAddress no longer contains a union for group/addr fields.

All functions that return a GObject have been changed to not add a ref to the object returned, meaning that it is no longer necessary to call g_object_unref() on MIME parts returned from functions like g_mime_message_get_mime_part() or g_mime_multipart_get_part(). This was done to be more consistent with the Gtk+ API.