<!-- ##### SECTION Title ##### -->
Xfce Generics

<!-- ##### SECTION Short_Description ##### -->
Generic data types and related functions.

<!-- ##### SECTION Long_Description ##### -->
<para>
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).
</para>

<para>
<example>
<title>Using a generic stack</title>
<programlisting>
  typedef XFCE_GENERIC_STACK(int) IntStack;

  IntStack *stack = xfce_stack_new (IntStack);

  xfce_stack_push (stack, 0);
  xfce_stack_push (stack, 1);

  printf ("Top is %d\n", xfce_stack_top (stack));

  xfce_stack_pop (stack);

  printf ("Top is %d\n", xfce_stack_top (stack));

  xfce_stack_free (stack);
</programlisting>
</example>
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### MACRO XFCE_GENERIC_STACK ##### -->
<para>
This macro is used to create a new stack data type which elements are of
@Type. For example, to create a stack type that handles elements of type
%double, you'd write the following
<programlisting>
typedef XFCE_GENERIC_STACK(double) MyDoubleStack;
</programlisting>
and furtheron refer to your stack type as %MyDoubleStack.
</para>

@Type: Data type of the elements that should be handled by the stack. Can
       be any valid data type from simple int's to complex structures.


<!-- ##### MACRO xfce_stack_new ##### -->
<para>
Creates a new instance of @StackType and returns a pointer to the newly
created instance. For example, imagine you declared a type %MyDoubleStack
as shown above, you can instantiate this type with
<programlisting>
MyDoubleStack *my_stack = xfce_stack_new (MyDoubleStack);
</programlisting>
</para>

@StackType: Type of stack declared with #XFCE_GENERIC_STACK.


<!-- ##### MACRO xfce_stack_free ##### -->
<para>
Frees a stack, that was allocated using #xfce_stack_new.
</para>

@stack: A stack object.


<!-- ##### MACRO xfce_stack_top ##### -->
<para>
Returns the top element from @stack. Note that this function does not
pop the top element, it just returns it.
</para>

@stack: 


<!-- ##### MACRO xfce_stack_pop ##### -->
<para>
Removes the top element from @stack.
</para>

@stack: 


<!-- ##### MACRO xfce_stack_push ##### -->
<para>
Pushes a new @value on top of @stack.
</para>

@stack: 
@value: 


