iff.h

Include dependency graph for iff.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="stdbool.h" tooltip="stdbool.h"]
    "3" [label="stdint.h" tooltip="stdint.h"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/iff.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/iff.h" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include iff.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="/__w/AtomVM/AtomVM/src/libAtomVM/module.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/module.c"]
    "2" [label="/__w/AtomVM/AtomVM/src/libAtomVM/iff.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/iff.c"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/iff.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/iff.h" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
}

IFF/BEAM file parsing and constants.

BEAM module parser function and related defines.

Defines

AT8U 0

UTF-8 Atoms table section

CODE 1

Code chunk section

EXPT 2

Exported functions table section

LOCT 3

Local functions table section

IMPT 4

Imported functions table section

LITT 5

Literals table section with all the compressed zlib literals data

LITU 6

Uncompressed literals table section

FUNT 7

Funs table section

STRT 8

Str table section

LINT 9

Str table section

MAX_OFFS 10

Required size for offsets array

MAX_SIZES 10

Required size for sizes array

IFF_SECTION_HEADER_SIZE 8

sizeof IFF section header in bytes

Functions

void scan_iff(const void *iff_binary, int file_size, unsigned long *offsets, unsigned long *sizes)

parse a BEAM/IFF file and build a sections offsets table

Read a buffer containing a BEAM module file and set all found IFF sections into offsets array.

Parameters:
  • iff_binary – is BEAM module data.

  • file_size – is the BEAM module size in bytes.

  • offsets – all the relative offsets, each entry will be set to the offset of a different IFF section.

  • sizes – the computed sections sizes.

bool iff_is_valid_beam(const void *beam_data)

Returns true if pointed binary is valid BEAM IFF.

Checks if the pointed binary has a valid BEAM IFF header.

Parameters:
  • beam_data – a pointer to the beam_data binary

Returns:

true if beam_data points to a valid binary, otherwise false is returned.