|Developer(s)||The GNOME Project et al.|
|Stable release||2.40.0 (March 24, 2014[±])|
|Operating system||Linux, Unix-like, OS X, Microsoft Windows|
|License||GNU Lesser General Public License|
GLib is a bundle of five low-level system libraries written in C and developed mainly by GNOME. GLib code was separated from GTK+, so it can be used by software other than GNOME and has been developed in parallel ever since.
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 (groups of strings), dynamic arrays, balanced binary trees, N-ary trees, quarks (a two-way association of a string and a unique integer identifier), 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 (callback registering) and timers. Also message passing facilities such as byte order conversion and I/O channels.
Some other features of GLib include:
The GLib package consisted of 5 libraries, but they were all merged into one library (since then simply known as Glib), and are no longer sustained as standalone libraries. The five original libraries were:
The source code for Glib can be found in the GNOME git: GLib.
GLib began as part of the GTK+ project. However, before releasing GTK+ version 2, the project's developers decided to separate non-GUI-specific code from GTK+, thus creating GLib as a separate software bundle. GLib was released as a separate library so other developers, those who did not make use of the GUI-related portions of GTK+, could make use of the non-GUI portions of the library without the overhead of depending on the entire 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.
|2.26||2010-03-26||GSettings, GDbus, GObject property bindings (GAtomic for refcounting)|
|2.30||2010-03-26||Non-unique GApplications, use eventfd() for mainloop wakeup, GHashTable set optimization, GObject data scalability|
|2.32||2012-03-24||Plans for GLib 2.32|
|2.38||2013-09-23||applications launched using D-Bus activation GSubprocess, Unicode 6.3 (released September 2013)|
|2.40||2014-03-24||GNotification, System notification API|
|2.41||TBA||GHmac has gained SHA-512 support|
Other widget toolkits provide low-level functions and implementations of data structures as well, e.g.:
- STL – C++ alternative to GObject
- Boost – provides some functionality for C++, such as threading primitives, similar to what GLib does for C.
- wxBase – non-GUI functions of the wxWidgets library
- The Apache Portable Runtime and Apple Core Foundation have a large functional overlap with GLib, and provide many similar OS-portable threading, network and data structure implementations in C.
- glib releases, gnome.org
- Krause, Andrew (2007). Foundations of GTK+ Development. Expert's Voice in Open Source. Apress. p. 5. ISBN 1-59059-793-1. Retrieved 3 April 2013. "[GLib] provides a cross-platform interface that allows your code to be run on any of its supported operating systems with little to no rewriting of code!"
- "Setting up an application for D-Bus Launching".
- "GLib 2.41.0 release notes".