- Calling the class loader
- Running the main method
- $Id: main.c 1371 2004-08-01 21:55:39Z stefan $
+ $Id: main.c 1424 2004-10-30 11:15:23Z motse $
*/
/************ Collect info from the environment ************************/
- classpath = MNEW(u1, 2);
+ /* set an initial, minimal classpath */
+ classpath = MNEW(char, 2);
strcpy(classpath, ".");
/* get classpath environment */
cp = getenv("CLASSPATH");
if (cp) {
classpath = MREALLOC(classpath,
- u1,
+ char,
strlen(classpath),
strlen(classpath) + 1 + strlen(cp) + 1);
strcat(classpath, ":");
- strncat(classpath, cp, strlen(cp));
+ strcat(classpath, cp);
}
/***************** Interpret the command line *****************/
case OPT_IGNORE: break;
case OPT_CLASSPATH:
- classpath = MREALLOC(classpath,
- u1,
- strlen(classpath),
- strlen(classpath) + 1 + strlen(opt_arg) + 1);
- strcat(classpath, ":");
- strncat(classpath, opt_arg, strlen(opt_arg));
+ /* forget old classpath and set the argument as new classpath */
+ MFREE(classpath, char, strlen(classpath));
+
+ classpath = MNEW(char, strlen(opt_arg) + 1);
+ strcpy(classpath, opt_arg);
break;
case OPT_D:
exit(10);
}
}
-
-
+
if (opt_ind >= argc) {
print_usage();
exit(10);
cacao_initializing = true;
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+#if defined(USE_THREADS)
+#if defined(NATIVE_THREADS)
initThreadsEarly();
#endif
initLocks();
+#endif
/* install architecture dependent signal handler used for exceptions */
init_exceptions();
if (!class_init(class_new(utf_new_char("java/lang/System"))))
throw_main_exception_exit();
+
+
+ jni_init();
cacao_initializing = false;
/************************* Start worker routines ********************/
void cacao_shutdown(s4 status)
{
- /**** RTAprint ***/
-
if (verbose || getcompilingtime || opt_stat) {
log_text("CACAO terminated by shutdown");
- if (opt_stat)
- print_stats();
- if (getcompilingtime)
- print_times();
- mem_usagelog(0);
- dolog("Exit status: %d\n", (int) status);
+ dolog("Exit status: %d\n", (s4) status);
}
exit(status);