atom.c

Include dependency graph for atom.c:

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

Functions

void atom_string_to_c(AtomString atom_string, char *buf, size_t bufsize)

Gets a C string from an AtomString.

Copies the atom string data to a buffer and makes it null terminated.

Parameters:
  • atom_string – that will be converted to a C string.

  • buf – the buffer where the C string will be written.

  • bufsize – available buf size.

int atom_are_equals(AtomString a, AtomString b)

Check for equality two AtomStrings.

Returns 1 if two atom strings are equal, 0 otherwise. This function doesn’t behave like strcmp.

Parameters:
  • a – first atom string to be compared.

  • b – second atom string to be compared.

Returns:

1 if they are equals, 0 otherwise.

static void utoa10(unsigned int int_value, char *integer_string)
void atom_write_mfa(char *buf, size_t buf_size, AtomString module, AtomString function, unsigned int arity)

Write module:function/arity to the supplied buffer.

Write module:function/arity to the supplied buffer. This function will abort if the written module, function, and arity are longer than the supplied buffer size.

Parameters:
  • buf – the buffer to write into

  • buf_size – the amount of room in the buffer

  • module – the module name

  • function – the function name

  • arity – the function arity