GLib

From Wikipedia, the free encyclopedia
Jump to: navigation, search
GLib
Developer(s) GNOME Foundation
Stable release 2.36.1 / April 16, 2013; 27 days ago (2013-04-16)
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 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 who 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 the entire 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 [edit]

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 [edit]

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

The Apache Portable Runtime and Apple Core Foundation have a large functional overlap with GLib, and provide 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++.

For C++, the Boost (C++ libraries) provide some similar functionality, such as threading primitives, similar to what glib does for C.[2]

Components [edit]

GLib package consists of 5 libraries:

References [edit]

  1. ^ Krause, Andrew (2007). Foundations of GTK+ Development. Expert's Voice in Open Source. Apress. p. 5. ISBN 1-59059-793-1. Retrieved 3 April 2013. "[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!" 
  2. ^ http://stackoverflow.com/questions/213460/boost-like-libraries-in-c

External links [edit]