~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to docs/reference/glib/changes.xml

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 
3
               "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
 
4
]>
 
5
<refentry id="glib-changes" revision="17 Jan 2002">
 
6
<refmeta>
 
7
<refentrytitle>Changes to GLib</refentrytitle>
 
8
<manvolnum>3</manvolnum>
 
9
<refmiscinfo>Changes to GLib</refmiscinfo>
 
10
</refmeta>
 
11
 
 
12
<refnamediv>
 
13
<refname>Changes to GLib</refname>
 
14
<refpurpose>
 
15
Incompatible changes made between successing versions of GLib
 
16
</refpurpose>
 
17
</refnamediv>
 
18
 
 
19
 
 
20
<refsect1>
 
21
<title>Incompatible changes from 2.0 to 2.2</title>
 
22
 
 
23
<itemizedlist>
 
24
 
 
25
<listitem>
 
26
<para>
 
27
GLib changed the seeding algorithm for the pseudo-random number
 
28
generator Mersenne Twister, as used by <structname>GRand</structname>
 
29
and <structname>GRandom</structname>. This was necessary, because some
 
30
seeds would yield very bad pseudo-random streams. Also the
 
31
pseudo-random integers generated by
 
32
<function>g_rand*_int_range()</function> will have a
 
33
slightly better equal distribution with the new version of GLib.
 
34
</para>
 
35
 
 
36
<para>
 
37
Further information can be found at the website of the Mersenne
 
38
Twister random number generator at <ulink
 
39
url="http://www.math.keio.ac.jp/~matumoto/emt.html">http://www.math.keio.ac.jp/~matumoto/emt.html</ulink>.
 
40
</para> 
 
41
 
 
42
<para>
 
43
The original seeding and generation algorithms, as found in GLib
 
44
2.0.x, can be used instead of the new ones by setting the environment
 
45
variable <envar>G_RANDOM_VERSION</envar> to the value of '2.0'. Use
 
46
the GLib-2.0 algorithms only if you have sequences of numbers generated
 
47
with Glib-2.0 that you need to reproduce exactly.  
 
48
</para> 
 
49
 
 
50
</listitem>
 
51
 
 
52
</itemizedlist>
 
53
 
 
54
</refsect1>
 
55
 
 
56
<refsect1>
 
57
<title>Incompatible changes from 1.2 to 2.0</title>
 
58
 
 
59
<itemizedlist>
 
60
 
 
61
<listitem>
 
62
<para>
 
63
The event loop functionality <structname>GMain</structname> has extensively 
 
64
been revised to support multiple separate main loops in separate threads. 
 
65
All sources (timeouts, idle functions, etc.) are associated with a 
 
66
<structname>GMainContext</structname>.
 
67
</para>
 
68
 
 
69
<para>
 
70
Compatibility functions exist so that most application code dealing with
 
71
the main loop will continue to work. However, code that creates new custom 
 
72
types of sources will require modification.
 
73
</para>
 
74
 
 
75
<para>
 
76
The main changes here are:
 
77
 
 
78
  <itemizedlist>
 
79
 
 
80
  <listitem>
 
81
  <para>
 
82
   Sources are now exposed as <type>GSource *</type>, rather than simply as 
 
83
   numeric ids.
 
84
  </para>
 
85
  </listitem>
 
86
  
 
87
  <listitem>
 
88
  <para>
 
89
   New types of sources are created by structure "derivation" from 
 
90
   <structname>GSource</structname>, so the <literal>source_data</literal> 
 
91
   parameter to the <structname>GSource</structname> virtual functions has been
 
92
   replaced with a <type>GSource *</type>.
 
93
  </para>
 
94
  </listitem>
 
95
  
 
96
  <listitem>
 
97
  <para>
 
98
   Sources are first created, then later added to a specific 
 
99
   <structname>GMainContext</structname>. 
 
100
  </para>
 
101
  </listitem>
 
102
  
 
103
  <listitem>
 
104
  <para>
 
105
   Dispatching has been modified so both the callback and data are passed
 
106
   in to the <function>dispatch()</function> virtual function.
 
107
  </para>
 
108
  </listitem>
 
109
 
 
110
  </itemizedlist>
 
111
  To go along with this change, the vtable for 
 
112
  <structname>GIOChannel</structname> has changed and
 
113
  <function>add_watch()</function> has been replaced by 
 
114
  <function>create_watch()</function>.
 
115
</para>
 
116
</listitem>
 
117
 
 
118
<listitem>
 
119
<para>
 
120
<function>g_list_foreach()</function> and 
 
121
<function>g_slist_foreach()</function> have been changed so they
 
122
are now safe against removal of the current item, not the next item.
 
123
</para>
 
124
 
 
125
<para>
 
126
It's not recommended to mutate the list in the callback to these
 
127
functions in any case.
 
128
</para>
 
129
</listitem>
 
130
 
 
131
<listitem>
 
132
<para>
 
133
<structname>GDate</structname> now works in UTF-8, not in the current locale. 
 
134
If you want to use it with the encoding of the locale, you need to convert 
 
135
strings using <function>g_locale_to_utf8()</function> first.
 
136
</para>
 
137
</listitem>
 
138
 
 
139
<listitem>
 
140
<para>
 
141
<function>g_strsplit()</function> has been fixed to:
 
142
 
 
143
  <itemizedlist>
 
144
  <listitem>
 
145
  <para>
 
146
   include trailing empty tokens, rather than stripping them
 
147
  </para>
 
148
  </listitem>
 
149
  <listitem>
 
150
  <para>
 
151
   split into a maximum of <literal>max_tokens</literal> tokens, rather 
 
152
   than <literal>max_tokens + 1</literal>
 
153
  </para>
 
154
  </listitem>
 
155
  </itemizedlist>
 
156
 
 
157
  Code depending on either of these bugs will need to be fixed.
 
158
</para>
 
159
</listitem>
 
160
 
 
161
<listitem>
 
162
<para>
 
163
Deprecated functions that got removed:
 
164
<function>g_set_error_handler()</function>, 
 
165
<function>g_set_warning_handler()</function>,
 
166
<function>g_set_message_handler()</function>, use 
 
167
<function>g_log_set_handler()</function> instead.
 
168
</para>
 
169
</listitem>
 
170
</itemizedlist>
 
171
 
 
172
</refsect1>
 
173
 
 
174
</refentry>