1 /* src/vm/package.cpp - Java boot-package functions
3 Copyright (C) 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30 #include "mm/memory.hpp"
32 #include "vm/options.h"
33 #include "vm/package.hpp"
34 #include "vm/string.hpp"
40 std::set<utf*> Package::_packages;
44 * Add a package to the boot-package list.
46 * @param packagename Package name as Java string.
48 void Package::add(utf* packagename)
50 // Intern the Java string to get a unique address.
51 /* s = javastring_intern(packagename); */
54 if (opt_DebugPackage) {
56 log_print("[package_add: packagename=");
57 utf_display_printable_ascii(packagename);
63 // Add the package name.
64 _packages.insert(packagename);
69 * Find a package in the list.
71 * @param packagename Package name as Java string.
73 * @return Package name as Java string.
75 utf* Package::find(utf* packagename)
77 std::set<utf*>::iterator it = _packages.find(packagename);
79 if (it == _packages.end())
87 * These are local overrides for various environment variables in Emacs.
88 * Please do not remove this and leave it at the end of the file, where
89 * Emacs will automagically detect them.
90 * ---------------------------------------------------------------------
97 * vim:noexpandtab:sw=4:ts=4: