1 /* src/native/vm/VMSystemProperties.c - gnu/classpath/VMSystemProperties
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
29 $Id: gnu_classpath_VMSystemProperties.c 7237 2007-01-22 20:16:22Z twisti $
40 #include "native/jni.h"
41 #include "native/include/java_util_Properties.h"
43 #include "vm/exceptions.h"
44 #include "vm/properties.h"
49 * Class: gnu/classpath/VMSystemProperties
51 * Signature: (Ljava/util/Properties;)V
53 JNIEXPORT void JNICALL Java_gnu_classpath_VMSystemProperties_preInit(JNIEnv *env, jclass clazz, java_util_Properties *properties)
55 if (properties == NULL) {
56 exceptions_throw_nullpointerexception();
60 /* fill the java.util.Properties object */
62 properties_system_add_all(properties);
67 * Class: gnu/classpath/VMSystemProperties
69 * Signature: (Ljava/util/Properties;)V
71 JNIEXPORT void JNICALL Java_gnu_classpath_VMSystemProperties_postInit(JNIEnv *env, jclass clazz, java_util_Properties *properties)
74 #if defined(WITH_JRE_LAYOUT)
79 p = (java_objectheader *) properties;
82 exceptions_throw_nullpointerexception();
86 /* post-set some properties */
88 #if defined(WITH_JRE_LAYOUT)
89 /* XXX when we do it that way, we can't set these properties on
92 properties_system_add(p, "gnu.classpath.home", cacao_prefix);
96 strlen(cacao_prefix) +
100 path = MNEW(char, len);
102 strcpy(path, "file://");
103 strcat(path, cacao_prefix);
104 strcat(path, "/lib");
106 properties_system_add(p, "gnu.classpath.home.url", path);
108 MFREE(path, char, len);
114 * These are local overrides for various environment variables in Emacs.
115 * Please do not remove this and leave it at the end of the file, where
116 * Emacs will automagically detect them.
117 * ---------------------------------------------------------------------
120 * indent-tabs-mode: t