GLib

GLib
Developer(s) GNOME Foundation
Stable release 2.30.0 / September 27, 2011; 4 months ago (2011-09-27)
Preview release 2.29.92 / September 18, 2011; 4 months ago (2011-09-18)
Development status Active
Written in C
Operating system Cross-platform
Platform Cross-platform
Available in Multilingual
Type Library
License GNU Lesser General Public License
Website http://library.gnome.org/devel/glib/

GLib is a cross-platform software utility library that began 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]

Contents

Features

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:

Similar projects

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

The Apache Portable Runtime has a large functional overlap with GLib, and provides many similar OS-portable threading, network and data structure implementations in C.

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, which is written in C++.

Components

GLib package consists of 5 libraries:

References

  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