| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'src/shared/struct/shr_omnimods.erl')
| -rw-r--r-- | src/shared/struct/shr_omnimods.erl | 29 | 
1 files changed, 28 insertions, 1 deletions
| diff --git a/src/shared/struct/shr_omnimods.erl b/src/shared/struct/shr_omnimods.erl index ae8ba44..f452e34 100644 --- a/src/shared/struct/shr_omnimods.erl +++ b/src/shared/struct/shr_omnimods.erl @@ -80,7 +80,8 @@  -export  (     [ -      encode/1 +      encode/1, +      export/1     ]  ). @@ -114,6 +115,22 @@ encode_mods (Mods) ->        dict:to_list(Mods)     ). +-spec mod_list_to_string_list (mods()) -> list(). +mod_list_to_string_list (Mods) -> +   ( +      "__MOD_LIST(" +      ++ +      lists:map +      ( +         fun ({Name, Value}) -> +            io_lib:format("__MOD_~p(~p),", [Name, Value]) +         end, +         Mods +      ) +      ++ +      ")" +   ). +  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -351,3 +368,13 @@ encode (Omnimods) ->           {<<"defm">>, encode_mods(Omnimods#omnimods.defmods)}        ]     }. + +-spec export (type()) -> list(). +export (Omnimods) -> +   ( +      mod_list_to_string_list(dict:to_list(Omnimods#omnimods.attmods)) +      ++ "\n" +      ++ mod_list_to_string_list(dict:to_list(Omnimods#omnimods.atkmods)) +      ++ "\n" +      ++ mod_list_to_string_list(dict:to_list(Omnimods#omnimods.defmods)) +   ). | 


