View Source packbeam_api (atomvm_packbeam v0.7.3)
A library used to generate an AtomVM AVM file from a set of files (beam files, previously built AVM files, or even arbitrary data files).
Summary
Functions
Create an AVM file.
Create an AVM file.
Delete selected elements of an AVM file.
Extract all or selected elements from an AVM file.
Return AVM element data.
Return AVM element module, if the element is a BEAM file.
Return the name of the element.
Indicates whether the AVM file element is a BEAM file.
Indicates whether the AVM file element is an entrypoint.
List the contents of an AVM file.
Types
Functions
Create an AVM file.
Equivalent to create(OutputPath, InputPaths, DefaultOptions)
where DefaultOptions
is #{ prune => false, start_module => undefined, application_module => undefined, include_lines => false }
-spec create(OutputPath :: path(), InputPaths :: [path()], Options :: options()) -> ok | {error, Reason :: term()}.
Create an AVM file.
This function will create an AVM file at the location specified in OutputPath, using the input files specified in InputPaths.
-spec delete(OutputPath :: path(), InputPath :: path(), AVMElementNames :: [avm_element_name()]) -> ok | {error, Reason :: term()}.
Delete selected elements of an AVM file.
This function will delete elements of an AVM file at the location specified in InputPath, specified by the supplied list of names. The output AVM file is written to OutputPath, which may be the same as InputPath.
-spec extract(InputPath :: path(), AVMElementNames :: [avm_element_name()], OutputDir :: path()) -> ok | {error, Reason :: term()}.
Extract all or selected elements from an AVM file.
This function will extract elements of an AVM file at the location specified in InputPath, specified by the supplied list of names. The elements from the input AVM file will be written into the specified output directory, creating any subdirectories if the AVM file elements contain path information.
-spec get_element_data(AVMElement :: avm_element()) -> binary().
Return AVM element data.
-spec get_element_module(AVMElement :: avm_element()) -> module() | undefined.
Return AVM element module, if the element is a BEAM file.
-spec get_element_name(AVMElement :: avm_element()) -> avm_element_name().
Return the name of the element.
-spec is_beam(AVMElement :: avm_element()) -> boolean().
Indicates whether the AVM file element is a BEAM file.
-spec is_entrypoint(AVMElement :: avm_element()) -> boolean().
Indicates whether the AVM file element is an entrypoint.
-spec list(InputPath :: path()) -> [avm_element()].
List the contents of an AVM file.
This function will list the contents of an AVM file at the location specified in InputPath.