c_iff - a portable IFF parser
Contents
Introduction
c_iff is a portable IFF parser library written entirely in simple C.
With this library you can read and write IFFs in an easy way.
It is inspired by the Amigas own iffparse.library, but without its
esotheric behaviour.
Background
IFF - Interchange File Format is the Amigas way to store data in a
generic form. An IFF can contain nearly every type of data you can
imagine, e.g. pictures (ILBM), animations (ANIM), sounds (AIFF),
text (FTXT) or all of this in one file. This file can also contain
Meta-information like the authors name or a version-strings.
In the PC-world the name IFF is wrongly attached to the IFF-subtype
ILBM, a picture-format.
Portability
c_iff is written in clean ANSI-C. It uses only simple functions
from <stdlib.h> and <stdio.h> .
So it should be portable to anything, a C-compiler exists for.
I have tested it on the following machines:
-
AmigaOS native m68k with different compilers
-
AmigaOS PowerUp PPC with the vbccppc compiler
-
Linux APUS PPC with the gcc compiler
-
Linux SuSE AMD K6 with the gcc compiler
You see, it runs on Big and Little Endian machines.
IFFs are stored in Big Endian order. To write portable code you must
swap the bytes of multibyte numbers before you write them to an IFF
or after you read them from an IFF. c_iff provides the two macros
Swap16IfLE and Swap32IfLE to do this.
If you are on a Big Endian machine you might have to add your machine to c_iff.h
64-bit machines (and 16-bit machines) are now supported too.
Never use your machines (unsigned) char, short, int, long numbers if you deal
with IFFs. Instead use the CARDXX and INTXX definitions from c_iff.h .
Installation
There is no configure and such things, just a simple Makefile.
This should be usable for any unixoid system, that has cc, ar and ranlib.
Just type "make" to build the statical library libc_iff.a .
To build the documentation, type "make doc". This requieres perl installed.
"make example" builds the example.
Documentation
c_iff has a build in documentation. This is generated by a "make doc" .
This produces a file c_iff.txt . This file
is in Amigas AutoDoc format, a simple ASCII-format.
The file example.c shows how to use c_iff to read and write
IFFs. The binary is build by "make example" .
Limitations
c_iff currently only supports FORM IFFs. But the other types of IFFs are very rare.
If you need them, tell me.
Copyright and License
c_iff is Copyright (C) 2000, 2001 Joerg Dietrich
This is the AROS-version of c_iff.
It is distributed under the AROS Public License.
But I reserve the right to distribute
my own version under other licenses.
Author
c_iff is written by me, Jörg Dietrich .
You can reach me at Dietrich_Joerg@t-online.de.
Version History
06-Nov-2000 : initial release
11-Nov-2001 : bug-fixes, support for non 32-bit architectures
Copyright © 2000, 2001 Jörg Dietrich
Last change: 11-Nov-2001