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;
25 char * lang = getenv("LANG");
26 #if defined(HAS_SETLOCALE) && defined(LC_CTYPE)
28 char * lc_all = getenv("LC_ALL");
29 char * lc_ctype = getenv("LC_CTYPE");
32 if (setlocale(LC_CTYPE, "") == NULL && (lc_all || lc_ctype || lang)) {
33 fprintf(stderr, "warning: setlocale(LC_CTYPE, \"\") failed.\n");
35 "warning: LC_ALL = \"%s\", LC_CTYPE = \"%s\", LANG = \"%s\",\n",
36 lc_all ? lc_all : "(null)",
37 lc_ctype ? lc_ctype : "(null)",
38 lang ? lang : "(null)"
40 fprintf(stderr, "warning: falling back to the \"C\" locale.\n");
41 setlocale(LC_CTYPE, "C");
44 for (i = 0; i < 256; i++) {
45 if (isUPPER(i)) fold[i] = toLOWER(i);
46 else if (isLOWER(i)) fold[i] = toUPPER(i);
60 #else /* def(CAN_PROTOTYPE) */
61 main(int argc, char **argv, char **env)
62 #endif /* def(CAN_PROTOTYPE) */
67 _response(&argc, &argv);
68 _wildcard(&argc, &argv);
72 getredirection(&argc,&argv);
75 /* here a union of the cpp #if:s inside i18nl14n() */
76 #if (defined(HAS_SETLOCALE) && defined(LC_CTYPE))
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 */