Blame docs/reference/glib/changes.xml

Packit ae235b
Packit ae235b
Packit ae235b
               "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
Packit ae235b
]>
Packit ae235b
<refentry id="glib-changes" revision="17 Jan 2002">
Packit ae235b
<refmeta>
Packit ae235b
<refentrytitle>Changes to GLib</refentrytitle>
Packit ae235b
<manvolnum>3</manvolnum>
Packit ae235b
<refmiscinfo>Changes to GLib</refmiscinfo>
Packit ae235b
</refmeta>
Packit ae235b
Packit ae235b
<refnamediv>
Packit ae235b
<refname>Changes to GLib</refname>
Packit ae235b
<refpurpose>
Packit ae235b
Incompatible changes made between successing versions of GLib
Packit ae235b
</refpurpose>
Packit ae235b
</refnamediv>
Packit ae235b
Packit ae235b
Packit ae235b
<refsect1>
Packit ae235b
<title>Incompatible changes from 2.0 to 2.2</title>
Packit ae235b
Packit ae235b
<itemizedlist>
Packit ae235b
Packit ae235b
<listitem>
Packit ae235b
<para>
Packit ae235b
GLib changed the seeding algorithm for the pseudo-random number
Packit ae235b
generator Mersenne Twister, as used by <structname>GRand</structname>
Packit ae235b
and <structname>GRandom</structname>. This was necessary, because some
Packit ae235b
seeds would yield very bad pseudo-random streams. Also the
Packit ae235b
pseudo-random integers generated by
Packit ae235b
<function>g_rand*_int_range()</function> will have a
Packit ae235b
slightly better equal distribution with the new version of GLib.
Packit ae235b
</para>
Packit ae235b
Packit ae235b
<para>
Packit ae235b
Further information can be found at the website of the Mersenne
Packit ae235b
Twister random number generator at 
Packit ae235b
url="http://www.math.keio.ac.jp/~matumoto/emt.html">http://www.math.keio.ac.jp/~matumoto/emt.html</ulink>.
Packit ae235b
</para> 
Packit ae235b
Packit ae235b
<para>
Packit ae235b
The original seeding and generation algorithms, as found in GLib
Packit ae235b
2.0.x, can be used instead of the new ones by setting the environment
Packit ae235b
variable <envar>G_RANDOM_VERSION</envar> to the value of '2.0'. Use
Packit ae235b
the GLib-2.0 algorithms only if you have sequences of numbers generated
Packit ae235b
with Glib-2.0 that you need to reproduce exactly.  
Packit ae235b
</para> 
Packit ae235b
Packit ae235b
</listitem>
Packit ae235b
Packit ae235b
</itemizedlist>
Packit ae235b
Packit ae235b
</refsect1>
Packit ae235b
Packit ae235b
<refsect1>
Packit ae235b
<title>Incompatible changes from 1.2 to 2.0</title>
Packit ae235b
Packit ae235b
<itemizedlist>
Packit ae235b
Packit ae235b
<listitem>
Packit ae235b
<para>
Packit ae235b
The event loop functionality <structname>GMain</structname> has extensively 
Packit ae235b
been revised to support multiple separate main loops in separate threads. 
Packit ae235b
All sources (timeouts, idle functions, etc.) are associated with a 
Packit ae235b
<structname>GMainContext</structname>.
Packit ae235b
</para>
Packit ae235b
Packit ae235b
<para>
Packit ae235b
Compatibility functions exist so that most application code dealing with
Packit ae235b
the main loop will continue to work. However, code that creates new custom 
Packit ae235b
types of sources will require modification.
Packit ae235b
</para>
Packit ae235b
Packit ae235b
<para>
Packit ae235b
The main changes here are:
Packit ae235b
Packit ae235b
  <itemizedlist>
Packit ae235b
Packit ae235b
  <listitem>
Packit ae235b
  <para>
Packit ae235b
   Sources are now exposed as <type>GSource *</type>, rather than simply as 
Packit ae235b
   numeric ids.
Packit ae235b
  </para>
Packit ae235b
  </listitem>
Packit ae235b
  
Packit ae235b
  <listitem>
Packit ae235b
  <para>
Packit ae235b
   New types of sources are created by structure "derivation" from 
Packit ae235b
   <structname>GSource</structname>, so the <literal>source_data</literal> 
Packit ae235b
   parameter to the <structname>GSource</structname> virtual functions has been
Packit ae235b
   replaced with a <type>GSource *</type>.
Packit ae235b
  </para>
Packit ae235b
  </listitem>
Packit ae235b
  
Packit ae235b
  <listitem>
Packit ae235b
  <para>
Packit ae235b
   Sources are first created, then later added to a specific 
Packit ae235b
   <structname>GMainContext</structname>. 
Packit ae235b
  </para>
Packit ae235b
  </listitem>
Packit ae235b
  
Packit ae235b
  <listitem>
Packit ae235b
  <para>
Packit ae235b
   Dispatching has been modified so both the callback and data are passed
Packit ae235b
   in to the <function>dispatch()</function> virtual function.
Packit ae235b
  </para>
Packit ae235b
  </listitem>
Packit ae235b
Packit ae235b
  </itemizedlist>
Packit ae235b
  To go along with this change, the vtable for 
Packit ae235b
  <structname>GIOChannel</structname> has changed and
Packit ae235b
  <function>add_watch()</function> has been replaced by 
Packit ae235b
  <function>create_watch()</function>.
Packit ae235b
</para>
Packit ae235b
</listitem>
Packit ae235b
Packit ae235b
<listitem>
Packit ae235b
<para>
Packit ae235b
<function>g_list_foreach()</function> and 
Packit ae235b
<function>g_slist_foreach()</function> have been changed so they
Packit ae235b
are now safe against removal of the current item, not the next item.
Packit ae235b
</para>
Packit ae235b
Packit ae235b
<para>
Packit ae235b
It's not recommended to mutate the list in the callback to these
Packit ae235b
functions in any case.
Packit ae235b
</para>
Packit ae235b
</listitem>
Packit ae235b
Packit ae235b
<listitem>
Packit ae235b
<para>
Packit ae235b
<structname>GDate</structname> now works in UTF-8, not in the current locale. 
Packit ae235b
If you want to use it with the encoding of the locale, you need to convert 
Packit ae235b
strings using <function>g_locale_to_utf8()</function> first.
Packit ae235b
</para>
Packit ae235b
</listitem>
Packit ae235b
Packit ae235b
<listitem>
Packit ae235b
<para>
Packit ae235b
<function>g_strsplit()</function> has been fixed to:
Packit ae235b
Packit ae235b
  <itemizedlist>
Packit ae235b
  <listitem>
Packit ae235b
  <para>
Packit ae235b
   include trailing empty tokens, rather than stripping them
Packit ae235b
  </para>
Packit ae235b
  </listitem>
Packit ae235b
  <listitem>
Packit ae235b
  <para>
Packit ae235b
   split into a maximum of <literal>max_tokens</literal> tokens, rather 
Packit ae235b
   than <literal>max_tokens + 1</literal>
Packit ae235b
  </para>
Packit ae235b
  </listitem>
Packit ae235b
  </itemizedlist>
Packit ae235b
Packit ae235b
  Code depending on either of these bugs will need to be fixed.
Packit ae235b
</para>
Packit ae235b
</listitem>
Packit ae235b
Packit ae235b
<listitem>
Packit ae235b
<para>
Packit ae235b
Deprecated functions that got removed:
Packit ae235b
<function>g_set_error_handler()</function>, 
Packit ae235b
<function>g_set_warning_handler()</function>,
Packit ae235b
<function>g_set_message_handler()</function>, use 
Packit ae235b
<function>g_log_set_handler()</function> instead.
Packit ae235b
</para>
Packit ae235b
</listitem>
Packit ae235b
</itemizedlist>
Packit ae235b
Packit ae235b
</refsect1>
Packit ae235b
Packit ae235b
</refentry>