Upload Tizen:Base source
[external/bash.git] / examples / loadables / perl / iperl.c
1 #include <EXTERN.h>               /* from the Perl distribution     */
2 #include <perl.h>                 /* from the Perl distribution     */
3
4 extern void xs_init _((void));
5
6 static PerlInterpreter *iperl;  /***    The Perl interpreter    ***/
7
8 int
9 perl_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
18 PerlIO_flush(PerlIO_stdout());
19 PerlIO_flush(PerlIO_stderr());
20
21         perl_destruct(iperl);
22         perl_free(iperl);
23         return (r);
24 }