#include <string.h> 
   
/* predefined exceptions */ 
char constraint_error; 
char numeric_error; 
char program_error; 
char storage_error; 
char tasking_error; 
  
static int static_argc; 
static char * *static_argv; 
  
int arg_count () { return static_argc; } 
  
int len_arg (arg_num) 
   int arg_num; 
   { return strlen(static_argv[arg_num]); } 
  
int fill_arg (a, i) 
   char * a; 
   int i; 
{ strncpy (a, static_argv[i], 
     strlen(static_argv[i])); } 
  
void catch_except (ptr, i) 
     void *ptr; 
     int i; 
{ 
  extern char *__gnat_exception; 
 
  if (!ptr)
    {
      if (__gnat_exception == &constraint_error)
        puts ("\nraised Constraint_Error\n");
      else if (__gnat_exception == &numeric_error)
        puts ("\nraised Numeric_Error\n");
      else if (__gnat_exception == &program_error)
        puts ("\nraised Program_Error\n");
      else if (__gnat_exception == &storage_error)
        puts ("\nraised Storage_Error\n");
      else
        puts ("\nraised unhandled exception\n");
 
      exit (1);
   }
  else
    longjmp (ptr, i);
}
 
void __gnat_raise_constraint ()
{
  extern char *__gnat_exception; 
  extern void *__gnat_jmpbuf; 
  __gnat_exception = &constraint_error;

  catch_except (__gnat_jmpbuf, 1);
}
 
void main (argc, argv)
   int argc;
   char * argv[];
{ 
   static_argc = argc;
   static_argv = argv;
 
   io___elabs ();
   io___elabb ();			  /* io.ali */
   hello___elabb ();			  /* hello.ali */
 
   _ada_hello ();
}
