Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 4d24f7e812d936de265d280318708608 > files > 3

erlang-R13B-04.15.fc13.src.rpm

#!/usr/bin/escript
%% -*- erlang -*-

main(EbinFiles) ->
	lists:foreach(
		fun(BeamFile) ->
			try
				{ok, {_Module, [{imports,Imports}]}} = beam_lib:chunks(BeamFile, [imports]),
				lists:foreach( fun({ModName,ModFun,Arity})->io:format("erlang(~s:~s/~p)~n", [ModName,ModFun,Arity]) end, Imports)
			catch
				_:_ ->
					ok
			end
		end,
		EbinFiles);

main(_) ->
	halt(1).