This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Sections in GLib

Or: what goes where

Foreword: the division in GLib is pretty much artificial. All symbols are compiled in the libglib-2.0 shared object, hence you could just do a version check on the glib-2.0 pkg-config file even if you use API defined in glib-object.h or gio/gio.h. On modern systems the symbols will be paged in only when used as well. And chances are that, on any given system, libglib-2.0 has already been loaded by the time your application starts.

GLib

The glib/ directory contains basic data types like lists, arrays, string builders, queues, etc.

It also contains all the main loop machinery and the portability layer necessary to run C code on Unix, Windows and OSX.

The main header for inclusion in your code is glib.h.

GObject

The gobject/ directory contains the GType run-time type system and the relative data types for defining values, signals and properties.

It also contains the main base class of the type system, GTypeInstance, and a reference counted object type, called GObject.

The type system also defines some types for the structures defined in glib/, to avoid circular dependencies.

The main header for inclusion in your code is glib-object.h.

GIO

Formerly known as GLib Input/Ouput it's now known as GLib Interfaces and Objects.

The gio/ directory contains an I/O layer for mass storage, a networking I/O layer, an IPC layer (using D-Bus), a settings API and, in general, utility API based on the GType system.

The main header for inclusion in your code is gio/gio.h.


2024-10-23 11:05