builtins.h (9491B)
1 /* -*-comment-start: "//";comment-end:""-*- 2 * GNU Mes --- Maxwell Equations of Software 3 * Copyright © 2016,2017,2018,2019,2020,2022,2023 Janneke Nieuwenhuizen <janneke@gnu.org> 4 * Copyright © 2022,2023 Timothy Sample <samplet@ngyro.com> 5 * 6 * This file is part of GNU Mes. 7 * 8 * GNU Mes is free software; you can redistribute it and/or modify it 9 * under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 3 of the License, or (at 11 * your option) any later version. 12 * 13 * GNU Mes is distributed in the hope that it will be useful, but 14 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 #ifndef __MES_BUILTINS_H 23 #define __MES_BUILTINS_H 24 25 /* src/builtins.c */ 26 struct scm *make_builtin (struct scm *builtin_type, struct scm *name, struct scm *arity, struct scm *function); 27 struct scm *builtin_name (struct scm *builtin); 28 struct scm *builtin_arity (struct scm *builtin); 29 struct scm *builtin_p (struct scm *x); 30 struct scm *builtin_printer (struct scm *builtin); 31 /* src/core.c */ 32 struct scm *car (struct scm *x); 33 struct scm *cdr (struct scm *x); 34 struct scm *list (struct scm *x); 35 struct scm *null_p (struct scm *x); 36 struct scm *eq_p (struct scm *x, struct scm *y); 37 struct scm *values (struct scm *x); 38 struct scm *acons (struct scm *key, struct scm *value, struct scm *alist); 39 struct scm *length (struct scm *x); 40 struct scm *error (struct scm *key, struct scm *x); 41 struct scm *append2 (struct scm *x, struct scm *y); 42 struct scm *append_reverse (struct scm *x, struct scm *y); 43 struct scm *reverse_x_ (struct scm *x, struct scm *t); 44 struct scm *assq (struct scm *x, struct scm *a); 45 struct scm *assoc (struct scm *x, struct scm *a); 46 /* src/display.c */ 47 struct scm *display_ (struct scm *x); 48 struct scm *display_error_ (struct scm *x); 49 struct scm *display_port_ (struct scm *x, struct scm *p); 50 struct scm *write_ (struct scm *x); 51 struct scm *write_error_ (struct scm *x); 52 struct scm *write_port_ (struct scm *x, struct scm *p); 53 /* src/eval-apply.c */ 54 struct scm *pairlis (struct scm *x, struct scm *y, struct scm *a); 55 struct scm *set_car_x (struct scm *x, struct scm *e); 56 struct scm *set_cdr_x (struct scm *x, struct scm *e); 57 struct scm *add_formals (struct scm *formals, struct scm *x); 58 struct scm *eval_apply (); 59 struct scm *primitive_load (struct scm *filename); 60 struct scm *make_binding (struct scm *name, struct scm *variable); 61 /* src/gc.c */ 62 struct scm *gc_stats (); 63 struct scm *cons (struct scm *x, struct scm *y); 64 struct scm *gc_check (); 65 struct scm *gc (); 66 /* src/hash.c */ 67 struct scm *hashq (struct scm *x, struct scm *size); 68 struct scm *hash (struct scm *x, struct scm *size); 69 struct scm *hashq_get_handle (struct scm *table, struct scm *key); 70 struct scm *hashq_ref_ (struct scm *table, struct scm *key, struct scm *dflt); 71 struct scm *hash_ref_ (struct scm *table, struct scm *key, struct scm *dflt); 72 struct scm *hashq_create_handle_x (struct scm *table, struct scm *key, struct scm *init); 73 struct scm *hash_create_handle_x (struct scm *table, struct scm *key, struct scm *init); 74 struct scm *hashq_set_x (struct scm *table, struct scm *key, struct scm *value); 75 struct scm *hash_set_x (struct scm *table, struct scm *key, struct scm *value); 76 struct scm *hash_remove_x (struct scm *table, struct scm *key); 77 struct scm *hash_table_printer (struct scm *table); 78 struct scm *make_hash_table (struct scm *x); 79 struct scm *hash_buckets (struct scm *table); 80 struct scm *hash_table_p (struct scm *x); 81 struct scm *hash_clear_x (struct scm *table); 82 /* src/lib.c */ 83 struct scm *type_ (struct scm *x); 84 struct scm *car_ (struct scm *x); 85 struct scm *cdr_ (struct scm *x); 86 struct scm *xassq (struct scm *x, struct scm *a); 87 struct scm *memq (struct scm *x, struct scm *a); 88 struct scm *equal2_p (struct scm *a, struct scm *b); 89 struct scm *last_pair (struct scm *x); 90 struct scm *pair_p (struct scm *x); 91 struct scm *char_to_integer (struct scm *x); 92 struct scm *integer_to_char (struct scm *x); 93 struct scm *make_bytevector (struct scm *args); 94 struct scm *bytevector_u8_ref (struct scm *bv, struct scm *k); 95 struct scm *bytevector_u8_set_x (struct scm *bv, struct scm *k, struct scm *value); 96 /* src/math.c */ 97 struct scm *greater_p (struct scm *x); 98 struct scm *less_p (struct scm *x); 99 struct scm *is_p (struct scm *x); 100 struct scm *minus (struct scm *x); 101 struct scm *plus (struct scm *x); 102 struct scm *divide (struct scm *x); 103 struct scm *modulo (struct scm *a, struct scm *b); 104 struct scm *multiply (struct scm *x); 105 struct scm *logand (struct scm *x); 106 struct scm *logior (struct scm *x); 107 struct scm *lognot (struct scm *x); 108 struct scm *logxor (struct scm *x); 109 struct scm *ash (struct scm *n, struct scm *count); 110 /* src/module.c */ 111 struct scm *initial_module (); 112 struct scm *current_module (); 113 struct scm *set_current_module (struct scm *module); 114 /* src/posix.c */ 115 struct scm *abort_ (); 116 struct scm *exit_ (struct scm *x); 117 struct scm *peek_byte (); 118 struct scm *read_byte (); 119 struct scm *unread_byte (struct scm *i); 120 struct scm *peek_char (); 121 struct scm *read_char (struct scm *port); 122 struct scm *unread_char (struct scm *i); 123 struct scm *write_char (struct scm *i); 124 struct scm *write_byte (struct scm *x); 125 struct scm *getenv_ (struct scm *s); 126 struct scm *setenv_ (struct scm *s, struct scm *v); 127 struct scm *access_p (struct scm *file_name, struct scm *mode); 128 struct scm *current_input_port (); 129 struct scm *open_ (struct scm *file_name, struct scm *flags); 130 struct scm *open_input_file (struct scm *file_name); 131 struct scm *open_input_string (struct scm *string); 132 struct scm *set_current_input_port (struct scm *port); 133 struct scm *current_output_port (); 134 struct scm *current_error_port (); 135 struct scm *open_output_file (struct scm *x); 136 struct scm *set_current_output_port (struct scm *port); 137 struct scm *set_current_error_port (struct scm *port); 138 struct scm *chmod_ (struct scm *file_name, struct scm *mode); 139 struct scm *isatty_p (struct scm *port); 140 struct scm *primitive_fork (); 141 struct scm *primitive_exit (struct scm *status); 142 struct scm *execl_ (struct scm *file_name, struct scm *args); 143 struct scm *execle_ (struct scm *file_name, struct scm *args, struct scm *env); 144 struct scm *waitpid_ (struct scm *pid, struct scm *options); 145 struct scm *current_time (); 146 struct scm *gettimeofday_ (); 147 struct scm *get_internal_run_time (); 148 struct scm *getcwd_ (); 149 struct scm *dup_ (struct scm *port); 150 struct scm *dup2_ (struct scm *old, struct scm *new); 151 struct scm *delete_file (struct scm *file_name); 152 struct scm *uname_ (); 153 /* src/reader.c */ 154 struct scm *read_input_file_env_ (struct scm *e, struct scm *a); 155 struct scm *read_input_file_env (struct scm *a); 156 struct scm *read_env (struct scm *a); 157 struct scm *reader_read_sexp (struct scm *c, struct scm *s, struct scm *a); 158 struct scm *reader_read_character (); 159 struct scm *reader_read_binary (); 160 struct scm *reader_read_octal (); 161 struct scm *reader_read_hex (); 162 struct scm *reader_read_string (); 163 /* src/stack.c */ 164 struct scm *frame_printer (struct scm *frame); 165 struct scm *make_stack (struct scm *stack); 166 struct scm *stack_length (struct scm *stack); 167 struct scm *stack_ref (struct scm *stack, struct scm *index); 168 /* src/string.c */ 169 struct scm *string_equal_p (struct scm *a, struct scm *b); 170 struct scm *symbol_to_string (struct scm *symbol); 171 struct scm *symbol_to_keyword (struct scm *symbol); 172 struct scm *keyword_to_string (struct scm *keyword); 173 struct scm *string_to_symbol (struct scm *string); 174 struct scm *make_symbol (struct scm *string); 175 struct scm *string_to_list (struct scm *string); 176 struct scm *list_to_string (struct scm *list); 177 struct scm *read_string (struct scm *port); 178 struct scm *string_append (struct scm *x); 179 struct scm *string_length (struct scm *string); 180 struct scm *string_ref (struct scm *str, struct scm *k); 181 struct scm *string_set_x (struct scm *str, struct scm *k, struct scm *c); 182 /* src/struct.c */ 183 struct scm *make_struct (struct scm *type, struct scm *fields, struct scm *printer); 184 struct scm *struct_length (struct scm *x); 185 struct scm *struct_ref (struct scm *x, struct scm *i); 186 struct scm *struct_set_x (struct scm *x, struct scm *i, struct scm *e); 187 /* src/variable.c */ 188 struct scm *make_variable (struct scm *var); 189 struct scm *variable_p (struct scm *x); 190 struct scm *variable_ref (struct scm *var); 191 struct scm *variable_set_x (struct scm *var, struct scm *value); 192 struct scm *variable_printer (struct scm *var); 193 /* src/vector.c */ 194 struct scm *make_vector (struct scm *x); 195 struct scm *vector_length (struct scm *x); 196 struct scm *vector_ref (struct scm *x, struct scm *i); 197 struct scm *vector_entry (struct scm *x); 198 struct scm *vector_set_x (struct scm *x, struct scm *i, struct scm *e); 199 struct scm *list_to_vector (struct scm *x); 200 struct scm *vector_to_list (struct scm *v); 201 202 /* This is a conditional compilation hack for M2-Planet in bootstrap 203 mode. The following file will not be included in the M2-Planet build 204 of Mes, as M2-Planet will ignore the preprocessor directive. Other 205 builds of Mes will include it. The code in the file relies on system 206 interfaces supported by MesCC but not M2-Planet. Note that we use 207 the full include path here, as otherwise NYACC can't find it when 208 this file is included from elsewhere (possibly a bug). */ 209 #include "mes/mescc-builtins.h" 210 211 #endif /* __MES_BUILTINS_H */