diff options
author | Benedikt Meurer <benny@xfce.org> | 2004-08-04 14:27:39 +0000 |
---|---|---|
committer | Benedikt Meurer <benny@xfce.org> | 2004-08-04 14:27:39 +0000 |
commit | ed5ffb2e541900749a83ed3a12cb07cbb8d20df7 (patch) | |
tree | 8eebe2056be929baf85b2bd3ecfdc57cb407f569 /docs | |
parent | fb27fa9d3579ee0f63dc956ec034de180e4de498 (diff) | |
download | libxfce4util-ed5ffb2e541900749a83ed3a12cb07cbb8d20df7.tar.gz |
Added a generic stack data type, usefull for keeping state while parsing xml
files using the Glib XML parser. Version is now 4.1.15.
(Old svn revision: 856)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/libxfce4util-docs.sgml | 8 | ||||
-rw-r--r-- | docs/libxfce4util-sections.txt | 12 | ||||
-rw-r--r-- | docs/tmpl/xfce-generics.sgml | 105 |
3 files changed, 122 insertions, 3 deletions
diff --git a/docs/libxfce4util-docs.sgml b/docs/libxfce4util-docs.sgml index 922a8d5..03afc39 100644 --- a/docs/libxfce4util-docs.sgml +++ b/docs/libxfce4util-docs.sgml @@ -10,6 +10,7 @@ <!ENTITY libxfce4util-MiscUtils-Functions SYSTEM "xml/xfce-miscutils.xml"> <!ENTITY libxfce4util-Unicode-Functions SYSTEM "xml/utf8.xml"> <!ENTITY libxfce4util-Desktop-Entries SYSTEM "xml/xfce-desktopentry.xml"> +<!ENTITY libxfce4util-Generics SYSTEM "xml/xfce-generics.xml"> <!ENTITY version SYSTEM "version.xml"> ]> @@ -36,6 +37,7 @@ <chapter id="libxfce4util-core"> <title>Xfce Core Application support</title> + &libxfce4util-Desktop-Entries; &libxfce4util-Kiosk; </chapter> @@ -48,9 +50,9 @@ &libxfce4util-Unicode-Functions; </chapter> - <chapter id="libxfce4util-desktop"> - <title>Xfce Desktop Support</title> - &libxfce4util-Desktop-Entries; + <chapter id="libxfce4util-datatypes"> + <title>Xfce Data types</title> + &libxfce4util-Generics; </chapter> </book> diff --git a/docs/libxfce4util-sections.txt b/docs/libxfce4util-sections.txt index 6980902..a1b7f70 100644 --- a/docs/libxfce4util-sections.txt +++ b/docs/libxfce4util-sections.txt @@ -30,6 +30,18 @@ xfce_locale_match <SECTION> +<TITLE>Xfce Generics</TITLE> +<FILE>xfce-generics</FILE> +XFCE_GENERIC_STACK +xfce_stack_new +xfce_stack_free +xfce_stack_top +xfce_stack_pop +xfce_stack_push +</SECTION> + + +<SECTION> <TITLE>Xfce Kiosk functions</TITLE> <FILE>xfce-kiosk</FILE> XfceKiosk diff --git a/docs/tmpl/xfce-generics.sgml b/docs/tmpl/xfce-generics.sgml new file mode 100644 index 0000000..096ce3c --- /dev/null +++ b/docs/tmpl/xfce-generics.sgml @@ -0,0 +1,105 @@ +<!-- ##### 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> + +<!-- ##### 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: + + |