GLib


GLib is a bundle of three low-level system libraries written in C and developed mainly by GNOME Project|GNOME]. GLib's code was separated from GTK, so it can be used by software other than GNOME and has been developed in parallel ever since.
The name "GLib" originates from the project's start as a GTK C utility library.

Features

GLib provides advanced data structures, such as memory chunks, doubly and singly linked lists, hash tables, dynamic strings and string utilities, such as a lexical scanner, string chunks, dynamic arrays, balanced binary trees, N-ary trees, quarks, keyed data lists, relations, and tuples. Caches provide memory management.
GLib implements functions that provide threads, thread programming and related facilities such as primitive variable access, mutexes, asynchronous queues, secure memory pools, message passing and logging, hook functions and timers. GLib also includes message passing facilities such as byte order conversion and I/O channels.
Some other features of GLib include:

Components

The GLib package consisted of five libraries, but they were all merged into one library, since then named simply GLib, and are no longer sustained as standalone libraries. The original libraries were:
Of these, three continue to reside in distinct subdirectories of the source tree, and so can be thought of as discrete components: GLib, GObject, and GIO. These can be thought of as a software stack: GObject relies on GLib, and GIO provides higher-level functionality that uses both.

Programs for the GLib library

Command-line utilities associated with GLib, are usually packaged separately into libglib2.0-bin:
  • – for starting applications via D-Bus activation
  • – for working with D-Bus objects and monitoring the bus
  • – a file management utility that can work with GIO virtual filesystems
  • – for extracting files from binary format -files and executables
  • – for inspecting and editing application configuration
  • – for updating caches used internally by GLib
  • – for updating caches used internally by GLib

History

GLib began as part of the GTK+ project, now named GTK. However, before releasing GTK+ version 2, the project's developers decided to separate code from GTK+ that was not for graphical user interfaces, thus creating GLib as a separate software bundle. GLib was released as a separate library so other developers, those not using the GUI-related parts of GTK+, could use the non-GUI parts of the library without the overhead of depending on the full GUI library.
Since GLib is a cross-platform library, applications using it to interface with the operating system are usually portable across different operating systems without major changes.

Releases

Glib is undergoing active development. For a current overview see . The table below documents major patch notes from 1998 to 2022.

Similar projects

Other libraries provide low-level functions and implementations of data structures, including: