README.in 13.1 KB
Newer Older
1 2 3
General Information
===================

Owen Taylor's avatar
Owen Taylor committed
4 5 6 7 8
This is GLib version @GLIB_VERSION@. GLib is the low-level core
library that forms the basis for projects such as GTK+ and GNOME. It
provides data structure handling for C, portability wrappers, and
interfaces for such runtime functionality as an event loop, threads,
dynamic loading, and an object system.
9

Matthias Clasen's avatar
Matthias Clasen committed
10
The official download locations are:
Matthias Clasen's avatar
Matthias Clasen committed
11
  ftp://ftp.gtk.org/pub/glib
Matthias Clasen's avatar
Matthias Clasen committed
12
  http://download.gnome.org/sources/glib
13 14 15 16 17

The official web site is:
  http://www.gtk.org/

Information about mailing lists can be found at
Matthias Clasen's avatar
Matthias Clasen committed
18
  http://www.gtk.org/mailing-lists.php
19

Matthias Clasen's avatar
Matthias Clasen committed
20 21
To subscribe, send mail to gtk-list-request@gnome.org
with the subject "subscribe".
22 23 24 25 26 27

Installation
============

See the file 'INSTALL'

Matthias Clasen's avatar
Matthias Clasen committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
How to report bugs
==================

Bugs should be reported to the GNOME bug tracking system.
(http://bugzilla.gnome.org, product glib.) You will need
to create an account for yourself.

In the bug report please include:

* Information about your system. For instance:

   - What operating system and version
   - For Linux, what version of the C library

  And anything else you think is relevant.

* How to reproduce the bug.

  If you can reproduce it with one of the test programs that are built
  in the tests/ subdirectory, that will be most convenient.  Otherwise,
  please include a short test program that exhibits the behavior.
  As a last resort, you can also provide a pointer to a larger piece
  of software that can be downloaded.

* If the bug was a crash, the exact text that was printed out
  when the crash occured.

* Further information such as stack traces may be useful, but
  is not necessary.

Patches
=======

Patches should also be submitted to bugzilla.gnome.org. If the
patch fixes an existing bug, add the patch as an attachment
to that bug report.

Otherwise, enter a new bug report that describes the patch,
and attach the patch to that bug report.

Patches should be in unified diff form. (The -up option to GNU diff.)

70 71 72
Notes about GLib 2.36
=====================

73 74 75 76
* It is no longer necessary to call g_type_init().  If you are
  loading GLib as a dynamic module, you should be careful to avoid
  unloading it, then subsequently loading it again.  This never
  really worked before, but it is now explicitly undefined behavior.
77 78 79 80 81
  Note that if g_type_init() was the only explicit use of a GObject
  API and you are using linker flags such as --no-add-needed, then
  you may have to artificially use some GObject call to keep the
  linker from optimizing away -lgobject. We recommend to use
  g_type_ensure (G_TYPE_OBJECT) for this purpose.
82

Matthias Clasen's avatar
Matthias Clasen committed
83 84 85 86 87 88
* This release contains an incompatible change to the g_get_home_dir()
  function.  Previously, this function would effectively ignore the HOME
  environment variable and always return the value from /etc/password.
  As of this version, the HOME variable is used if it is set and the
  value from /etc/passwd is only used as a fallback.

89 90 91 92 93 94
* The 'flowinfo' and 'scope_id' fields of GInetSocketAddress
  (introduced in GLib 2.32) have been fixed to be in host byte order
  rather than network byte order. This is an incompatible change, but
  the previous behavior was clearly broken, so it seems unlikely that
  anyone was using it.

Matthias Clasen's avatar
Matthias Clasen committed
95 96 97 98 99 100 101 102 103 104
Notes about GLib 2.34
=====================

* GIO now looks for thumbnails in XDG_CACHE_HOME, following a
  recent alignment of the thumbnail spec with the basedir spec.

* The default values for GThreadPools max_unused_threads and
  max_idle_time settings have been changed to 2 and 15*1000,
  respectively.

105 106 107 108
Notes about GLib 2.32
=====================

* It is no longer necessary to use g_thread_init() or to link against
Matthias Clasen's avatar
Matthias Clasen committed
109
  libgthread.  libglib is now always thread-enabled. Custom thread
110 111 112 113 114 115 116 117 118 119
  system implementations are no longer supported (including errorcheck
  mutexes).

* The thread and synchronisation APIs have been updated.
  GMutex and GCond can be statically allocated without explicit
  initialisation, as can new types GRWLock and GRecMutex.  The
  GStatic_______ variants of these types have been deprecated.  GPrivate
  can also be statically allocated and has a nicer API (deprecating
  GStaticPrivate).  Finally, g_thread_create() has been replaced with a
  substantially simplified g_thread_new().
120 121 122 123 124 125 126

* The g_once_init_enter()/_leave() functions have been replaced with
  macros that allow for a pointer to any gsize-sized object, not just a
  gsize*.  The assertions to ensure that a pointer to a correctly-sized
  object is being used will not work with generic pointers (ie: (void*)
  and (gpointer) casts) which would have worked with the old version.

127 128
* It is now mandatory to include glib.h instead of individual headers.

129 130
* The -uninstalled variants of the pkg-config files have been dropped.

131 132 133 134 135 136 137 138 139 140 141 142 143
* For a long time, gobject-2.0.pc mistakenly declared a public
  dependency on gthread-2.0.pc (when the dependency should have been
  private).  This means that programs got away with calling
  g_thread_init() without explicitly listing gthread-2.0.pc among their
  dependencies.

  gthread has now been removed as a gobject dependency, which will cause
  such programs to break.

  The fix for this problem is either to declare an explicit dependency
  on gthread-2.0.pc (if you care about compatibility with older GLib
  versions) or to stop calling g_thread_init().

144 145 146 147 148
* g_debug() output is no longer enabled by default.  It can be enabled
  on a per-domain basis with the G_MESSAGES_DEBUG environment variable
  like
    G_MESSAGES_DEBUG=domain1,domain2
  or
149
    G_MESSAGES_DEBUG=all
150

151 152 153 154 155 156 157 158
Notes about GLib 2.30
=====================

* GObject includes a generic marshaller, g_cclosure_marshal_generic.
  To use it, simply specify NULL as the marshaller in g_signal_new().
  The generic marshaller is implemented with libffi, and consequently
  GObject depends on libffi now.

159 160 161 162 163 164 165 166 167 168 169 170
Notes about GLib 2.28
=====================

* The GApplication API has changed compared to the version that was
  included in the 2.25 development snapshots. Existing users will need
  adjustments.

Notes about GLib 2.26
=====================

* Nothing noteworthy.

Matthias Clasen's avatar
Matthias Clasen committed
171 172 173
Notes about GLib 2.24
=====================

174 175 176 177 178 179 180 181
* It is now allowed to call g_thread_init(NULL) multiple times, and
  to call glib functions before g_thread_init(NULL) is called
  (although the later is mainly a change in docs as this worked before
  too). See the GThread reference documentation for the details.

* GObject now links to GThread and threads are enabled automatically
  when g_type_init() is called.

Matthias Clasen's avatar
Matthias Clasen committed
182 183 184 185
* GObject no longer allows to call g_object_set() on construct-only properties
  while an object is being initialized. If this behavior is needed, setting a
  custom constructor that just chains up will re-enable this functionality.

186 187 188 189 190
* GMappedFile on an empty file now returns NULL for the contents instead of
  returning an empty string. The documentation specifically states that code
  may not rely on nul-termination here so any breakage caused by this change
  is a bug in application code.

191 192 193 194 195 196 197
Notes about GLib 2.22
=====================

* Repeated calls to g_simple_async_result_set_op_res_gpointer used
  to leak the data. This has been fixed to always call the provided
  destroy notify.

198 199 200
Notes about GLib 2.20
=====================

Matthias Clasen's avatar
Matthias Clasen committed
201
* The functions for launching applications (e.g. g_app_info_launch() +
202 203 204 205 206 207 208 209 210 211 212
  friends) now passes a FUSE file:// URI if possible (requires gvfs
  with the FUSE daemon to be running and operational). With gvfs 2.26,
  FUSE file:// URIs will be mapped back to gio URIs in the GFile
  constructors. The intent of this change is to better integrate
  POSIX-only applications, see bug #528670 for the rationale.  The
  only user-visible change is when an application needs to examine an
  URI passed to it (e.g. as a positional parameter). Instead of
  looking at the given URI, the application will now need to look at
  the result of g_file_get_uri() after having constructed a GFile
  object with the given URI.

Matthias Clasen's avatar
Matthias Clasen committed
213 214 215 216
Notes about GLib 2.18
=====================

* The recommended way of using GLib has always been to only include the
Matthias Clasen's avatar
Matthias Clasen committed
217 218 219
  toplevel headers glib.h, glib-object.h and gio.h. GLib enforces this by
  generating an error when individual headers are directly included.
  To help with the transition, the enforcement is not turned on by
Matthias Clasen's avatar
Matthias Clasen committed
220 221
  default for GLib headers (it is turned on for GObject and GIO).
  To turn it on, define the preprocessor symbol G_DISABLE_SINGLE_INCLUDES.
Matthias Clasen's avatar
Matthias Clasen committed
222

223 224 225 226
Notes about GLib 2.16
=====================

* GLib now includes GIO, which adds optional dependencies against libattr
Matthias Clasen's avatar
Matthias Clasen committed
227
  and libselinux for extended attribute and SELinux support. Use
228 229
  --disable-xattr and --disable-selinux to build without these.

Matthias Clasen's avatar
Matthias Clasen committed
230 231 232 233 234 235 236 237 238 239 240
Notes about GLib 2.10
=====================

* The functions g_snprintf() and g_vsnprintf() have been removed from
  the gprintf.h header, since they are already declared in glib.h. This
  doesn't break documented use of gprintf.h, but people have been known
  to include gprintf.h without including glib.h.

* The Unicode support has been updated to Unicode 4.1. This adds several
  new members to the GUnicodeBreakType enumeration.

Matthias Clasen's avatar
Matthias Clasen committed
241 242 243
* The support for Solaris threads has been retired. Solaris has provided
  POSIX threads for long enough now to have them available on every
  Solaris platform.
244

Matthias Clasen's avatar
Matthias Clasen committed
245 246 247
* 'make check' has been changed to validate translations by calling
  msgfmt with the -c option. As a result, it may fail on systems with
  older gettext implementations (GNU gettext < 0.14.1, or Solaris gettext).
Matthias Clasen's avatar
Matthias Clasen committed
248 249
  'make check' will also fail on systems where the C compiler does not
  support ELF visibility attributes.
250

Matthias Clasen's avatar
Matthias Clasen committed
251 252
* The GMemChunk API has been deprecated in favour of a new 'slice
  allocator'. See the g_slice documentation for more details.
Matthias Clasen's avatar
Matthias Clasen committed
253 254 255 256 257 258 259 260 261 262

* A new type, GInitiallyUnowned, has been introduced, which is
  intended to serve as a common implementation of the 'floating reference'
  concept that is e.g. used by GtkObject. Note that changing the
  inheritance hierarchy of a type can cause problems for language
  bindings and other code which needs to work closely with the type
  system. Therefore, switching to GInitiallyUnowned should be done
  carefully. g_object_compat_control() has been added to GLib 2.8.5
  to help with the transition.

Matthias Clasen's avatar
Matthias Clasen committed
263
Notes about GLib 2.6.0
264 265
======================

Tor Lillqvist's avatar
Tor Lillqvist committed
266 267 268 269
* GLib 2.6 introduces the concept of 'GLib filename encoding', which is the
  on-disk encoding on Unix, but UTF-8 on Windows. All GLib functions
  returning or accepting pathnames have been changed to expect
  filenames in this encoding, and the common POSIX functions dealing
Tor Lillqvist's avatar
Tor Lillqvist committed
270
  with pathnames have been wrapped. These wrappers are declared in the
Matthias Clasen's avatar
Matthias Clasen committed
271
  header <glib/gstdio.h> which must be included explicitly; it is not
Tor Lillqvist's avatar
Tor Lillqvist committed
272 273 274 275 276 277 278
  included through <glib.h>.

  On current (NT-based) Windows versions, where the on-disk file names
  are Unicode, these wrappers use the wide-character API in the C
  library. Thus applications can handle file names containing any
  Unicode characters through GLib's own API and its POSIX wrappers,
  not just file names restricted to characters in the system codepage.
Tor Lillqvist's avatar
Tor Lillqvist committed
279 280 281 282

  To keep binary compatibility with applications compiled against
  older versions of GLib, the Windows DLL still provides entry points
  with the old semantics using the old names, and applications
Tor Lillqvist's avatar
Tor Lillqvist committed
283
  compiled against GLib 2.6 will actually use new names for the
Tor Lillqvist's avatar
Tor Lillqvist committed
284
  functions. This is transparent to the programmer.
Matthias Clasen's avatar
Matthias Clasen committed
285

Tor Lillqvist's avatar
Tor Lillqvist committed
286 287 288 289 290
  When compiling against GLib 2.6, applications intended to be
  portable to Windows must take the UTF-8 file name encoding into
  consideration, and use the gstdio wrappers to access files whose
  names have been constructed from strings returned from GLib.

Matthias Clasen's avatar
Matthias Clasen committed
291 292
* Likewise, g_get_user_name() and g_get_real_name() have been changed
  to return UTF-8 on Windows, while keeping the old semantics for
Matthias Clasen's avatar
Matthias Clasen committed
293
  applications compiled against older versions of GLib.
Matthias Clasen's avatar
Matthias Clasen committed
294 295

* The GLib uses an '_' prefix to indicate private symbols that
Matthias Clasen's avatar
Matthias Clasen committed
296 297 298 299
  must not be used by applications. On some platforms, symbols beginning
  with prefixes such as _g will be exported from the library, on others not.
  In no case can applications use these private symbols. In addition to that,
  GLib+ 2.6 makes several symbols private which were not in any installed
Matthias Clasen's avatar
Matthias Clasen committed
300 301
  header files and were never intended to be exported.

Matthias Clasen's avatar
Matthias Clasen committed
302 303 304
* To reduce code size and improve efficiency, GLib, when compiled
  with the GNU toolchain, has separate internal and external entry
  points for exported functions. The internal names, which begin with
Matthias Clasen's avatar
Matthias Clasen committed
305
  IA__, may be seen when debugging a GLib program.
Matthias Clasen's avatar
Matthias Clasen committed
306

Tor Lillqvist's avatar
Tor Lillqvist committed
307 308 309 310
* On Windows, GLib no longer opens a console window when printing
  warning messages if stdout or stderr are invalid, as they are in
  "Windows subsystem" (GUI) applications. Simply redirect stdout or
  stderr if you need to see them.
Owen Taylor's avatar
Owen Taylor committed
311 312

* The child watch functionality tends to reveal a bug in many
Matthias Clasen's avatar
Matthias Clasen committed
313 314 315 316
  thread implementations (in particular the older LinuxThreads
  implementation on Linux) where it's not possible to call waitpid()
  for a child created in a different thread. For this reason, for
  maximum portability, you should structure your code to fork all
Matthias Clasen's avatar
Matthias Clasen committed
317
  child processes that you want to wait for from the main thread.
Owen Taylor's avatar
Owen Taylor committed
318

Matthias Clasen's avatar
Matthias Clasen committed
319 320 321 322
* A problem was recently discovered with g_signal_connect_object();
  it doesn't actually disconnect the signal handler once the object being
  connected to dies, just disables it. See the API docs for the function
  for further details and the correct workaround that will continue to
Owen Taylor's avatar
Owen Taylor committed
323
  work with future versions of GLib.