1 /* src/vm/assertion.c - assertion options
4 CACAOVM - Verein zu Foerderung der freien virtuellen Machine 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
29 #if defined(HAVE_STRING_H)
33 #include "mm/memory.h"
35 #include "vm/global.h"
38 #include "toolbox/list.h"
40 #include "vm/assertion.h"
42 /* -ea/-da options ************************************************************/
44 list_t *list_assertion_names = (list_t *)NULL;
45 int32_t assertion_class_count = 0;
46 int32_t assertion_package_count = 0;
47 bool assertion_user_enabled = false;
48 bool assertion_system_enabled = false;
50 /* assertion_ea_da *************************************************************
52 Handle -ea:/-enableassertions: and -da:/-disableassertions: options.
54 *******************************************************************************/
56 void assertion_ea_da(const char *name, bool enabled) {
60 assertion_name_t *item;
64 assertion_user_enabled = enabled;
71 if (name[len - 1] == '/') {
77 vm_abort("assertion_ea_da: strdup failed: %s", strerror(errno));
80 if ((len > 2) && (strcmp(name + (len - 3), "...") == 0)) {
82 assertion_package_count += 1;
83 #if defined(WITH_CLASSPATH_SUN)
91 assertion_class_count += 1;
95 for (i = 0; i < len; i++) {
96 #if defined(WITH_CLASSPATH_SUN)
107 item = NEW(assertion_name_t);
109 item->enabled = enabled;
110 item->package = package;
112 if (list_assertion_names == NULL) {
113 list_assertion_names = list_create(OFFSET(assertion_name_t, linkage));
115 list_add_last(list_assertion_names, item);
119 * These are local overrides for various environment variables in Emacs.
120 * Please do not remove this and leave it at the end of the file, where
121 * Emacs will automagically detect them.
122 * ---------------------------------------------------------------------
125 * indent-tabs-mode: t
129 * vim:noexpandtab:sw=4:ts=4: