GLib is a bundle of three (formerly five) low-level system
libraries written in
C and developed mainly by
GNOME
A gnome is a mythological creature and diminutive spirit in Renaissance magic and alchemy, first introduced by Paracelsus in the 16th century and later adopted by more recent authors including those of modern fantasy literature. Its characte ...
. 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.
Features
GLib provides advanced data structures, such as memory chunks, doubly and singly
linked list
In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes whic ...
s,
hash tables, dynamic
strings
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
and string utilities, such as a
lexical
Lexical may refer to:
Linguistics
* Lexical corpus or lexis, a complete set of all words in a language
* Lexical item, a basic unit of lexicographical classification
* Lexicon, the vocabulary of a person, language, or branch of knowledge
* Lexical ...
scanner, string chunks (groups of strings), dynamic
arrays, balanced
binary tree
In computer science, a binary tree is a k-ary k = 2 tree data structure in which each node has at most two children, which are referred to as the ' and the '. A recursive definition using just set theory notions is that a (non-empty) binary t ...
s,
N-ary trees, quarks (a two-way association of a string and a unique integer identifier), keyed data lists, relations, and
tuple
In mathematics, a tuple is a finite ordered list (sequence) of elements. An -tuple is a sequence (or ordered list) of elements, where is a non-negative integer. There is only one 0-tuple, referred to as ''the empty tuple''. An -tuple is defi ...
s.
Caches provide memory management.
GLib implements functions that provide
threads, thread programming and related facilities such as primitive variable access,
mutexes, asynchronous
queue __NOTOC__
Queue () may refer to:
* Queue area, or queue, a line or area where people wait for goods or services
Arts, entertainment, and media
*''ACM Queue'', a computer magazine
* The Queue (Sorokin novel), ''The Queue'' (Sorokin novel), a 198 ...
s, secure
memory pools,
message passing
In computer science, message passing is a technique for invoking behavior (i.e., running a program) on a computer. The invoking program sends a message to a process (which may be an actor or object) and relies on that process and its supporting i ...
and logging,
hook functions (callback registering) and
timer
A timer is a specialized type of clock used for measuring specific time intervals.
Timers can be categorized into two main types.
The word "timer" is usually reserved for devices that counts down from a specified time interval, while devices th ...
s. GLib also includes message passing facilities such as
byte order conversion and I/O channels.
Some other features of GLib include:
* standard
macros
* warnings and assertions
* dynamic loading of
modules
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
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:
*
GObject
The GLib Object System, or GObject, is a free software library providing a portable object system and transparent cross-language interoperability. GObject is designed for use both directly in C programs to provide object-oriented C-based APIs ...
, an object system including the type system GType
* GLib
* GModule
* GThread
*
GIO
Gio or GIO may refer to:
People
* Gio (nickname)
* Gio (footballer, born 1984), Spanish
* Gio (singer) (born 1990)
* Gio people, an ethnic group in northeastern Liberia and Côte d'Ivoire
Science and technology
* Gi/o, protein subunits
* GIO, ...
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.
History
GLib began as part of the
GTK+
GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprie ...
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 interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
s (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 a
cross-platform
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software r ...
library, applications using it to interface with the
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
are usually portable across different operating systems without major changes.
Releases
Glib is undergoing active development. For a current overview se
https://gitlab.gnome.org/GNOME/glib/-/blob/main/NEWS 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:
*
Standard Template Library (STL) –
C++ library for data structures and algorithms
*
Boost
Boost, boosted or boosting may refer to:
Science, technology and mathematics
* Boost, positive manifold pressure in turbocharged engines
* Boost (C++ libraries), a set of free peer-reviewed portable C++ libraries
* Boost (material), a material b ...
– provides some functions for C++, such as threading primitives, similar to what GLib does for C
* QtCore – core API of the
Qt Framework
Qt (pronounced "cute") is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems wit ...
* wxBase – non-GUI functions of the
wxWidgets library
* The
Apache Portable Runtime and Apple
Core Foundation
Core Foundation (also called CF) is a C application programming interface (API) written by Apple for its operating systems, and is a mix of low-level routines and wrapper functions. Most Core Foundation routines follow a certain naming conventi ...
have a large functional overlap with GLib, and provide many similar OS-portable threading, network and data structure implementations in C.
References
External links
*
GLib API documentationGLib Git Source Tree
{{DEFAULTSORT:Glib
C (programming language) libraries
Free computer libraries
Free software programmed in C
GNOME libraries
GTK
Software using the LGPL license