<refentry id="gmime-changes-2-4" revision="23 May 2008">
  <refmeta>
    <refentrytitle>Changes from 2.2 to 2.4</refentrytitle>
    <manvolnum>3</manvolnum>
    <refmiscinfo>Changes from 2.2 to 2.4</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>Changes from 2.2 to 2.4</refname>
    <refpurpose>Changes made between version 2.2 and version 2.4</refpurpose>
  </refnamediv>
  <refsect1>
    <title>Changes from 2.2 to 2.4</title>
    <para>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.</para>
    <para>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).</para>
    <para>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
`gmime-port-2-2-to-2-4.sh'.</para>
    <para>This script won't fix everything, but it should help quite a
bit.</para>
    <para>Beyond that, a few methods have changed in other ways:</para>
    <itemizedlist>
      <listitem><para><function>g_mime_cipher_context_sign()</function>
  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.</para></listitem>
      <listitem><para><function>g_mime_cipher_context_decrypt()</function>
  now returns a GMimeSignatureValidty on success and NULL on
  failure. This is needed in case the encrypted stream was also
  signed.</para></listitem>
      <listitem><para><function>g_mime_multipart_encrypted_encrypt()</function>
  now takes a boolean 'sign' argument to allow the caller to request
  encrypting and signing in a single pass.</para></listitem>
    </itemizedlist>
    <para>Several structs have also been rewritten to subclass GObject like
GMimeContentType and GMimeContentDisposition as well as
InternetAddress and InternetAddressList.</para>
    <para>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.</para>
    <para>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.</para>
  </refsect1>
</refentry>
