externalterm.c

Include dependency graph for externalterm.c:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "23" [label="atom.h" tooltip="atom.h"]
    "21" [label="context.h" tooltip="context.h"]
    "10" [label="erl_nif.h" tooltip="erl_nif.h"]
    "1" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/externalterm.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/externalterm.c" fillcolor="#BFBFBF"]
    "2" [label="externalterm.h" tooltip="externalterm.h"]
    "22" [label="globalcontext.h" tooltip="globalcontext.h"]
    "17" [label="list.h" tooltip="list.h"]
    "26" [label="mailbox.h" tooltip="mailbox.h"]
    "9" [label="memory.h" tooltip="memory.h"]
    "16" [label="refc_binary.h" tooltip="refc_binary.h"]
    "18" [label="resources.h" tooltip="resources.h"]
    "19" [label="smp.h" tooltip="smp.h"]
    "24" [label="synclist.h" tooltip="synclist.h"]
    "3" [label="term.h" tooltip="term.h"]
    "11" [label="term_typedef.h" tooltip="term_typedef.h"]
    "25" [label="timer_list.h" tooltip="timer_list.h"]
    "14" [label="utils.h" tooltip="utils.h"]
    "13" [label="inttypes.h" tooltip="inttypes.h"]
    "12" [label="limits.h" tooltip="limits.h"]
    "20" [label="stdatomic.h" tooltip="stdatomic.h"]
    "4" [label="stdbool.h" tooltip="stdbool.h"]
    "15" [label="stddef.h" tooltip="stddef.h"]
    "5" [label="stdint.h" tooltip="stdint.h"]
    "6" [label="stdio.h" tooltip="stdio.h"]
    "7" [label="stdlib.h" tooltip="stdlib.h"]
    "8" [label="string.h" tooltip="string.h"]
    "23" -> "5" [dir=forward tooltip="include"]
    "23" -> "7" [dir=forward tooltip="include"]
    "21" -> "22" [dir=forward tooltip="include"]
    "21" -> "17" [dir=forward tooltip="include"]
    "21" -> "26" [dir=forward tooltip="include"]
    "21" -> "19" [dir=forward tooltip="include"]
    "21" -> "3" [dir=forward tooltip="include"]
    "21" -> "25" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "21" [dir=forward tooltip="include"]
    "1" -> "17" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "5" [dir=forward tooltip="include"]
    "1" -> "6" [dir=forward tooltip="include"]
    "1" -> "7" [dir=forward tooltip="include"]
    "1" -> "14" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "22" -> "5" [dir=forward tooltip="include"]
    "22" -> "23" [dir=forward tooltip="include"]
    "22" -> "10" [dir=forward tooltip="include"]
    "22" -> "17" [dir=forward tooltip="include"]
    "22" -> "19" [dir=forward tooltip="include"]
    "22" -> "24" [dir=forward tooltip="include"]
    "22" -> "3" [dir=forward tooltip="include"]
    "22" -> "25" [dir=forward tooltip="include"]
    "26" -> "4" [dir=forward tooltip="include"]
    "26" -> "17" [dir=forward tooltip="include"]
    "26" -> "19" [dir=forward tooltip="include"]
    "26" -> "11" [dir=forward tooltip="include"]
    "26" -> "14" [dir=forward tooltip="include"]
    "9" -> "10" [dir=forward tooltip="include"]
    "9" -> "11" [dir=forward tooltip="include"]
    "9" -> "14" [dir=forward tooltip="include"]
    "9" -> "5" [dir=forward tooltip="include"]
    "9" -> "7" [dir=forward tooltip="include"]
    "16" -> "4" [dir=forward tooltip="include"]
    "16" -> "7" [dir=forward tooltip="include"]
    "16" -> "17" [dir=forward tooltip="include"]
    "16" -> "18" [dir=forward tooltip="include"]
    "16" -> "19" [dir=forward tooltip="include"]
    "18" -> "7" [dir=forward tooltip="include"]
    "18" -> "10" [dir=forward tooltip="include"]
    "18" -> "17" [dir=forward tooltip="include"]
    "19" -> "4" [dir=forward tooltip="include"]
    "19" -> "20" [dir=forward tooltip="include"]
    "24" -> "17" [dir=forward tooltip="include"]
    "24" -> "6" [dir=forward tooltip="include"]
    "24" -> "19" [dir=forward tooltip="include"]
    "3" -> "4" [dir=forward tooltip="include"]
    "3" -> "5" [dir=forward tooltip="include"]
    "3" -> "6" [dir=forward tooltip="include"]
    "3" -> "7" [dir=forward tooltip="include"]
    "3" -> "8" [dir=forward tooltip="include"]
    "3" -> "9" [dir=forward tooltip="include"]
    "3" -> "16" [dir=forward tooltip="include"]
    "3" -> "14" [dir=forward tooltip="include"]
    "3" -> "11" [dir=forward tooltip="include"]
    "11" -> "12" [dir=forward tooltip="include"]
    "11" -> "13" [dir=forward tooltip="include"]
    "11" -> "5" [dir=forward tooltip="include"]
    "25" -> "4" [dir=forward tooltip="include"]
    "25" -> "5" [dir=forward tooltip="include"]
    "25" -> "17" [dir=forward tooltip="include"]
    "14" -> "15" [dir=forward tooltip="include"]
}

Defines

EXTERNAL_TERM_TAG
NEW_FLOAT_EXT
SMALL_INTEGER_EXT
INTEGER_EXT
ATOM_EXT
SMALL_TUPLE_EXT
NIL_EXT
STRING_EXT
LIST_EXT
BINARY_EXT
SMALL_BIG_EXT
EXPORT_EXT
MAP_EXT
SMALL_ATOM_UTF8_EXT
INVALID_TERM_SIZE
NEW_FLOAT_EXT_SIZE
SMALL_INTEGER_EXT_SIZE
INTEGER_EXT_SIZE
SMALL_BIG_EXT_BASE_SIZE
ATOM_EXT_BASE_SIZE
STRING_EXT_BASE_SIZE
LIST_EXT_BASE_SIZE
BINARY_EXT_BASE_SIZE
MAP_EXT_BASE_SIZE
SMALL_ATOM_EXT_BASE_SIZE
SIGNED_INT_TO_UNSIGNED(val, unsigned_type)

Functions

static term parse_external_terms(const uint8_t *external_term_buf, size_t *eterm_size, bool copy, Heap *heap, GlobalContext *glb)
static int calculate_heap_usage(const uint8_t *external_term_buf, size_t remaining, size_t *eterm_size, bool copy)
static size_t compute_external_size(term t, GlobalContext *glb)
static int externalterm_from_term(uint8_t **buf, size_t *len, term t, GlobalContext *glb)
static int serialize_term(uint8_t *buf, term t, GlobalContext *glb)
static term externalterm_to_term_internal(const void *external_term, size_t size, Context *ctx, ExternalTermOpts opts, size_t *bytes_read, bool copy)
term externalterm_to_term(const void *external_term, size_t size, Context *ctx, ExternalTermOpts opts)
enum ExternalTermResult externalterm_from_binary(Context *ctx, term *dst, term binary, size_t *bytes_read)
term externalterm_to_binary(Context *ctx, term t)
static uint8_t get_num_bytes(avm_uint64_t val)
static void write_bytes(uint8_t *buf, avm_uint64_t val)
static avm_uint64_t read_bytes(const uint8_t *buf, uint8_t num_bytes)