Commit e64e28cb authored by yoogx's avatar yoogx

* Separate initialization function for library from the one

          for the Ocarina main binary.
parent 60d2922b
with GNATCOLL.Scripts; use GNATCOLL.Scripts; with GNATCOLL.Scripts; use GNATCOLL.Scripts;
with GNATCOLL.Scripts.Python; use GNATCOLL.Scripts.Python; with GNATCOLL.Scripts.Python; use GNATCOLL.Scripts.Python;
with Ocarina.Configuration; use Ocarina.Configuration;
with Ocarina.Utils; with Ocarina.Utils;
package body Ocarina.Python_Cmd is package body Ocarina.Python_Cmd is
...@@ -145,6 +146,28 @@ package body Ocarina.Python_Cmd is ...@@ -145,6 +146,28 @@ package body Ocarina.Python_Cmd is
return Repo; return Repo;
end Register_Scripts_And_Functions; end Register_Scripts_And_Functions;
--------------------
-- Initialize_Lib --
--------------------
procedure Initialize_Lib is
procedure Adainit;
pragma Import (C, Adainit, "adainit");
begin
-- Initialize Ada runtime
Adainit;
-- Initialize Ocarina runtime
Ocarina.Initialize;
Default_AADL_Version := Get_Default_AADL_Version;
AADL_Version := Ocarina.AADL_V2;
Ocarina.Configuration.Init_Modules;
-- Initialize Python bindings
Repo := Register_Scripts_And_Functions;
end Initialize_Lib;
---------------- ----------------
-- Initialize -- -- Initialize --
---------------- ----------------
......
...@@ -10,8 +10,10 @@ package Ocarina.Python_Cmd is ...@@ -10,8 +10,10 @@ package Ocarina.Python_Cmd is
-- Register the Python scripting language, and the functions we -- Register the Python scripting language, and the functions we
-- export -- export
procedure Initialize_Lib;
pragma Export (C, Initialize_Lib, "initocarina");
procedure Initialize; procedure Initialize;
pragma Export (C, Initialize, "initocarina");
private private
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment