The Full Wiki

More info on GLIB

GLIB: Wikis


Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.


Template:Infobox Software In computing, GLib refers to a cross-platform software utility library. It started off as part of the GTK+ project, however, before releasing version 2 of GTK+, the project's developers decided to separate non-GUI-specific code from the GTK+ platform, thus creating GLib as a separate product. GLib was released as a separate library so other developers, those that 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 a full-blown 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.[1]



On an elementary level GLib provides type definitions replacing the C primitive types char, int, float, and so on in order to improve portability; since the C standard doesn't define any minimal byte size of those types, GLib replaces them with types that have such a minimal size and provides declared constants for their sizes.

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 household.

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:

  • standard macros
  • warnings and assertions
  • dynamic loading of modules
  • a type system, GType
  • an object system, GObject

Similar projects

For many applications, C with GLib is an alternative to C++ with STL (see GObject for a detailed comparison).

Other widget toolkits usually also provide low-level functions and implementations of data structures. For instance, in the wxWidgets library the non-GUI functions are in the wxBase library, and in Qt the non-GUI parts are in the QtCore module.


  1. Krause, Andrew (2007). Foundations of GTK+ Development. Expert's Voice in Open Source. Apress. p. 5. ISBN 1590597931. "[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!" 

External links

File:Free Software Portal Free software portal

Got something to say? Make a comment.
Your name
Your email address