<s>
Interchange	B-Device
File	I-Device
Format	I-Device
(	O
IFF	O
)	O
,	O
is	O
a	O
generic	O
container	O
file	O
format	O
originally	O
introduced	O
by	O
Electronic	O
Arts	O
in	O
1985	O
(	O
in	O
cooperation	O
with	O
Commodore	O
)	O
in	O
order	O
to	O
facilitate	O
transfer	O
of	O
data	O
between	O
software	O
produced	O
by	O
different	O
companies	O
.	O
</s>
<s>
An	O
.iff	B-Operating_System
extension	O
is	O
commonly	O
used	O
for	O
ILBM	B-Operating_System
format	O
files	O
,	O
which	O
use	O
the	O
IFF	O
container	O
format	O
.	O
</s>
<s>
Resource	O
Interchange	B-Device
File	I-Device
Format	I-Device
is	O
a	O
format	O
developed	O
by	O
Microsoft	O
and	O
IBM	O
in	O
1991	O
that	O
is	O
based	O
on	O
IFF	O
,	O
except	O
the	O
byte	O
order	O
has	O
been	O
changed	O
to	O
little-endian	O
to	O
match	O
the	O
x86	B-Operating_System
processor	O
architecture	O
.	O
</s>
<s>
An	O
IFF	O
file	O
is	O
built	O
up	O
from	O
chunks	B-General_Concept
.	O
</s>
<s>
Each	O
chunk	B-General_Concept
begins	O
with	O
what	O
the	O
specification	O
calls	O
a	O
"	O
Type	O
ID	O
"	O
(	O
what	O
the	O
Macintosh	B-Device
called	O
an	O
OSType	B-Application
,	O
and	O
Windows	O
developers	O
might	O
call	O
a	O
FourCC	B-Application
)	O
.	O
</s>
<s>
This	O
is	O
followed	O
by	O
a	O
32-bit	O
signed	O
integer	O
(	O
all	O
integers	O
in	O
IFF	O
file	O
structure	O
are	O
big-endian	O
)	O
specifying	O
the	O
size	O
of	O
the	O
following	O
data	O
(	O
the	O
chunk	B-General_Concept
content	O
)	O
in	O
bytes	O
.	O
</s>
<s>
Because	O
the	O
specification	O
includes	O
explicit	O
lengths	O
for	O
each	O
chunk	B-General_Concept
,	O
it	O
is	O
possible	O
for	O
a	O
parser	O
to	O
skip	O
over	O
chunks	B-General_Concept
that	O
it	O
either	O
ca	O
n't	O
or	O
does	O
n't	O
care	O
to	O
process	O
.	O
</s>
<s>
This	O
structure	O
is	O
closely	O
related	O
to	O
the	O
type	B-Protocol
–	I-Protocol
length	I-Protocol
–	I-Protocol
value	I-Protocol
(	O
TLV	B-Protocol
)	O
representation	O
.	O
</s>
<s>
There	O
are	O
predefined	O
group	O
chunks	B-General_Concept
,	O
with	O
type	O
IDs	O
FORM	O
,	O
LIST	O
and	O
CAT	O
.	O
</s>
<s>
A	O
FORM	O
chunk	B-General_Concept
is	O
like	O
a	O
record	O
structure	O
,	O
containing	O
a	O
type	O
ID	O
(	O
indicating	O
the	O
record	O
type	O
)	O
followed	O
by	O
nested	O
chunks	B-General_Concept
specifying	O
the	O
record	O
fields	O
.	O
</s>
<s>
A	O
LIST	O
is	O
a	O
factoring	O
structure	O
containing	O
a	O
series	O
of	O
PROP	O
(	O
property	O
)	O
chunks	B-General_Concept
plus	O
nested	O
group	O
chunks	B-General_Concept
to	O
which	O
those	O
properties	O
apply	O
.	O
</s>
<s>
A	O
CAT	O
is	O
just	O
a	O
collection	O
of	O
nested	O
chunks	B-General_Concept
with	O
no	O
special	O
semantics	O
.	O
</s>
<s>
Group	O
chunks	B-General_Concept
can	O
contain	O
other	O
group	O
chunks	B-General_Concept
,	O
depending	O
on	O
the	O
needs	O
of	O
the	O
application	O
.	O
</s>
<s>
Group	O
chunks	B-General_Concept
,	O
like	O
their	O
simpler	O
counterparts	O
,	O
contain	O
a	O
length	O
element	O
.	O
</s>
<s>
Chunks	B-General_Concept
must	O
begin	O
on	O
even	O
file	O
offsets	O
,	O
as	O
befits	O
the	O
origins	O
of	O
IFF	O
on	O
the	O
Motorola	B-Device
68000	I-Device
processor	I-Device
,	O
which	O
could	O
n't	O
address	O
quantities	O
larger	O
than	O
a	O
byte	O
on	O
odd	O
addresses	O
.	O
</s>
<s>
Thus	O
chunks	B-General_Concept
with	O
odd	O
lengths	O
will	O
be	O
"	O
padded	O
"	O
to	O
an	O
even	O
byte	O
boundary	O
by	O
adding	O
a	O
so-called	O
"	O
pad	O
byte	O
"	O
after	O
their	O
regular	O
end	O
.	O
</s>
<s>
The	O
top-level	O
structure	O
of	O
an	O
IFF	O
file	O
consists	O
of	O
exactly	O
one	O
of	O
the	O
group	O
chunks	B-General_Concept
:	O
FORM	O
,	O
LIST	O
or	O
CAT	O
,	O
where	O
FORM	O
is	O
by	O
far	O
the	O
most	O
common	O
one	O
.	O
</s>
<s>
Each	O
type	O
of	O
chunk	B-General_Concept
typically	O
has	O
a	O
different	O
internal	O
structure	O
,	O
which	O
could	O
be	O
numerical	O
data	O
,	O
text	O
,	O
or	O
raw	O
data	O
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
include	O
other	O
IFF	O
files	O
as	O
if	O
they	O
are	O
chunks	B-General_Concept
(	O
note	O
that	O
they	O
have	O
the	O
same	O
structure	O
:	O
four	O
letters	O
followed	O
with	O
length	O
)	O
,	O
and	O
some	O
formats	O
use	O
this	O
.	O
</s>
<s>
There	O
are	O
standard	O
chunks	B-General_Concept
that	O
could	O
be	O
present	O
in	O
any	O
IFF	O
file	O
,	O
such	O
as	O
AUTH	O
(	O
containing	O
text	O
with	O
information	O
about	O
author	O
of	O
the	O
file	O
)	O
,	O
ANNO	O
(	O
containing	O
text	O
with	O
annotation	O
,	O
usually	O
name	O
of	O
the	O
program	O
that	O
created	O
the	O
file	O
)	O
,	O
NAME	O
(	O
containing	O
text	O
with	O
name	O
of	O
the	O
work	O
in	O
the	O
file	O
)	O
,	O
VERS	O
(	O
containing	O
file	O
version	O
)	O
,	O
(	O
c	O
)	O
(	O
containing	O
text	O
with	O
copyright	O
information	O
)	O
.	O
</s>
<s>
There	O
are	O
also	O
chunks	B-General_Concept
that	O
are	O
common	O
among	O
a	O
number	O
of	O
formats	O
,	O
such	O
as	O
CMAP	O
,	O
which	O
holds	O
color	O
palette	O
in	O
ILBM	B-Operating_System
,	O
ANIM	B-Device
and	O
files	O
(	O
pictures	O
,	O
animations	O
and	O
vector	O
pictures	O
)	O
.	O
</s>
<s>
There	O
are	O
chunks	B-General_Concept
that	O
have	O
a	O
common	O
name	O
but	O
hold	O
different	O
data	O
such	O
as	O
BODY	O
,	O
which	O
could	O
store	O
an	O
image	O
in	O
an	O
ILBM	B-Operating_System
file	O
and	O
sound	O
in	O
an	O
8SVX	B-Operating_System
file	O
.	O
</s>
<s>
And	O
finally	O
,	O
there	O
are	O
chunks	B-General_Concept
unique	O
to	O
their	O
file	O
type	O
.	O
</s>
<s>
Some	O
programs	O
that	O
create	O
IFF	O
files	O
add	O
chunks	B-General_Concept
to	O
them	O
with	O
their	O
internal	O
data	O
;	O
these	O
same	O
files	O
can	O
later	O
be	O
read	O
by	O
other	O
programs	O
without	O
any	O
disruption	O
(	O
because	O
their	O
parsers	O
could	O
skip	O
uninteresting	O
chunks	B-General_Concept
)	O
,	O
which	O
is	O
a	O
great	O
advantage	O
of	O
IFF	O
and	O
similar	O
formats	O
.	O
</s>
