Skip to content

Commit

Permalink
Tighten up packbeam_api
Browse files Browse the repository at this point in the history
This change set tightens up the packbeam API to expose just enough information about AVM files as is needed without exposing internal implementation details.

Signed-off-by: Fred Dushin <[email protected]>
  • Loading branch information
fadushin committed Oct 20, 2023
1 parent 1874698 commit 56fcf44
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 79 deletions.
12 changes: 6 additions & 6 deletions src/packbeam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ print_modules(Modules, Format) ->
print_module(ParsedFile, undefined) ->
print_module(ParsedFile, "default");
print_module(ParsedFile, "default") ->
ModuleName = proplists:get_value(module_name, ParsedFile),
Flags = proplists:get_value(flags, ParsedFile),
Data = proplists:get_value(data, ParsedFile),
ModuleName = packbeam_api:get_module_name(ParsedFile),
Flags = packbeam_api:get_flags(ParsedFile),
Data = packbeam_api:get_element_data(ParsedFile),
io:format(
"~s~s [~p]~n", [
ModuleName,
Expand All @@ -286,8 +286,8 @@ print_module(ParsedFile, "default") ->
]
);
print_module(ParsedFile, "csv") ->
ModuleName = proplists:get_value(module_name, ParsedFile),
Data = proplists:get_value(data, ParsedFile),
ModuleName = packbeam_api:get_module_name(ParsedFile),
Data = packbeam_api:get_element_data(ParsedFile),
io:format(
"~s,~p,~p,~p~n", [
ModuleName,
Expand All @@ -297,7 +297,7 @@ print_module(ParsedFile, "csv") ->
]
);
print_module(ParsedFile, "bare") ->
ModuleName = proplists:get_value(module_name, ParsedFile),
ModuleName = packbeam_api:get_module_name(ParsedFile),
io:format(
"~s~n", [
ModuleName
Expand Down
Loading

0 comments on commit 56fcf44

Please sign in to comment.