diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-19 10:13:38 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-19 10:13:38 +0000 |
commit | 14856225739aa48b6c9cf4c17925362b2d95cea3 (patch) | |
tree | dfd38f1b654fb5bbdfc38887c1a829b658e71530 /gnu/usr.bin/perl/miniperlmain.c | |
parent | 77469082517e44fe6ca347d9e8dc7dffd1583637 (diff) |
Import of Perl 5.003 into the tree. Makefile.bsd-wrapper and
config.sh.OpenBSD are the only local changes.
Diffstat (limited to 'gnu/usr.bin/perl/miniperlmain.c')
-rw-r--r-- | gnu/usr.bin/perl/miniperlmain.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/miniperlmain.c b/gnu/usr.bin/perl/miniperlmain.c new file mode 100644 index 00000000000..bc81e997372 --- /dev/null +++ b/gnu/usr.bin/perl/miniperlmain.c @@ -0,0 +1,67 @@ +/* + * "The Road goes ever on and on, down from the door where it began." + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "EXTERN.h" +#include "perl.h" + +#ifdef __cplusplus +} +# define EXTERN_C extern "C" +#else +# define EXTERN_C extern +#endif + +static void xs_init _((void)); +static PerlInterpreter *my_perl; + +int +#ifdef CAN_PROTOTYPE +main(int argc, char **argv, char **env) +#else +main(argc, argv, env) +int argc; +char **argv; +char **env; +#endif +{ + int exitstatus; + + PERL_SYS_INIT(&argc,&argv); + + perl_init_i18nl14n(1); + + if (!do_undump) { + my_perl = perl_alloc(); + if (!my_perl) + exit(1); + perl_construct( my_perl ); + } + + exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL ); + if (exitstatus) + exit( exitstatus ); + + exitstatus = perl_run( my_perl ); + + perl_destruct( my_perl ); + perl_free( my_perl ); + + PERL_SYS_TERM(); + + exit( exitstatus ); +} + +/* Register any extra external extensions */ + +/* Do not delete this line--writemain depends on it */ + +static void +xs_init() +{ + dXSUB_SYS; +} |