/usr/share/gtk-doc/html/libxfce4util/libxfce4util-Xfce-Generics.html is in libxfce4util-dev 4.10.1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Xfce Generics</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="libxfce4util Reference Manual">
<link rel="up" href="libxfce4util-datatypes.html" title="Xfce Data types">
<link rel="prev" href="libxfce4util-datatypes.html" title="Xfce Data types">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libxfce4util-datatypes.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libxfce4util-datatypes.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libxfce4util Reference Manual</th>
<td> </td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libxfce4util-Xfce-Generics.synopsis" class="shortcut">Top</a>
|
<a href="#libxfce4util-Xfce-Generics.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libxfce4util-Xfce-Generics"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libxfce4util-Xfce-Generics.top_of_page"></a>Xfce Generics</span></h2>
<p>Xfce Generics — Generic data types and related functions.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libxfce4util-Xfce-Generics.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <libxfce4util/libxfce4util.h>
#define <a class="link" href="libxfce4util-Xfce-Generics.html#XFCE-GENERIC-STACK:CAPS" title="XFCE_GENERIC_STACK()">XFCE_GENERIC_STACK</a> (Type)
#define <a class="link" href="libxfce4util-Xfce-Generics.html#xfce-stack-new" title="xfce_stack_new()">xfce_stack_new</a> (StackType)
#define <a class="link" href="libxfce4util-Xfce-Generics.html#xfce-stack-free" title="xfce_stack_free()">xfce_stack_free</a> (stack)
#define <a class="link" href="libxfce4util-Xfce-Generics.html#xfce-stack-top" title="xfce_stack_top()">xfce_stack_top</a> (stack)
#define <a class="link" href="libxfce4util-Xfce-Generics.html#xfce-stack-pop" title="xfce_stack_pop()">xfce_stack_pop</a> (stack)
#define <a class="link" href="libxfce4util-Xfce-Generics.html#xfce-stack-push" title="xfce_stack_push()">xfce_stack_push</a> (stack,
value)
</pre>
</div>
<div class="refsect1">
<a name="libxfce4util-Xfce-Generics.description"></a><h2>Description</h2>
<p>
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).
</p>
<p>
</p>
<div class="example">
<a name="idp8023968"></a><p class="title"><b>Example 2. Using a generic stack</b></p>
<div class="example-contents"><pre class="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);
</pre></div>
</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="libxfce4util-Xfce-Generics.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="XFCE-GENERIC-STACK:CAPS"></a><h3>XFCE_GENERIC_STACK()</h3>
<pre class="programlisting">#define XFCE_GENERIC_STACK(Type)</pre>
<p>
This macro is used to create a new stack data type which elements are of
<em class="parameter"><code>Type</code></em>. For example, to create a stack type that handles elements of type
<code class="literal">double</code>, you'd write the following
</p>
<pre class="programlisting">
typedef XFCE_GENERIC_STACK(double) MyDoubleStack;
</pre>
<p>
and furtheron refer to your stack type as <code class="literal">MyDoubleStack</code>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>Type</code></em> :</span></p></td>
<td>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.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="xfce-stack-new"></a><h3>xfce_stack_new()</h3>
<pre class="programlisting">#define xfce_stack_new(StackType)</pre>
<p>
Creates a new instance of <em class="parameter"><code>StackType</code></em> and returns a pointer to the newly
created instance. For example, imagine you declared a type <code class="literal">MyDoubleStack</code>
as shown above, you can instantiate this type with
</p>
<pre class="programlisting">
MyDoubleStack *my_stack = xfce_stack_new (MyDoubleStack);
</pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>StackType</code></em> :</span></p></td>
<td>Type of stack declared with <a class="link" href="libxfce4util-Xfce-Generics.html#XFCE-GENERIC-STACK:CAPS" title="XFCE_GENERIC_STACK()"><span class="type">XFCE_GENERIC_STACK</span></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="xfce-stack-free"></a><h3>xfce_stack_free()</h3>
<pre class="programlisting">#define xfce_stack_free(stack)</pre>
<p>
Frees a stack, that was allocated using <a class="link" href="libxfce4util-Xfce-Generics.html#xfce-stack-new" title="xfce_stack_new()"><span class="type">xfce_stack_new</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>stack</code></em> :</span></p></td>
<td>A stack object.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="xfce-stack-top"></a><h3>xfce_stack_top()</h3>
<pre class="programlisting">#define xfce_stack_top(stack)</pre>
<p>
Returns the top element from <em class="parameter"><code>stack</code></em>. Note that this function does not
pop the top element, it just returns it.
</p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-stack-pop"></a><h3>xfce_stack_pop()</h3>
<pre class="programlisting">#define xfce_stack_pop(stack)</pre>
<p>
Removes the top element from <em class="parameter"><code>stack</code></em>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-stack-push"></a><h3>xfce_stack_push()</h3>
<pre class="programlisting">#define xfce_stack_push(stack, value)</pre>
<p>
Pushes a new <em class="parameter"><code>value</code></em> on top of <em class="parameter"><code>stack</code></em>.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|