Brian Callahan | 1c76196 | 2019-04-02 18:37:44 -0400 | [diff] [blame] | 1 | /* |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 2 | * ***************************************************************************** |
| 3 | * |
Gavin Howard | 7345cb9 | 2019-04-08 14:13:43 -0600 | [diff] [blame] | 4 | * Copyright (c) 2018-2019 Gavin D. Howard and contributors. |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 5 | * |
Gavin Howard | 7345cb9 | 2019-04-08 14:13:43 -0600 | [diff] [blame] | 6 | * All rights reserved. |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 7 | * |
Gavin Howard | 7345cb9 | 2019-04-08 14:13:43 -0600 | [diff] [blame] | 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions are met: |
| 10 | * |
| 11 | * * Redistributions of source code must retain the above copyright notice, this |
| 12 | * list of conditions and the following disclaimer. |
| 13 | * |
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
| 15 | * this list of conditions and the following disclaimer in the documentation |
| 16 | * and/or other materials provided with the distribution. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 | * POSSIBILITY OF SUCH DAMAGE. |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 29 | * |
| 30 | * ***************************************************************************** |
| 31 | * |
| 32 | * Definitions for bc's VM. |
| 33 | * |
| 34 | */ |
| 35 | |
| 36 | #ifndef BC_VM_H |
| 37 | #define BC_VM_H |
| 38 | |
Gavin Howard | 411f732 | 2018-09-26 17:21:19 -0600 | [diff] [blame] | 39 | #include <stddef.h> |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 40 | #include <limits.h> |
| 41 | |
Gavin Howard | aa66054 | 2019-01-08 11:25:04 -0700 | [diff] [blame] | 42 | #include <signal.h> |
Gavin Howard | 6075b44 | 2019-03-28 10:03:51 -0600 | [diff] [blame] | 43 | |
Gavin Howard | 8ffac9b | 2019-02-20 16:13:49 -0700 | [diff] [blame] | 44 | #if BC_ENABLE_NLS |
Gavin Howard | 6075b44 | 2019-03-28 10:03:51 -0600 | [diff] [blame] | 45 | |
| 46 | # ifdef _WIN32 |
| 47 | # error NLS is not supported on Windows. |
| 48 | # endif // _WIN32 |
| 49 | |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 50 | #include <nl_types.h> |
Gavin Howard | 6075b44 | 2019-03-28 10:03:51 -0600 | [diff] [blame] | 51 | |
Gavin Howard | 8ffac9b | 2019-02-20 16:13:49 -0700 | [diff] [blame] | 52 | #endif // BC_ENABLE_NLS |
Gavin Howard | aa66054 | 2019-01-08 11:25:04 -0700 | [diff] [blame] | 53 | |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 54 | #include <status.h> |
Gavin Howard | 1009a16 | 2019-05-18 12:26:09 -0600 | [diff] [blame] | 55 | #include <num.h> |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 56 | #include <parse.h> |
| 57 | #include <program.h> |
Gavin Howard | bceb32d | 2018-12-12 22:23:51 -0700 | [diff] [blame] | 58 | #include <history.h> |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 59 | |
Gavin Howard | 40a085f | 2018-12-03 12:08:59 -0700 | [diff] [blame] | 60 | #if !BC_ENABLED && !DC_ENABLED |
Gavin Howard | e6e8476 | 2018-10-03 11:46:34 -0600 | [diff] [blame] | 61 | #error Must define BC_ENABLED, DC_ENABLED, or both |
Gavin Howard | a0ccea6 | 2018-09-26 21:02:22 -0600 | [diff] [blame] | 62 | #endif |
| 63 | |
Gavin Howard | 9e48544 | 2019-01-03 09:29:19 -0700 | [diff] [blame] | 64 | // CHAR_BIT must be at least 6. |
| 65 | #if CHAR_BIT < 6 |
| 66 | #error CHAR_BIT must be at least 6. |
Gavin Howard | c1902aa | 2018-12-20 15:54:28 -0700 | [diff] [blame] | 67 | #endif |
| 68 | |
Gavin Howard | 77d016f | 2019-04-22 09:44:43 -0600 | [diff] [blame] | 69 | #ifndef BC_ENABLE_NLS |
| 70 | #define BC_ENABLE_NLS (0) |
| 71 | #endif // BC_ENABLE_NLS |
| 72 | |
| 73 | #ifndef BC_ENABLE_SIGNALS |
| 74 | #define BC_ENABLE_SIGNALS (1) |
| 75 | #endif // BC_ENABLE_SIGNALS |
| 76 | |
| 77 | #ifndef MAINEXEC |
| 78 | #define MAINEXEC bc |
| 79 | #endif |
| 80 | |
| 81 | #ifndef EXECPREFIX |
| 82 | #define EXECPREFIX |
| 83 | #endif |
| 84 | |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 85 | #define GEN_STR(V) #V |
| 86 | #define GEN_STR2(V) GEN_STR(V) |
| 87 | |
| 88 | #define BC_VERSION GEN_STR2(VERSION) |
Gavin Howard | 36ae629 | 2019-04-01 07:30:27 -0600 | [diff] [blame] | 89 | #define BC_EXECPREFIX GEN_STR2(EXECPREFIX) |
Gavin Howard | c1075ce | 2019-04-01 13:52:38 -0600 | [diff] [blame] | 90 | #define BC_MAINEXEC GEN_STR2(MAINEXEC) |
Gavin Howard | a95501a | 2018-10-03 16:13:34 -0600 | [diff] [blame] | 91 | |
Gavin Howard | 66f2a6b | 2018-12-14 14:31:08 -0700 | [diff] [blame] | 92 | // Windows has deprecated isatty(). |
| 93 | #ifdef _WIN32 |
| 94 | #define isatty _isatty |
| 95 | #endif // _WIN32 |
| 96 | |
Gavin Howard | f2d9a65 | 2019-05-11 07:38:32 -0600 | [diff] [blame] | 97 | #define DC_FLAG_X (UINTMAX_C(1)<<0) |
| 98 | #define BC_FLAG_W (UINTMAX_C(1)<<1) |
| 99 | #define BC_FLAG_S (UINTMAX_C(1)<<2) |
| 100 | #define BC_FLAG_Q (UINTMAX_C(1)<<3) |
| 101 | #define BC_FLAG_L (UINTMAX_C(1)<<4) |
| 102 | #define BC_FLAG_I (UINTMAX_C(1)<<5) |
| 103 | #define BC_FLAG_G (UINTMAX_C(1)<<6) |
| 104 | #define BC_FLAG_TTYIN (UINTMAX_C(1)<<7) |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 105 | #define BC_TTYIN (vm->flags & BC_FLAG_TTYIN) |
| 106 | |
| 107 | #define BC_S (BC_ENABLED && (vm->flags & BC_FLAG_S)) |
| 108 | #define BC_W (BC_ENABLED && (vm->flags & BC_FLAG_W)) |
| 109 | #define BC_L (BC_ENABLED && (vm->flags & BC_FLAG_L)) |
Gavin Howard | 75389d1 | 2019-02-25 16:39:02 -0700 | [diff] [blame] | 110 | #define BC_I (BC_ENABLED && (vm->flags & BC_FLAG_I)) |
| 111 | #define BC_G (BC_ENABLED && (vm->flags & BC_FLAG_G)) |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 112 | #define DC_X (DC_ENABLED && (vm->flags & DC_FLAG_X)) |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 113 | |
| 114 | #define BC_MAX(a, b) ((a) > (b) ? (a) : (b)) |
| 115 | #define BC_MIN(a, b) ((a) < (b) ? (a) : (b)) |
| 116 | |
Gavin Howard | 92ba4e5 | 2019-05-10 20:49:13 -0600 | [diff] [blame] | 117 | #define BC_MAX_OBASE ((unsigned long) (BC_BASE_POW)) |
Gavin Howard | f2d9a65 | 2019-05-11 07:38:32 -0600 | [diff] [blame] | 118 | #define BC_MAX_DIM ((unsigned long) (SIZE_MAX / sizeof(BcNum) - 1)) |
Gavin Howard | 2956a5e | 2019-05-08 08:04:06 -0600 | [diff] [blame] | 119 | #define BC_MAX_SCALE ((unsigned long) (BC_NUM_BIGDIG_MAX - 1)) |
| 120 | #define BC_MAX_STRING ((unsigned long) (BC_NUM_BIGDIG_MAX - 1)) |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 121 | #define BC_MAX_NAME BC_MAX_STRING |
Gavin Howard | 530e307 | 2019-04-23 16:23:36 -0600 | [diff] [blame] | 122 | #define BC_MAX_NUM BC_MAX_SCALE |
Gavin Howard | 2956a5e | 2019-05-08 08:04:06 -0600 | [diff] [blame] | 123 | #define BC_MAX_EXP ((unsigned long) (BC_NUM_BIGDIG_MAX - 1)) |
Gavin Howard | f2d9a65 | 2019-05-11 07:38:32 -0600 | [diff] [blame] | 124 | #define BC_MAX_VARS ((unsigned long) (SIZE_MAX / sizeof(BcId) - 1)) |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 125 | |
Gavin Howard | 664476c | 2019-01-03 14:57:19 -0700 | [diff] [blame] | 126 | #define BC_IS_BC (BC_ENABLED && (!DC_ENABLED || vm->name[0] != 'd')) |
Gavin Howard | a652788 | 2019-02-19 20:23:17 -0700 | [diff] [blame] | 127 | #define BC_IS_POSIX (BC_S || BC_W) |
Gavin Howard | f878d33 | 2018-12-03 12:58:38 -0700 | [diff] [blame] | 128 | |
Gavin Howard | 112304b | 2018-12-04 14:30:01 -0700 | [diff] [blame] | 129 | #if BC_ENABLE_SIGNALS |
Gavin Howard | b9a0b86 | 2019-01-08 11:47:09 -0700 | [diff] [blame] | 130 | |
Gavin Howard | 2d188a5 | 2019-02-25 14:19:08 -0700 | [diff] [blame] | 131 | #define BC_SIG BC_UNLIKELY(vm->sig) |
| 132 | #define BC_NO_SIG BC_LIKELY(!vm->sig) |
Gavin Howard | 5dbb48b | 2019-01-04 11:29:29 -0700 | [diff] [blame] | 133 | #define BC_SIGINT (vm->sig == SIGINT) |
Gavin Howard | b9a0b86 | 2019-01-08 11:47:09 -0700 | [diff] [blame] | 134 | |
| 135 | #ifdef SIGQUIT |
Gavin Howard | 5dbb48b | 2019-01-04 11:29:29 -0700 | [diff] [blame] | 136 | #define BC_SIGTERM (vm->sig == SIGTERM || vm->sig == SIGQUIT) |
Gavin Howard | b9a0b86 | 2019-01-08 11:47:09 -0700 | [diff] [blame] | 137 | #else // SIGQUIT |
| 138 | #define BC_SIGTERM (vm->sig == SIGTERM) |
| 139 | #endif // SIGQUIT |
| 140 | |
Gavin Howard | 112304b | 2018-12-04 14:30:01 -0700 | [diff] [blame] | 141 | #else // BC_ENABLE_SIGNALS |
Gavin Howard | 4eb1465 | 2019-02-25 14:26:53 -0700 | [diff] [blame] | 142 | #define BC_SIG (0) |
| 143 | #define BC_NO_SIG (1) |
Gavin Howard | 112304b | 2018-12-04 14:30:01 -0700 | [diff] [blame] | 144 | #endif // BC_ENABLE_SIGNALS |
| 145 | |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 146 | #define bc_vm_err(e) (bc_vm_error((e), 0)) |
Gavin Howard | ecc7fc2 | 2018-12-31 13:21:47 -0700 | [diff] [blame] | 147 | #define bc_vm_verr(e, ...) (bc_vm_error((e), 0, __VA_ARGS__)) |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 148 | |
Gavin Howard | 75abdc9 | 2019-02-25 13:47:16 -0700 | [diff] [blame] | 149 | #define BC_IO_ERR(e, f) (BC_ERR((e) == EOF || ferror(f))) |
Gavin Howard | fb4f2b8 | 2019-02-19 08:43:27 -0700 | [diff] [blame] | 150 | #define BC_STATUS_IS_ERROR(s) \ |
| 151 | ((s) >= BC_STATUS_ERROR_MATH && (s) <= BC_STATUS_ERROR_PARSE) |
Gavin Howard | ecafd4f | 2019-02-23 09:30:45 -0700 | [diff] [blame] | 152 | #define BC_ERROR_SIGNAL_ONLY(s) (BC_ENABLE_SIGNALS && BC_ERR(s)) |
Gavin Howard | fb4f2b8 | 2019-02-19 08:43:27 -0700 | [diff] [blame] | 153 | |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 154 | typedef struct BcVm { |
Gavin Howard | 773c86b | 2018-11-02 14:07:19 -0600 | [diff] [blame] | 155 | |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 156 | BcParse prs; |
| 157 | BcProgram prog; |
| 158 | |
Gavin Howard | ab5e963 | 2019-01-02 13:32:02 -0700 | [diff] [blame] | 159 | size_t nchars; |
| 160 | |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 161 | const char* file; |
| 162 | |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 163 | #if BC_ENABLE_SIGNALS |
Gavin Howard | 2d188a5 | 2019-02-25 14:19:08 -0700 | [diff] [blame] | 164 | const char *sigmsg; |
| 165 | uchar siglen; |
Gavin Howard | 9e48544 | 2019-01-03 09:29:19 -0700 | [diff] [blame] | 166 | uchar sig; |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 167 | #endif // BC_ENABLE_SIGNALS |
| 168 | |
Gavin Howard | a89d2f5 | 2018-12-27 13:56:19 -0700 | [diff] [blame] | 169 | uint8_t flags; |
Gavin Howard | 180f6ba | 2018-12-27 14:01:28 -0700 | [diff] [blame] | 170 | uchar read_ret; |
Gavin Howard | a89d2f5 | 2018-12-27 13:56:19 -0700 | [diff] [blame] | 171 | |
Gavin Howard | bd84820 | 2019-05-18 11:50:42 -0600 | [diff] [blame] | 172 | uint16_t line_len; |
| 173 | |
| 174 | BcBigDig maxes[BC_PROG_GLOBALS_LEN]; |
| 175 | |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 176 | BcVec files; |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 177 | BcVec exprs; |
| 178 | |
Gavin Howard | f4983b8 | 2018-09-27 10:44:21 -0600 | [diff] [blame] | 179 | const char *name; |
Gavin Howard | 07f0d10 | 2018-12-04 14:28:03 -0700 | [diff] [blame] | 180 | const char *help; |
Gavin Howard | 07f0d10 | 2018-12-04 14:28:03 -0700 | [diff] [blame] | 181 | |
Gavin Howard | 1ab22d2 | 2019-01-03 13:32:17 -0700 | [diff] [blame] | 182 | char *env_args; |
| 183 | |
Gavin Howard | bceb32d | 2018-12-12 22:23:51 -0700 | [diff] [blame] | 184 | #if BC_ENABLE_HISTORY |
Gavin Howard | 6e04ac2 | 2018-12-12 22:33:53 -0700 | [diff] [blame] | 185 | BcHistory history; |
Gavin Howard | bceb32d | 2018-12-12 22:23:51 -0700 | [diff] [blame] | 186 | #endif // BC_ENABLE_HISTORY |
| 187 | |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 188 | BcLexNext next; |
| 189 | BcParseParse parse; |
| 190 | BcParseExpr expr; |
Gavin Howard | 5ec7573 | 2018-12-03 12:11:28 -0700 | [diff] [blame] | 191 | |
Gavin Howard | 2425bf2 | 2019-04-08 17:05:45 -0600 | [diff] [blame] | 192 | const char *func_header; |
| 193 | |
| 194 | const char *err_ids[BC_ERR_IDX_NELEMS + BC_ENABLED]; |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 195 | const char *err_msgs[BC_ERROR_NELEMS]; |
| 196 | |
Gavin Howard | 013a230 | 2019-04-01 15:00:39 -0600 | [diff] [blame] | 197 | const char *locale; |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 198 | |
Gavin Howard | ba0e16f | 2019-05-18 19:33:01 -0600 | [diff] [blame^] | 199 | BcBigDig last_base; |
| 200 | BcBigDig last_pow; |
| 201 | BcBigDig last_exp; |
| 202 | BcBigDig last_rem; |
| 203 | |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 204 | #if BC_ENABLE_NLS |
| 205 | nl_catd catalog; |
| 206 | #endif // BC_ENABLE_NLS |
| 207 | |
Gavin Howard | 70e3d60 | 2018-12-11 11:00:49 -0700 | [diff] [blame] | 208 | } BcVm; |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 209 | |
Gavin Howard | 40a085f | 2018-12-03 12:08:59 -0700 | [diff] [blame] | 210 | #if BC_ENABLED |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 211 | BcStatus bc_vm_posixError(BcError e, size_t line, ...); |
Gavin Howard | f8f232b | 2018-10-11 17:29:47 -0600 | [diff] [blame] | 212 | #endif // BC_ENABLED |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 213 | |
Gavin Howard | a84ad99 | 2018-12-03 19:11:06 -0700 | [diff] [blame] | 214 | void bc_vm_info(const char* const help); |
Gavin Howard | 70e3d60 | 2018-12-11 11:00:49 -0700 | [diff] [blame] | 215 | BcStatus bc_vm_boot(int argc, char *argv[], const char *env_len); |
Gavin Howard | 1cbfe24 | 2019-01-09 17:13:11 -0700 | [diff] [blame] | 216 | void bc_vm_shutdown(void); |
Gavin Howard | a84ad99 | 2018-12-03 19:11:06 -0700 | [diff] [blame] | 217 | |
Gavin Howard | f7699f2 | 2019-01-02 13:02:48 -0700 | [diff] [blame] | 218 | size_t bc_vm_printf(const char *fmt, ...); |
Gavin Howard | 48af52e | 2018-10-30 14:47:38 -0600 | [diff] [blame] | 219 | void bc_vm_puts(const char *str, FILE *restrict f); |
| 220 | void bc_vm_putchar(int c); |
| 221 | void bc_vm_fflush(FILE *restrict f); |
| 222 | |
Gavin Howard | 5bede41 | 2019-02-23 09:31:28 -0700 | [diff] [blame] | 223 | size_t bc_vm_arraySize(size_t n, size_t size); |
Gavin Howard | 007afdf | 2019-02-23 09:45:42 -0700 | [diff] [blame] | 224 | size_t bc_vm_growSize(size_t a, size_t b); |
Gavin Howard | ad0ecfe | 2018-10-30 01:16:01 -0600 | [diff] [blame] | 225 | void* bc_vm_malloc(size_t n); |
| 226 | void* bc_vm_realloc(void *ptr, size_t n); |
| 227 | char* bc_vm_strdup(const char *str); |
| 228 | |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 229 | BcStatus bc_vm_error(BcError e, size_t line, ...); |
Gavin Howard | 0f31f5b | 2018-12-03 11:15:46 -0700 | [diff] [blame] | 230 | |
Gavin Howard | 40a085f | 2018-12-03 12:08:59 -0700 | [diff] [blame] | 231 | #if BC_ENABLED |
Gavin Howard | 9fbeaa8 | 2018-12-27 18:13:28 -0700 | [diff] [blame] | 232 | extern const char bc_lib[]; |
| 233 | extern const char *bc_lib_name; |
| 234 | #if BC_ENABLE_EXTRA_MATH |
| 235 | extern const char bc_lib2[]; |
| 236 | extern const char *bc_lib2_name; |
| 237 | #endif // BC_ENABLE_EXTRA_MATH |
Gavin Howard | a95501a | 2018-10-03 16:13:34 -0600 | [diff] [blame] | 238 | #endif // BC_ENABLED |
Gavin Howard | 4ffe5a9 | 2018-09-26 20:58:31 -0600 | [diff] [blame] | 239 | |
Gavin Howard | a95501a | 2018-10-03 16:13:34 -0600 | [diff] [blame] | 240 | extern const char bc_copyright[]; |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 241 | extern const char* const bc_err_line; |
Gavin Howard | 2425bf2 | 2019-04-08 17:05:45 -0600 | [diff] [blame] | 242 | extern const char* const bc_err_func_header; |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 243 | extern const char *bc_errs[]; |
Gavin Howard | 5f349d4 | 2019-04-09 14:14:00 -0600 | [diff] [blame] | 244 | extern const uchar bc_err_ids[]; |
Gavin Howard | 1cbfe24 | 2019-01-09 17:13:11 -0700 | [diff] [blame] | 245 | extern const char* const bc_err_msgs[]; |
Gavin Howard | f89006a | 2018-10-29 13:01:51 -0600 | [diff] [blame] | 246 | |
Gavin Howard | 70e3d60 | 2018-12-11 11:00:49 -0700 | [diff] [blame] | 247 | extern BcVm *vm; |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 248 | |
| 249 | #endif // BC_VM_H |