1#include <EXTERN.h>               /* from the Perl distribution     */
2#include <perl.h>                 /* from the Perl distribution     */
3
4extern void xs_init _((void));
5
6static PerlInterpreter *iperl;  /***    The Perl interpreter    ***/
7
8int
9perl_main(int argc, char **argv, char **env)
10{
11	int	r;
12
13	iperl = perl_alloc();
14	perl_construct(iperl);
15	perl_parse(iperl, xs_init, argc, argv, (char **)NULL);
16	r = perl_run(iperl);
17
18PerlIO_flush(PerlIO_stdout());
19PerlIO_flush(PerlIO_stderr());
20
21	perl_destruct(iperl);
22	perl_free(iperl);
23	return (r);
24}
25