2 * "The Road goes ever on and on, down from the door where it began."
14 # define EXTERN_C extern "C"
16 # define EXTERN_C extern
19 static void xs_init _((void));
20 static PerlInterpreter *my_perl;
23 perl_init_i18nl14n(printwarn) /* XXX move to perl.c */
28 * 1 = set ok or not applicable,
29 * 0 = fallback to C locale,
30 * -1 = fallback to C locale failed
32 #if defined(HAS_SETLOCALE) && defined(LC_CTYPE)
33 char * lang = getenv("LANG");
34 char * lc_all = getenv("LC_ALL");
35 char * lc_ctype = getenv("LC_CTYPE");
38 if (setlocale(LC_CTYPE, "") == NULL && (lc_all || lc_ctype || lang)) {
40 fprintf(stderr, "warning: setlocale(LC_CTYPE, \"\") failed.\n");
42 "warning: LC_ALL = \"%s\", LC_CTYPE = \"%s\", LANG = \"%s\",\n",
43 lc_all ? lc_all : "(null)",
44 lc_ctype ? lc_ctype : "(null)",
45 lang ? lang : "(null)"
47 fprintf(stderr, "warning: falling back to the \"C\" locale.\n");
50 if (setlocale(LC_CTYPE, "C") == NULL)
54 for (i = 0; i < 256; i++) {
55 if (isUPPER(i)) fold[i] = toLOWER(i);
56 else if (isLOWER(i)) fold[i] = toUPPER(i);
70 #else /* def(CAN_PROTOTYPE) */
71 main(int argc, char **argv, char **env)
72 #endif /* def(CAN_PROTOTYPE) */
76 PERL_SYS_INIT(&argc,&argv);
78 perl_init_i18nl14n(1);
81 my_perl = perl_alloc();
84 perl_construct( my_perl );
87 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
91 exitstatus = perl_run( my_perl );
93 perl_destruct( my_perl );
99 /* Register any extra external extensions */
101 /* Do not delete this line--writemain depends on it */