Xfce Generics

Xfce Generics — Generic data types and related functions.

Synopsis

#include <libxfce4util/libxfce4util.h>

#define             XFCE_GENERIC_STACK                  (Type)
#define             xfce_stack_new                      (StackType)
#define             xfce_stack_free                     (stack)
#define             xfce_stack_top                      (stack)
#define             xfce_stack_pop                      (stack)
#define             xfce_stack_push                     (stack,
                                                         value)

Description

This module provides generic data types - as known from the C++ standard template library - for the brave C programmer. Since C does not provide any template mechanism, these generics are completely based on C preprocessor macros and the functions offer no type safety at all (though some common mistakes will surely be caught by the C compiler).

Example 2. Using a generic stack

1
2
3
4
5
6
7
8
9
10
11