diff options
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/doc/api/xml/iff.xml')
-rw-r--r-- | src/others/mimesh/libg3d-0.0.8/doc/api/xml/iff.xml | 558 |
1 files changed, 558 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/doc/api/xml/iff.xml b/src/others/mimesh/libg3d-0.0.8/doc/api/xml/iff.xml new file mode 100644 index 0000000..73b9ca6 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/doc/api/xml/iff.xml | |||
@@ -0,0 +1,558 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> | ||
4 | <refentry id="libg3d-iff"> | ||
5 | <refmeta> | ||
6 | <refentrytitle role="top_of_page" id="libg3d-iff.top_of_page">iff</refentrytitle> | ||
7 | <manvolnum>3</manvolnum> | ||
8 | <refmiscinfo>LIBG3D Library</refmiscinfo> | ||
9 | </refmeta> | ||
10 | |||
11 | <refnamediv> | ||
12 | <refname>iff</refname> | ||
13 | <refpurpose>IFF file helper functions</refpurpose> | ||
14 | <!--[<xref linkend="desc" endterm="desc.title"/>]--> | ||
15 | </refnamediv> | ||
16 | |||
17 | <refsynopsisdiv id="libg3d-iff.synopsis" role="synopsis"> | ||
18 | <title role="synopsis.title">Synopsis</title> | ||
19 | |||
20 | <synopsis> | ||
21 | |||
22 | #include <g3d/iff.h> | ||
23 | |||
24 | #define <link linkend="G3D-IFF-PAD1:CAPS">G3D_IFF_PAD1</link> | ||
25 | #define <link linkend="G3D-IFF-PAD2:CAPS">G3D_IFF_PAD2</link> | ||
26 | #define <link linkend="G3D-IFF-PAD4:CAPS">G3D_IFF_PAD4</link> | ||
27 | #define <link linkend="G3D-IFF-PAD8:CAPS">G3D_IFF_PAD8</link> | ||
28 | #define <link linkend="G3D-IFF-LE:CAPS">G3D_IFF_LE</link> | ||
29 | #define <link linkend="G3D-IFF-LEN16:CAPS">G3D_IFF_LEN16</link> | ||
30 | #define <link linkend="G3D-IFF-SUBCHUNK-LEN16:CAPS">G3D_IFF_SUBCHUNK_LEN16</link> | ||
31 | #define <link linkend="G3D-IFF-MKID:CAPS">G3D_IFF_MKID</link> (a,b,c,d) | ||
32 | <link linkend="gboolean">gboolean</link> <link linkend="g3d-iff-check">g3d_iff_check</link> (<link linkend="G3DStream">G3DStream</link> *stream, | ||
33 | <link linkend="guint32">guint32</link> *id, | ||
34 | <link linkend="gsize">gsize</link> *len); | ||
35 | <link linkend="gsize">gsize</link> <link linkend="g3d-iff-read-chunk">g3d_iff_read_chunk</link> (<link linkend="G3DStream">G3DStream</link> *stream, | ||
36 | <link linkend="guint32">guint32</link> *id, | ||
37 | <link linkend="gsize">gsize</link> *len, | ||
38 | <link linkend="guint32">guint32</link> flags); | ||
39 | <link linkend="gpointer">gpointer</link> <link linkend="g3d-iff-handle-chunk">g3d_iff_handle_chunk</link> (<link linkend="G3DIffGlobal">G3DIffGlobal</link> *global, | ||
40 | <link linkend="G3DIffLocal">G3DIffLocal</link> *plocal, | ||
41 | <link linkend="G3DIffChunkInfo">G3DIffChunkInfo</link> *chunks, | ||
42 | <link linkend="guint32">guint32</link> flags); | ||
43 | <link linkend="gboolean">gboolean</link> <link linkend="g3d-iff-chunk-matches">g3d_iff_chunk_matches</link> (<link linkend="guint32">guint32</link> id, | ||
44 | <link linkend="gchar">gchar</link> *tid); | ||
45 | <link linkend="gboolean">gboolean</link> <link linkend="g3d-iff-read-ctnr">g3d_iff_read_ctnr</link> (<link linkend="G3DIffGlobal">G3DIffGlobal</link> *global, | ||
46 | <link linkend="G3DIffLocal">G3DIffLocal</link> *local, | ||
47 | <link linkend="G3DIffChunkInfo">G3DIffChunkInfo</link> *chunks, | ||
48 | <link linkend="guint32">guint32</link> flags); | ||
49 | <link linkend="gchar">gchar</link>* <link linkend="g3d-iff-id-to-text">g3d_iff_id_to_text</link> (<link linkend="guint32">guint32</link> id); | ||
50 | <link linkend="FILE:CAPS">FILE</link>* <link linkend="g3d-iff-open">g3d_iff_open</link> (const <link linkend="gchar">gchar</link> *filename, | ||
51 | <link linkend="guint32">guint32</link> *id, | ||
52 | <link linkend="guint32">guint32</link> *len); | ||
53 | <link linkend="int">int</link> <link linkend="g3d-iff-readchunk">g3d_iff_readchunk</link> (<link linkend="FILE:CAPS">FILE</link> *f, | ||
54 | <link linkend="guint32">guint32</link> *id, | ||
55 | <link linkend="guint32">guint32</link> *len, | ||
56 | <link linkend="guint32">guint32</link> flags); | ||
57 | <link linkend="gboolean">gboolean</link> (<link linkend="G3DIffChunkCallback">*G3DIffChunkCallback</link>) (<link linkend="G3DIffGlobal">G3DIffGlobal</link> *global, | ||
58 | <link linkend="G3DIffLocal">G3DIffLocal</link> *local); | ||
59 | #define <link linkend="g3d-iff-chunk-callback">g3d_iff_chunk_callback</link> | ||
60 | <link linkend="G3DIffChunkInfo">G3DIffChunkInfo</link>; | ||
61 | #define <link linkend="g3d-iff-chunk-info">g3d_iff_chunk_info</link> | ||
62 | <link linkend="G3DIffGlobal">G3DIffGlobal</link>; | ||
63 | #define <link linkend="g3d-iff-gdata">g3d_iff_gdata</link> | ||
64 | <link linkend="G3DIffLocal">G3DIffLocal</link>; | ||
65 | #define <link linkend="g3d-iff-ldata">g3d_iff_ldata</link> | ||
66 | </synopsis> | ||
67 | </refsynopsisdiv> | ||
68 | |||
69 | |||
70 | |||
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | <refsect1 id="libg3d-iff.description" role="desc"> | ||
78 | <title role="desc.title">Description</title> | ||
79 | <para> | ||
80 | These are helper functions to read data from the Interchange File Format | ||
81 | (IFF).</para> | ||
82 | <para> | ||
83 | |||
84 | </para> | ||
85 | </refsect1> | ||
86 | |||
87 | <refsect1 id="libg3d-iff.details" role="details"> | ||
88 | <title role="details.title">Details</title> | ||
89 | <refsect2 id="G3D-IFF-PAD1:CAPS" role="macro"> | ||
90 | <title>G3D_IFF_PAD1</title> | ||
91 | <indexterm zone="G3D-IFF-PAD1:CAPS"><primary>G3D_IFF_PAD1</primary></indexterm><programlisting>#define G3D_IFF_PAD1 0x01 | ||
92 | </programlisting> | ||
93 | <para> | ||
94 | No padding is done after chunks.</para> | ||
95 | <para> | ||
96 | |||
97 | </para></refsect2> | ||
98 | <refsect2 id="G3D-IFF-PAD2:CAPS" role="macro"> | ||
99 | <title>G3D_IFF_PAD2</title> | ||
100 | <indexterm zone="G3D-IFF-PAD2:CAPS"><primary>G3D_IFF_PAD2</primary></indexterm><programlisting>#define G3D_IFF_PAD2 0x02 | ||
101 | </programlisting> | ||
102 | <para> | ||
103 | Chunks are 2-byte aligned</para> | ||
104 | <para> | ||
105 | |||
106 | </para></refsect2> | ||
107 | <refsect2 id="G3D-IFF-PAD4:CAPS" role="macro"> | ||
108 | <title>G3D_IFF_PAD4</title> | ||
109 | <indexterm zone="G3D-IFF-PAD4:CAPS"><primary>G3D_IFF_PAD4</primary></indexterm><programlisting>#define G3D_IFF_PAD4 0x04 | ||
110 | </programlisting> | ||
111 | <para> | ||
112 | Chunks are 4-byte aligned</para> | ||
113 | <para> | ||
114 | |||
115 | </para></refsect2> | ||
116 | <refsect2 id="G3D-IFF-PAD8:CAPS" role="macro"> | ||
117 | <title>G3D_IFF_PAD8</title> | ||
118 | <indexterm zone="G3D-IFF-PAD8:CAPS"><primary>G3D_IFF_PAD8</primary></indexterm><programlisting>#define G3D_IFF_PAD8 0x08 | ||
119 | </programlisting> | ||
120 | <para> | ||
121 | Chunks are 8-byte aligned</para> | ||
122 | <para> | ||
123 | |||
124 | </para></refsect2> | ||
125 | <refsect2 id="G3D-IFF-LE:CAPS" role="macro"> | ||
126 | <title>G3D_IFF_LE</title> | ||
127 | <indexterm zone="G3D-IFF-LE:CAPS"><primary>G3D_IFF_LE</primary></indexterm><programlisting>#define G3D_IFF_LE 0x40 /* little endian */ | ||
128 | </programlisting> | ||
129 | <para> | ||
130 | The file has little-endian data.</para> | ||
131 | <para> | ||
132 | |||
133 | </para></refsect2> | ||
134 | <refsect2 id="G3D-IFF-LEN16:CAPS" role="macro"> | ||
135 | <title>G3D_IFF_LEN16</title> | ||
136 | <indexterm zone="G3D-IFF-LEN16:CAPS"><primary>G3D_IFF_LEN16</primary></indexterm><programlisting>#define G3D_IFF_LEN16 0x20 | ||
137 | </programlisting> | ||
138 | <para> | ||
139 | All chunks have 16-bit sizes.</para> | ||
140 | <para> | ||
141 | |||
142 | </para></refsect2> | ||
143 | <refsect2 id="G3D-IFF-SUBCHUNK-LEN16:CAPS" role="macro"> | ||
144 | <title>G3D_IFF_SUBCHUNK_LEN16</title> | ||
145 | <indexterm zone="G3D-IFF-SUBCHUNK-LEN16:CAPS"><primary>G3D_IFF_SUBCHUNK_LEN16</primary></indexterm><programlisting>#define G3D_IFF_SUBCHUNK_LEN16 0x10 | ||
146 | </programlisting> | ||
147 | <para> | ||
148 | All chunks except the toplevel ones have 16-bit sizes.</para> | ||
149 | <para> | ||
150 | |||
151 | </para></refsect2> | ||
152 | <refsect2 id="G3D-IFF-MKID:CAPS" role="macro"> | ||
153 | <title>G3D_IFF_MKID()</title> | ||
154 | <indexterm zone="G3D-IFF-MKID:CAPS"><primary>G3D_IFF_MKID</primary></indexterm><programlisting>#define G3D_IFF_MKID(a,b,c,d)</programlisting> | ||
155 | <para> | ||
156 | Generate an IFF chunk identifier from character representation, e.g. | ||
157 | G3D_IFF_MKID('F','O','R','M').</para> | ||
158 | <para> | ||
159 | |||
160 | </para><variablelist role="params"> | ||
161 | <varlistentry><term><parameter>a</parameter> :</term> | ||
162 | <listitem><simpara> first byte | ||
163 | </simpara></listitem></varlistentry> | ||
164 | <varlistentry><term><parameter>b</parameter> :</term> | ||
165 | <listitem><simpara> second byte | ||
166 | </simpara></listitem></varlistentry> | ||
167 | <varlistentry><term><parameter>c</parameter> :</term> | ||
168 | <listitem><simpara> third byte | ||
169 | </simpara></listitem></varlistentry> | ||
170 | <varlistentry><term><parameter>d</parameter> :</term> | ||
171 | <listitem><simpara> fourth byte | ||
172 | </simpara></listitem></varlistentry> | ||
173 | </variablelist></refsect2> | ||
174 | <refsect2 id="g3d-iff-check" role="function"> | ||
175 | <title>g3d_iff_check ()</title> | ||
176 | <indexterm zone="g3d-iff-check"><primary>g3d_iff_check</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g3d_iff_check (<link linkend="G3DStream">G3DStream</link> *stream, | ||
177 | <link linkend="guint32">guint32</link> *id, | ||
178 | <link linkend="gsize">gsize</link> *len);</programlisting> | ||
179 | <para> | ||
180 | Checks a stream for a valid IFF signature and reads the top level container.</para> | ||
181 | <para> | ||
182 | |||
183 | </para><variablelist role="params"> | ||
184 | <varlistentry><term><parameter>stream</parameter> :</term> | ||
185 | <listitem><simpara> stream containing IFF file to check | ||
186 | </simpara></listitem></varlistentry> | ||
187 | <varlistentry><term><parameter>id</parameter> :</term> | ||
188 | <listitem><simpara> top level ID (out) | ||
189 | </simpara></listitem></varlistentry> | ||
190 | <varlistentry><term><parameter>len</parameter> :</term> | ||
191 | <listitem><simpara> length of top level container (out) | ||
192 | </simpara></listitem></varlistentry> | ||
193 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on success (valid IFF), FALSE else | ||
194 | </simpara></listitem></varlistentry> | ||
195 | </variablelist></refsect2> | ||
196 | <refsect2 id="g3d-iff-read-chunk" role="function"> | ||
197 | <title>g3d_iff_read_chunk ()</title> | ||
198 | <indexterm zone="g3d-iff-read-chunk"><primary>g3d_iff_read_chunk</primary></indexterm><programlisting><link linkend="gsize">gsize</link> g3d_iff_read_chunk (<link linkend="G3DStream">G3DStream</link> *stream, | ||
199 | <link linkend="guint32">guint32</link> *id, | ||
200 | <link linkend="gsize">gsize</link> *len, | ||
201 | <link linkend="guint32">guint32</link> flags);</programlisting> | ||
202 | <para> | ||
203 | Reads one chunk header from an IFF file.</para> | ||
204 | <para> | ||
205 | |||
206 | </para><variablelist role="params"> | ||
207 | <varlistentry><term><parameter>stream</parameter> :</term> | ||
208 | <listitem><simpara> stream to read from | ||
209 | </simpara></listitem></varlistentry> | ||
210 | <varlistentry><term><parameter>id</parameter> :</term> | ||
211 | <listitem><simpara> ID of chunk (out) | ||
212 | </simpara></listitem></varlistentry> | ||
213 | <varlistentry><term><parameter>len</parameter> :</term> | ||
214 | <listitem><simpara> length of chunk (excluding header) (out) | ||
215 | </simpara></listitem></varlistentry> | ||
216 | <varlistentry><term><parameter>flags</parameter> :</term> | ||
217 | <listitem><simpara> flags | ||
218 | </simpara></listitem></varlistentry> | ||
219 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> real length of chunk including header and possible padding byte | ||
220 | </simpara></listitem></varlistentry> | ||
221 | </variablelist></refsect2> | ||
222 | <refsect2 id="g3d-iff-handle-chunk" role="function"> | ||
223 | <title>g3d_iff_handle_chunk ()</title> | ||
224 | <indexterm zone="g3d-iff-handle-chunk"><primary>g3d_iff_handle_chunk</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> g3d_iff_handle_chunk (<link linkend="G3DIffGlobal">G3DIffGlobal</link> *global, | ||
225 | <link linkend="G3DIffLocal">G3DIffLocal</link> *plocal, | ||
226 | <link linkend="G3DIffChunkInfo">G3DIffChunkInfo</link> *chunks, | ||
227 | <link linkend="guint32">guint32</link> flags);</programlisting> | ||
228 | <para> | ||
229 | Handle an IFF chunk based on chunk description.</para> | ||
230 | <para> | ||
231 | |||
232 | </para><variablelist role="params"> | ||
233 | <varlistentry><term><parameter>global</parameter> :</term> | ||
234 | <listitem><simpara> global data | ||
235 | </simpara></listitem></varlistentry> | ||
236 | <varlistentry><term><parameter>plocal</parameter> :</term> | ||
237 | <listitem><simpara> local data of parent chunk, must not be NULL | ||
238 | </simpara></listitem></varlistentry> | ||
239 | <varlistentry><term><parameter>chunks</parameter> :</term> | ||
240 | <listitem><simpara> chunk description list | ||
241 | </simpara></listitem></varlistentry> | ||
242 | <varlistentry><term><parameter>flags</parameter> :</term> | ||
243 | <listitem><simpara> IFF flags | ||
244 | </simpara></listitem></varlistentry> | ||
245 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> level object for siblings, may be NULL. | ||
246 | </simpara></listitem></varlistentry> | ||
247 | </variablelist></refsect2> | ||
248 | <refsect2 id="g3d-iff-chunk-matches" role="function"> | ||
249 | <title>g3d_iff_chunk_matches ()</title> | ||
250 | <indexterm zone="g3d-iff-chunk-matches"><primary>g3d_iff_chunk_matches</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g3d_iff_chunk_matches (<link linkend="guint32">guint32</link> id, | ||
251 | <link linkend="gchar">gchar</link> *tid);</programlisting> | ||
252 | <para> | ||
253 | Check whether <parameter>id</parameter> and <parameter>tid</parameter> match.</para> | ||
254 | <para> | ||
255 | |||
256 | </para><variablelist role="params"> | ||
257 | <varlistentry><term><parameter>id</parameter> :</term> | ||
258 | <listitem><simpara> IFF identifier | ||
259 | </simpara></listitem></varlistentry> | ||
260 | <varlistentry><term><parameter>tid</parameter> :</term> | ||
261 | <listitem><simpara> textual representation of identifier | ||
262 | </simpara></listitem></varlistentry> | ||
263 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on match, FALSE else. | ||
264 | </simpara></listitem></varlistentry> | ||
265 | </variablelist></refsect2> | ||
266 | <refsect2 id="g3d-iff-read-ctnr" role="function"> | ||
267 | <title>g3d_iff_read_ctnr ()</title> | ||
268 | <indexterm zone="g3d-iff-read-ctnr"><primary>g3d_iff_read_ctnr</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g3d_iff_read_ctnr (<link linkend="G3DIffGlobal">G3DIffGlobal</link> *global, | ||
269 | <link linkend="G3DIffLocal">G3DIffLocal</link> *local, | ||
270 | <link linkend="G3DIffChunkInfo">G3DIffChunkInfo</link> *chunks, | ||
271 | <link linkend="guint32">guint32</link> flags);</programlisting> | ||
272 | <para> | ||
273 | Read subchunks in current chunk and handle them appropriately.</para> | ||
274 | <para> | ||
275 | |||
276 | </para><variablelist role="params"> | ||
277 | <varlistentry><term><parameter>global</parameter> :</term> | ||
278 | <listitem><simpara> global data | ||
279 | </simpara></listitem></varlistentry> | ||
280 | <varlistentry><term><parameter>local</parameter> :</term> | ||
281 | <listitem><simpara> local data of current chunk, must not be NULL | ||
282 | </simpara></listitem></varlistentry> | ||
283 | <varlistentry><term><parameter>chunks</parameter> :</term> | ||
284 | <listitem><simpara> chunk description list | ||
285 | </simpara></listitem></varlistentry> | ||
286 | <varlistentry><term><parameter>flags</parameter> :</term> | ||
287 | <listitem><simpara> IFF flags | ||
288 | </simpara></listitem></varlistentry> | ||
289 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on success, FALSE else. | ||
290 | </simpara></listitem></varlistentry> | ||
291 | </variablelist></refsect2> | ||
292 | <refsect2 id="g3d-iff-id-to-text" role="function"> | ||
293 | <title>g3d_iff_id_to_text ()</title> | ||
294 | <indexterm zone="g3d-iff-id-to-text"><primary>g3d_iff_id_to_text</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* g3d_iff_id_to_text (<link linkend="guint32">guint32</link> id);</programlisting> | ||
295 | <para> | ||
296 | Get the text representation of an IFF chunk identifier.</para> | ||
297 | <para> | ||
298 | |||
299 | </para><variablelist role="params"> | ||
300 | <varlistentry><term><parameter>id</parameter> :</term> | ||
301 | <listitem><simpara> an IFF identifier | ||
302 | </simpara></listitem></varlistentry> | ||
303 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated string containing the text identifier. | ||
304 | </simpara></listitem></varlistentry> | ||
305 | </variablelist></refsect2> | ||
306 | <refsect2 id="g3d-iff-open" role="function"> | ||
307 | <title>g3d_iff_open ()</title> | ||
308 | <indexterm zone="g3d-iff-open"><primary>g3d_iff_open</primary></indexterm><programlisting><link linkend="FILE:CAPS">FILE</link>* g3d_iff_open (const <link linkend="gchar">gchar</link> *filename, | ||
309 | <link linkend="guint32">guint32</link> *id, | ||
310 | <link linkend="guint32">guint32</link> *len);</programlisting> | ||
311 | <para> | ||
312 | Opens an IFF file, checks it and reads its top level container.</para> | ||
313 | <para> | ||
314 | |||
315 | </para><variablelist role="params"> | ||
316 | <varlistentry><term><parameter>filename</parameter> :</term> | ||
317 | <listitem><simpara> file name of IFF file | ||
318 | </simpara></listitem></varlistentry> | ||
319 | <varlistentry><term><parameter>id</parameter> :</term> | ||
320 | <listitem><simpara> top level ID (out) | ||
321 | </simpara></listitem></varlistentry> | ||
322 | <varlistentry><term><parameter>len</parameter> :</term> | ||
323 | <listitem><simpara> length of top level container (out) | ||
324 | </simpara></listitem></varlistentry> | ||
325 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the file pointer of open file or NULL in case of an error | ||
326 | </simpara></listitem></varlistentry> | ||
327 | </variablelist></refsect2> | ||
328 | <refsect2 id="g3d-iff-readchunk" role="function"> | ||
329 | <title>g3d_iff_readchunk ()</title> | ||
330 | <indexterm zone="g3d-iff-readchunk"><primary>g3d_iff_readchunk</primary></indexterm><programlisting><link linkend="int">int</link> g3d_iff_readchunk (<link linkend="FILE:CAPS">FILE</link> *f, | ||
331 | <link linkend="guint32">guint32</link> *id, | ||
332 | <link linkend="guint32">guint32</link> *len, | ||
333 | <link linkend="guint32">guint32</link> flags);</programlisting> | ||
334 | <para> | ||
335 | Reads one chunk header from an IFF file.</para> | ||
336 | <para> | ||
337 | |||
338 | </para><variablelist role="params"> | ||
339 | <varlistentry><term><parameter>f</parameter> :</term> | ||
340 | <listitem><simpara> the open IFF file pointer | ||
341 | </simpara></listitem></varlistentry> | ||
342 | <varlistentry><term><parameter>id</parameter> :</term> | ||
343 | <listitem><simpara> ID of chunk (out) | ||
344 | </simpara></listitem></varlistentry> | ||
345 | <varlistentry><term><parameter>len</parameter> :</term> | ||
346 | <listitem><simpara> length of chunk (excluding header) (out) | ||
347 | </simpara></listitem></varlistentry> | ||
348 | <varlistentry><term><parameter>flags</parameter> :</term> | ||
349 | <listitem><simpara> flags | ||
350 | </simpara></listitem></varlistentry> | ||
351 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> real length of chunk including header and possible padding byte | ||
352 | </simpara></listitem></varlistentry> | ||
353 | </variablelist></refsect2> | ||
354 | <refsect2 id="G3DIffChunkCallback" role="function"> | ||
355 | <title>G3DIffChunkCallback ()</title> | ||
356 | <indexterm zone="G3DIffChunkCallback"><primary>G3DIffChunkCallback</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> (*G3DIffChunkCallback) (<link linkend="G3DIffGlobal">G3DIffGlobal</link> *global, | ||
357 | <link linkend="G3DIffLocal">G3DIffLocal</link> *local);</programlisting> | ||
358 | <para> | ||
359 | IFF callback function prototype.</para> | ||
360 | <para> | ||
361 | |||
362 | </para><variablelist role="params"> | ||
363 | <varlistentry><term><parameter>global</parameter> :</term> | ||
364 | <listitem><simpara> the global data | ||
365 | </simpara></listitem></varlistentry> | ||
366 | <varlistentry><term><parameter>local</parameter> :</term> | ||
367 | <listitem><simpara> the local data | ||
368 | </simpara></listitem></varlistentry> | ||
369 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on success, FALSE else. | ||
370 | </simpara></listitem></varlistentry> | ||
371 | </variablelist></refsect2> | ||
372 | <refsect2 id="g3d-iff-chunk-callback" role="macro"> | ||
373 | <title>g3d_iff_chunk_callback</title> | ||
374 | <indexterm zone="g3d-iff-chunk-callback"><primary>g3d_iff_chunk_callback</primary></indexterm><programlisting>#define g3d_iff_chunk_callback G3DIffChunkCallback | ||
375 | </programlisting> | ||
376 | <para> | ||
377 | IFF chunk callback (deprecated).</para> | ||
378 | <para> | ||
379 | |||
380 | </para></refsect2> | ||
381 | <refsect2 id="G3DIffChunkInfo" role="struct"> | ||
382 | <title>G3DIffChunkInfo</title> | ||
383 | <indexterm zone="G3DIffChunkInfo"><primary>G3DIffChunkInfo</primary></indexterm><programlisting>typedef struct { | ||
384 | gchar *id; | ||
385 | gchar *description; | ||
386 | gboolean container; | ||
387 | G3DIffChunkCallback callback; | ||
388 | } G3DIffChunkInfo; | ||
389 | </programlisting> | ||
390 | <para> | ||
391 | A chunk type description.</para> | ||
392 | <para> | ||
393 | |||
394 | </para><variablelist role="struct"> | ||
395 | <varlistentry> | ||
396 | <term><link linkend="gchar">gchar</link> *<structfield>id</structfield>;</term> | ||
397 | <listitem><simpara> identifier of chunk | ||
398 | </simpara></listitem> | ||
399 | </varlistentry> | ||
400 | <varlistentry> | ||
401 | <term><link linkend="gchar">gchar</link> *<structfield>description</structfield>;</term> | ||
402 | <listitem><simpara> human-readable description of chunk type | ||
403 | </simpara></listitem> | ||
404 | </varlistentry> | ||
405 | <varlistentry> | ||
406 | <term><link linkend="gboolean">gboolean</link> <structfield>container</structfield>;</term> | ||
407 | <listitem><simpara> TRUE if this chunk contains sub-chunks | ||
408 | </simpara></listitem> | ||
409 | </varlistentry> | ||
410 | <varlistentry> | ||
411 | <term><link linkend="G3DIffChunkCallback">G3DIffChunkCallback</link> <structfield>callback</structfield>;</term> | ||
412 | <listitem><simpara> function to be called if such a chunk is found | ||
413 | </simpara></listitem> | ||
414 | </varlistentry> | ||
415 | </variablelist></refsect2> | ||
416 | <refsect2 id="g3d-iff-chunk-info" role="macro"> | ||
417 | <title>g3d_iff_chunk_info</title> | ||
418 | <indexterm zone="g3d-iff-chunk-info"><primary>g3d_iff_chunk_info</primary></indexterm><programlisting>#define g3d_iff_chunk_info G3DIffChunkInfo | ||
419 | </programlisting> | ||
420 | <para> | ||
421 | IFF chunk description (deprecated).</para> | ||
422 | <para> | ||
423 | |||
424 | </para></refsect2> | ||
425 | <refsect2 id="G3DIffGlobal" role="struct"> | ||
426 | <title>G3DIffGlobal</title> | ||
427 | <indexterm zone="G3DIffGlobal"><primary>G3DIffGlobal</primary></indexterm><programlisting>typedef struct { | ||
428 | G3DContext *context; | ||
429 | G3DModel *model; | ||
430 | G3DStream *stream; | ||
431 | guint32 flags; | ||
432 | gpointer user_data; | ||
433 | FILE *f; | ||
434 | long int max_fpos; | ||
435 | } G3DIffGlobal; | ||
436 | </programlisting> | ||
437 | <para> | ||
438 | The plugin-global data to be given to IFF callback functions.</para> | ||
439 | <para> | ||
440 | |||
441 | </para><variablelist role="struct"> | ||
442 | <varlistentry> | ||
443 | <term><link linkend="G3DContext">G3DContext</link> *<structfield>context</structfield>;</term> | ||
444 | <listitem><simpara> a valid context | ||
445 | </simpara></listitem> | ||
446 | </varlistentry> | ||
447 | <varlistentry> | ||
448 | <term><link linkend="G3DModel">G3DModel</link> *<structfield>model</structfield>;</term> | ||
449 | <listitem><simpara> a model | ||
450 | </simpara></listitem> | ||
451 | </varlistentry> | ||
452 | <varlistentry> | ||
453 | <term><link linkend="G3DStream">G3DStream</link> *<structfield>stream</structfield>;</term> | ||
454 | <listitem><simpara> the stream to read model from | ||
455 | </simpara></listitem> | ||
456 | </varlistentry> | ||
457 | <varlistentry> | ||
458 | <term><link linkend="guint32">guint32</link> <structfield>flags</structfield>;</term> | ||
459 | <listitem><simpara> IFF flags | ||
460 | </simpara></listitem> | ||
461 | </varlistentry> | ||
462 | <varlistentry> | ||
463 | <term><link linkend="gpointer">gpointer</link> <structfield>user_data</structfield>;</term> | ||
464 | <listitem><simpara> to be used by plugin | ||
465 | </simpara></listitem> | ||
466 | </varlistentry> | ||
467 | <varlistentry> | ||
468 | <term><link linkend="FILE:CAPS">FILE</link> *<structfield>f</structfield>;</term> | ||
469 | <listitem><simpara> file to read model from (DEPRECATED) | ||
470 | </simpara></listitem> | ||
471 | </varlistentry> | ||
472 | <varlistentry> | ||
473 | <term>long <link linkend="int">int</link> <structfield>max_fpos</structfield>;</term> | ||
474 | <listitem><simpara> maximum file position (DEPRECATED) | ||
475 | </simpara></listitem> | ||
476 | </varlistentry> | ||
477 | </variablelist></refsect2> | ||
478 | <refsect2 id="g3d-iff-gdata" role="macro"> | ||
479 | <title>g3d_iff_gdata</title> | ||
480 | <indexterm zone="g3d-iff-gdata"><primary>g3d_iff_gdata</primary></indexterm><programlisting>#define g3d_iff_gdata G3DIffGlobal | ||
481 | </programlisting> | ||
482 | <para> | ||
483 | IFF global data (deprecated).</para> | ||
484 | <para> | ||
485 | |||
486 | </para></refsect2> | ||
487 | <refsect2 id="G3DIffLocal" role="struct"> | ||
488 | <title>G3DIffLocal</title> | ||
489 | <indexterm zone="G3DIffLocal"><primary>G3DIffLocal</primary></indexterm><programlisting>typedef struct { | ||
490 | guint32 id; | ||
491 | guint32 parent_id; | ||
492 | gpointer object; | ||
493 | gint32 level; | ||
494 | gpointer level_object; | ||
495 | gint32 nb; | ||
496 | gboolean finalize; | ||
497 | } G3DIffLocal; | ||
498 | </programlisting> | ||
499 | <para> | ||
500 | The function-local data for IFF callback functions.</para> | ||
501 | <para> | ||
502 | |||
503 | </para><variablelist role="struct"> | ||
504 | <varlistentry> | ||
505 | <term><link linkend="guint32">guint32</link> <structfield>id</structfield>;</term> | ||
506 | <listitem><simpara> chunk identifier | ||
507 | </simpara></listitem> | ||
508 | </varlistentry> | ||
509 | <varlistentry> | ||
510 | <term><link linkend="guint32">guint32</link> <structfield>parent_id</structfield>;</term> | ||
511 | <listitem><simpara> parent chunk identifier | ||
512 | </simpara></listitem> | ||
513 | </varlistentry> | ||
514 | <varlistentry> | ||
515 | <term><link linkend="gpointer">gpointer</link> <structfield>object</structfield>;</term> | ||
516 | <listitem><simpara> an object set by parent callbacks, may be NULL | ||
517 | </simpara></listitem> | ||
518 | </varlistentry> | ||
519 | <varlistentry> | ||
520 | <term><link linkend="gint32">gint32</link> <structfield>level</structfield>;</term> | ||
521 | <listitem><simpara> level of chunk | ||
522 | </simpara></listitem> | ||
523 | </varlistentry> | ||
524 | <varlistentry> | ||
525 | <term><link linkend="gpointer">gpointer</link> <structfield>level_object</structfield>;</term> | ||
526 | <listitem><simpara> object shared by callbacks on the same level, may be NULL | ||
527 | </simpara></listitem> | ||
528 | </varlistentry> | ||
529 | <varlistentry> | ||
530 | <term><link linkend="gint32">gint32</link> <structfield>nb</structfield>;</term> | ||
531 | <listitem><simpara> number of bytes remaining in chunk, has to be decremented after | ||
532 | correctly after reading from stream | ||
533 | </simpara></listitem> | ||
534 | </varlistentry> | ||
535 | <varlistentry> | ||
536 | <term><link linkend="gboolean">gboolean</link> <structfield>finalize</structfield>;</term> | ||
537 | <listitem><simpara> for container chunks the callback function is called before | ||
538 | and after processing possible sub-chunks, the second time <parameter>finalize</parameter> is set | ||
539 | to TRUE | ||
540 | </simpara></listitem> | ||
541 | </varlistentry> | ||
542 | </variablelist></refsect2> | ||
543 | <refsect2 id="g3d-iff-ldata" role="macro"> | ||
544 | <title>g3d_iff_ldata</title> | ||
545 | <indexterm zone="g3d-iff-ldata"><primary>g3d_iff_ldata</primary></indexterm><programlisting>#define g3d_iff_ldata G3DIffLocal | ||
546 | </programlisting> | ||
547 | <para> | ||
548 | IFF local data (deprecated).</para> | ||
549 | <para> | ||
550 | |||
551 | </para></refsect2> | ||
552 | |||
553 | </refsect1> | ||
554 | |||
555 | |||
556 | |||
557 | |||
558 | </refentry> | ||