pragma Source_File_Name (ada_main, Spec_File_Name => "b~rapid.ads");
pragma Source_File_Name (ada_main, Body_File_Name => "b~rapid.adb");

package body ada_main is
   pragma Warnings (Off);

   procedure Do_Finalize;
   pragma Import (C, Do_Finalize, "system__standard_library__adafinal");

   procedure adainit is
      E068 : Boolean; pragma Import (Ada, E068, "system__restrictions_E");
      E009 : Boolean; pragma Import (Ada, E009, "system__secondary_stack_E");
      E013 : Boolean; pragma Import (Ada, E013, "system__soft_links_E");
      E019 : Boolean; pragma Import (Ada, E019, "system__exception_table_E");
      E075 : Boolean; pragma Import (Ada, E075, "ada__io_exceptions_E");
      E040 : Boolean; pragma Import (Ada, E040, "ada__strings_E");
      E064 : Boolean; pragma Import (Ada, E064, "ada__tags_E");
      E062 : Boolean; pragma Import (Ada, E062, "ada__streams_E");
      E338 : Boolean; pragma Import (Ada, E338, "gnat__os_lib_E");
      E151 : Boolean; pragma Import (Ada, E151, "interfaces__c_E");
      E153 : Boolean; pragma Import (Ada, E153, "interfaces__c__strings_E");
      E061 : Boolean; pragma Import (Ada, E061, "system__finalization_root_E");
      E046 : Boolean; pragma Import (Ada, E046, "ada__strings__maps_E");
      E084 : Boolean; pragma Import (Ada, E084, "ada__strings__maps__constants_E");
      E066 : Boolean; pragma Import (Ada, E066, "system__finalization_implementation_E");
      E059 : Boolean; pragma Import (Ada, E059, "ada__finalization_E");
      E096 : Boolean; pragma Import (Ada, E096, "ada__finalization__list_controller_E");
      E042 : Boolean; pragma Import (Ada, E042, "ada__strings__unbounded_E");
      E336 : Boolean; pragma Import (Ada, E336, "gnat__directory_operations_E");
      E094 : Boolean; pragma Import (Ada, E094, "system__file_control_block_E");
      E093 : Boolean; pragma Import (Ada, E093, "system__file_io_E");
      E088 : Boolean; pragma Import (Ada, E088, "ada__text_io_E");
      E147 : Boolean; pragma Import (Ada, E147, "cargv_E");
      E156 : Boolean; pragma Import (Ada, E156, "cargv_helpers_E");
      E149 : Boolean; pragma Import (Ada, E149, "chelper_E");
      E162 : Boolean; pragma Import (Ada, E162, "expanding_array_E");
      E128 : Boolean; pragma Import (Ada, E128, "file_helpers_E");
      E132 : Boolean; pragma Import (Ada, E132, "generate_helpers_E");
      E317 : Boolean; pragma Import (Ada, E317, "help_menu_E");
      E136 : Boolean; pragma Import (Ada, E136, "lists_generic_E");
      E130 : Boolean; pragma Import (Ada, E130, "gui__menu_E");
      E324 : Boolean; pragma Import (Ada, E324, "lists_generic__generic_key_E");
      E269 : Boolean; pragma Import (Ada, E269, "lists_generic__key_E");
      E333 : Boolean; pragma Import (Ada, E333, "mcc__directory_operations_E");
      E287 : Boolean; pragma Import (Ada, E287, "mcc__text_entry_types_E");
      E326 : Boolean; pragma Import (Ada, E326, "menu_io_E");
      E166 : Boolean; pragma Import (Ada, E166, "tcl_E");
      E178 : Boolean; pragma Import (Ada, E178, "tcl__ada_E");
      E176 : Boolean; pragma Import (Ada, E176, "peer_E");
      E145 : Boolean; pragma Import (Ada, E145, "mcc__gui_E");
      E205 : Boolean; pragma Import (Ada, E205, "mcc__gui__colors_E");
      E157 : Boolean; pragma Import (Ada, E157, "mcc__gui__container_E");
      E301 : Boolean; pragma Import (Ada, E301, "mcc__gui__container__frame_E");
      E159 : Boolean; pragma Import (Ada, E159, "mcc__gui__container__window_E");
      E174 : Boolean; pragma Import (Ada, E174, "mcc__common_dialogs_E");
      E215 : Boolean; pragma Import (Ada, E215, "mcc__gui__fonts_E");
      E225 : Boolean; pragma Import (Ada, E225, "mcc__gui__image_E");
      E295 : Boolean; pragma Import (Ada, E295, "mcc__gui__menu_E");
      E170 : Boolean; pragma Import (Ada, E170, "mcc__gui__widget_E");
      E211 : Boolean; pragma Import (Ada, E211, "mcc__gui__widget__button_E");
      E313 : Boolean; pragma Import (Ada, E313, "edit_menu_E");
      E077 : Boolean; pragma Import (Ada, E077, "file_menu_E");
      E241 : Boolean; pragma Import (Ada, E241, "mcc__gui__widget__button__check_E");
      E223 : Boolean; pragma Import (Ada, E223, "mcc__gui__widget__button__picture_E");
      E271 : Boolean; pragma Import (Ada, E271, "mcc__gui__widget__button__radio_E");
      E267 : Boolean; pragma Import (Ada, E267, "group_manager_E");
      E213 : Boolean; pragma Import (Ada, E213, "mcc__gui__widget__button__text_E");
      E172 : Boolean; pragma Import (Ada, E172, "mcc__gui__widget__dropdown_E");
      E203 : Boolean; pragma Import (Ada, E203, "mcc__gui__widget__label_E");
      E311 : Boolean; pragma Import (Ada, E311, "main_window_E");
      E199 : Boolean; pragma Import (Ada, E199, "mcc__gui__widget__listbox_E");
      E142 : Boolean; pragma Import (Ada, E142, "font_selection_dialog_window_E");
      E257 : Boolean; pragma Import (Ada, E257, "mcc__gui__widget__picture_E");
      E201 : Boolean; pragma Import (Ada, E201, "mcc__gui__widget__progress_E");
      E321 : Boolean; pragma Import (Ada, E321, "mcc__gui__widget__rectangle_E");
      E277 : Boolean; pragma Import (Ada, E277, "mcc__gui__widget__scale_E");
      E229 : Boolean; pragma Import (Ada, E229, "mcc__gui__widget__text_entry_E");
      E315 : Boolean; pragma Import (Ada, E315, "change_window_dialog_window_E");
      E239 : Boolean; pragma Import (Ada, E239, "check_button_dialog_window_E");
      E245 : Boolean; pragma Import (Ada, E245, "dropdown_dialog_window_E");
      E138 : Boolean; pragma Import (Ada, E138, "gui__widget_E");
      E140 : Boolean; pragma Import (Ada, E140, "font_actions_E");
      E221 : Boolean; pragma Import (Ada, E221, "gui__widget__button_E");
      E237 : Boolean; pragma Import (Ada, E237, "gui__widget__check_button_E");
      E243 : Boolean; pragma Import (Ada, E243, "gui__widget__dropdown_E");
      E247 : Boolean; pragma Import (Ada, E247, "gui__widget__listbox_E");
      E255 : Boolean; pragma Import (Ada, E255, "gui__widget__picture_E");
      E261 : Boolean; pragma Import (Ada, E261, "gui__widget__progress_E");
      E265 : Boolean; pragma Import (Ada, E265, "gui__widget__radio_button_E");
      E275 : Boolean; pragma Import (Ada, E275, "gui__widget__scale_E");
      E281 : Boolean; pragma Import (Ada, E281, "gui__widget__static_E");
      E285 : Boolean; pragma Import (Ada, E285, "gui__widget__text_E");
      E081 : Boolean; pragma Import (Ada, E081, "gui__window_E");
      E219 : Boolean; pragma Import (Ada, E219, "gui_enum_E");
      E283 : Boolean; pragma Import (Ada, E283, "label_dialog_window_E");
      E249 : Boolean; pragma Import (Ada, E249, "listbox_dialog_window_E");
      E291 : Boolean; pragma Import (Ada, E291, "menu_edit_E");
      E293 : Boolean; pragma Import (Ada, E293, "menu_generate_E");
      E303 : Boolean; pragma Import (Ada, E303, "menuedit_window_E");
      E305 : Boolean; pragma Import (Ada, E305, "menuitem_dialog_window_E");
      E160 : Boolean; pragma Import (Ada, E160, "my_expanding_array_E");
      E332 : Boolean; pragma Import (Ada, E332, "new_dialog_window_E");
      E328 : Boolean; pragma Import (Ada, E328, "novice_mode_E");
      E259 : Boolean; pragma Import (Ada, E259, "picture_dialog_window_E");
      E227 : Boolean; pragma Import (Ada, E227, "picturebutton_dialog_window_E");
      E263 : Boolean; pragma Import (Ada, E263, "progress_dialog_window_E");
      E273 : Boolean; pragma Import (Ada, E273, "radio_button_dialog_window_E");
      E342 : Boolean; pragma Import (Ada, E342, "rapid_helpers_E");
      E279 : Boolean; pragma Import (Ada, E279, "scale_dialog_window_E");
      E231 : Boolean; pragma Import (Ada, E231, "state_E");
      E307 : Boolean; pragma Import (Ada, E307, "submenu_dialog_window_E");
      E217 : Boolean; pragma Import (Ada, E217, "subwindow_actions_E");
      E168 : Boolean; pragma Import (Ada, E168, "tcl__tk_E");
      E180 : Boolean; pragma Import (Ada, E180, "tcl_utilities_E");
      E235 : Boolean; pragma Import (Ada, E235, "textbutton_dialog_window_E");
      E289 : Boolean; pragma Import (Ada, E289, "textentry_dialog_window_E");
      E309 : Boolean; pragma Import (Ada, E309, "toolbar_E");
      E319 : Boolean; pragma Import (Ada, E319, "tools_menu_E");
      E330 : Boolean; pragma Import (Ada, E330, "widget_io_E");

      Restrictions : constant String :=
        "nnvvnnnvvnnvnnvnvvvvvvvvvnvnvnnvnnnvnvnnnnnnnvvvnnnvvnvvv" &
        "nnnnnnnnnnnnnn" & ASCII.Nul;

      Interrupt_States : constant String :=
        "";

      procedure Set_Globals
        (Main_Priority            : Integer;
         Time_Slice_Value         : Integer;
         WC_Encoding              : Character;
         Locking_Policy           : Character;
         Queuing_Policy           : Character;
         Task_Dispatching_Policy  : Character;
         Restrictions             : System.Address;
         Interrupt_States         : System.Address;
         Num_Interrupt_States     : Integer;
         Unreserve_All_Interrupts : Integer;
         Exception_Tracebacks     : Integer;
         Zero_Cost_Exceptions     : Integer;
         Detect_Blocking          : Integer;
         Default_Stack_Size       : Integer);
      pragma Import (C, Set_Globals, "__gnat_set_globals");

      procedure Install_Handler;
      pragma Import (C, Install_Handler, "__gnat_install_handler");

      Handler_Installed : Integer;
      pragma Import (C, Handler_Installed, "__gnat_handler_installed");
   begin
      Set_Globals
        (Main_Priority            => -1,
         Time_Slice_Value         => -1,
         WC_Encoding              => 'b',
         Locking_Policy           => ' ',
         Queuing_Policy           => ' ',
         Task_Dispatching_Policy  => ' ',
         Restrictions             => Restrictions'Address,
         Interrupt_States         => Interrupt_States'Address,
         Num_Interrupt_States     => 0,
         Unreserve_All_Interrupts => 0,
         Exception_Tracebacks     => 0,
         Zero_Cost_Exceptions     => 1,
         Detect_Blocking          => 0,
         Default_Stack_Size       => -1);

      if Handler_Installed = 0 then
         Install_Handler;
      end if;

      System.Restrictions'Elab_Spec;
      System.Restrictions'Elab_Body;
      E068 := True;
      System.Soft_Links'Elab_Body;
      E013 := True;
      System.Secondary_Stack'Elab_Body;
      E009 := True;
      System.Exception_Table'Elab_Body;
      E019 := True;
      Ada.Io_Exceptions'Elab_Spec;
      E075 := True;
      Ada.Strings'Elab_Spec;
      E040 := True;
      Ada.Tags'Elab_Spec;
      Ada.Streams'Elab_Spec;
      E062 := True;
      Gnat.Os_Lib'Elab_Body;
      E338 := True;
      Interfaces.C'Elab_Spec;
      E151 := True;
      Interfaces.C.Strings'Elab_Spec;
      E153 := True;
      System.Finalization_Root'Elab_Spec;
      E061 := True;
      Ada.Strings.Maps'Elab_Spec;
      E046 := True;
      Ada.Strings.Maps.Constants'Elab_Spec;
      E084 := True;
      System.Finalization_Implementation'Elab_Spec;
      System.Finalization_Implementation'Elab_Body;
      E066 := True;
      Ada.Finalization'Elab_Spec;
      E059 := True;
      Ada.Finalization.List_Controller'Elab_Spec;
      E096 := True;
      Ada.Strings.Unbounded'Elab_Spec;
      E042 := True;
      Gnat.Directory_Operations'Elab_Spec;
      E336 := True;
      System.File_Control_Block'Elab_Spec;
      E094 := True;
      System.File_Io'Elab_Body;
      E093 := True;
      Ada.Text_Io'Elab_Spec;
      Ada.Text_Io'Elab_Body;
      E088 := True;
      Ada.Tags'Elab_Body;
      E064 := True;
      Cargv'Elab_Spec;
      Cargv_Helpers'Elab_Spec;
      E156 := True;
      E149 := True;
      E147 := True;
      E162 := True;
      E128 := True;
      E132 := True;
      E136 := True;
      Gui.Menu'Elab_Spec;
      E130 := True;
      E324 := True;
      E269 := True;
      Mcc.Directory_Operations'Elab_Spec;
      E333 := True;
      E287 := True;
      Menu_Io'Elab_Spec;
      Tcl'Elab_Spec;
      E166 := True;
      Tcl.Ada'Elab_Spec;
      E178 := True;
      Mcc.Gui'Elab_Spec;
      E205 := True;
      Mcc.Gui.Container'Elab_Spec;
      E157 := True;
      Mcc.Gui.Container.Frame'Elab_Spec;
      E301 := True;
      Mcc.Gui.Container.Window'Elab_Spec;
      E317 := True;
      Mcc.Gui.Fonts'Elab_Spec;
      Mcc.Gui.Image'Elab_Spec;
      E225 := True;
      Mcc.Gui.Menu'Elab_Spec;
      Mcc.Gui.Menu'Elab_Body;
      E295 := True;
      Mcc.Gui.Widget'Elab_Spec;
      Mcc.Gui.Widget.Button'Elab_Spec;
      Mcc.Gui.Widget.Button.Check'Elab_Spec;
      E241 := True;
      Mcc.Gui.Widget.Button.Picture'Elab_Spec;
      E223 := True;
      Mcc.Gui.Widget.Button.Radio'Elab_Spec;
      Group_Manager'Elab_Body;
      E267 := True;
      Mcc.Gui.Widget.Button.Text'Elab_Spec;
      E213 := True;
      Mcc.Gui.Widget.Dropdown'Elab_Spec;
      E172 := True;
      Mcc.Gui.Widget.Label'Elab_Spec;
      E203 := True;
      main_window'elab_spec;
      Mcc.Gui.Widget.Listbox'Elab_Spec;
      E199 := True;
      Mcc.Gui.Fonts'Elab_Body;
      E215 := True;
      font_selection_dialog_window'elab_spec;
      Mcc.Gui.Widget.Picture'Elab_Spec;
      E257 := True;
      Mcc.Gui.Widget.Progress'Elab_Spec;
      E201 := True;
      E170 := True;
      Mcc.Gui.Widget.Rectangle'Elab_Spec;
      E321 := True;
      Mcc.Gui.Widget.Scale'Elab_Spec;
      Mcc.Gui.Widget.Text_Entry'Elab_Spec;
      E229 := True;
      change_window_dialog_window'elab_spec;
      E315 := True;
      check_button_dialog_window'elab_spec;
      dropdown_dialog_window'elab_spec;
      Gui.Widget'Elab_Spec;
      E142 := True;
      Gui.Widget.Button'Elab_Spec;
      Gui.Widget.Check_Button'Elab_Spec;
      Gui.Widget.Dropdown'Elab_Spec;
      Gui.Widget.Listbox'Elab_Spec;
      Gui.Widget.Picture'Elab_Spec;
      Gui.Widget.Progress'Elab_Spec;
      Gui.Widget.Radio_Button'Elab_Spec;
      Gui.Widget.Scale'Elab_Spec;
      Gui.Widget.Static'Elab_Spec;
      Gui.Widget.Text'Elab_Spec;
      Gui.Window'Elab_Spec;
      E219 := True;
      label_dialog_window'elab_spec;
      E281 := True;
      listbox_dialog_window'elab_spec;
      E247 := True;
      E326 := True;
      Menu_Generate'Elab_Body;
      E293 := True;
      menuedit_window'elab_spec;
      E303 := True;
      menuitem_dialog_window'elab_spec;
      E305 := True;
      My_Expanding_Array'Elab_Spec;
      E160 := True;
      E277 := True;
      E271 := True;
      E211 := True;
      E145 := True;
      new_dialog_window'elab_spec;
      E332 := True;
      E328 := True;
      Picture_Dialog_Window'Elab_Spec;
      E255 := True;
      picturebutton_dialog_window'elab_spec;
      Progress_Dialog_Window'Elab_Spec;
      E261 := True;
      radio_button_dialog_window'elab_spec;
      E265 := True;
      E342 := True;
      Scale_Dialog_Window'Elab_Spec;
      E275 := True;
      state'elab_body;
      E231 := True;
      E243 := True;
      E237 := True;
      E077 := True;
      Submenu_Dialog_Window'Elab_Spec;
      E307 := True;
      E291 := True;
      E279 := True;
      E273 := True;
      E263 := True;
      E227 := True;
      E259 := True;
      E249 := True;
      E283 := True;
      Font_Actions'Elab_Body;
      E140 := True;
      E138 := True;
      E245 := True;
      E239 := True;
      Edit_Menu'Elab_Body;
      E313 := True;
      E168 := True;
      E159 := True;
      peer'elab_body;
      E176 := True;
      E180 := True;
      E174 := True;
      textbutton_dialog_window'elab_spec;
      E235 := True;
      E221 := True;
      textentry_dialog_window'elab_spec;
      E289 := True;
      E285 := True;
      E309 := True;
      Subwindow_Actions'Elab_Body;
      E217 := True;
      E319 := True;
      E311 := True;
      Widget_Io'Elab_Spec;
      Widget_Io'Elab_Body;
      E330 := True;
      Gui.Window'Elab_Body;
      E081 := True;
   end adainit;

   procedure adafinal is
   begin
      Do_Finalize;
   end adafinal;

   function main
     (argc : Integer;
      argv : System.Address;
      envp : System.Address)
      return Integer
   is
      procedure initialize (Addr : System.Address);
      pragma Import (C, initialize, "__gnat_initialize");

      procedure finalize;
      pragma Import (C, finalize, "__gnat_finalize");

      procedure Ada_Main_Program;
      pragma Import (Ada, Ada_Main_Program, "_ada_rapid");

      SEH : aliased array (1 .. 2) of Integer;

      Ensure_Reference : aliased System.Address := Ada_Main_Program_Name'Address;
      pragma Volatile (Ensure_Reference);

   begin
      gnat_argc := argc;
      gnat_argv := argv;
      gnat_envp := envp;

      Initialize (SEH'Address);
      adainit;
      Break_Start;
      Ada_Main_Program;
      Do_Finalize;
      Finalize;
      return (gnat_exit_status);
   end;

--  BEGIN Object file/option list
   --   ./cargv_helpers.o
   --   ./chelper.o
   --   ./cargv.o
   --   ./expanding_array.o
   --   ./file_helpers.o
   --   ./generate_helpers.o
   --   ./limits.o
   --   ./gui.o
   --   ./lists_generic.o
   --   ./gui-menu.o
   --   ./lists_generic-generic_key.o
   --   ./lists_generic-key.o
   --   ./lists_generic_2keys.o
   --   ./mcc.o
   --   ./mcc-directory_operations.o
   --   ./mcc-text_entry_types.o
   --   ./tcl.o
   --   ./tcl-ada.o
   --   ./mcc-gui-colors.o
   --   ./mcc-gui-container.o
   --   ./mcc-gui-container-frame.o
   --   ./help_menu.o
   --   ./mcc-gui-image.o
   --   ./mcc-gui-menu.o
   --   ./mcc-gui-widget-button-check.o
   --   ./mcc-gui-widget-button-picture.o
   --   ./group_manager.o
   --   ./mcc-gui-widget-button-text.o
   --   ./mcc-gui-widget-dropdown.o
   --   ./mcc-gui-widget-label.o
   --   ./mcc-gui-widget-listbox.o
   --   ./mcc-gui-fonts.o
   --   ./mcc-gui-widget-picture.o
   --   ./mcc-gui-widget-progress.o
   --   ./mcc-gui-widget.o
   --   ./mcc-gui-widget-rectangle.o
   --   ./mcc-gui-widget-text_entry.o
   --   ./change_window_dialog_window.o
   --   ./font_selection_dialog_window.o
   --   ./gui_enum.o
   --   ./gui-widget-static.o
   --   ./gui-widget-listbox.o
   --   ./menu_io.o
   --   ./menu_generate.o
   --   ./menuedit_window.o
   --   ./menuitem_dialog_window.o
   --   ./my_expanding_array.o
   --   ./mcc-gui-widget-scale.o
   --   ./mcc-gui-widget-button-radio.o
   --   ./mcc-gui-widget-button.o
   --   ./mcc-gui.o
   --   ./new_dialog_window.o
   --   ./novice_mode.o
   --   ./peer-keys.o
   --   ./mcc-gui-keys.o
   --   ./gui-widget-picture.o
   --   ./gui-widget-progress.o
   --   ./gui-widget-radio_button.o
   --   ./rapid_helpers.o
   --   ./gui-widget-scale.o
   --   ./state.o
   --   ./gui-widget-dropdown.o
   --   ./gui-widget-check_button.o
   --   ./file_menu.o
   --   ./submenu_dialog_window.o
   --   ./menu_edit.o
   --   ./scale_dialog_window.o
   --   ./radio_button_dialog_window.o
   --   ./progress_dialog_window.o
   --   ./picturebutton_dialog_window.o
   --   ./picture_dialog_window.o
   --   ./listbox_dialog_window.o
   --   ./label_dialog_window.o
   --   ./font_actions.o
   --   ./gui-widget.o
   --   ./dropdown_dialog_window.o
   --   ./check_button_dialog_window.o
   --   ./edit_menu.o
   --   ./tcl-tk.o
   --   ./mcc-gui-container-window.o
   --   ./peer.o
   --   ./tcl_utilities.o
   --   ./mcc-common_dialogs.o
   --   ./textbutton_dialog_window.o
   --   ./gui-widget-button.o
   --   ./textentry_dialog_window.o
   --   ./gui-widget-text.o
   --   ./toolbar.o
   --   ./subwindow_actions.o
   --   ./rapid.o
   --   ./tools_menu.o
   --   ./main_window.o
   --   ./widget_io.o
   --   ./gui-window.o
   --   -L./
   --   -LC:\d\keepme\rapid-3.0\rapid\
   --   -L..\mcc_gui\
   --   -L..\tcl_peer\
   --   -Lc:\d\desktop\tash841a\tash841a\src\
   --   -L..\lib\
   --   -LC:\gnatpro\bindings\GNATCOM\bindings\
   --   -LC:\gnat\adagraph\
   --   -LC:\Rapid\tash\
   --   -LC:\Rapid\Tcl_Peer\
   --   -LC:\Rapid\lib\
   --   -LC:\Rapid\mcc_gui\
   --   -LC:\gnatpro\aunit\
   --   -LC:/GNATPRO/5.04a/lib/gcc/pentium-mingw32msv/3.4.6/adalib/
   --   -ltash
   --   -ltcl84
   --   -ltk84
   --   -static
   --   -lgnat
   --   -Wl,--stack=0x2000000
--  END Object file/option list   

end ada_main;
