| 1 | /* |
| 2 | * Copyright (c) 2002 by Michael J. Roberts. All Rights Reserved. |
| 3 | * |
| 4 | * Please see the accompanying license file, LICENSE.TXT, for information |
| 5 | * on using and copying this software. |
| 6 | */ |
| 7 | /* |
| 8 | Name |
| 9 | vmglobv.h - global variable definitions |
| 10 | Function |
| 11 | Defines the global variables for the T3 VM |
| 12 | Notes |
| 13 | This file is NOT protected against multiple inclusion, because it's |
| 14 | designed to be included more than once with different definitions for |
| 15 | the macros. |
| 16 | Modified |
| 17 | 09/18/02 MJRoberts - Creation |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | VM_GLOBALS_BEGIN |
| 22 | |
| 23 | /* object memory manager */ |
| 24 | VM_GLOBAL_OBJDEF(class CVmMemory, mem) |
| 25 | |
| 26 | /* variable-size block heap manager */ |
| 27 | VM_GLOBAL_OBJDEF(class CVmVarHeap, varheap) |
| 28 | |
| 29 | /* undo manager */ |
| 30 | VM_GLOBAL_OBJDEF(class CVmUndo, undo) |
| 31 | |
| 32 | /* constant pool manager */ |
| 33 | VM_GLOBAL_PREOBJDEF(class CVmPool_CLASS, const_pool) |
| 34 | |
| 35 | /* code pool manager */ |
| 36 | VM_GLOBAL_PREOBJDEF(class CVmPool_CLASS, code_pool) |
| 37 | |
| 38 | /* metaclass dependency table for loaded image file */ |
| 39 | VM_GLOBAL_OBJDEF(class CVmMetaTable, meta_table) |
| 40 | |
| 41 | /* built-in function set table */ |
| 42 | VM_GLOBAL_OBJDEF(class CVmBifTable, bif_table) |
| 43 | |
| 44 | /* source file list (for debugger) */ |
| 45 | VM_GLOBAL_OBJDEF(class CVmSrcfTable, srcf_table) |
| 46 | |
| 47 | /* global symbol table (for debugger) */ |
| 48 | VM_GLOBAL_OBJDEF(class CTcPrsSymtab, sym_table) |
| 49 | |
| 50 | /* byte code interpreter */ |
| 51 | VM_GLOBAL_PRECOBJDEF(class CVmRun, interpreter, |
| 52 | (VM_STACK_SIZE, vm_init_stack_reserve())) |
| 53 | |
| 54 | /* size of each exception table entry in the image file */ |
| 55 | VM_GLOBAL_VARDEF(size_t, exc_entry_size) |
| 56 | |
| 57 | /* size of each debugger source line entry in the image file */ |
| 58 | VM_GLOBAL_VARDEF(size_t, line_entry_size) |
| 59 | |
| 60 | /* pre-defined objects and properties */ |
| 61 | VM_GLOBAL_PREOBJDEF(struct CVmPredef, predef) |
| 62 | |
| 63 | /* preinit mode flag */ |
| 64 | VM_GLOBAL_VARDEF(int, preinit_mode) |
| 65 | |
| 66 | /* flag: error subsystem initialized outside of VM globals */ |
| 67 | VM_GLOBAL_VARDEF(int, err_pre_inited) |
| 68 | |
| 69 | /* TADS built-in function globals */ |
| 70 | VM_GLOBAL_OBJDEF(class CVmBifTADSGlobals, bif_tads_globals) |
| 71 | |
| 72 | /* host application interface */ |
| 73 | VM_GLOBAL_OBJDEF(class CVmHostIfc, host_ifc) |
| 74 | |
| 75 | /* image file loader */ |
| 76 | VM_GLOBAL_OBJDEF(class CVmImageLoader, image_loader) |
| 77 | |
| 78 | /* name of the UI character set, if specified explicitly */ |
| 79 | VM_GLOBAL_OBJDEF(char, disp_cset_name) |
| 80 | |
| 81 | /* |
| 82 | * Character mappings to and from the local filename character set. |
| 83 | * This is the character set that's used by the local file system to |
| 84 | * represent filenames. Note that this isn't the set for the |
| 85 | * *contents* of files - just for their names. |
| 86 | */ |
| 87 | VM_GLOBAL_OBJDEF(class CCharmapToUni, cmap_from_fname) |
| 88 | VM_GLOBAL_OBJDEF(class CCharmapToLocal, cmap_to_fname) |
| 89 | |
| 90 | /* |
| 91 | * Character mappings to and from the default local file-contents |
| 92 | * character set. |
| 93 | * |
| 94 | * At best, this is only a default. In actual practice files can be in |
| 95 | * any character set (or even in no character sets at all, or in |
| 96 | * multiple character sets, in the case of binary or structured files). |
| 97 | * Even so, on most systems, there will be a character set that most |
| 98 | * ordinary text files use; this is that set. |
| 99 | */ |
| 100 | VM_GLOBAL_OBJDEF(class CCharmapToUni, cmap_from_file) |
| 101 | VM_GLOBAL_OBJDEF(class CCharmapToLocal, cmap_to_file) |
| 102 | |
| 103 | /* |
| 104 | * Character mapping to the log file. This is the mapping from unicode |
| 105 | * to the log file. |
| 106 | */ |
| 107 | VM_GLOBAL_OBJDEF(class CCharmapToLocal, cmap_to_log) |
| 108 | |
| 109 | /* |
| 110 | * Character mappings to and from the local character set for the |
| 111 | * console/display user interface. This character set is used for |
| 112 | * formatting output to the display and reading input from the |
| 113 | * keyboard. |
| 114 | */ |
| 115 | VM_GLOBAL_OBJDEF(class CCharmapToUni, cmap_from_ui) |
| 116 | VM_GLOBAL_OBJDEF(class CCharmapToLocal, cmap_to_ui) |
| 117 | |
| 118 | /* user interface primary console */ |
| 119 | VM_GLOBAL_OBJDEF(class CVmConsoleMain, console) |
| 120 | |
| 121 | /* TadsObject inheritance path analysis queue */ |
| 122 | VM_GLOBAL_PREOBJDEF(class CVmObjTadsInhQueue, tadsobj_queue) |
| 123 | |
| 124 | /* dynamic compiler */ |
| 125 | VM_GLOBAL_OBJDEF(class CVmDynamicCompiler, dyncomp) |
| 126 | |
| 127 | /* web host configuration */ |
| 128 | VM_GLOBAL_OBJDEF(class TadsNetConfig, net_config) |
| 129 | |
| 130 | /* network I/O message queue */ |
| 131 | VM_GLOBAL_OBJDEF(class TadsMessageQueue, net_queue) |
| 132 | |
| 133 | /* |
| 134 | * The isNextAvailable() and getNext() properties from the Collection |
| 135 | * entry in the metaclass table. We initialize these after loading the |
| 136 | * program so that CVmObject::iter_next() has quick access to these |
| 137 | * properties for executing iterator loops. |
| 138 | */ |
| 139 | VM_GLOBAL_VARDEF(uint16_t, iter_get_next) |
| 140 | VM_GLOBAL_VARDEF(uint16_t, iter_next_avail) |
| 141 | |
| 142 | /* system debug log file name */ |
| 143 | VM_GLOBAL_ARRAYDEF(char, syslogfile, OSFNMAX) |
| 144 | |
| 145 | /* |
| 146 | * Base path for file I/O operations on files with relative filenames. |
| 147 | * This is used instead of the operating system's native notion of the |
| 148 | * working directory to provide better consistency across platforms, |
| 149 | * since some systems change the working directory after certain file |
| 150 | * operations. |
| 151 | */ |
| 152 | VM_GLOBAL_VARDEF(char *, file_path) |
| 153 | |
| 154 | /* |
| 155 | * Sandbox path for the file safety feature. If the file safety |
| 156 | * settings only allow access within the sandbox directory and its |
| 157 | * children, this is the root path for the sandbox. |
| 158 | */ |
| 159 | VM_GLOBAL_VARDEF(char *, sandbox_path) |
| 160 | |
| 161 | /* time zone cache */ |
| 162 | VM_GLOBAL_OBJDEF(class CVmTimeZoneCache, tzcache) |
| 163 | |
| 164 | /* size of header of each method's debug table */ |
| 165 | VM_GLOBAL_VARDEF(size_t, dbg_hdr_size) |
| 166 | |
| 167 | /* size of each debugger local symbol header */ |
| 168 | VM_GLOBAL_VARDEF(size_t, dbg_lclsym_hdr_size) |
| 169 | |
| 170 | /* debug record format version */ |
| 171 | VM_GLOBAL_VARDEF(int, dbg_fmt_vsn) |
| 172 | |
| 173 | /* debug frame record size */ |
| 174 | VM_GLOBAL_VARDEF(int, dbg_frame_size) |
| 175 | |
| 176 | /* debugger API */ |
| 177 | VM_GLOBAL_OBJDEF(class CVmDebug, debugger) |
| 178 | |
| 179 | /* object table */ |
| 180 | VM_GLOBAL_PREOBJDEF(class CVmObjTable, obj_table) |
| 181 | |
| 182 | |
| 183 | VM_GLOBALS_END |
| 184 |