home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / perl / perl_1 / Perlsource / source / !Perl / c / miniplmain < prev    next >
Encoding:
Text File  |  1996-02-27  |  1.0 KB  |  63 lines

  1. /*
  2.  * "The Road goes ever on and on, down from the door where it began."
  3.  */
  4.  
  5. #include "INTERN.h"
  6. #include "perl.h"
  7.  
  8. static void xs_init _((void));
  9. static PerlInterpreter *my_perl;
  10.  
  11. #ifdef RISCOS
  12. extern char * *  _make_environ(void);
  13. #endif
  14.  
  15.  
  16. int
  17. main(int argc, char **argv)
  18. {
  19. #ifdef RISCOS
  20. char ** env;
  21. #else
  22.     char *env[] = {"There","Is","No","Env","Array","ATM","Remind","Me","To","Fix","It",0};
  23. #endif
  24.     int exitstatus;
  25.  
  26. #ifdef VMS
  27.     getredirection(&argc,&argv);
  28. #endif
  29.  
  30.     if (!do_undump) {
  31.     my_perl = perl_alloc();
  32.     if (!my_perl)
  33.         exit(1);
  34.     perl_construct( my_perl );
  35.     }
  36.  
  37. #ifdef RISCOS
  38.     env =  _make_environ();
  39. #endif
  40.     exitstatus = perl_parse( my_perl, xs_init, argc, argv, env );
  41.  
  42. #ifdef RISCOS /* THIS COULD BE DANGEROUS */
  43.     free(env);
  44. #endif
  45.     if (exitstatus)
  46.     exit( exitstatus );
  47.  
  48.     exitstatus = perl_run( my_perl );
  49.  
  50.     perl_destruct( my_perl );
  51.     perl_free( my_perl );
  52.  
  53.     exit( exitstatus );
  54. }
  55.  
  56. /* Register any extra external extensions */
  57.  
  58. static void
  59. xs_init()
  60. {
  61.     /* Do not delete this line--writemain depends on it */
  62. }
  63.