| 1 |
#ifdef RCSID |
| 2 |
static char RCSid[] = |
| 3 |
"$Header$"; |
| 4 |
#endif |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 2000, 2002 Michael J. Roberts. All Rights Reserved. |
| 8 |
* |
| 9 |
* Please see the accompanying license file, LICENSE.TXT, for information |
| 10 |
* on using and copying this software. |
| 11 |
*/ |
| 12 |
/* |
| 13 |
Name |
| 14 |
vmerrmsg.cpp - T3 VM error message strings |
| 15 |
Function |
| 16 |
Defines the message text for VM errors. All error text is isolated into |
| 17 |
this module for easy replacement in translated versions. |
| 18 |
Notes |
| 19 |
|
| 20 |
Modified |
| 21 |
05/13/00 MJRoberts - Creation |
| 22 |
*/ |
| 23 |
|
| 24 |
#include <stdarg.h> |
| 25 |
#include <stdlib.h> |
| 26 |
|
| 27 |
#include "t3std.h" |
| 28 |
#include "vmerr.h" |
| 29 |
|
| 30 |
/* ------------------------------------------------------------------------ */ |
| 31 |
/* |
| 32 |
* Enable or disable verbose messages. To conserve memory, verbose |
| 33 |
* messages can be omitted. To omit verbose messages, the platform |
| 34 |
* makefile should define the preprocessor symbol VMERR_OMIT_VERBOSE. |
| 35 |
*/ |
| 36 |
#ifdef VMERR_OMIT_VERBOSE |
| 37 |
# define VMsg(msg) "" |
| 38 |
#else |
| 39 |
# define VMsg(msg) msg |
| 40 |
#endif |
| 41 |
|
| 42 |
#ifdef VMERR_BOOK_MSG |
| 43 |
# define VBook(msg) , msg |
| 44 |
#else |
| 45 |
# define VBook(msg) |
| 46 |
#endif |
| 47 |
|
| 48 |
/* |
| 49 |
* To conserve even more memory, the messages can be omitted entirely. To |
| 50 |
* disable all compiled-in messages, define VMERR_OMIT_MESSAGES. |
| 51 |
*/ |
| 52 |
|
| 53 |
|
| 54 |
/* ------------------------------------------------------------------------ */ |
| 55 |
/* |
| 56 |
* T3 VM Error Messages |
| 57 |
* |
| 58 |
* The messages must be sorted by message number, so that we can perform |
| 59 |
* a binary search to look up a message by number. |
| 60 |
*/ |
| 61 |
const err_msg_t vm_messages_english[] = |
| 62 |
{ |
| 63 |
#ifdef VMERR_OMIT_MESSAGES |
| 64 |
|
| 65 |
{ 0, 0, 0 VBook(0) } |
| 66 |
|
| 67 |
#else /* VMERR_OMIT_MESSAGES */ |
| 68 |
|
| 69 |
{ VMERR_READ_FILE, |
| 70 |
"error reading file", |
| 71 |
VMsg("Error reading file. The file might be corrupted or a media error " |
| 72 |
"might have occurred.") }, |
| 73 |
|
| 74 |
{ VMERR_WRITE_FILE, |
| 75 |
"error writing file", |
| 76 |
VMsg("Error writing file. The media might be full, or another media " |
| 77 |
"error might have occurred.") }, |
| 78 |
|
| 79 |
{ VMERR_FILE_NOT_FOUND, |
| 80 |
"file not found", |
| 81 |
VMsg("Error opening file. The specified file might not exist, you " |
| 82 |
"might not have sufficient privileges to open the file, or " |
| 83 |
"a sharing violation might have occurred.") }, |
| 84 |
|
| 85 |
{ VMERR_CREATE_FILE, |
| 86 |
"error creating file", |
| 87 |
VMsg("Error creating file. You might not have sufficient privileges " |
| 88 |
"to open the file, or a sharing violation might have occurred.") }, |
| 89 |
|
| 90 |
{ VMERR_CLOSE_FILE, |
| 91 |
"error closing file", |
| 92 |
VMsg("Error closing file. Some or all changes made to the file might " |
| 93 |
"not have been properly written to the physical disk/media.") }, |
| 94 |
|
| 95 |
{ VMERR_DELETE_FILE, |
| 96 |
"error deleting file", |
| 97 |
VMsg("Error deleting file. This could because you don't have " |
| 98 |
"sufficient privileges, the file is marked as read-only, another " |
| 99 |
"program is using the file, or a physical media error occurred.") }, |
| 100 |
|
| 101 |
{ VMERR_PACK_PARSE, |
| 102 |
"data packer format string parsing error at character index %d", |
| 103 |
VMsg("The format string for the data packing or unpacking has a syntax " |
| 104 |
"error at character index %d.") }, |
| 105 |
|
| 106 |
{ VMERR_PACK_ARG_MISMATCH, |
| 107 |
"data packer argument type mismatch at format string index %d", |
| 108 |
VMsg("Data packer argument type mismatch. The type of the argument " |
| 109 |
"doesn't match the format code at character index %d in the " |
| 110 |
"format string.") }, |
| 111 |
|
| 112 |
{ VMERR_PACK_ARGC_MISMATCH, |
| 113 |
"wrong number of data packer arguments at format string index %d", |
| 114 |
VMsg("Wrong number of arguments to the data packer. The number of " |
| 115 |
"argument values doesn't match the number of elements in the " |
| 116 |
"format string.") }, |
| 117 |
|
| 118 |
{ VMERR_NET_FILE_NOIMPL, |
| 119 |
"this file operation isn't supported for storage server files", |
| 120 |
VMsg("This file operation isn't supported for storage server files. " |
| 121 |
"This operation can only be used with local disk files.") }, |
| 122 |
|
| 123 |
{ VMERR_RENAME_FILE, |
| 124 |
"error renaming file", |
| 125 |
VMsg("An error occurred renaming the file. The new name might already " |
| 126 |
"be used by an existing file, you might not have the necessary " |
| 127 |
"permissions in the new or old directory locations, or the " |
| 128 |
"new name might be in an incompatible location, such as on " |
| 129 |
"a different device or volume." ) }, |
| 130 |
|
| 131 |
{ VMERR_OBJ_IN_USE, |
| 132 |
"object ID in use - the image/save file might be corrupted", |
| 133 |
VMsg("An object ID requested by the image/save file is already in use " |
| 134 |
"and cannot be allocated to the file. This might indicate that " |
| 135 |
"the file is corrupted.") }, |
| 136 |
|
| 137 |
{ VMERR_OUT_OF_MEMORY, |
| 138 |
"out of memory", |
| 139 |
VMsg("Out of memory. Try making more memory available by closing " |
| 140 |
"other applications if possible.") }, |
| 141 |
|
| 142 |
{ VMERR_NO_MEM_FOR_PAGE, |
| 143 |
"out of memory allocating pool page", |
| 144 |
VMsg("Out of memory allocating pool page. Try making more memory " |
| 145 |
"available by closing other applications.") }, |
| 146 |
|
| 147 |
{ VMERR_BAD_POOL_PAGE_SIZE, |
| 148 |
"invalid page size - file is not valid", |
| 149 |
VMsg("Invalid page size. The file being loaded is not valid.") }, |
| 150 |
|
| 151 |
{ VMERR_OUT_OF_PROPIDS, |
| 152 |
"no more property ID's are available", |
| 153 |
VMsg("Out of property ID's. No more properties can be allocated.") }, |
| 154 |
|
| 155 |
{ VMERR_CIRCULAR_INIT, |
| 156 |
"circular initialization dependency in intrinsic class (internal error)", |
| 157 |
VMsg("Circular initialization dependency detected in intrinsic class. " |
| 158 |
"This indicates an internal error in the interpreter. Please " |
| 159 |
"report this error to the interpreter's maintainer.") }, |
| 160 |
|
| 161 |
{ VMERR_UNKNOWN_METACLASS, |
| 162 |
"this interpreter version cannot run this program (program requires " |
| 163 |
"intrinsic class %s, which is not available in this interpreter)", |
| 164 |
VMsg("This image file requires an intrinsic class with the identifier " |
| 165 |
"\"%s\", but the class is not available in this interpreter. This " |
| 166 |
"program cannot be executed with this interpreter.") }, |
| 167 |
|
| 168 |
{ VMERR_UNKNOWN_FUNC_SET, |
| 169 |
"this interpreter version cannot run this program (program requires " |
| 170 |
"intrinsic function set %s, which is not available in this interpreter)", |
| 171 |
VMsg("This image file requires a function set with the identifier " |
| 172 |
"\"%s\", but the function set is not available in this " |
| 173 |
"interpreter. This program cannot be executed with this " |
| 174 |
"interpreter.") }, |
| 175 |
|
| 176 |
{ VMERR_READ_PAST_IMG_END, |
| 177 |
"reading past end of image file - program might be corrupted", |
| 178 |
VMsg("Reading past end of image file. The image file might " |
| 179 |
"be corrupted.") }, |
| 180 |
|
| 181 |
{ VMERR_NOT_AN_IMAGE_FILE, |
| 182 |
"this is not an image file (no valid signature found)", |
| 183 |
VMsg("This file is not a valid image file - the file has an invalid " |
| 184 |
"signature. The image file might be corrupted.") }, |
| 185 |
|
| 186 |
{ VMERR_UNKNOWN_IMAGE_BLOCK, |
| 187 |
"this interpreter version cannot run this program (unknown block type " |
| 188 |
"in image file)", |
| 189 |
VMsg("Unknown block type. This image file is either incompatible with " |
| 190 |
"this version of the interpreter, or has been corrupted.") }, |
| 191 |
|
| 192 |
{ VMERR_IMAGE_BLOCK_TOO_SMALL, |
| 193 |
"data block too small", |
| 194 |
VMsg("A data block in the image file is too small. The image file might " |
| 195 |
"be corrupted.") }, |
| 196 |
|
| 197 |
{ VMERR_IMAGE_POOL_BEFORE_DEF, |
| 198 |
"invalid image file: pool page before pool definition", |
| 199 |
VMsg("This image file is invalid because it specifies a pool page " |
| 200 |
"before the pool's definition. The image file might be " |
| 201 |
"corrupted.") }, |
| 202 |
|
| 203 |
{ VMERR_IMAGE_POOL_BAD_PAGE, |
| 204 |
"invalid image file: pool page out of range of definition", |
| 205 |
VMsg("This image file is invalid because it specifies a pool page " |
| 206 |
"outside of the range of the pool's definition. The image file " |
| 207 |
"might be corrupted.") }, |
| 208 |
|
| 209 |
{ VMERR_IMAGE_BAD_POOL_ID, |
| 210 |
"invalid image file: invalid pool ID", |
| 211 |
VMsg("This image file is invalid because it specifies an invalid " |
| 212 |
"pool ID. The image file might be corrupted.") }, |
| 213 |
|
| 214 |
{ VMERR_LOAD_BAD_PAGE_IDX, |
| 215 |
"invalid image file: bad page index", |
| 216 |
VMsg("This image file is invalid because it specifies an invalid " |
| 217 |
"page index. The image file might be corrupted.") }, |
| 218 |
|
| 219 |
{ VMERR_LOAD_UNDEF_PAGE, |
| 220 |
"loading undefined pool page", |
| 221 |
VMsg("The program is attempting to load a pool page that is not present " |
| 222 |
"in the image file. The image file might be corrupted.") }, |
| 223 |
|
| 224 |
{ VMERR_IMAGE_POOL_REDEF, |
| 225 |
"invalid image file: pool is defined more than once", |
| 226 |
VMsg("This image file is invalid because it defines a pool more than " |
| 227 |
"once. The image file might be corrupted.") }, |
| 228 |
|
| 229 |
{ VMERR_IMAGE_METADEP_REDEF, |
| 230 |
"invalid image file: multiple intrinsic class dependency tables found", |
| 231 |
VMsg("This image file is invalid because it contains multiple " |
| 232 |
"intrinsic class tables. The image file might be corrupted.") }, |
| 233 |
|
| 234 |
{ VMERR_IMAGE_NO_METADEP, |
| 235 |
"invalid image file: no intrinsic class dependency table found", |
| 236 |
VMsg("This image file is invalid because it contains no intrinsic class " |
| 237 |
"tables. The image file might be corrupted.") }, |
| 238 |
|
| 239 |
{ VMERR_IMAGE_FUNCDEP_REDEF, |
| 240 |
"invalid image file: multiple function set dependency tables found", |
| 241 |
VMsg("This image file is invalid because it contains multiple " |
| 242 |
"function set tables. The image file might be corrupted.") }, |
| 243 |
|
| 244 |
{ VMERR_IMAGE_NO_FUNCDEP, |
| 245 |
"invalid image file: no function set dependency table found", |
| 246 |
VMsg("This image file is invalid because it contains no function set " |
| 247 |
"tables. The image file might be corrupted.") }, |
| 248 |
|
| 249 |
{ VMERR_IMAGE_ENTRYPT_REDEF, |
| 250 |
"invalid image file: multiple entrypoints found", |
| 251 |
VMsg("This image file is invalid because it contains multiple entrypoint " |
| 252 |
"definitions. The image file might be corrupted.") }, |
| 253 |
|
| 254 |
{ VMERR_IMAGE_NO_ENTRYPT, |
| 255 |
"invalid image file: no entrypoint found", |
| 256 |
VMsg("This image file is invalid because it contains no entrypoint " |
| 257 |
"specification. The image file might be corrupted.") }, |
| 258 |
|
| 259 |
{ VMERR_IMAGE_INCOMPAT_VSN, |
| 260 |
"incompatible image file format version", |
| 261 |
VMsg("This image file has an incompatible format version. You must " |
| 262 |
"obtain a newer version of the interpreter to execute this " |
| 263 |
"program.") }, |
| 264 |
|
| 265 |
{ VMERR_IMAGE_NO_CODE, |
| 266 |
"image contains no code", |
| 267 |
VMsg("This image file contains no executable code. The file might " |
| 268 |
"be corrupted.") }, |
| 269 |
|
| 270 |
{ VMERR_IMAGE_INCOMPAT_HDR_FMT, |
| 271 |
"incomptabile image file format: method header too old", |
| 272 |
VMsg("This image file has an incompatible method header format. " |
| 273 |
"This is an older image file version which this interpreter " |
| 274 |
"does not support.") }, |
| 275 |
|
| 276 |
{ VMERR_UNAVAIL_INTRINSIC, |
| 277 |
"unavailable intrinsic function called (index %d in function set \"%s\")", |
| 278 |
VMsg("Unavailable intrinsic function called (the function is at " |
| 279 |
"index %d in function set \"%s\"). This function is not available " |
| 280 |
"in this version of the interpreter and cannot be called when " |
| 281 |
"running the program with this version. This normally indicates " |
| 282 |
"either (a) that the \"preinit\" function (or code invoked by " |
| 283 |
"preinit) called an intrinsic that isn't available during " |
| 284 |
"this phase, such as an advanced display function; or (b) that " |
| 285 |
"the program used '&' to refer to a function address, and" |
| 286 |
"the function isn't available in this interpreter version.") }, |
| 287 |
|
| 288 |
{ VMERR_UNKNOWN_METACLASS_INTERNAL, |
| 289 |
"unknown internal intrinsic class ID %x", |
| 290 |
VMsg("Unknown internal intrinsic class ID %x. This indicates an " |
| 291 |
"internal error in the interpreter. Please report this error " |
| 292 |
"to the interpreter's maintainer.") }, |
| 293 |
|
| 294 |
{ VMERR_XOR_MASK_BAD_IN_MEM, |
| 295 |
"page mask is not allowed for in-memory image file", |
| 296 |
VMsg("This image file cannot be loaded from memory because it contains " |
| 297 |
"masked data. Masked data is not valid with in-memory files. " |
| 298 |
"This probably indicates that the program file was not installed " |
| 299 |
"properly; you must convert this program file for in-memory use " |
| 300 |
"before you can load the program with this version of the " |
| 301 |
"interpreter.") }, |
| 302 |
|
| 303 |
{ VMERR_NO_IMAGE_IN_EXE, |
| 304 |
"no embedded image file found in executable", |
| 305 |
VMsg("This executable does not contain an embedded image file. The " |
| 306 |
"application might not be configured properly or might need to " |
| 307 |
"be rebuilt. Re-install the application or obtain an updated " |
| 308 |
"version from the application's author.") }, |
| 309 |
|
| 310 |
{ VMERR_OBJ_SIZE_OVERFLOW, |
| 311 |
"object size exceeds hardware limits of this computer", |
| 312 |
VMsg("An object defined in this program file exceeds the hardware limits " |
| 313 |
"of this computer. This program cannot be executed on this type " |
| 314 |
"of computer or operating system. Contact the program's author " |
| 315 |
"for assistance.") }, |
| 316 |
|
| 317 |
{ VMERR_METACLASS_TOO_OLD, |
| 318 |
"this interpreter is too old to run this program (program requires " |
| 319 |
"intrinsic class version %s, interpreter provides version %s)", |
| 320 |
VMsg("This program needs the intrinsic class \"%s\". This VM " |
| 321 |
"implementation does not provide a sufficiently recent version " |
| 322 |
"of this intrinsic class; the latest version available in this " |
| 323 |
"VM is \"%s\". This program cannot run with this version of the " |
| 324 |
"VM; you must use a more recent version of the VM to execute this " |
| 325 |
"program.") }, |
| 326 |
|
| 327 |
{ VMERR_INVAL_METACLASS_DATA, |
| 328 |
"invalid intrinsic class data - image file may be corrupted", |
| 329 |
VMsg("Invalid data were detected in an intrinsic class. This might " |
| 330 |
"indicate that the image file has been corrupted. You might need " |
| 331 |
"to re-install the program.") }, |
| 332 |
|
| 333 |
{ VMERR_BAD_STATIC_NEW, |
| 334 |
"invalid object - class does not allow loading", |
| 335 |
VMsg("An object in the image file cannot be loaded because its class " |
| 336 |
"does not allow creation of objects of the class. This usually " |
| 337 |
"means that the class is abstract and cannot be instantiated " |
| 338 |
"as a concrete object.") }, |
| 339 |
|
| 340 |
{ VMERR_FUNCSET_TOO_OLD, |
| 341 |
"this interpreter is too old to run this program (program requires " |
| 342 |
"function set version %s, interpreter provides version %s)", |
| 343 |
VMsg("This program needs the function set \"%s\". This VM " |
| 344 |
"implementation does not provide a sufficiently recent version " |
| 345 |
"of this function set; the latest version available in this VM " |
| 346 |
"is \"%s\". This program cannot run with this version of the " |
| 347 |
"VM; you must use a more recent version of the VM to execute " |
| 348 |
"this program.") }, |
| 349 |
|
| 350 |
{ VMERR_INVAL_EXPORT_TYPE, |
| 351 |
"exported symbol \"%s\" is of incorrect datatype", |
| 352 |
VMsg("The exported symbol \"%s\" is of the incorrect datatype. Check " |
| 353 |
"the program and the library version.") }, |
| 354 |
|
| 355 |
{ VMERR_INVAL_IMAGE_MACRO, |
| 356 |
"invalid data in macro definitions in image file (error code %d)", |
| 357 |
VMsg("The image file contains invalid data in the macro symbols " |
| 358 |
"in the debugging records: macro loader error code %d. This " |
| 359 |
"might indicate that the image file is corrupted.") }, |
| 360 |
|
| 361 |
{ VMERR_NO_MAINRESTORE, |
| 362 |
"this program is not capable of restoring a saved state on startup", |
| 363 |
VMsg("This program is not capable of restoring a saved state on " |
| 364 |
"startup. To restore the saved state, you must run the program " |
| 365 |
"normally, then use the appropriate command or operation within " |
| 366 |
"the running program to restore the saved position file.") }, |
| 367 |
|
| 368 |
{ VMERR_IMAGE_INCOMPAT_VSN_DBG, |
| 369 |
"image file is incompatible with debugger - recompile the program", |
| 370 |
VMsg("This image file was created with a version of the compiler " |
| 371 |
"that is incompatible with this debugger. Recompile the program " |
| 372 |
"with the compiler that's bundled with this debugger. If no " |
| 373 |
"compiler is bundled, check the debugger release notes for " |
| 374 |
"information on which compiler to use. ") }, |
| 375 |
|
| 376 |
{ VMERR_NETWORK_SAFETY, |
| 377 |
"this operation is not allowed by the network safety level settings", |
| 378 |
VMsg("This operation is not allowed by the current network safety level " |
| 379 |
"settings. The program is attempting to access network features " |
| 380 |
"that you have disabled with the network safety level options. " |
| 381 |
"If you wish to allow this operation, you must restart the " |
| 382 |
"program with new network safety settings.") }, |
| 383 |
|
| 384 |
{ VMERR_INVALID_SETPROP, |
| 385 |
"property cannot be set for object", |
| 386 |
VMsg("Invalid property change - this property cannot be set for this " |
| 387 |
"object. This normally indicates that the object is of a type " |
| 388 |
"that does not allow setting of properties at all, or at least " |
| 389 |
"of certain properties. For example, a string object does not " |
| 390 |
"allow setting properties at all.") }, |
| 391 |
|
| 392 |
{ VMERR_NOT_SAVED_STATE, |
| 393 |
"file is not a valid saved state file", |
| 394 |
VMsg("This file is not a valid saved state file. Either the file was " |
| 395 |
"not created as a saved state file, or its contents have been " |
| 396 |
"corrupted.") }, |
| 397 |
|
| 398 |
{ VMERR_WRONG_SAVED_STATE, |
| 399 |
"saved state is for a different program or a different version of " |
| 400 |
"this program", |
| 401 |
VMsg("This file does not contain saved state information for " |
| 402 |
"this program. The file was saved by another program, or " |
| 403 |
"by a different version of this program; in either case, it " |
| 404 |
"cannot be restored with this version of this program.") }, |
| 405 |
|
| 406 |
{ VMERR_SAVED_META_TOO_LONG, |
| 407 |
"intrinsic class name in saved state file is too long", |
| 408 |
VMsg("An intrinsic class name in the saved state file is too long. " |
| 409 |
"The file might be corrupted, or might have been saved by an " |
| 410 |
"incompatible version of the interpreter.") }, |
| 411 |
|
| 412 |
{ VMERR_SAVED_OBJ_ID_INVALID, |
| 413 |
"invalid object ID in saved state file", |
| 414 |
VMsg("The saved state file contains an invalid object ID. The saved " |
| 415 |
"state file might be corrupted.") }, |
| 416 |
|
| 417 |
{ VMERR_BAD_SAVED_STATE, |
| 418 |
"saved state file is corrupted (incorrect checksum)", |
| 419 |
VMsg("The saved state file's checksum is invalid. This usually " |
| 420 |
"indicates that the file has been corrupted (which could be " |
| 421 |
"due to a media error, modification by another application, " |
| 422 |
"or a file transfer that lost or changed data).") }, |
| 423 |
|
| 424 |
{ VMERR_STORAGE_SERVER_ERR, |
| 425 |
"storage server error", |
| 426 |
VMsg("An error occurred accessing the storage server. This could " |
| 427 |
"be due to a network problem, invalid user credentials, or " |
| 428 |
"a configuration problem on the game server.") }, |
| 429 |
|
| 430 |
{ VMERR_DESC_TAB_OVERFLOW, |
| 431 |
"saved file metadata table exceeds 64k bytes", |
| 432 |
VMsg("The metadata table for the saved state file is too large. " |
| 433 |
"This table is limited to 64k bytes in length.") }, |
| 434 |
|
| 435 |
{ VMERR_BAD_SAVED_META_DATA, |
| 436 |
"invalid intrinsic class data in saved state file", |
| 437 |
VMsg("The saved state file contains intrinsic class data that " |
| 438 |
"is not valid. This usually means that the file was saved " |
| 439 |
"with an incompatible version of the interpreter program.") }, |
| 440 |
|
| 441 |
{ VMERR_NO_STR_CONV, |
| 442 |
"cannot convert value to string", |
| 443 |
VMsg("This value cannot be converted to a string.") }, |
| 444 |
|
| 445 |
{ VMERR_CONV_BUF_OVF, |
| 446 |
"string conversion buffer overflow", |
| 447 |
VMsg("An internal buffer overflow occurred converting this value to " |
| 448 |
"a string.") }, |
| 449 |
|
| 450 |
{ VMERR_BAD_TYPE_ADD, |
| 451 |
"invalid datatypes for addition operator", |
| 452 |
VMsg("Invalid datatypes for addition operator. The values being added " |
| 453 |
"cannot be combined in this manner.") }, |
| 454 |
|
| 455 |
{ VMERR_NUM_VAL_REQD, |
| 456 |
"numeric value required", |
| 457 |
VMsg("Invalid value type - a numeric value is required.") }, |
| 458 |
|
| 459 |
{ VMERR_INT_VAL_REQD, |
| 460 |
"integer value required", |
| 461 |
VMsg("Invalid value type - an integer value is required.") }, |
| 462 |
|
| 463 |
{ VMERR_NO_LOG_CONV, |
| 464 |
"cannot convert value to logical (true/nil)", |
| 465 |
VMsg("This value cannot be converted to a logical (true/nil) value.") }, |
| 466 |
|
| 467 |
{ VMERR_BAD_TYPE_SUB, |
| 468 |
"invalid datatypes for subtraction operator", |
| 469 |
VMsg("Invalid datatypes for subtraction operator. The values used " |
| 470 |
"cannot be combined in this manner.") }, |
| 471 |
|
| 472 |
{ VMERR_DIVIDE_BY_ZERO, |
| 473 |
"division by zero", |
| 474 |
VMsg("Arithmetic error - Division by zero.") }, |
| 475 |
|
| 476 |
{ VMERR_INVALID_COMPARISON, |
| 477 |
"invalid comparison", |
| 478 |
VMsg("Invalid comparison - these values cannot be compared " |
| 479 |
"to one another.") }, |
| 480 |
|
| 481 |
{ VMERR_OBJ_VAL_REQD, |
| 482 |
"object value required", |
| 483 |
VMsg("An object value is required.") }, |
| 484 |
|
| 485 |
{ VMERR_PROPPTR_VAL_REQD, |
| 486 |
"property pointer required", |
| 487 |
VMsg("A property pointer value is required.") }, |
| 488 |
|
| 489 |
{ VMERR_LOG_VAL_REQD, |
| 490 |
"logical value required", |
| 491 |
VMsg("A logical (true/nil) value is required.") }, |
| 492 |
|
| 493 |
{ VMERR_FUNCPTR_VAL_REQD, |
| 494 |
"function pointer required", |
| 495 |
VMsg("A function pointer value is required.") }, |
| 496 |
|
| 497 |
{ VMERR_CANNOT_INDEX_TYPE, |
| 498 |
"invalid index operation - this type of value cannot be indexed", |
| 499 |
VMsg("This type of value cannot be indexed.") }, |
| 500 |
|
| 501 |
{ VMERR_INDEX_OUT_OF_RANGE, |
| 502 |
"index out of range", |
| 503 |
VMsg("The index value is out of range for the value being indexed (it is " |
| 504 |
"too low or too high).") }, |
| 505 |
|
| 506 |
{ VMERR_BAD_METACLASS_INDEX, |
| 507 |
"invalid intrinsic class index", |
| 508 |
VMsg("The intrinsic class index is out of range. This probably " |
| 509 |
"indicates that the image file is corrupted.") }, |
| 510 |
|
| 511 |
{ VMERR_BAD_DYNAMIC_NEW, |
| 512 |
"invalid dynamic object creation (intrinsic class does not support NEW)", |
| 513 |
VMsg("This type of object cannot be dynamically created, because the " |
| 514 |
"intrinsic class does not support dynamic creation.") }, |
| 515 |
|
| 516 |
{ VMERR_OBJ_VAL_REQD_SC, |
| 517 |
"object value required for base class", |
| 518 |
VMsg("An object value must be specified for the base class of a dynamic " |
| 519 |
"object creation operation. The superclass value is of a " |
| 520 |
"non-object type.") }, |
| 521 |
|
| 522 |
{ VMERR_STRING_VAL_REQD, |
| 523 |
"string value required", |
| 524 |
VMsg("A string value is required.") }, |
| 525 |
|
| 526 |
{ VMERR_LIST_VAL_REQD, |
| 527 |
"list value required", |
| 528 |
VMsg("A list value is required.") }, |
| 529 |
|
| 530 |
{ VMERR_DICT_NO_CONST, |
| 531 |
"list or string reference found in dictionary (entry \"%s\") - this " |
| 532 |
"dictionary cannot be saved in the image file", |
| 533 |
VMsg("A dictionary entry (for the string \"%s\") referred to a string " |
| 534 |
"or list value for its associated value data. This dictionary " |
| 535 |
"cannot be stored in the image file, so the image file cannot " |
| 536 |
"be created. Check dictionary word additions and ensure that " |
| 537 |
"only objects are added to the dictionary.") }, |
| 538 |
|
| 539 |
{ VMERR_INVAL_OBJ_TYPE, |
| 540 |
"invalid object type - cannot convert to required object type", |
| 541 |
VMsg("An object is not of the correct type. The object specified " |
| 542 |
"cannot be converted to the required object type.") }, |
| 543 |
|
| 544 |
{ VMERR_NUM_OVERFLOW, |
| 545 |
"numeric overflow", |
| 546 |
VMsg("A numeric calculation overflowed the limits of the datatype.") }, |
| 547 |
|
| 548 |
{ VMERR_BAD_TYPE_MUL, |
| 549 |
"invalid datatypes for multiplication operator", |
| 550 |
VMsg("Invalid datatypes for multiplication operator. The values " |
| 551 |
"being added cannot be combined in this manner.") }, |
| 552 |
|
| 553 |
{ VMERR_BAD_TYPE_DIV, |
| 554 |
"invalid datatypes for division operator", |
| 555 |
VMsg("Invalid datatypes for division operator. The values being added " |
| 556 |
"cannot be combined in this manner.") }, |
| 557 |
|
| 558 |
{ VMERR_BAD_TYPE_NEG, |
| 559 |
"invalid datatype for arithmetic negation operator", |
| 560 |
VMsg("Invalid datatype for arithmetic negation operator. The value " |
| 561 |
"cannot be negated.") }, |
| 562 |
|
| 563 |
{ VMERR_OUT_OF_RANGE, |
| 564 |
"value is out of range", |
| 565 |
VMsg("A value that was outside of the legal range of inputs was " |
| 566 |
"specified for a calculation.") }, |
| 567 |
|
| 568 |
{ VMERR_STR_TOO_LONG, |
| 569 |
"string is too long", |
| 570 |
VMsg("A string value is limited to 65535 bytes in length. This " |
| 571 |
"string exceeds the length limit.") }, |
| 572 |
|
| 573 |
{ VMERR_LIST_TOO_LONG, |
| 574 |
"list too long", |
| 575 |
VMsg("A list value is limited to about 13100 elements. This list " |
| 576 |
"exceeds the limit.") }, |
| 577 |
|
| 578 |
{ VMERR_TREE_TOO_DEEP_EQ, |
| 579 |
"maximum equality test/hash recursion depth exceeded", |
| 580 |
VMsg("This equality comparison or hash calculation is too complex and " |
| 581 |
"cannot be performed. This usually indicates that a value " |
| 582 |
"contains circular references, such as a Vector that contains " |
| 583 |
"a reference to itself, or to another Vector that contains a " |
| 584 |
"reference to the first one. This type of value cannot be " |
| 585 |
"compared for equality or used in a LookupTable.") }, |
| 586 |
|
| 587 |
{ VMERR_NO_INT_CONV, |
| 588 |
"cannot convert value to integer", |
| 589 |
VMsg("This value cannot be converted to an integer.") }, |
| 590 |
|
| 591 |
{ VMERR_BAD_TYPE_MOD, |
| 592 |
"invalid datatype for modulo operator", |
| 593 |
VMsg("Invalid datatype for the modulo operator. These values can't be " |
| 594 |
"combined with this operator.") }, |
| 595 |
|
| 596 |
{ VMERR_BAD_TYPE_BIT_AND, |
| 597 |
"invalid datatype for bitwise AND operator", |
| 598 |
VMsg("Invalid datatype for the bitwise AND operator. These values can't " |
| 599 |
"be combined with this operator.") }, |
| 600 |
|
| 601 |
{ VMERR_BAD_TYPE_BIT_OR, |
| 602 |
"invalid datatype for bitwise OR operator", |
| 603 |
VMsg("Invalid datatype for the bitwise OR operator. These values can't " |
| 604 |
"be combined with this operator.") }, |
| 605 |
|
| 606 |
{ VMERR_BAD_TYPE_XOR, |
| 607 |
"invalid datatype for XOR operator", |
| 608 |
VMsg("Invalid datatype for the XOR operator. These values can't " |
| 609 |
"be combined with this operator.") }, |
| 610 |
|
| 611 |
{ VMERR_BAD_TYPE_SHL, |
| 612 |
"invalid datatype for left-shift operator '<<'", |
| 613 |
VMsg("Invalid datatype for the left-shift operator '<<'. These values " |
| 614 |
"can't be combined with this operator.") }, |
| 615 |
|
| 616 |
{ VMERR_BAD_TYPE_ASHR, |
| 617 |
"invalid datatype for arithmetic right-shift operator '>>'", |
| 618 |
VMsg("Invalid datatype for the arithmetic right-shift operator '>>'. " |
| 619 |
"These values can't be combined with this operator.") }, |
| 620 |
|
| 621 |
{ VMERR_BAD_TYPE_BIT_NOT, |
| 622 |
"invalid datatype for bitwise NOT operator", |
| 623 |
VMsg("Invalid datatype for the bitwise NOT operator. These values can't " |
| 624 |
"be combined with this operator.") }, |
| 625 |
|
| 626 |
{ VMERR_CODEPTR_VAL_REQD, |
| 627 |
"code pointer value required", |
| 628 |
VMsg("Invalid type - code pointer value required. (This probably " |
| 629 |
"indicates an internal problem in the interpreter.)") }, |
| 630 |
|
| 631 |
{ VMERR_EXCEPTION_OBJ_REQD, |
| 632 |
"exception object required, but 'new' did not yield an object", |
| 633 |
VMsg("The VM tried to construct a new program-defined exception object " |
| 634 |
"to represent a run-time error that occurred, but 'new' did not " |
| 635 |
"yield an object. Note that another underlying run-time error " |
| 636 |
"occurred that triggered the throw in the first place, but " |
| 637 |
"information on that error is not available now because of the " |
| 638 |
"problem creating the exception object to represent that error.") }, |
| 639 |
|
| 640 |
{ VMERR_NO_DOUBLE_CONV, |
| 641 |
"cannot convert value to native floating point", |
| 642 |
VMsg("The value cannot be converted to a floating-point type.") }, |
| 643 |
|
| 644 |
{ VMERR_NO_NUM_CONV, |
| 645 |
"cannot convert value to a numeric type", |
| 646 |
VMsg("The value cannot be converted to a numeric type. Only values " |
| 647 |
"that can be converted to integer or BigNumber can be used in " |
| 648 |
"this context.") }, |
| 649 |
|
| 650 |
{ VMERR_BAD_TYPE_LSHR, |
| 651 |
"invalid datatype for logical right-shift operator '>>>'", |
| 652 |
VMsg("Invalid datatype for the logical right-shift operator '>>>'. " |
| 653 |
"These values can't be combined with this operator.") }, |
| 654 |
|
| 655 |
{ VMERR_WRONG_NUM_OF_ARGS, |
| 656 |
"wrong number of arguments", |
| 657 |
VMsg("The wrong number of arguments was passed to a function or method " |
| 658 |
"in the invocation of the function or method.") }, |
| 659 |
|
| 660 |
{ VMERR_WRONG_NUM_OF_ARGS_CALLING, |
| 661 |
"argument mismatch calling %s - function definition is incorrect", |
| 662 |
VMsg("The number of arguments doesn't match the number expected " |
| 663 |
"calling %s. Check the function or method and correct the " |
| 664 |
"number of parameters that it is declared to receive.") }, |
| 665 |
|
| 666 |
{ VMERR_NIL_DEREF, |
| 667 |
"nil object reference", |
| 668 |
VMsg("The value 'nil' was used to reference an object property. Only " |
| 669 |
"valid object references can be used in property evaluations.") }, |
| 670 |
|
| 671 |
{ VMERR_MISSING_NAMED_ARG, |
| 672 |
"missing named argument '%s'", |
| 673 |
VMsg("The named argument '%s' was expected in a function or method " |
| 674 |
"call, but it wasn't provided by the caller.") }, |
| 675 |
|
| 676 |
{ VMERR_BAD_TYPE_CALL, |
| 677 |
"invalid type for call", |
| 678 |
VMsg("The value cannot be invoked as a method or function.") }, |
| 679 |
|
| 680 |
{ VMERR_NIL_SELF, |
| 681 |
"nil 'self' value is not allowed", |
| 682 |
VMsg("'self' cannot be nil. The function or method context has " |
| 683 |
"a nil value for 'self', which is not allowed.") }, |
| 684 |
|
| 685 |
{ VMERR_CANNOT_CREATE_INST, |
| 686 |
"cannot create instance of object - object is not a class", |
| 687 |
VMsg("An instance of this object cannot be created, because this " |
| 688 |
"object is not a class.") }, |
| 689 |
|
| 690 |
{ VMERR_ILLEGAL_NEW, |
| 691 |
"cannot create instance - class does not allow dynamic construction", |
| 692 |
VMsg("An instance of this class cannot be created, because this class " |
| 693 |
"does not allow dynamic construction.") }, |
| 694 |
|
| 695 |
{ VMERR_INVALID_OPCODE, |
| 696 |
"invalid opcode - possible image file corruption", |
| 697 |
VMsg("Invalid instruction opcode - the image file might be corrupted.") }, |
| 698 |
|
| 699 |
{ VMERR_UNHANDLED_EXC, |
| 700 |
"unhandled exception", |
| 701 |
VMsg("An exception was thrown but was not caught by the program. " |
| 702 |
"The interpreter is terminating execution of the program.") }, |
| 703 |
|
| 704 |
{ VMERR_STACK_OVERFLOW, |
| 705 |
"stack overflow", |
| 706 |
VMsg("Stack overflow. This indicates that function or method calls " |
| 707 |
"were nested too deeply; this might have occurred because of " |
| 708 |
"unterminated recursion, which can happen when a function or method " |
| 709 |
"calls itself (either directly or indirectly).") }, |
| 710 |
|
| 711 |
{ VMERR_BAD_TYPE_BIF, |
| 712 |
"invalid type for intrinsic function argument", |
| 713 |
VMsg("An invalid datatype was provided for an intrinsic " |
| 714 |
"function argument.") }, |
| 715 |
|
| 716 |
{ VMERR_SAY_IS_NOT_DEFINED, |
| 717 |
"default output function is not defined", |
| 718 |
VMsg("The default output function is not defined. Implicit string " |
| 719 |
"display is not allowed until a default output function " |
| 720 |
"is specified.") }, |
| 721 |
|
| 722 |
{ VMERR_BAD_VAL_BIF, |
| 723 |
"invalid value for intrinsic function argument", |
| 724 |
VMsg("An invalid value was specified for an intrinsic function argument. " |
| 725 |
"The value is out of range or is not an allowed value.") }, |
| 726 |
|
| 727 |
{ VMERR_BREAKPOINT, |
| 728 |
"breakpoint encountered", |
| 729 |
VMsg("A breakpoint instruction was encountered, and no debugger is " |
| 730 |
"active. The compiler might have inserted this breakpoint to " |
| 731 |
"indicate an invalid or unreachable location in the code, so " |
| 732 |
"executing this instruction probably indicates an error in the " |
| 733 |
"program.") }, |
| 734 |
|
| 735 |
{ VMERR_CALLEXT_NOT_IMPL, |
| 736 |
"external function calls are not implemented in this version", |
| 737 |
VMsg("This version of the interpreter does not implement external " |
| 738 |
"function calls. This program requires an interpreter that " |
| 739 |
"provides external function call capabilities, so this program " |
| 740 |
"is not compatible with this interpreter.") }, |
| 741 |
|
| 742 |
{ VMERR_INVALID_OPCODE_MOD, |
| 743 |
"invalid opcode modifier - possible image file corruption", |
| 744 |
VMsg("Invalid instruction opcode modifier - the image file might " |
| 745 |
"be corrupted.") }, |
| 746 |
|
| 747 |
/* |
| 748 |
* Note - do NOT use the VMsg() macro on this message, since we always |
| 749 |
* want to have this verbose message available. |
| 750 |
*/ |
| 751 |
{ VMERR_NO_CHARMAP_FILE, |
| 752 |
"No mapping file available for local character set \"%.32s\"", |
| 753 |
"[Warning: no mapping file is available for the local character set " |
| 754 |
"\"%.32s\". The system will use a default ASCII character set " |
| 755 |
"mapping instead, so accented characters will be displayed without " |
| 756 |
"their accents.]" }, |
| 757 |
|
| 758 |
{ VMERR_UNHANDLED_EXC_PARAM, |
| 759 |
"Unhandled exception: %s", |
| 760 |
VMsg("Unhandled exception: %s") }, |
| 761 |
|
| 762 |
{ VMERR_VM_EXC_PARAM, |
| 763 |
"VM Error: %s", |
| 764 |
VMsg("VM Error: %s") |
| 765 |
VBook("This is used as a generic template for VM run-time " |
| 766 |
"exception messages. The interpreter uses this to " |
| 767 |
"display unhandled exceptions that terminate the program.") }, |
| 768 |
|
| 769 |
{ VMERR_VM_EXC_CODE, |
| 770 |
"VM Error: code %d", |
| 771 |
VMsg("VM Error: code %d") |
| 772 |
VBook("This is used as a generic template for VM run-time " |
| 773 |
"exceptions. The interpreter uses this to report unhandled " |
| 774 |
"exceptions that terminate the program. When it can't find " |
| 775 |
"any message for the VM error code, the interpreter simply " |
| 776 |
"displays the error number using this template.") }, |
| 777 |
|
| 778 |
{ VMERR_EXC_IN_STATIC_INIT, |
| 779 |
"Exception in static initializer for %s.%s: %s", |
| 780 |
VMsg("An exception occurred in the static initializer for " |
| 781 |
"%s.%s: %s") }, |
| 782 |
|
| 783 |
{ VMERR_INTCLS_GENERAL_ERROR, |
| 784 |
"intrinsic class exception: %s", |
| 785 |
VMsg("Exception in intrinsic class method: %s") }, |
| 786 |
|
| 787 |
{ VMERR_STACK_OUT_OF_BOUNDS, |
| 788 |
"stack access is out of bounds", |
| 789 |
VMsg("The program attempted to access a stack location that isn't " |
| 790 |
"part of the current expression storage area. This probably " |
| 791 |
"indicates a problem with the compiler that was used to create " |
| 792 |
"this program, or a corrupted program file.") }, |
| 793 |
|
| 794 |
{ VMERR_DBG_ABORT, |
| 795 |
"'abort' signal", |
| 796 |
VMsg("'abort' signal") |
| 797 |
VBook("This exception is used internally by the debugger to " |
| 798 |
"signal program termination via the debugger UI.") }, |
| 799 |
|
| 800 |
{ VMERR_DBG_RESTART, |
| 801 |
"'restart' signal", |
| 802 |
VMsg("'restart' signal") |
| 803 |
VBook("This exception is used internally by the debugger to " |
| 804 |
"signal program restart via the debugger UI.") }, |
| 805 |
|
| 806 |
{ VMERR_DBG_HALT, |
| 807 |
"debugger VM halt", |
| 808 |
VMsg("debugger VM halt") |
| 809 |
VBook("This exception is used internally by the debugger to " |
| 810 |
"signal program termination via the debugger UI.") }, |
| 811 |
|
| 812 |
{ VMERR_DBG_INTERRUPT, |
| 813 |
"interrupted by user", |
| 814 |
VMsg("The program was interrupted by a user interrupt key or " |
| 815 |
"other action.") }, |
| 816 |
|
| 817 |
{ VMERR_NO_DEBUGGER, |
| 818 |
"no debugger available", |
| 819 |
VMsg("An instruction was encountered that requires the debugger, " |
| 820 |
"but this interpreter version doesn't include debugging " |
| 821 |
"capaabilities.") }, |
| 822 |
|
| 823 |
{ VMERR_BAD_FRAME, |
| 824 |
"invalid frame in debugger local/parameter evaluation", |
| 825 |
VMsg("An invalid stack frame was specified in a debugger local/parameter " |
| 826 |
"evaluation. This probably indicates an internal problem in the " |
| 827 |
"debugger.") }, |
| 828 |
|
| 829 |
{ VMERR_BAD_SPEC_EVAL, |
| 830 |
"invalid speculative expression", |
| 831 |
VMsg("This expression cannot be executed speculatively. (This does not " |
| 832 |
"indicate a problem; it's merely an internal condition in the " |
| 833 |
"debugger.)") }, |
| 834 |
|
| 835 |
{ VMERR_INVAL_DBG_EXPR, |
| 836 |
"invalid debugger expression", |
| 837 |
VMsg("This expression cannot be evaluated in the debugger.") }, |
| 838 |
|
| 839 |
{ VMERR_NO_IMAGE_DBG_INFO, |
| 840 |
"image file has no debugging information - recompile for debugging", |
| 841 |
VMsg("The image file has no debugging information. You must recompile " |
| 842 |
"the source code for this program with debugging information in " |
| 843 |
"order to run the program under the debugger.") }, |
| 844 |
|
| 845 |
{ VMERR_BIGNUM_NO_REGS, |
| 846 |
"out of temporary floating point registers (calculation too complex)", |
| 847 |
VMsg("The interpreter is out of temporary floating point registers. " |
| 848 |
"This probably indicates that an excessively complex calculation " |
| 849 |
"has been attempted.") }, |
| 850 |
|
| 851 |
{ VMERR_NO_BIGNUM_CONV, |
| 852 |
"cannot convert value to BigNumber", |
| 853 |
VMsg("This value cannot be converted to a BigNumber.") } |
| 854 |
|
| 855 |
#endif /* VMERR_OMIT_MESSAGES */ |
| 856 |
}; |
| 857 |
|
| 858 |
/* size of the english message array */ |
| 859 |
size_t vm_message_count_english = |
| 860 |
sizeof(vm_messages_english)/sizeof(vm_messages_english[0]); |
| 861 |
|
| 862 |
/* |
| 863 |
* the actual message array - we'll initialize this to the |
| 864 |
* english list that's linked in, but if we find an external message |
| 865 |
* file, we'll use the external file instead |
| 866 |
*/ |
| 867 |
const err_msg_t *vm_messages = vm_messages_english; |
| 868 |
|
| 869 |
/* message count - initialize to the english message array count */ |
| 870 |
size_t vm_message_count = |
| 871 |
sizeof(vm_messages_english)/sizeof(vm_messages_english[0]); |
| 872 |
|
| 873 |
/* ------------------------------------------------------------------------ */ |
| 874 |
/* |
| 875 |
* we don't need the VMsg() (verbose message) cover macro any more |
| 876 |
*/ |
| 877 |
#undef VMsg |