1 /* src/native/vm/gnu/gnu_classpath_VMSystemProperties.c
3 Copyright (C) 1996-2005, 2006, 2007 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 $Id: gnu_classpath_VMSystemProperties.c 7264 2007-01-31 14:05:57Z twisti $
37 #include "mm/memory.h"
39 #include "native/jni.h"
40 #include "native/include/java_util_Properties.h"
42 #include "vm/exceptions.h"
43 #include "vm/properties.h"
48 * Class: gnu/classpath/VMSystemProperties
50 * Signature: (Ljava/util/Properties;)V
52 JNIEXPORT void JNICALL Java_gnu_classpath_VMSystemProperties_preInit(JNIEnv *env, jclass clazz, java_util_Properties *properties)
56 p = (java_objectheader *) properties;
59 exceptions_throw_nullpointerexception();
63 /* fill the java.util.Properties object */
65 properties_system_add_all(p);
70 * Class: gnu/classpath/VMSystemProperties
72 * Signature: (Ljava/util/Properties;)V
74 JNIEXPORT void JNICALL Java_gnu_classpath_VMSystemProperties_postInit(JNIEnv *env, jclass clazz, java_util_Properties *properties)
77 #if defined(WITH_JRE_LAYOUT)
82 p = (java_objectheader *) properties;
85 exceptions_throw_nullpointerexception();
89 /* post-set some properties */
91 #if defined(WITH_JRE_LAYOUT)
92 /* XXX when we do it that way, we can't set these properties on
95 properties_system_add(p, "gnu.classpath.home", cacao_prefix);
99 strlen(cacao_prefix) +
103 path = MNEW(char, len);
105 strcpy(path, "file://");
106 strcat(path, cacao_prefix);
107 strcat(path, "/lib");
109 properties_system_add(p, "gnu.classpath.home.url", path);
111 MFREE(path, char, len);
117 * These are local overrides for various environment variables in Emacs.
118 * Please do not remove this and leave it at the end of the file, where
119 * Emacs will automagically detect them.
120 * ---------------------------------------------------------------------
123 * indent-tabs-mode: t