home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / ada / 3336 < prev    next >
Encoding:
Text File  |  1992-11-23  |  3.8 KB  |  104 lines

  1. Path: sparky!uunet!mcsun!uknet!gdt!aber!btk
  2. From: btk@aber.ac.uk (Benjamin Thomas Ketteridge)
  3. Newsgroups: comp.lang.ada
  4. Subject: Re: DEC Ada run-time error messages (Was: More Ashamedness of Ada - this time OBJECT WORLD)
  5. Message-ID: <1992Nov23.102732.16228@aber.ac.uk>
  6. Date: 23 Nov 92 10:27:32 GMT
  7. References: <199211161803.AA02960@cnam.cnam.fr>
  8. Sender: news@aber.ac.uk (USENET news service)
  9. Organization: The Cottage of the 2 Bears, Aberystwyth.
  10. Lines: 91
  11. Nntp-Posting-Host: aberda
  12.  
  13. > DEC's "Software Product Description" says that the DEC Ada compiler for
  14. > Ultrix is written in Bliss and Ada (no proportions given). So, it's not
  15. > the fault of C...
  16.  
  17. ================ Cut Here ======================== Cut Here ===================
  18.  
  19. /* ACS generated code
  20. */
  21. #define Ada_Start ada$acs$start
  22. static int once_block[3] = { 0, 0, 0};
  23. static int ada_component_handle_address;
  24. int ada_argc;
  25. char **ada_argv;
  26. static ada_elaborate(task_monitor_ptr,coll_list_ptr)
  27.         int task_monitor_ptr, coll_list_ptr;
  28.  
  29. {
  30.         ADA$MAIN_PROGRAM_ARGUMENT_LIST_$E (task_monitor_ptr, coll_list_ptr);
  31.         ADA$ANALYSER_$E (task_monitor_ptr, coll_list_ptr);
  32.         ADA$LOW_LEVEL_IO_$E (task_monitor_ptr, coll_list_ptr);
  33.         ADA$IO_EXCEPTIONS_$E (task_monitor_ptr, coll_list_ptr);
  34.         ADA$LOW_LEVEL_IO$E (task_monitor_ptr, coll_list_ptr);
  35.         ADA$TEXT_IO_$E (task_monitor_ptr, coll_list_ptr);
  36.         ADA$TEXT_IO$E (task_monitor_ptr, coll_list_ptr);
  37.         ADA$C_TYPES_$E (task_monitor_ptr, coll_list_ptr);
  38.         ADA$C_TYPES$E (task_monitor_ptr, coll_list_ptr);
  39.         ADA$MAIN_PROGRAM_ARGUMENT_LIST$E (task_monitor_ptr, coll_list_ptr);
  40.         ADA$VMT_PACKAGE_$E (task_monitor_ptr, coll_list_ptr);
  41.         ADA$MATH_LIB_$E (task_monitor_ptr, coll_list_ptr);
  42.         ADA$D3_VECTORS_$E (task_monitor_ptr, coll_list_ptr);
  43.         ADA$MATH_LIB_ERRNO_$E (task_monitor_ptr, coll_list_ptr);
  44.         ADA$MATH_LIB$E (task_monitor_ptr, coll_list_ptr);
  45.         ADA$D3_VECTORS$E (task_monitor_ptr, coll_list_ptr);
  46.         ADA$VMT_PACKAGE$E (task_monitor_ptr, coll_list_ptr);
  47.         ADA$OGL_PACKAGE_$E (task_monitor_ptr, coll_list_ptr);
  48.         ADA$OGL_PACKAGE$E (task_monitor_ptr, coll_list_ptr);
  49.         ADA$SML_PACKAGE_$E (task_monitor_ptr, coll_list_ptr);
  50.         ADA$SML_PACKAGE$E (task_monitor_ptr, coll_list_ptr);
  51.         ADA$ANALYSER$E (task_monitor_ptr, coll_list_ptr);
  52.         return;
  53. }
  54.  
  55. static ada_make_component_handle()
  56. {
  57.     ada_component_handle_address = ada$init_component_handle(ada_elaborate);
  58. }
  59. int Ada_Start ()
  60. {
  61.     ada$cma_once(once_block, ada_make_component_handle);
  62.     return ada_component_handle_address;
  63. }
  64.  
  65. main(argc, argv ,envp)
  66.     int argc;
  67.     char *argv[];
  68.     char *envp[];
  69. {
  70.     int my_component_handle;
  71.     int returned_value;
  72.  
  73. #define Main_Name ADA$ANALYSE$M
  74.     int Main_Name();
  75.  
  76. #define Ada_Init ada_init_no_tasks
  77.     int Ada_Init();
  78.     int ada_complete_component();
  79.     int ada_call_main_program();
  80.     int Ada_Start();
  81.         ada_argc = argc;
  82.         ada_argv = argv;
  83.         Ada_Init(Ada_Start, 1, 2, &my_component_handle);
  84.         if(!my_component_handle) {
  85.             return 1;
  86.         }
  87.         returned_value = ada_call_main_program(Main_Name, &my_component_handle);
  88.         ada_complete_component(&my_component_handle);
  89.         return 0;
  90. }
  91.  
  92. ================ Cut Here ======================== Cut Here ===================
  93.  
  94. When binding an Ada program under DEC Ada 1.10 the above is compiled first, and 
  95. then linked into the executable along with the user's program! I think it's C,
  96. don't you? >8-> >8->
  97.  
  98. ciao
  99. +--------------------------------------------------------------------------+
  100. |    _|--|_    | Disclaimer: I know nothing! Do you really know anything?  |
  101. |     (\/)     +-------------------------------+---------------------------+
  102. |      vv      | We've a Gremlin in the works! |      btk@aber.ac.uk       |
  103. +--------------+-------------------------------+---------------------------+
  104.