HOME

TheInfoList



OR:

GLib is a bundle of three (formerly five) low-level system
libraries A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
written in C and developed mainly by GNOME. GLib's code was separated from
GTK GTK (formerly GIMP ToolKit and GTK+) is a free software 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 software, free and ...
, 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 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 whi ...
s,
hash table In computer science, a hash table is a data structure that implements an associative array, also called a dictionary or simply map; an associative array is an abstract data type that maps Unique key, keys to Value (computer science), values. ...
s, dynamic strings and string utilities, such as a lexical scanner, string chunks (groups of strings), dynamic
arrays An array is a systematic arrangement of similar objects, usually in rows and columns. Things called an array include: {{TOC right Music * In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
, balanced
binary tree In computer science, a binary tree is a tree data structure in which each node has at most two children, referred to as the ''left child'' and the ''right child''. That is, it is a ''k''-ary tree with . A recursive definition using set theor ...
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 sequence or ''ordered list'' of numbers or, more generally, mathematical objects, which are called the ''elements'' of the tuple. An -tuple is a tuple of elements, where is a non-negative integer. There is o ...
s. 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 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 ...
and logging, hook functions (callback registering) and
timer A timer or countdown timer is a type of clock that starts from a specified time duration and stops upon reaching 00:00. It can also usually be stopped manually before the whole duration has elapsed. An example of a simple timer is an hourglass ...
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


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, free software library providing a portable object system and transparent cross-language interoperability. GObject is designed for use both directly in C (programming language), C programs ...
, an object system including the type system GType * GLib * GModule * GThread * 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.


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 (*.gresource)-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 interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
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 Within 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 platform, computing platforms. Some ...
library, applications using it to interface with the
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
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: *
Microsoft Foundation Class Library Microsoft Foundation Class Library (MFC) is a C++ object-oriented library for developing desktop applications for Windows. MFC was introduced by Microsoft in 1992 and quickly gained widespread use. While Microsoft has introduced alternative a ...
(MFC) – An object-oriented C++ wrapper library to the C-based Windows API which also includes some data structures and other convenience functionality * Standard Template Library (STL) – C++ library for data structures and algorithms * Boost – provides some functions for C++, such as threading primitives, similar to what GLib does for C * QtCore – core API of the Qt Framework * wxBase – non-GUI functions of the
wxWidgets wxWidgets (formerly wxWindows) is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with no s ...
library * The Apache Portable Runtime and Apple
Core Foundation Core Foundation (also called CF) is a C application programming interface (API) written by Apple Inc. for its operating systems, and is a mix of low-level routines and wrapper functions. Most Core Foundation routines follow a certain naming c ...
have a large functional overlap with GLib, and provide many similar OS-portable threading, network and data structure implementations in C. * Gnulib - The GNU portability library


References


External links


GLib API documentation

GLib Git Source Tree
{{DEFAULTSORT:Glib C (programming language) libraries Free computer libraries Free software programmed in C GNOME libraries GTK Software using the GNU Lesser General Public License