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_ctype = getenv("LC_CTYPE");
31 if (setlocale(LC_CTYPE, "") == NULL && (lc_ctype || lang)) {
33 "warning: setlocale(LC_CTYPE, \"\") failed, LC_CTYPE = \"%s\", LANG = \"%s\",\n",
34 lc_ctype ? lc_ctype : "(null)",
35 lang ? lang : "(null)"
38 "warning: falling back to the \"C\" locale.\n");
39 setlocale(LC_CTYPE, "C");
42 for (i = 0; i < 256; i++) {
43 if (isUPPER(i)) fold[i] = toLOWER(i);
44 else if (isLOWER(i)) fold[i] = toUPPER(i);
58 #else /* def(CAN_PROTOTYPE) */
59 main(int argc, char **argv, char **env)
60 #endif /* def(CAN_PROTOTYPE) */
65 _response(&argc, &argv);
66 _wildcard(&argc, &argv);
70 getredirection(&argc,&argv);
73 /* here a union of the cpp #if:s inside i18nl14n() */
74 #if (defined(HAS_SETLOCALE) && defined(LC_CTYPE))
79 my_perl = perl_alloc();
82 perl_construct( my_perl );
85 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
89 exitstatus = perl_run( my_perl );
91 perl_destruct( my_perl );
97 /* Register any extra external extensions */
99 /* Do not delete this line--writemain depends on it */