X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fproperties.cpp;h=cb49e96acbc5db6af3f41ba89675037584ca3c59;hb=c7982045b8e1a27aca0c14398bd17a90f88ae8cc;hp=ee8bb72dd2149a96b3414234243152ed06de0ab7;hpb=a4a4e5b7925946ef7ab8728fa1e4a047b47c979b;p=cacao.git diff --git a/src/vm/properties.cpp b/src/vm/properties.cpp index ee8bb72dd..cb49e96ac 100644 --- a/src/vm/properties.cpp +++ b/src/vm/properties.cpp @@ -32,17 +32,14 @@ #include #include #include -#include -#include "mm/memory.h" +#include "mm/memory.hpp" #include "native/llni.h" -#include "toolbox/util.h" - -#include "vm/class.h" +#include "vm/class.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/os.hpp" #include "vm/properties.hpp" @@ -75,7 +72,7 @@ Properties::Properties() p = MNEW(char, 4096); if (os::readlink("/proc/self/exe", p, 4095) == -1) - VM::get->current()->abort_errno("readlink failed"); + os::abort_errno("readlink failed"); /* We have a path like: @@ -94,13 +91,13 @@ Properties::Properties() /* Set java.home. */ - const char* java_home = strdup(p); + char* java_home = strdup(p); /* Set the path to Java core native libraries. */ len = strlen(java_home) + strlen("/lib/classpath") + strlen("0"); - const char* boot_library_path = MNEW(char, len); + char* boot_library_path = MNEW(char, len); strcpy(boot_library_path, java_home); strcat(boot_library_path, "/lib/classpath"); @@ -118,22 +115,19 @@ Properties::Properties() strlen("/jre/lib/"JAVA_ARCH"/server/libjvm.so") + strlen("0"); - const char* java_home = MNEW(char, len); + char* java_home = MNEW(char, len); strcpy(java_home, p); strcat(java_home, "/jre/lib/"JAVA_ARCH"/server/libjvm.so"); - /* Check if that libjvm.so exists. */ - - if (os_access(java_home, F_OK) == 0) { - /* Yes, we add /jre to java.home. */ - + // Check if that libjvm.so exists. + if (os::access(java_home, F_OK) == 0) { + // Yes, we add /jre to java.home. strcpy(java_home, p); strcat(java_home, "/jre"); } else { - /* No, java.home is parent directory. */ - + // No, java.home is parent directory. strcpy(java_home, p); } @@ -141,7 +135,7 @@ Properties::Properties() len = strlen(java_home) + strlen("/lib/"JAVA_ARCH) + strlen("0"); - const char* boot_library_path = MNEW(char, len); + char* boot_library_path = MNEW(char, len); strcpy(boot_library_path, java_home); strcat(boot_library_path, "/lib/"JAVA_ARCH); @@ -320,7 +314,7 @@ Properties::Properties() put("java.vm.specification.version", "1.0"); put("java.vm.specification.vendor", "Sun Microsystems Inc."); put("java.vm.specification.name", "Java Virtual Machine Specification"); - put("java.vm.version", VERSION); + put("java.vm.version", VERSION_FULL); put("java.vm.vendor", "CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO"); put("java.vm.name", "CACAO"); @@ -335,14 +329,14 @@ Properties::Properties() { /* XXX We don't support java.lang.Compiler */ /* put("java.compiler", "cacao.jit"); */ - put("java.vm.info", "JIT mode"); + put("java.vm.info", "compiled mode"); } # if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH) /* Get properties from system. */ - char* cwd = _Jv_getcwd(); + char* cwd = os::getcwd(); char* env_user = os::getenv("USER"); char* env_home = os::getenv("HOME"); @@ -352,7 +346,7 @@ Properties::Properties() uname(utsnamebuf); - put("java.runtime.version", VERSION); + put("java.runtime.version", VERSION_FULL); put("java.runtime.name", "CACAO"); put("java.specification.version", "1.5"); @@ -653,13 +647,6 @@ void Properties::dump() #endif -// Legacy C interface. -extern "C" { - void Properties_put(const char *key, const char *value) { VM::get_current()->get_properties().put(key, value); } - const char *Properties_get(const char *key) { return VM::get_current()->get_properties().get(key); } -} - - /* * These are local overrides for various environment variables in Emacs. * Please do not remove this and leave it at the end of the file, where