This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "GLib" – news ·newspapers ·books ·scholar ·JSTOR(July 2019) (Learn how and when to remove this message) |
| GLib | |
|---|---|
| Original author | Shawn Amundson |
| Developer | The GNOME Project et al. |
| Initial release | 1998; 27 years ago (1998) |
| Stable release | |
| Repository | |
| Written in | C |
| Operating system | Linux,Unix-like,macOS,Windows |
| Platform | Cross-platform |
| Type | Library |
| License | LGPLv2.1 |
| Website | www |

GLib is a bundle of three (formerly five) low-level systemlibraries written inC and developed mainly byGNOME. GLib's code was separated fromGTK, 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.
GLib provides advanced data structures, such as memory chunks, doubly and singlylinked lists,hash tables, dynamicstrings and string utilities, such as alexical scanner, string chunks (groups of strings), dynamicarrays, balancedbinary trees,N-ary trees, quarks (a two-way association of a string and a unique integer identifier), keyed data lists, relations, andtuples.Caches provide memory management.
GLib implements functions that providethreads, thread programming and related facilities such as primitive variable access,mutexes, asynchronousqueues, securememory pools,message passing and logging,hook functions (callback registering) andtimers. GLib also includes message passing facilities such asbyte order conversion and I/O channels.
Some other features of GLib include:
The GLib package consisted of five libraries, but they were all merged into one library, since then named simplyGLib, 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.
Command-line utilities associated with GLib, are usually packaged separately into libglib2.0-bin:
gapplication(1) – for starting applications via D-Bus activationgdbus(1) – for working with D-Bus objects and monitoring the busgio(1) – a file management utility that can work with GIO virtual filesystemsgresource(1) – for extracting files from binary format (*.gresource)-files and executablesgsettings(1) – for inspecting and editing application configurationgio-query-modules(1) – for updating caches used internally by GLibglib-compile-schemas(1) – for updating caches used internally by GLibGLib began as part of theGTK+ project, now named GTK. However, before releasing GTK+ version 2, the project's developers decided to separate code from GTK+ that was not forgraphical user interfaces (GUIs), 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 across-platform library, applications using it to interface with theoperating system are usually portable across different operating systems without major changes.[2]
Glib is undergoing active development. For a current overview seehttps://gitlab.gnome.org/GNOME/glib/-/blob/main/NEWS. The table below documents major patch notes from 1998 to 2022.
| Release series | Initial release date | Major enhancements |
|---|---|---|
| GLib 1.x | ||
| 1.1 | 1998-09-12 | |
| 1.2 | 1999-02-27 | |
| 1.3 | 2001-09-25 | |
| GLib 2.x | ||
| 2.0 | 2002-03-08 | |
| 2.24 | 2010-03-26 | GVariant, GConverted |
| 2.26 | 2010-09-27 | GSettings, GDbus,GObject property bindings (GAtomic for refcounting) |
| 2.30 | 2011-09-26 | Non-unique GApplications, useeventfd() for mainloop wakeup, GHashTable set optimization, GObject data scalability |
| 2.32 | 2012-03-24 | Plans for GLib 2.32 |
| 2.34 | 2012-09-23 | What's New for Developers in GLib 2.34 |
| 2.36 | 2013-03-25 | |
| 2.38 | 2013-09-23 | applications launched usingD-Bus activation[3] GSubprocess,Unicode 6.3 (released September 2013) |
| 2.40 | 2014-03-24 | GNotification, System notification API[4] |
| 2.42 | 2014-09-22 | |
| 2.43 | 2014-10-27 | |
| 2.44 | 2015-03-23 | |
| 2.45 | 2015-04-30 | |
| 2.46 | 2015-09-21 | |
| 2.47 | 2015-10-26 | |
| 2.48 | 2016-03-22 | |
| 2.50 | 2016-09-19 | |
| 2.52 | 2017-03-19 | |
| 2.53 | 2017-04-25 | |
| 2.54 | 2018-01-08 | |
| 2.55 | 2018-02-06 | |
| 2.56 | 2018-03-12 | |
| 2.57 | 2018-05-05 | |
| 2.58 | 2018-08-30 | |
| 2.59 | 2018-12-23 | |
| 2.60 | 2019-03-04 | |
| 2.61 | 2019-04-15 | |
| 2.62 | 2019-09-05 | |
| 2.63 | 2019-10-04 | |
| 2.64 | 2020-02-27 | |
| 2.65 | 2020-06-18 | |
| 2.66 | 2020-09-10 | |
| 2.67 | 2020-10-23 | |
| 2.68 | 2021-03-18 | |
| 2.69 | 2021-07-06 | |
| 2.70 | 2021-09-17 | |
| 2.71 | 2021-12-16 | |
| 2.72 | 2022-03-17 | |
Other libraries provide low-level functions and implementations of data structures, including:
[GLib] provides a cross-platform interface that allows your code to be run on any of its supported operating systemswith little to no rewriting of code!