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) |
Gavin Howard | 0638434 | 2019-05-26 08:29:05 -0600 | [diff] [blame] | 104 | #define BC_FLAG_P (UINTMAX_C(1)<<7) |
| 105 | #define BC_FLAG_TTYIN (UINTMAX_C(1)<<8) |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 106 | #define BC_TTYIN (vm->flags & BC_FLAG_TTYIN) |
Gavin Howard | 5e59c39 | 2019-05-20 07:51:10 -0600 | [diff] [blame] | 107 | #define BC_TTY (vm->tty) |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 108 | |
| 109 | #define BC_S (BC_ENABLED && (vm->flags & BC_FLAG_S)) |
| 110 | #define BC_W (BC_ENABLED && (vm->flags & BC_FLAG_W)) |
| 111 | #define BC_L (BC_ENABLED && (vm->flags & BC_FLAG_L)) |
Gavin Howard | 5b9393a | 2019-05-26 08:27:40 -0600 | [diff] [blame] | 112 | #define BC_I (vm->flags & BC_FLAG_I) |
Gavin Howard | 75389d1 | 2019-02-25 16:39:02 -0700 | [diff] [blame] | 113 | #define BC_G (BC_ENABLED && (vm->flags & BC_FLAG_G)) |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 114 | #define DC_X (DC_ENABLED && (vm->flags & DC_FLAG_X)) |
Gavin Howard | 0638434 | 2019-05-26 08:29:05 -0600 | [diff] [blame] | 115 | #define BC_P (vm->flags & BC_FLAG_P) |
| 116 | |
Gavin Howard | b6cc5ef | 2019-06-13 08:29:36 -0600 | [diff] [blame] | 117 | #define BC_USE_PROMPT (!BC_P && BC_TTY && !BC_IS_POSIX) |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 118 | |
| 119 | #define BC_MAX(a, b) ((a) > (b) ? (a) : (b)) |
| 120 | #define BC_MIN(a, b) ((a) < (b) ? (a) : (b)) |
| 121 | |
Gavin Howard | e647686 | 2019-05-23 08:54:15 -0600 | [diff] [blame] | 122 | #define BC_MAX_OBASE ((ulong) (BC_BASE_POW)) |
| 123 | #define BC_MAX_DIM ((ulong) (SIZE_MAX - 1)) |
| 124 | #define BC_MAX_SCALE ((ulong) (BC_NUM_BIGDIG_MAX - 1)) |
| 125 | #define BC_MAX_STRING ((ulong) (BC_NUM_BIGDIG_MAX - 1)) |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 126 | #define BC_MAX_NAME BC_MAX_STRING |
Gavin Howard | 530e307 | 2019-04-23 16:23:36 -0600 | [diff] [blame] | 127 | #define BC_MAX_NUM BC_MAX_SCALE |
Gavin Howard | e647686 | 2019-05-23 08:54:15 -0600 | [diff] [blame] | 128 | #define BC_MAX_EXP ((ulong) (BC_NUM_BIGDIG_MAX)) |
| 129 | #define BC_MAX_VARS ((ulong) (SIZE_MAX - 1)) |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 130 | |
Gavin Howard | 664476c | 2019-01-03 14:57:19 -0700 | [diff] [blame] | 131 | #define BC_IS_BC (BC_ENABLED && (!DC_ENABLED || vm->name[0] != 'd')) |
Gavin Howard | a652788 | 2019-02-19 20:23:17 -0700 | [diff] [blame] | 132 | #define BC_IS_POSIX (BC_S || BC_W) |
Gavin Howard | f878d33 | 2018-12-03 12:58:38 -0700 | [diff] [blame] | 133 | |
Gavin Howard | 112304b | 2018-12-04 14:30:01 -0700 | [diff] [blame] | 134 | #if BC_ENABLE_SIGNALS |
Gavin Howard | b9a0b86 | 2019-01-08 11:47:09 -0700 | [diff] [blame] | 135 | |
Gavin Howard | c281d42 | 2019-05-22 19:32:13 -0600 | [diff] [blame] | 136 | #define BC_SIG BC_UNLIKELY(vm->sig != vm->sig_chk) |
| 137 | #define BC_NO_SIG BC_LIKELY(vm->sig == vm->sig_chk) |
Gavin Howard | b9a0b86 | 2019-01-08 11:47:09 -0700 | [diff] [blame] | 138 | |
Gavin Howard | a3d4c97 | 2019-05-28 18:47:37 -0600 | [diff] [blame] | 139 | #define BC_SIGTERM_VAL (SIG_ATOMIC_MAX) |
Gavin Howard | c281d42 | 2019-05-22 19:32:13 -0600 | [diff] [blame] | 140 | #define BC_SIGTERM (vm->sig == BC_SIGTERM_VAL) |
| 141 | #define BC_SIGINT (vm->sig && vm->sig != BC_SIGTERM_VAL) |
Gavin Howard | b9a0b86 | 2019-01-08 11:47:09 -0700 | [diff] [blame] | 142 | |
Gavin Howard | 112304b | 2018-12-04 14:30:01 -0700 | [diff] [blame] | 143 | #else // BC_ENABLE_SIGNALS |
Gavin Howard | 4eb1465 | 2019-02-25 14:26:53 -0700 | [diff] [blame] | 144 | #define BC_SIG (0) |
| 145 | #define BC_NO_SIG (1) |
Gavin Howard | 112304b | 2018-12-04 14:30:01 -0700 | [diff] [blame] | 146 | #endif // BC_ENABLE_SIGNALS |
| 147 | |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 148 | #define bc_vm_err(e) (bc_vm_error((e), 0)) |
Gavin Howard | ecc7fc2 | 2018-12-31 13:21:47 -0700 | [diff] [blame] | 149 | #define bc_vm_verr(e, ...) (bc_vm_error((e), 0, __VA_ARGS__)) |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 150 | |
Gavin Howard | 42a832d | 2019-06-14 18:33:53 -0600 | [diff] [blame^] | 151 | #define BC_IO_ERR(e, f) (BC_ERR((e) < 0 || ferror(f))) |
Gavin Howard | fb4f2b8 | 2019-02-19 08:43:27 -0700 | [diff] [blame] | 152 | #define BC_STATUS_IS_ERROR(s) \ |
Gavin Howard | ecc0435 | 2019-05-23 07:32:51 -0600 | [diff] [blame] | 153 | ((s) >= BC_STATUS_ERROR_MATH && (s) <= BC_STATUS_ERROR_FATAL) |
Gavin Howard | ecafd4f | 2019-02-23 09:30:45 -0700 | [diff] [blame] | 154 | #define BC_ERROR_SIGNAL_ONLY(s) (BC_ENABLE_SIGNALS && BC_ERR(s)) |
Gavin Howard | fb4f2b8 | 2019-02-19 08:43:27 -0700 | [diff] [blame] | 155 | |
Gavin Howard | b63c8a1 | 2019-05-24 21:06:01 -0600 | [diff] [blame] | 156 | #define BC_VM_INVALID_CATALOG ((nl_catd) -1) |
| 157 | |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 158 | typedef struct BcVm { |
Gavin Howard | 773c86b | 2018-11-02 14:07:19 -0600 | [diff] [blame] | 159 | |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 160 | BcParse prs; |
| 161 | BcProgram prog; |
| 162 | |
Gavin Howard | ab5e963 | 2019-01-02 13:32:02 -0700 | [diff] [blame] | 163 | size_t nchars; |
| 164 | |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 165 | const char* file; |
| 166 | |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 167 | #if BC_ENABLE_SIGNALS |
Gavin Howard | 2d188a5 | 2019-02-25 14:19:08 -0700 | [diff] [blame] | 168 | const char *sigmsg; |
Gavin Howard | 3058649 | 2019-05-21 00:26:14 -0600 | [diff] [blame] | 169 | volatile sig_atomic_t sig; |
Gavin Howard | c281d42 | 2019-05-22 19:32:13 -0600 | [diff] [blame] | 170 | sig_atomic_t sig_chk; |
Gavin Howard | 90c4380 | 2019-05-21 08:13:32 -0600 | [diff] [blame] | 171 | uchar siglen; |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 172 | #endif // BC_ENABLE_SIGNALS |
| 173 | |
Gavin Howard | 0638434 | 2019-05-26 08:29:05 -0600 | [diff] [blame] | 174 | uint16_t flags; |
Gavin Howard | 180f6ba | 2018-12-27 14:01:28 -0700 | [diff] [blame] | 175 | uchar read_ret; |
Gavin Howard | 5e59c39 | 2019-05-20 07:51:10 -0600 | [diff] [blame] | 176 | bool tty; |
Gavin Howard | a89d2f5 | 2018-12-27 13:56:19 -0700 | [diff] [blame] | 177 | |
Gavin Howard | bd84820 | 2019-05-18 11:50:42 -0600 | [diff] [blame] | 178 | uint16_t line_len; |
| 179 | |
| 180 | BcBigDig maxes[BC_PROG_GLOBALS_LEN]; |
| 181 | |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 182 | BcVec files; |
Gavin Howard | 6365b24 | 2018-10-08 10:34:26 -0600 | [diff] [blame] | 183 | BcVec exprs; |
| 184 | |
Gavin Howard | f4983b8 | 2018-09-27 10:44:21 -0600 | [diff] [blame] | 185 | const char *name; |
Gavin Howard | 07f0d10 | 2018-12-04 14:28:03 -0700 | [diff] [blame] | 186 | const char *help; |
Gavin Howard | 07f0d10 | 2018-12-04 14:28:03 -0700 | [diff] [blame] | 187 | |
Gavin Howard | bceb32d | 2018-12-12 22:23:51 -0700 | [diff] [blame] | 188 | #if BC_ENABLE_HISTORY |
Gavin Howard | 6e04ac2 | 2018-12-12 22:33:53 -0700 | [diff] [blame] | 189 | BcHistory history; |
Gavin Howard | bceb32d | 2018-12-12 22:23:51 -0700 | [diff] [blame] | 190 | #endif // BC_ENABLE_HISTORY |
| 191 | |
Gavin Howard | 48354e8 | 2019-01-02 18:15:56 -0700 | [diff] [blame] | 192 | BcLexNext next; |
| 193 | BcParseParse parse; |
| 194 | BcParseExpr expr; |
Gavin Howard | 5ec7573 | 2018-12-03 12:11:28 -0700 | [diff] [blame] | 195 | |
Gavin Howard | 2425bf2 | 2019-04-08 17:05:45 -0600 | [diff] [blame] | 196 | const char *func_header; |
| 197 | |
| 198 | const char *err_ids[BC_ERR_IDX_NELEMS + BC_ENABLED]; |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 199 | const char *err_msgs[BC_ERROR_NELEMS]; |
| 200 | |
Gavin Howard | 013a230 | 2019-04-01 15:00:39 -0600 | [diff] [blame] | 201 | const char *locale; |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 202 | |
Gavin Howard | ba0e16f | 2019-05-18 19:33:01 -0600 | [diff] [blame] | 203 | BcBigDig last_base; |
| 204 | BcBigDig last_pow; |
| 205 | BcBigDig last_exp; |
| 206 | BcBigDig last_rem; |
| 207 | |
Gavin Howard | 5008025 | 2019-02-20 15:27:43 -0700 | [diff] [blame] | 208 | #if BC_ENABLE_NLS |
| 209 | nl_catd catalog; |
| 210 | #endif // BC_ENABLE_NLS |
| 211 | |
Gavin Howard | 70e3d60 | 2018-12-11 11:00:49 -0700 | [diff] [blame] | 212 | } BcVm; |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 213 | |
Gavin Howard | 40a085f | 2018-12-03 12:08:59 -0700 | [diff] [blame] | 214 | #if BC_ENABLED |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 215 | BcStatus bc_vm_posixError(BcError e, size_t line, ...); |
Gavin Howard | f8f232b | 2018-10-11 17:29:47 -0600 | [diff] [blame] | 216 | #endif // BC_ENABLED |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 217 | |
Gavin Howard | a84ad99 | 2018-12-03 19:11:06 -0700 | [diff] [blame] | 218 | void bc_vm_info(const char* const help); |
Gavin Howard | 64f1e82 | 2019-05-21 08:40:19 -0600 | [diff] [blame] | 219 | BcStatus bc_vm_boot(int argc, char *argv[], const char *env_len, |
| 220 | const char* const env_args); |
Gavin Howard | 0bc5dcf | 2019-05-21 21:44:21 -0600 | [diff] [blame] | 221 | void bc_vm_shutdown(void); |
Gavin Howard | a84ad99 | 2018-12-03 19:11:06 -0700 | [diff] [blame] | 222 | |
Gavin Howard | f7699f2 | 2019-01-02 13:02:48 -0700 | [diff] [blame] | 223 | size_t bc_vm_printf(const char *fmt, ...); |
Gavin Howard | 48af52e | 2018-10-30 14:47:38 -0600 | [diff] [blame] | 224 | void bc_vm_puts(const char *str, FILE *restrict f); |
| 225 | void bc_vm_putchar(int c); |
| 226 | void bc_vm_fflush(FILE *restrict f); |
| 227 | |
Gavin Howard | 5bede41 | 2019-02-23 09:31:28 -0700 | [diff] [blame] | 228 | size_t bc_vm_arraySize(size_t n, size_t size); |
Gavin Howard | 007afdf | 2019-02-23 09:45:42 -0700 | [diff] [blame] | 229 | size_t bc_vm_growSize(size_t a, size_t b); |
Gavin Howard | ad0ecfe | 2018-10-30 01:16:01 -0600 | [diff] [blame] | 230 | void* bc_vm_malloc(size_t n); |
| 231 | void* bc_vm_realloc(void *ptr, size_t n); |
| 232 | char* bc_vm_strdup(const char *str); |
| 233 | |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 234 | BcStatus bc_vm_error(BcError e, size_t line, ...); |
Gavin Howard | 0f31f5b | 2018-12-03 11:15:46 -0700 | [diff] [blame] | 235 | |
Gavin Howard | 40a085f | 2018-12-03 12:08:59 -0700 | [diff] [blame] | 236 | #if BC_ENABLED |
Gavin Howard | 9fbeaa8 | 2018-12-27 18:13:28 -0700 | [diff] [blame] | 237 | extern const char bc_lib[]; |
| 238 | extern const char *bc_lib_name; |
| 239 | #if BC_ENABLE_EXTRA_MATH |
| 240 | extern const char bc_lib2[]; |
| 241 | extern const char *bc_lib2_name; |
| 242 | #endif // BC_ENABLE_EXTRA_MATH |
Gavin Howard | a95501a | 2018-10-03 16:13:34 -0600 | [diff] [blame] | 243 | #endif // BC_ENABLED |
Gavin Howard | 4ffe5a9 | 2018-09-26 20:58:31 -0600 | [diff] [blame] | 244 | |
Gavin Howard | a95501a | 2018-10-03 16:13:34 -0600 | [diff] [blame] | 245 | extern const char bc_copyright[]; |
Gavin Howard | 7536dcf | 2018-12-15 19:27:09 -0700 | [diff] [blame] | 246 | extern const char* const bc_err_line; |
Gavin Howard | 2425bf2 | 2019-04-08 17:05:45 -0600 | [diff] [blame] | 247 | extern const char* const bc_err_func_header; |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 248 | extern const char *bc_errs[]; |
Gavin Howard | 5f349d4 | 2019-04-09 14:14:00 -0600 | [diff] [blame] | 249 | extern const uchar bc_err_ids[]; |
Gavin Howard | 1cbfe24 | 2019-01-09 17:13:11 -0700 | [diff] [blame] | 250 | extern const char* const bc_err_msgs[]; |
Gavin Howard | f89006a | 2018-10-29 13:01:51 -0600 | [diff] [blame] | 251 | |
Gavin Howard | 70e3d60 | 2018-12-11 11:00:49 -0700 | [diff] [blame] | 252 | extern BcVm *vm; |
Gavin Howard | d555167 | 2018-09-22 19:52:42 -0600 | [diff] [blame] | 253 | |
| 254 | #endif // BC_VM_H |