1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "glk/jacl/jacl.h"
#include "glk/jacl/language.h"
#include "glk/jacl/types.h"
#include "glk/jacl/prototypes.h"
namespace Glk {
namespace JACL {
extern struct function_type *executing_function;
extern const char *word[];
extern char error_buffer[];
void badparrun() {
Common::sprintf_s(error_buffer, 1024, BAD_PARENT, executing_function->name);
log_error(error_buffer, PLUS_STDERR);
}
void notintrun() {
Common::sprintf_s(error_buffer, 1024, NOT_INTEGER, executing_function->name, word[0]);
log_error(error_buffer, PLUS_STDERR);
}
void unkfunrun(const char *name) {
Common::sprintf_s(error_buffer, 1024, UNKNOWN_FUNCTION_RUN, name);
log_error(error_buffer, PLUS_STDOUT);
}
void unkkeyerr(int line, int wordno) {
Common::sprintf_s(error_buffer, 1024, UNKNOWN_KEYWORD_ERR, line, word[wordno]);
log_error(error_buffer, PLUS_STDERR);
}
void unkatterr(int line, int wordno) {
Common::sprintf_s(error_buffer, 1024, UNKNOWN_ATTRIBUTE_ERR, line,
word[wordno]);
log_error(error_buffer, PLUS_STDERR);
}
void unkvalerr(int line, int wordno) {
Common::sprintf_s(error_buffer, 1024, UNKNOWN_VALUE_ERR, line,
word[wordno]);
log_error(error_buffer, PLUS_STDERR);
}
void noproprun(int) {
Common::sprintf_s(error_buffer, 1024, INSUFFICIENT_PARAMETERS_RUN, executing_function->name, word[0]);
log_error(error_buffer, PLUS_STDOUT);
}
void noobjerr(int line) {
Common::sprintf_s(error_buffer, 1024, NO_OBJECT_ERR,
line, word[0]);
log_error(error_buffer, PLUS_STDERR);
}
void noproperr(int line) {
Common::sprintf_s(error_buffer, 1024, INSUFFICIENT_PARAMETERS_ERR,
line, word[0]);
log_error(error_buffer, PLUS_STDERR);
}
void nongloberr(int line) {
Common::sprintf_s(error_buffer, 1024, NON_GLOBAL_FIRST, line);
log_error(error_buffer, PLUS_STDERR);
}
void nofnamerr(int line) {
Common::sprintf_s(error_buffer, 1024, NO_NAME_FUNCTION, line);
log_error(error_buffer, PLUS_STDERR);
}
void unkobjerr(int line, int wordno) {
Common::sprintf_s(error_buffer, 1024, UNDEFINED_ITEM_ERR, line, word[wordno]);
log_error(error_buffer, PLUS_STDERR);
}
void maxatterr(int line, int wordno) {
Common::sprintf_s(error_buffer, 1024,
MAXIMUM_ATTRIBUTES_ERR, line, word[wordno]);
log_error(error_buffer, PLUS_STDERR);
}
void unkobjrun(int wordno) {
Common::sprintf_s(error_buffer, 1024, UNDEFINED_ITEM_RUN, executing_function->name, word[wordno]);
log_error(error_buffer, PLUS_STDOUT);
}
void unkattrun(int wordno) {
Common::sprintf_s(error_buffer, 1024, UNKNOWN_ATTRIBUTE_RUN, executing_function->name, word[wordno]);
log_error(error_buffer, PLUS_STDOUT);
}
void unkdirrun(int wordno) {
Common::sprintf_s(error_buffer, 1024, UNDEFINED_DIRECTION_RUN,
executing_function->name, word[wordno]);
log_error(error_buffer, PLUS_STDOUT);
}
void badparun() {
Common::sprintf_s(error_buffer, 1024, BAD_PARENT, executing_function->name);
log_error(error_buffer, PLUS_STDOUT);
}
void badplrrun(int value) {
Common::sprintf_s(error_buffer, 1024, BAD_PLAYER, executing_function->name, value);
log_error(error_buffer, PLUS_STDOUT);
}
void badptrrun(const char *name, int value) {
Common::sprintf_s(error_buffer, 1024, BAD_POINTER, executing_function->name, name, value);
log_error(error_buffer, PLUS_STDOUT);
}
void unkvarrun(const char *variable) {
Common::sprintf_s(error_buffer, 1024, UNDEFINED_CONTAINER_RUN, executing_function->name, arg_text_of(variable));
log_error(error_buffer, PLUS_STDOUT);
}
void unkstrrun(const char *variable) {
Common::sprintf_s(error_buffer, 1024, UNDEFINED_STRING_RUN, executing_function->name, variable);
log_error(error_buffer, PLUS_STDOUT);
}
void unkscorun(const char *scope) {
Common::sprintf_s(error_buffer, 1024, UNKNOWN_SCOPE_RUN, executing_function->name, scope);
log_error(error_buffer, PLUS_STDOUT);
}
void totalerrs(int errors) {
if (errors == 1)
Common::sprintf_s(error_buffer, 1024, ERROR_DETECTED);
else {
Common::sprintf_s(error_buffer, 1024, ERRORS_DETECTED, errors);
}
log_error(error_buffer, PLUS_STDERR);
}
void outofmem() {
log_error(OUT_OF_MEMORY, PLUS_STDERR);
error("Terminated");
}
} // End of namespace JACL
} // End of namespace Glk
|