~xubuntu-dev/libxfce4util/maverick

« back to all changes in this revision

Viewing changes to docs/xml/xfce-generics.xml

  • Committer: Lionel Le Folgoc
  • Date: 2010-05-23 18:00:15 UTC
  • Revision ID: mrpouit@ubuntu.com-20100523180015-0ddtdmn4xstvm2y8
* Merge from debian testing, remaining Ubuntu changes:
  - debian/control: use our Vcs-* fields.
  - debian/patches:
    + xubuntu_desktop-x-ubuntu-gettext.patch: display translations for
      "X-Ubuntu-Gettext-Domain" desktop files
    + series:
      . don't apply 01_add-desktop-base-in-config-dirs.patch
      . refreshed.
* New upstream release.
* debian/control:
  - bump standards version to 3.8.4.
  - add build-dep on intltool. 
  - drop quilt and chrpath build-deps.
  - bump debhelper build-deps for overrides.
* debian/rules:
  - switch to debhelper 7.
* switch to 3.0 (quilt) source format.
* debian/watch edited to track Xfce archive reorganisation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<refentry id="libxfce4util-Xfce-Generics">
2
 
<refmeta>
3
 
<refentrytitle role="top_of_page" id="libxfce4util-Xfce-Generics.top_of_page">Xfce Generics</refentrytitle>
4
 
<manvolnum>3</manvolnum>
5
 
<refmiscinfo>LIBXFCE4UTIL Library</refmiscinfo>
6
 
</refmeta>
7
 
 
8
 
<refnamediv>
9
 
<refname>Xfce Generics</refname>
10
 
<refpurpose>Generic data types and related functions.</refpurpose>
11
 
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
12
 
</refnamediv>
13
 
 
14
 
<refsynopsisdiv id="libxfce4util-Xfce-Generics.synopsis" role="synopsis">
15
 
<title role="synopsis.title">Synopsis</title>
16
 
 
17
 
<synopsis>
18
 
 
19
 
#include &lt;libxfce4util/libxfce4util.h&gt;
20
 
 
21
 
#define             <link linkend="XFCE-GENERIC-STACK:CAPS">XFCE_GENERIC_STACK</link>                  (Type)
22
 
#define             <link linkend="xfce-stack-new">xfce_stack_new</link>                      (StackType)
23
 
#define             <link linkend="xfce-stack-free">xfce_stack_free</link>                     (stack)
24
 
#define             <link linkend="xfce-stack-top">xfce_stack_top</link>                      (stack)
25
 
#define             <link linkend="xfce-stack-pop">xfce_stack_pop</link>                      (stack)
26
 
#define             <link linkend="xfce-stack-push">xfce_stack_push</link>                     (stack, value)
27
 
</synopsis>
28
 
</refsynopsisdiv>
29
 
 
30
 
 
31
 
 
32
 
 
33
 
 
34
 
 
35
 
 
36
 
 
37
 
 
38
 
<refsect1 id="libxfce4util-Xfce-Generics.description" role="desc">
39
 
<title role="desc.title">Description</title>
40
 
<para>
41
 
This module provides generic data types - as known from the C++ standard
42
 
template library - for the brave C programmer. Since C does not provide
43
 
any template mechanism, these generics are completely based on C preprocessor
44
 
macros and the functions offer no type safety at all (though some common
45
 
mistakes will surely be caught by the C compiler).
46
 
</para>
47
 
 
48
 
<para>
49
 
<example>
50
 
<title>Using a generic stack</title>
51
 
<programlisting>
52
 
  typedef XFCE_GENERIC_STACK(int) IntStack;
53
 
 
54
 
  IntStack *stack = xfce_stack_new (IntStack);
55
 
 
56
 
  xfce_stack_push (stack, 0);
57
 
  xfce_stack_push (stack, 1);
58
 
 
59
 
  printf ("Top is %d\n", xfce_stack_top (stack));
60
 
 
61
 
  xfce_stack_pop (stack);
62
 
 
63
 
  printf ("Top is %d\n", xfce_stack_top (stack));
64
 
 
65
 
  xfce_stack_free (stack);
66
 
</programlisting>
67
 
</example>
68
 
</para>
69
 
</refsect1>
70
 
 
71
 
<refsect1 id="libxfce4util-Xfce-Generics.details" role="details">
72
 
<title role="details.title">Details</title>
73
 
<refsect2 id="XFCE-GENERIC-STACK:CAPS" role="macro">
74
 
<title>XFCE_GENERIC_STACK()</title>
75
 
<indexterm zone="XFCE-GENERIC-STACK:CAPS"><primary>XFCE_GENERIC_STACK</primary></indexterm><programlisting>#define             XFCE_GENERIC_STACK(Type)</programlisting>
76
 
<para>
77
 
This macro is used to create a new stack data type which elements are of
78
 
<parameter>Type</parameter>. For example, to create a stack type that handles elements of type
79
 
<link linkend="double"><literal>double</literal></link>, you'd write the following
80
 
<programlisting>
81
 
typedef XFCE_GENERIC_STACK(double) MyDoubleStack;
82
 
</programlisting>
83
 
and furtheron refer to your stack type as <link linkend="MyDoubleStack"><literal>MyDoubleStack</literal></link>.
84
 
</para><variablelist role="params">
85
 
<varlistentry><term><parameter>Type</parameter>&nbsp;:</term>
86
 
<listitem><simpara>Data type of the elements that should be handled by the stack. Can
87
 
       be any valid data type from simple int's to complex structures.
88
 
 
89
 
 
90
 
</simpara></listitem></varlistentry>
91
 
</variablelist></refsect2>
92
 
<refsect2 id="xfce-stack-new" role="macro">
93
 
<title>xfce_stack_new()</title>
94
 
<indexterm zone="xfce-stack-new"><primary>xfce_stack_new</primary></indexterm><programlisting>#define             xfce_stack_new(StackType)</programlisting>
95
 
<para>
96
 
Creates a new instance of <parameter>StackType</parameter> and returns a pointer to the newly
97
 
created instance. For example, imagine you declared a type <link linkend="MyDoubleStack"><literal>MyDoubleStack</literal></link>
98
 
as shown above, you can instantiate this type with
99
 
<programlisting>
100
 
MyDoubleStack *my_stack = xfce_stack_new (MyDoubleStack);
101
 
</programlisting>
102
 
</para><variablelist role="params">
103
 
<varlistentry><term><parameter>StackType</parameter>&nbsp;:</term>
104
 
<listitem><simpara>Type of stack declared with <link linkend="XFCE-GENERIC-STACK:CAPS"><type>XFCE_GENERIC_STACK</type></link>.
105
 
 
106
 
 
107
 
</simpara></listitem></varlistentry>
108
 
</variablelist></refsect2>
109
 
<refsect2 id="xfce-stack-free" role="macro">
110
 
<title>xfce_stack_free()</title>
111
 
<indexterm zone="xfce-stack-free"><primary>xfce_stack_free</primary></indexterm><programlisting>#define             xfce_stack_free(stack)</programlisting>
112
 
<para>
113
 
Frees a stack, that was allocated using <link linkend="xfce-stack-new"><type>xfce_stack_new</type></link>.
114
 
</para><variablelist role="params">
115
 
<varlistentry><term><parameter>stack</parameter>&nbsp;:</term>
116
 
<listitem><simpara>A stack object.
117
 
 
118
 
 
119
 
</simpara></listitem></varlistentry>
120
 
</variablelist></refsect2>
121
 
<refsect2 id="xfce-stack-top" role="macro">
122
 
<title>xfce_stack_top()</title>
123
 
<indexterm zone="xfce-stack-top"><primary>xfce_stack_top</primary></indexterm><programlisting>#define             xfce_stack_top(stack)</programlisting>
124
 
<para>
125
 
Returns the top element from <parameter>stack</parameter>. Note that this function does not
126
 
pop the top element, it just returns it.
127
 
</para><variablelist role="params">
128
 
<varlistentry><term><parameter>stack</parameter>&nbsp;:</term>
129
 
<listitem><simpara>
130
 
 
131
 
 
132
 
</simpara></listitem></varlistentry>
133
 
</variablelist></refsect2>
134
 
<refsect2 id="xfce-stack-pop" role="macro">
135
 
<title>xfce_stack_pop()</title>
136
 
<indexterm zone="xfce-stack-pop"><primary>xfce_stack_pop</primary></indexterm><programlisting>#define             xfce_stack_pop(stack)</programlisting>
137
 
<para>
138
 
Removes the top element from <parameter>stack</parameter>.
139
 
</para><variablelist role="params">
140
 
<varlistentry><term><parameter>stack</parameter>&nbsp;:</term>
141
 
<listitem><simpara>
142
 
 
143
 
 
144
 
</simpara></listitem></varlistentry>
145
 
</variablelist></refsect2>
146
 
<refsect2 id="xfce-stack-push" role="macro">
147
 
<title>xfce_stack_push()</title>
148
 
<indexterm zone="xfce-stack-push"><primary>xfce_stack_push</primary></indexterm><programlisting>#define             xfce_stack_push(stack, value)</programlisting>
149
 
<para>
150
 
Pushes a new <parameter>value</parameter> on top of <parameter>stack</parameter>.
151
 
</para><variablelist role="params">
152
 
<varlistentry><term><parameter>stack</parameter>&nbsp;:</term>
153
 
<listitem><simpara>
154
 
</simpara></listitem></varlistentry>
155
 
<varlistentry><term><parameter>value</parameter>&nbsp;:</term>
156
 
<listitem><simpara>
157
 
 
158
 
 
159
 
</simpara></listitem></varlistentry>
160
 
</variablelist></refsect2>
161
 
 
162
 
</refsect1>
163
 
 
164
 
 
165
 
 
166
 
 
167
 
</refentry>