/usr/share/gtk-doc/html/libg3d/libg3d-iff.html is in libg3d-doc 0.0.8-20.
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>libg3d Reference Manual: iff</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="libg3d Reference Manual">
<link rel="up" href="ch02.html" title="Plugin interface">
<link rel="prev" href="libg3d-stream.html" title="stream">
<link rel="next" href="libg3d-read.html" title="read">
<meta name="generator" content="GTK-Doc V1.21 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#libg3d-iff.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libg3d-stream.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libg3d-read.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libg3d-iff"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libg3d-iff.top_of_page"></a>iff</span></h2>
<p>iff — IFF file helper functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libg3d-iff.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#G3D-IFF-MKID:CAPS" title="G3D_IFF_MKID()">G3D_IFF_MKID</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-check" title="g3d_iff_check ()">g3d_iff_check</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gsize</span>
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-read-chunk" title="g3d_iff_read_chunk ()">g3d_iff_read_chunk</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gpointer</span>
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-handle-chunk" title="g3d_iff_handle_chunk ()">g3d_iff_handle_chunk</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-chunk-matches" title="g3d_iff_chunk_matches ()">g3d_iff_chunk_matches</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-read-ctnr" title="g3d_iff_read_ctnr ()">g3d_iff_read_ctnr</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-id-to-text" title="g3d_iff_id_to_text ()">g3d_iff_id_to_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">FILE</span> *
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-open" title="g3d_iff_open ()">g3d_iff_open</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libg3d-iff.html#g3d-iff-readchunk" title="g3d_iff_readchunk ()">g3d_iff_readchunk</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libg3d-iff.html#G3DIffChunkCallback" title="G3DIffChunkCallback ()">*G3DIffChunkCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libg3d-iff.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-PAD1:CAPS" title="G3D_IFF_PAD1">G3D_IFF_PAD1</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-PAD2:CAPS" title="G3D_IFF_PAD2">G3D_IFF_PAD2</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-PAD4:CAPS" title="G3D_IFF_PAD4">G3D_IFF_PAD4</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-PAD8:CAPS" title="G3D_IFF_PAD8">G3D_IFF_PAD8</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-LE:CAPS" title="G3D_IFF_LE">G3D_IFF_LE</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-LEN16:CAPS" title="G3D_IFF_LEN16">G3D_IFF_LEN16</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3D-IFF-SUBCHUNK-LEN16:CAPS" title="G3D_IFF_SUBCHUNK_LEN16">G3D_IFF_SUBCHUNK_LEN16</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#g3d-iff-chunk-callback" title="g3d_iff_chunk_callback">g3d_iff_chunk_callback</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3DIffChunkInfo" title="G3DIffChunkInfo">G3DIffChunkInfo</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#g3d-iff-chunk-info" title="g3d_iff_chunk_info">g3d_iff_chunk_info</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3DIffGlobal" title="G3DIffGlobal">G3DIffGlobal</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#g3d-iff-gdata" title="g3d_iff_gdata">g3d_iff_gdata</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="libg3d-iff.html#G3DIffLocal" title="G3DIffLocal">G3DIffLocal</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libg3d-iff.html#g3d-iff-ldata" title="g3d_iff_ldata">g3d_iff_ldata</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libg3d-iff.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <g3d/iff.h>
</pre>
</div>
<div class="refsect1">
<a name="libg3d-iff.description"></a><h2>Description</h2>
<p>These are helper functions to read data from the Interchange File Format
(IFF).</p>
</div>
<div class="refsect1">
<a name="libg3d-iff.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="G3D-IFF-MKID:CAPS"></a><h3>G3D_IFF_MKID()</h3>
<pre class="programlisting">#define G3D_IFF_MKID(a,b,c,d)</pre>
<p>Generate an IFF chunk identifier from character representation, e.g.
G3D_IFF_MKID('F','O','R','M').</p>
<div class="refsect3">
<a name="id-1.3.4.7.2.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>a</p></td>
<td class="parameter_description"><p>first byte</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>b</p></td>
<td class="parameter_description"><p>second byte</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>third byte</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>d</p></td>
<td class="parameter_description"><p>fourth byte</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.2.6"></a><h4>Returns</h4>
<p> unsigned integer identifier.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-check"></a><h3>g3d_iff_check ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
g3d_iff_check (<em class="parameter"><code><a class="link" href="libg3d-stream.html#G3DStream" title="G3DStream"><span class="type">G3DStream</span></a> *stream</code></em>,
<em class="parameter"><code><span class="type">guint32</span> *id</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *len</code></em>);</pre>
<p>Checks a stream for a valid IFF signature and reads the top level container.</p>
<div class="refsect3">
<a name="id-1.3.4.7.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>stream containing IFF file to check</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>top level ID (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of top level container (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.3.6"></a><h4>Returns</h4>
<p> TRUE on success (valid IFF), FALSE else</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-read-chunk"></a><h3>g3d_iff_read_chunk ()</h3>
<pre class="programlisting"><span class="returnvalue">gsize</span>
g3d_iff_read_chunk (<em class="parameter"><code><a class="link" href="libg3d-stream.html#G3DStream" title="G3DStream"><span class="type">G3DStream</span></a> *stream</code></em>,
<em class="parameter"><code><span class="type">guint32</span> *id</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *len</code></em>,
<em class="parameter"><code><span class="type">guint32</span> flags</code></em>);</pre>
<p>Reads one chunk header from an IFF file.</p>
<div class="refsect3">
<a name="id-1.3.4.7.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>stream to read from</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>ID of chunk (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of chunk (excluding header) (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>flags</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.4.6"></a><h4>Returns</h4>
<p> real length of chunk including header and possible padding byte</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-handle-chunk"></a><h3>g3d_iff_handle_chunk ()</h3>
<pre class="programlisting"><span class="returnvalue">gpointer</span>
g3d_iff_handle_chunk (<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffGlobal" title="G3DIffGlobal"><span class="type">G3DIffGlobal</span></a> *global</code></em>,
<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffLocal" title="G3DIffLocal"><span class="type">G3DIffLocal</span></a> *plocal</code></em>,
<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffChunkInfo" title="G3DIffChunkInfo"><span class="type">G3DIffChunkInfo</span></a> *chunks</code></em>,
<em class="parameter"><code><span class="type">guint32</span> flags</code></em>);</pre>
<p>Handle an IFF chunk based on chunk description.</p>
<div class="refsect3">
<a name="id-1.3.4.7.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>global</p></td>
<td class="parameter_description"><p>global data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>plocal</p></td>
<td class="parameter_description"><p>local data of parent chunk, must not be NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>chunks</p></td>
<td class="parameter_description"><p>chunk description list</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>IFF flags</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.5.6"></a><h4>Returns</h4>
<p> level object for siblings, may be NULL.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-chunk-matches"></a><h3>g3d_iff_chunk_matches ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
g3d_iff_chunk_matches (<em class="parameter"><code><span class="type">guint32</span> id</code></em>,
<em class="parameter"><code><span class="type">gchar</span> *tid</code></em>);</pre>
<p>Check whether <em class="parameter"><code>id</code></em>
and <em class="parameter"><code>tid</code></em>
match.</p>
<div class="refsect3">
<a name="id-1.3.4.7.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>IFF identifier</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>tid</p></td>
<td class="parameter_description"><p>textual representation of identifier</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.6.6"></a><h4>Returns</h4>
<p> TRUE on match, FALSE else.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-read-ctnr"></a><h3>g3d_iff_read_ctnr ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
g3d_iff_read_ctnr (<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffGlobal" title="G3DIffGlobal"><span class="type">G3DIffGlobal</span></a> *global</code></em>,
<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffLocal" title="G3DIffLocal"><span class="type">G3DIffLocal</span></a> *local</code></em>,
<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffChunkInfo" title="G3DIffChunkInfo"><span class="type">G3DIffChunkInfo</span></a> *chunks</code></em>,
<em class="parameter"><code><span class="type">guint32</span> flags</code></em>);</pre>
<p>Read subchunks in current chunk and handle them appropriately.</p>
<div class="refsect3">
<a name="id-1.3.4.7.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>global</p></td>
<td class="parameter_description"><p>global data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>local</p></td>
<td class="parameter_description"><p>local data of current chunk, must not be NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>chunks</p></td>
<td class="parameter_description"><p>chunk description list</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>IFF flags</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.7.6"></a><h4>Returns</h4>
<p> TRUE on success, FALSE else.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-id-to-text"></a><h3>g3d_iff_id_to_text ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
g3d_iff_id_to_text (<em class="parameter"><code><span class="type">guint32</span> id</code></em>);</pre>
<div class="warning"><p><code class="literal">g3d_iff_id_to_text</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Get the text representation of an IFF chunk identifier.</p>
<div class="refsect3">
<a name="id-1.3.4.7.8.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>an IFF identifier</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.8.7"></a><h4>Returns</h4>
<p> a newly allocated string containing the text identifier.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-open"></a><h3>g3d_iff_open ()</h3>
<pre class="programlisting"><span class="returnvalue">FILE</span> *
g3d_iff_open (<em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>,
<em class="parameter"><code><span class="type">guint32</span> *id</code></em>,
<em class="parameter"><code><span class="type">guint32</span> *len</code></em>);</pre>
<p>Opens an IFF file, checks it and reads its top level container.</p>
<div class="refsect3">
<a name="id-1.3.4.7.9.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>file name of IFF file</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>top level ID (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of top level container (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.9.6"></a><h4>Returns</h4>
<p> the file pointer of open file or NULL in case of an error</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-readchunk"></a><h3>g3d_iff_readchunk ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
g3d_iff_readchunk (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
<em class="parameter"><code><span class="type">guint32</span> *id</code></em>,
<em class="parameter"><code><span class="type">guint32</span> *len</code></em>,
<em class="parameter"><code><span class="type">guint32</span> flags</code></em>);</pre>
<p>Reads one chunk header from an IFF file.</p>
<div class="refsect3">
<a name="id-1.3.4.7.10.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>f</p></td>
<td class="parameter_description"><p>the open IFF file pointer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>ID of chunk (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of chunk (excluding header) (out)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>flags</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.10.6"></a><h4>Returns</h4>
<p> real length of chunk including header and possible padding byte</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G3DIffChunkCallback"></a><h3>G3DIffChunkCallback ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
<span class="c_punctuation">(</span>*G3DIffChunkCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffGlobal" title="G3DIffGlobal"><span class="type">G3DIffGlobal</span></a> *global</code></em>,
<em class="parameter"><code><a class="link" href="libg3d-iff.html#G3DIffLocal" title="G3DIffLocal"><span class="type">G3DIffLocal</span></a> *local</code></em>);</pre>
<p>IFF callback function prototype.</p>
<div class="refsect3">
<a name="id-1.3.4.7.11.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>global</p></td>
<td class="parameter_description"><p>the global data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>local</p></td>
<td class="parameter_description"><p>the local data</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.4.7.11.6"></a><h4>Returns</h4>
<p> TRUE on success, FALSE else.</p>
<p></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libg3d-iff.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="G3D-IFF-PAD1:CAPS"></a><h3>G3D_IFF_PAD1</h3>
<pre class="programlisting">#define G3D_IFF_PAD1 0x01
</pre>
<p>No padding is done after chunks.</p>
</div>
<hr>
<div class="refsect2">
<a name="G3D-IFF-PAD2:CAPS"></a><h3>G3D_IFF_PAD2</h3>
<pre class="programlisting">#define G3D_IFF_PAD2 0x02
</pre>
<p>Chunks are 2-byte aligned</p>
</div>
<hr>
<div class="refsect2">
<a name="G3D-IFF-PAD4:CAPS"></a><h3>G3D_IFF_PAD4</h3>
<pre class="programlisting">#define G3D_IFF_PAD4 0x04
</pre>
<p>Chunks are 4-byte aligned</p>
</div>
<hr>
<div class="refsect2">
<a name="G3D-IFF-PAD8:CAPS"></a><h3>G3D_IFF_PAD8</h3>
<pre class="programlisting">#define G3D_IFF_PAD8 0x08
</pre>
<p>Chunks are 8-byte aligned</p>
</div>
<hr>
<div class="refsect2">
<a name="G3D-IFF-LE:CAPS"></a><h3>G3D_IFF_LE</h3>
<pre class="programlisting">#define G3D_IFF_LE 0x40 /* little endian */
</pre>
<p>The file has little-endian data.</p>
</div>
<hr>
<div class="refsect2">
<a name="G3D-IFF-LEN16:CAPS"></a><h3>G3D_IFF_LEN16</h3>
<pre class="programlisting">#define G3D_IFF_LEN16 0x20
</pre>
<p>All chunks have 16-bit sizes.</p>
</div>
<hr>
<div class="refsect2">
<a name="G3D-IFF-SUBCHUNK-LEN16:CAPS"></a><h3>G3D_IFF_SUBCHUNK_LEN16</h3>
<pre class="programlisting">#define G3D_IFF_SUBCHUNK_LEN16 0x10
</pre>
<p>All chunks except the toplevel ones have 16-bit sizes.</p>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-chunk-callback"></a><h3>g3d_iff_chunk_callback</h3>
<pre class="programlisting">#define g3d_iff_chunk_callback G3DIffChunkCallback
</pre>
<p>IFF chunk callback (deprecated).</p>
</div>
<hr>
<div class="refsect2">
<a name="G3DIffChunkInfo"></a><h3>G3DIffChunkInfo</h3>
<pre class="programlisting">typedef struct {
gchar *id;
gchar *description;
gboolean container;
G3DIffChunkCallback callback;
} G3DIffChunkInfo;
</pre>
<p>A chunk type description.</p>
<div class="refsect3">
<a name="id-1.3.4.8.10.5"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">gchar</span> *<em class="structfield"><code><a name="G3DIffChunkInfo.id"></a>id</code></em>;</p></td>
<td class="struct_member_description"><p>identifier of chunk</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gchar</span> *<em class="structfield"><code><a name="G3DIffChunkInfo.description"></a>description</code></em>;</p></td>
<td class="struct_member_description"><p>human-readable description of chunk type</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gboolean</span> <em class="structfield"><code><a name="G3DIffChunkInfo.container"></a>container</code></em>;</p></td>
<td class="struct_member_description"><p>TRUE if this chunk contains sub-chunks</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libg3d-iff.html#G3DIffChunkCallback" title="G3DIffChunkCallback ()"><span class="type">G3DIffChunkCallback</span></a> <em class="structfield"><code><a name="G3DIffChunkInfo.callback"></a>callback</code></em>;</p></td>
<td class="struct_member_description"><p>function to be called if such a chunk is found</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-chunk-info"></a><h3>g3d_iff_chunk_info</h3>
<pre class="programlisting">#define g3d_iff_chunk_info G3DIffChunkInfo
</pre>
<p>IFF chunk description (deprecated).</p>
</div>
<hr>
<div class="refsect2">
<a name="G3DIffGlobal"></a><h3>G3DIffGlobal</h3>
<pre class="programlisting">typedef struct {
G3DContext *context;
G3DModel *model;
G3DStream *stream;
guint32 flags;
gpointer user_data;
FILE *f;
long int max_fpos;
} G3DIffGlobal;
</pre>
<p>The plugin-global data to be given to IFF callback functions.</p>
<div class="refsect3">
<a name="id-1.3.4.8.12.5"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="libg3d-context.html#G3DContext" title="G3DContext"><span class="type">G3DContext</span></a> *<em class="structfield"><code><a name="G3DIffGlobal.context"></a>context</code></em>;</p></td>
<td class="struct_member_description"><p>a valid context</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libg3d-model.html#G3DModel" title="G3DModel"><span class="type">G3DModel</span></a> *<em class="structfield"><code><a name="G3DIffGlobal.model"></a>model</code></em>;</p></td>
<td class="struct_member_description"><p>a model</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libg3d-stream.html#G3DStream" title="G3DStream"><span class="type">G3DStream</span></a> *<em class="structfield"><code><a name="G3DIffGlobal.stream"></a>stream</code></em>;</p></td>
<td class="struct_member_description"><p>the stream to read model from</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guint32</span> <em class="structfield"><code><a name="G3DIffGlobal.flags"></a>flags</code></em>;</p></td>
<td class="struct_member_description"><p>IFF flags</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gpointer</span> <em class="structfield"><code><a name="G3DIffGlobal.user-data"></a>user_data</code></em>;</p></td>
<td class="struct_member_description"><p>to be used by plugin</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">FILE</span> *<em class="structfield"><code><a name="G3DIffGlobal.f"></a>f</code></em>;</p></td>
<td class="struct_member_description"><p>file to read model from (DEPRECATED)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>long <span class="type">int</span> <em class="structfield"><code><a name="G3DIffGlobal.max-fpos"></a>max_fpos</code></em>;</p></td>
<td class="struct_member_description"><p>maximum file position (DEPRECATED)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-gdata"></a><h3>g3d_iff_gdata</h3>
<pre class="programlisting">#define g3d_iff_gdata G3DIffGlobal
</pre>
<p>IFF global data (deprecated).</p>
</div>
<hr>
<div class="refsect2">
<a name="G3DIffLocal"></a><h3>G3DIffLocal</h3>
<pre class="programlisting">typedef struct {
guint32 id;
guint32 parent_id;
gpointer object;
gint32 level;
gpointer level_object;
gint32 nb;
gboolean finalize;
} G3DIffLocal;
</pre>
<p>The function-local data for IFF callback functions.</p>
<div class="refsect3">
<a name="id-1.3.4.8.14.5"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">guint32</span> <em class="structfield"><code><a name="G3DIffLocal.id"></a>id</code></em>;</p></td>
<td class="struct_member_description"><p>chunk identifier</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guint32</span> <em class="structfield"><code><a name="G3DIffLocal.parent-id"></a>parent_id</code></em>;</p></td>
<td class="struct_member_description"><p>parent chunk identifier</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gpointer</span> <em class="structfield"><code><a name="G3DIffLocal.object"></a>object</code></em>;</p></td>
<td class="struct_member_description"><p>an object set by parent callbacks, may be NULL</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gint32</span> <em class="structfield"><code><a name="G3DIffLocal.level"></a>level</code></em>;</p></td>
<td class="struct_member_description"><p>level of chunk</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gpointer</span> <em class="structfield"><code><a name="G3DIffLocal.level-object"></a>level_object</code></em>;</p></td>
<td class="struct_member_description"><p>object shared by callbacks on the same level, may be NULL</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gint32</span> <em class="structfield"><code><a name="G3DIffLocal.nb"></a>nb</code></em>;</p></td>
<td class="struct_member_description"><p>number of bytes remaining in chunk, has to be decremented after
correctly after reading from stream</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gboolean</span> <em class="structfield"><code><a name="G3DIffLocal.finalize"></a>finalize</code></em>;</p></td>
<td class="struct_member_description"><p>for container chunks the callback function is called before
and after processing possible sub-chunks, the second time <em class="parameter"><code>finalize</code></em>
is set
to TRUE</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g3d-iff-ldata"></a><h3>g3d_iff_ldata</h3>
<pre class="programlisting">#define g3d_iff_ldata G3DIffLocal
</pre>
<p>IFF local data (deprecated).</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.21</div>
</body>
</html>
|