iff.c

Include dependency graph for iff.c:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "4" [label="utils.h" tooltip="utils.h"]
    "3" [label="stdint.h" tooltip="stdint.h"]
    "7" [label="stdlib.h" tooltip="stdlib.h"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/iff.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/iff.c" fillcolor="#BFBFBF"]
    "2" [label="iff.h" tooltip="iff.h"]
    "5" [label="stddef.h" tooltip="stddef.h"]
    "8" [label="string.h" tooltip="string.h"]
    "6" [label="stdio.h" tooltip="stdio.h"]
    "4" -> "5" [dir=forward tooltip="include"]
    "4" -> "6" [dir=forward tooltip="include"]
    "4" -> "7" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "6" [dir=forward tooltip="include"]
    "1" -> "7" [dir=forward tooltip="include"]
    "1" -> "8" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
}

Functions

static uint32_t iff_align(uint32_t size)
int iff_is_valid_beam(const void *beam_data)

Returns 1 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:

1 if beam_data points to a valid binary, otherwise 0 is returned.

void scan_iff(const void *iff_binary, int buf_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.

struct IFFRecord

Public Members

const char name[4]
uint32_t size