Commit | Line | Data |
a0d0e21e |
1 | /* |
2 | * "The Road goes ever on and on, down from the door where it began." |
3 | */ |
4 | |
4633a7c4 |
5 | #ifdef __cplusplus |
6 | extern "C" { |
7 | #endif |
8 | |
ecfc5424 |
9 | #include "EXTERN.h" |
2304df62 |
10 | #include "perl.h" |
11 | |
4633a7c4 |
12 | #ifdef __cplusplus |
13 | } |
14 | # define EXTERN_C extern "C" |
15 | #else |
16 | # define EXTERN_C extern |
17 | #endif |
18 | |
a0d0e21e |
19 | static void xs_init _((void)); |
20 | static PerlInterpreter *my_perl; |
21 | |
a0d0e21e |
22 | int |
4633a7c4 |
23 | #ifndef CAN_PROTOTYPE |
2304df62 |
24 | main(argc, argv, env) |
25 | int argc; |
26 | char **argv; |
27 | char **env; |
4633a7c4 |
28 | #else /* def(CAN_PROTOTYPE) */ |
29 | main(int argc, char **argv, char **env) |
30 | #endif /* def(CAN_PROTOTYPE) */ |
2304df62 |
31 | { |
32 | int exitstatus; |
2304df62 |
33 | |
4633a7c4 |
34 | #ifdef OS2 |
35 | _response(&argc, &argv); |
36 | _wildcard(&argc, &argv); |
37 | #endif |
38 | |
a0d0e21e |
39 | #ifdef VMS |
40 | getredirection(&argc,&argv); |
41 | #endif |
42 | |
4633a7c4 |
43 | #if defined(HAS_SETLOCALE) && defined(LC_CTYPE) |
44 | if (setlocale(LC_CTYPE, "") == NULL) { |
45 | fprintf(stderr, |
46 | "setlocale(LC_CTYPE, \"\") failed (LC_CTYPE = \"%s\").\n", |
47 | getenv("LC_CTYPE")); |
48 | exit(1); |
49 | } |
50 | #endif |
51 | |
a0d0e21e |
52 | if (!do_undump) { |
53 | my_perl = perl_alloc(); |
54 | if (!my_perl) |
55 | exit(1); |
56 | perl_construct( my_perl ); |
57 | } |
2304df62 |
58 | |
4633a7c4 |
59 | exitstatus = perl_parse( my_perl, xs_init, argc, argv, NULL ); |
2304df62 |
60 | if (exitstatus) |
61 | exit( exitstatus ); |
62 | |
63 | exitstatus = perl_run( my_perl ); |
64 | |
748a9306 |
65 | perl_destruct( my_perl ); |
2304df62 |
66 | perl_free( my_perl ); |
67 | |
68 | exit( exitstatus ); |
69 | } |
70 | |
71 | /* Register any extra external extensions */ |
72 | |
4633a7c4 |
73 | /* Do not delete this line--writemain depends on it */ |
74 | |
a0d0e21e |
75 | static void |
76 | xs_init() |
2304df62 |
77 | { |
2304df62 |
78 | } |