There simply isn't space to cover all of glib's features in
this book. It's worth looking at glib whenever you find
yourself thinking, "There really
should be a function that..."---glib.h and the glib documentation on
https://www.gtk.org/ are excellent resources.
equivalents for many numeric types.
g_memmove() is more portable
G_VA_COPY copies a
va_list in a portable
Numerous macros to permit the use of compiler
extensions (especially gcc
extensions) in a portable way.
Portable g_htonl() and other
A GCache generic cache
"Callback maintenance" routines---registering and
unregistering of callbacks.
The g_log() facility, allows
you to print warnings, messages, etc. with configurable
log levels and pluggable print routines.
allows you to allocate a large pool of small memory
chunks, for efficiency gains compared to g_malloc(). Used in the GList implementation, for
A timer facility.
Convenience/portability routines to get the user's home
directory, get the name of a
/tmp directory, and similar tasks.
Filename manipulation, such as
Enhanced string and array classes. Pointer and byte
mapping from strings to integer identifiers.
Routines to associate data with strings, or with
A lexical scanner.
A generic event loop abstraction, used to implement
GTK+'s event loop.
A portable threads abstraction.
If you need some generally-useful routine that's not in
glib already, consider writing it in glib style and
contributing it to the library! You get free assistance
with design, debugging, and maintenance, and other
programmers benefit from the facility you've written. By
the time you read this, it's also possible that the feature
you want is already in the latest version of glib.