Unified · Split
| @@ -4,7 +4,7 @@ · 3 unmodified lines | |||
| 4 | *.bak | 4 | *.bak |
| 5 | instructions.sl | 5 | instructions.sl |
| 6 | builtins.sl | 6 | builtins.sl |
| 7 | docs_ops.sl | 7 | src/docs/ops.sl |
| 8 | builtin_fns.h | 8 | builtin_fns.h |
| 9 | *.core | 9 | *.core |
| 10 | sl.boot.s | 10 | sl.boot.s |
| @@ -21,7 +21,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE · 20 unmodified lines | |||
| 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #include "slpriv.h" | 24 | #include "inc/priv.h" |
| 25 | 25 | ||
| 26 | // straight from musl | 26 | // straight from musl |
| 27 | int | 27 | int |
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "platform.h" | 1 | #include "platform.h" |
| 2 | #include "mp.h" | 2 | #include "mp.h" |
| 3 | #include "nan.h" | 3 | #include "inc/nan.h" |
| 4 | 4 | ||
| 5 | double | 5 | double |
| 6 | mptod(mpint *a) | 6 | mptod(mpint *a) |
| @@ -16,7 +16,7 @@ · 15 unmodified lines | |||
| 16 | * https://github.com/termux/termux-packages/tree/master/packages/libandroid-support | 16 | * https://github.com/termux/termux-packages/tree/master/packages/libandroid-support |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include "slpriv.h" | 19 | #include "inc/priv.h" |
| 20 | 20 | ||
| 21 | struct width_interval { | 21 | struct width_interval { |
| 22 | int start; | 22 | int start; |
| @@ -1154,4 +1154,4 @@ vec->list #fn("A17080z2:" #(list) 6) vinfo · 1153 unmodified lines | |||
| 1154 | #6# vinfo:sym #.car void | 1154 | #6# vinfo:sym #.car void |
| 1155 | #3# void? #fn("A180DIQ:" 6) zero? | 1155 | #3# void? #fn("A180DIQ:" 6) zero? |
| 1156 | #fn("A180El2:" 6) zip #fn("r0707180z3:" #(map list) 7) zip-with | 1156 | #fn("A180El2:" 6) zip #fn("r0707180z3:" #(map list) 7) zip-with |
| 1157 | #fn("r1708081z3:" #(map) 7)) | 1157 | #fn("r1708081z3:" #(map) 7)) |
| @@ -11,12 +11,34 @@ CFLAGS=$CFLAGS -p -Isrc -I3rd -I3rd/brieflz -I3rd/pcg-c -Isrc/plan9 \ · 10 unmodified lines | |||
| 11 | CLEANFILES=src/plan9/sl.boot.s src/plan9/builtin_fns.h | 11 | CLEANFILES=src/plan9/sl.boot.s src/plan9/builtin_fns.h |
| 12 | 12 | ||
| 13 | HFILES=\ | 13 | HFILES=\ |
| 14 | src/equal.h\ | 14 | src/inc/arith.h\ |
| 15 | src/sl.h\ | 15 | src/inc/bitvector.h\ |
| 16 | src/slpriv.h\ | 16 | src/inc/cc.h\ |
| 17 | src/opcodes.h\ | 17 | src/inc/cvalues.h\ |
| 18 | src/plan9/platform.h\ | 18 | src/inc/equal.h\ |
| 19 | src/inc/hashing.h\ | ||
| 20 | src/inc/htable.h\ | ||
| 21 | src/inc/htable_c.h\ | ||
| 22 | src/inc/htable_h.h\ | ||
| 23 | src/inc/ieee754.h\ | ||
| 24 | src/inc/io.h\ | ||
| 25 | src/inc/ios.h\ | ||
| 26 | src/inc/mem.h\ | ||
| 27 | src/inc/nan.h\ | ||
| 28 | src/inc/opcodes.h\ | ||
| 29 | src/inc/operators.h\ | ||
| 30 | src/inc/overflow.h\ | ||
| 31 | src/inc/print.h\ | ||
| 32 | src/inc/priv.h\ | ||
| 33 | src/inc/process.h\ | ||
| 34 | src/inc/read.h\ | ||
| 35 | src/inc/sl.h\ | ||
| 36 | src/inc/str.h\ | ||
| 37 | src/inc/table.h\ | ||
| 38 | src/inc/time.h\ | ||
| 39 | src/inc/types.h\ | ||
| 19 | src/plan9/lsd.h\ | 40 | src/plan9/lsd.h\ |
| 41 | src/plan9/platform.h\ | ||
| 20 | 42 | ||
| 21 | OFILES=\ | 43 | OFILES=\ |
| 22 | 3rd/brieflz/brieflz.$O\ | 44 | 3rd/brieflz/brieflz.$O\ |
| @@ -77,10 +99,6 @@ src/plan9/builtin_fns.h:D: · 54 unmodified lines | |||
| 77 | {attr=""}' \ | 99 | {attr=""}' \ |
| 78 | `{ls $CFILES >[2]/dev/null} | sort >$target | 100 | `{ls $CFILES >[2]/dev/null} | sort >$target |
| 79 | 101 | ||
| 80 | src/cvalues.$O: src/sl_arith_any.h | ||
| 81 | src/equal.$O: src/htable_c.h | ||
| 82 | src/ptrhash.$O: src/htable_c.h | ||
| 83 | |||
| 84 | OFILES_lzpack=\ | 102 | OFILES_lzpack=\ |
| 85 | 3rd/brieflz/brieflz_lzpack.$O\ | 103 | 3rd/brieflz/brieflz_lzpack.$O\ |
| 86 | 3rd/brieflz/depacks_lzpack.$O\ | 104 | 3rd/brieflz/depacks_lzpack.$O\ |
| @@ -1,4 +1,4 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | 2 | ||
| 3 | void | 3 | void |
| 4 | bcc_init(void) | 4 | bcc_init(void) |
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "print.h" | 3 | #include "inc/print.h" |
| 4 | #include "types.h" | 4 | #include "inc/types.h" |
| 5 | #include "libtcc.h" | 5 | #include "libtcc.h" |
| 6 | 6 | ||
| 7 | static sl_v ccsym, vtbtypesym[VT_BTYPE+1]; | 7 | static sl_v ccsym, vtbtypesym[VT_BTYPE+1]; |
| @@ -1,5 +1,5 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "bitvector.h" | 2 | #include "inc/bitvector.h" |
| 3 | 3 | ||
| 4 | u32int * | 4 | u32int * |
| 5 | bitvector_resize(u32int *b, u64int oldsz, u64int newsz) | 5 | bitvector_resize(u32int *b, u64int oldsz, u64int newsz) |
| @@ -1,13 +1,13 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "sl_io.h" | 2 | #include "inc/io.h" |
| 3 | #include "str.h" | 3 | #include "inc/str.h" |
| 4 | #include "inc/operators.h" | ||
| 5 | #include "inc/cvalues.h" | ||
| 6 | #include "inc/time.h" | ||
| 7 | #include "inc/table.h" | ||
| 8 | #include "inc/nan.h" | ||
| 9 | #include "inc/ieee754.h" | ||
| 4 | #include "tbl.h" | 10 | #include "tbl.h" |
| 5 | #include "operators.h" | ||
| 6 | #include "cvalues.h" | ||
| 7 | #include "timefuncs.h" | ||
| 8 | #include "table.h" | ||
| 9 | #include "nan.h" | ||
| 10 | #include "ieee754.h" | ||
| 11 | 11 | ||
| 12 | usize | 12 | usize |
| 13 | llength(sl_v v) | 13 | llength(sl_v v) |
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "types.h" | 3 | #include "inc/types.h" |
| 4 | #include "brieflz.h" | 4 | #include "brieflz.h" |
| 5 | 5 | ||
| 6 | static sl_v sl_sizesym, sl_tosym; | 6 | static sl_v sl_sizesym, sl_tosym; |
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "operators.h" | 2 | #include "inc/operators.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "types.h" | 4 | #include "inc/types.h" |
| 5 | #include "sl_io.h" | 5 | #include "inc/io.h" |
| 6 | #include "equal.h" | 6 | #include "inc/equal.h" |
| 7 | 7 | ||
| 8 | enum { | 8 | enum { |
| 9 | MAX_INL_SIZE = 384, | 9 | MAX_INL_SIZE = 384, |
| @@ -1064,7 +1064,7 @@ return_from_s64(s64int Saccum) · 1054 unmodified lines | |||
| 1064 | sl_v | 1064 | sl_v |
| 1065 | sl_add_any(sl_v *args, u32int nargs) | 1065 | sl_add_any(sl_v *args, u32int nargs) |
| 1066 | { | 1066 | { |
| 1067 | #include "sl_arith_any.h" | 1067 | #include "inc/arith.h" |
| 1068 | } | 1068 | } |
| 1069 | 1069 | ||
| 1070 | #define ACCUM_DEFAULT 1 | 1070 | #define ACCUM_DEFAULT 1 |
| @@ -1075,7 +1075,7 @@ sl_add_any(sl_v *args, u32int nargs) · 4 unmodified lines | |||
| 1075 | sl_v | 1075 | sl_v |
| 1076 | sl_mul_any(sl_v *args, u32int nargs) | 1076 | sl_mul_any(sl_v *args, u32int nargs) |
| 1077 | { | 1077 | { |
| 1078 | #include "sl_arith_any.h" | 1078 | #include "inc/arith.h" |
| 1079 | } | 1079 | } |
| 1080 | 1080 | ||
| 1081 | sl_v | 1081 | sl_v |
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -52,21 +52,21 @@ · 51 unmodified lines | |||
| 52 | (doc-group doc | 52 | (doc-group doc |
| 53 | «Writing and reading documentation.») | 53 | «Writing and reading documentation.») |
| 54 | 54 | ||
| 55 | (load "../src/docs_array.sl") | 55 | (load "../src/docs/array.sl") |
| 56 | (load "../src/docs_compress.sl") | 56 | (load "../src/docs/compress.sl") |
| 57 | (load "../src/docs_debug.sl") | 57 | (load "../src/docs/debug.sl") |
| 58 | (load "../src/docs_io.sl") | 58 | (load "../src/docs/io.sl") |
| 59 | (load "../src/docs_list.sl") | 59 | (load "../src/docs/list.sl") |
| 60 | (load "../src/docs_misc.sl") | 60 | (load "../src/docs/misc.sl") |
| 61 | (load "../src/docs_number.sl") | 61 | (load "../src/docs/number.sl") |
| 62 | (load "../src/docs_ops.sl") | 62 | (load "../src/docs/ops.sl") |
| 63 | (load "../src/docs_process.sl") | 63 | (load "../src/docs/process.sl") |
| 64 | (load "../src/docs_random.sl") | 64 | (load "../src/docs/random.sl") |
| 65 | (load "../src/docs_seq.sl") | 65 | (load "../src/docs/seq.sl") |
| 66 | (load "../src/docs_string.sl") | 66 | (load "../src/docs/string.sl") |
| 67 | (load "../src/docs_struct.sl") | 67 | (load "../src/docs/struct.sl") |
| 68 | (load "../src/docs_sys.sl") | 68 | (load "../src/docs/sys.sl") |
| 69 | (load "../src/docs_table.sl") | 69 | (load "../src/docs/table.sl") |
| 70 | (load "../src/docs_time.sl") | 70 | (load "../src/docs/time.sl") |
| 71 | (load "../src/docs_type.sl") | 71 | (load "../src/docs/type.sl") |
| 72 | (load "../src/docs_vm.sl") | 72 | (load "../src/docs/vm.sl") |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -45,7 +45,7 @@ void sys_seed(void *p, int sz); · 44 unmodified lines | |||
| 45 | #define sl_segfree(s, sz) MEM_FREE(s) | 45 | #define sl_segfree(s, sz) MEM_FREE(s) |
| 46 | #define sl_segused(s, sz, used) do{}while(0) | 46 | #define sl_segused(s, sz, used) do{}while(0) |
| 47 | 47 | ||
| 48 | #include "cc.h" | 48 | #include "inc/cc.h" |
| 49 | #include "mem.h" | 49 | #include "inc/mem.h" |
| 50 | #include "mp.h" | 50 | #include "mp.h" |
| 51 | #include "utf.h" | 51 | #include "utf.h" |
| @@ -1,8 +1,8 @@ | |||
| 1 | #include "slpriv.h" | ||
| 2 | #include "timefuncs.h" | ||
| 3 | #include <fcntl.h> | 1 | #include <fcntl.h> |
| 4 | #include <time.h> | 2 | #include <time.h> |
| 5 | #include <locale.h> | 3 | #include <locale.h> |
| 4 | #include "inc/priv.h" | ||
| 5 | #include "inc/time.h" | ||
| 6 | 6 | ||
| 7 | u64int | 7 | u64int |
| 8 | sec_realtime(void) | 8 | sec_realtime(void) |
| @@ -1,8 +1,8 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "operators.h" | 2 | #include "inc/operators.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "equal.h" | 4 | #include "inc/equal.h" |
| 5 | #include "hashing.h" | 5 | #include "inc/hashing.h" |
| 6 | 6 | ||
| 7 | enum { | 7 | enum { |
| 8 | BOUNDED_COMPARE_BOUND = 128, | 8 | BOUNDED_COMPARE_BOUND = 128, |
| @@ -410,4 +410,4 @@ hash_lispvalue(sl_v a) · 401 unmodified lines | |||
| 410 | #define HFUNC(v) hash_lispvalue((sl_v)(v)) | 410 | #define HFUNC(v) hash_lispvalue((sl_v)(v)) |
| 411 | #define EQFUNC(x, y) equal_lispvalue((sl_v)(x), (sl_v)(y)) | 411 | #define EQFUNC(x, y) equal_lispvalue((sl_v)(x), (sl_v)(y)) |
| 412 | 412 | ||
| 413 | #include "htable_c.h" | 413 | #include "inc/htable_c.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "hashing.h" | 2 | #include "inc/hashing.h" |
| 3 | #if defined(USE_XXHASH) | 3 | #if defined(USE_XXHASH) |
| 4 | #include <xxhash.h> | 4 | #include <xxhash.h> |
| 5 | #else | 5 | #else |
| @@ -1,10 +1,6 @@ | |||
| 1 | /* | 1 | #include "inc/priv.h" |
| 2 | functions common to all hash table instantiations | 2 | #include "inc/htable.h" |
| 3 | */ | 3 | #include "inc/hashing.h" |
| 4 | |||
| 5 | #include "slpriv.h" | ||
| 6 | #include "htable.h" | ||
| 7 | #include "hashing.h" | ||
| 8 | 4 | ||
| 9 | sl_htable * | 5 | sl_htable * |
| 10 | htable_new(sl_htable *h, usize numpairs) | 6 | htable_new(sl_htable *h, usize numpairs) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1,8 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #include "sl.h" | 3 | #include "inc/sl.h" |
| 4 | #include "ios.h" | 4 | #include "inc/ios.h" |
| 5 | #include "htable_h.h" | 5 | #include "inc/htable_h.h" |
| 6 | HTPROT(ptrhash) | 6 | HTPROT(ptrhash) |
| 7 | 7 | ||
| 8 | // all allocations on the heap are 8-byte aligned | 8 | // all allocations on the heap are 8-byte aligned |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "types.h" | 3 | #include "inc/types.h" |
| 4 | #include "print.h" | 4 | #include "inc/print.h" |
| 5 | #include "read.h" | 5 | #include "inc/read.h" |
| 6 | #include "sl_io.h" | 6 | #include "inc/io.h" |
| 7 | 7 | ||
| 8 | static sl_v iosym, rdsym, wrsym, apsym, crsym, truncsym; | 8 | static sl_v iosym, rdsym, wrsym, apsym, crsym, truncsym; |
| 9 | static sl_v linesym, blocksym, memorysym; | 9 | static sl_v linesym, blocksym, memorysym; |
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "str.h" | 2 | #include "inc/str.h" |
| 3 | #include "timefuncs.h" | 3 | #include "inc/time.h" |
| 4 | 4 | ||
| 5 | #define MOST_OF(x) ((x) - ((x)>>4)) | 5 | #define MOST_OF(x) ((x) - ((x)>>4)) |
| 6 | 6 | ||
| @@ -43,8 +43,8 @@ void sys_seed(void *p, int sz); · 42 unmodified lines | |||
| 43 | #define HEAP_SIZE0 128*1024 | 43 | #define HEAP_SIZE0 128*1024 |
| 44 | #define STACK_SIZE0 8*1024 | 44 | #define STACK_SIZE0 8*1024 |
| 45 | 45 | ||
| 46 | #include "cc.h" | 46 | #include "inc/cc.h" |
| 47 | #include "mem_dlmalloc.h" | 47 | #include "inc/mem_dlmalloc.h" |
| 48 | #include "mem.h" | 48 | #include "inc/mem.h" |
| 49 | #include "mp.h" | 49 | #include "mp.h" |
| 50 | #include "utf.h" | 50 | #include "utf.h" |
| @@ -1,9 +1,9 @@ | |||
| 1 | #include <OSUtils.h> | ||
| 2 | #include "slpriv.h" | ||
| 3 | #include "timefuncs.h" | ||
| 4 | #include <fcntl.h> | 1 | #include <fcntl.h> |
| 5 | #include <sys/time.h> | 2 | #include <sys/time.h> |
| 6 | #include <time.h> | 3 | #include <time.h> |
| 4 | #include <OSUtils.h> | ||
| 5 | #include "inc/priv.h" | ||
| 6 | #include "inc/time.h" | ||
| 7 | 7 | ||
| 8 | u64int | 8 | u64int |
| 9 | sec_realtime(void) | 9 | sec_realtime(void) |
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "platform.h" | 1 | #include "platform.h" |
| 2 | #include "nan.h" | 2 | #include "inc/nan.h" |
| 3 | #include "ieee754.h" | 3 | #include "inc/ieee754.h" |
| 4 | 4 | ||
| 5 | double D_NNAN, D_NINF; | 5 | double D_NNAN, D_NINF; |
| 6 | #if defined(__TINYC__) || defined(__plan9__) | 6 | #if defined(__TINYC__) || defined(__plan9__) |
| @@ -1,4 +1,4 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | 2 | ||
| 3 | const sl_builtin builtins[N_OPCODES] = { | 3 | const sl_builtin builtins[N_OPCODES] = { |
| 4 | [OP_BUILTINP] = {"builtin?", 1}, | 4 | [OP_BUILTINP] = {"builtin?", 1}, |
| @@ -1,5 +1,5 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "operators.h" | 2 | #include "inc/operators.h" |
| 3 | 3 | ||
| 4 | mpint * | 4 | mpint * |
| 5 | conv_to_bignum(sl_v v, const void *data, sl_numtype tag) | 5 | conv_to_bignum(sl_v v, const void *data, sl_numtype tag) |
| @@ -1,11 +1,11 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include <draw.h> | 2 | #include <draw.h> |
| 3 | #include <bio.h> | 3 | #include <bio.h> |
| 4 | #include <ctype.h> | 4 | #include <ctype.h> |
| 5 | #include <mach.h> | 5 | #include <mach.h> |
| 6 | #include "cvalues.h" | 6 | #include "inc/cvalues.h" |
| 7 | #include "types.h" | 7 | #include "inc/types.h" |
| 8 | #include "sl_io.h" | 8 | #include "inc/io.h" |
| 9 | 9 | ||
| 10 | static char aout[1024]; | 10 | static char aout[1024]; |
| 11 | static sl_v gpregsym, fpregsym, mkregsym, mksymbolsym, mkframesym; | 11 | static sl_v gpregsym, fpregsym, mkregsym, mksymbolsym, mkframesym; |
| @@ -139,5 +139,5 @@ int ftruncate(int f, soffset sz); · 138 unmodified lines | |||
| 139 | #define sl_enum_flags | 139 | #define sl_enum_flags |
| 140 | #define sl_offsetof(x, y) offsetof(x, y) | 140 | #define sl_offsetof(x, y) offsetof(x, y) |
| 141 | 141 | ||
| 142 | #include "mem.h" | 142 | #include "inc/mem.h" |
| 143 | #include "overflow.h" | 143 | #include "inc/overflow.h" |
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "lsd.h" | ||
| 3 | #include "nan.h" | ||
| 4 | #include "sl_process.h" | ||
| 5 | #include "timefuncs.h" | ||
| 6 | #include <tos.h> | 2 | #include <tos.h> |
| 3 | #include "inc/nan.h" | ||
| 4 | #include "inc/process.h" | ||
| 5 | #include "inc/time.h" | ||
| 6 | #include "lsd.h" | ||
| 7 | 7 | ||
| 8 | u64int | 8 | u64int |
| 9 | sec_realtime(void) | 9 | sec_realtime(void) |
| @@ -84,7 +84,7 @@ void sys_seed(void *p, int sz); · 83 unmodified lines | |||
| 84 | #endif | 84 | #endif |
| 85 | #endif | 85 | #endif |
| 86 | 86 | ||
| 87 | #include "cc.h" | 87 | #include "inc/cc.h" |
| 88 | #include "mem.h" | 88 | #include "inc/mem.h" |
| 89 | #include "mp.h" | 89 | #include "mp.h" |
| 90 | #include "utf.h" | 90 | #include "utf.h" |
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "sl_process.h" | 2 | #include "inc/process.h" |
| 3 | #include "timefuncs.h" | 3 | #include "inc/time.h" |
| 4 | #include <errno.h> | 4 | #include <errno.h> |
| 5 | #include <fcntl.h> | 5 | #include <fcntl.h> |
| 6 | #include <locale.h> | 6 | #include <locale.h> |
| @@ -1,11 +1,11 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "str.h" | 2 | #include "inc/str.h" |
| 3 | #include "bitvector.h" | 3 | #include "inc/bitvector.h" |
| 4 | #include "operators.h" | 4 | #include "inc/operators.h" |
| 5 | #include "cvalues.h" | 5 | #include "inc/cvalues.h" |
| 6 | #include "ieee754.h" | 6 | #include "inc/ieee754.h" |
| 7 | #include "print.h" | 7 | #include "inc/print.h" |
| 8 | #include "read.h" | 8 | #include "inc/read.h" |
| 9 | 9 | ||
| 10 | enum { | 10 | enum { |
| 11 | SMALL_STR_LEN = 24, | 11 | SMALL_STR_LEN = 24, |
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "print.h" | 3 | #include "inc/print.h" |
| 4 | #include "sl_io.h" | 4 | #include "inc/io.h" |
| 5 | #include "sl_process.h" | 5 | #include "inc/process.h" |
| 6 | #include "types.h" | 6 | #include "inc/types.h" |
| 7 | 7 | ||
| 8 | static const sl_type *processtype; | 8 | static const sl_type *processtype; |
| 9 | static sl_v runningsym, exitedsym, streamsym; | 9 | static sl_v runningsym, exitedsym, streamsym; |
| @@ -1,10 +1,11 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "sl_process.h" | 2 | #include "inc/process.h" |
| 3 | 3 | ||
| 4 | int | 4 | int |
| 5 | sys_pipe(int fd[2], bool rd, bool wr) | 5 | sys_pipe(int fd[2], bool rd, bool wr) |
| 6 | { | 6 | { |
| 7 | USED(fd); USED(rd); USED(wr); | 7 | USED(rd); USED(wr); |
| 8 | fd[0] = fd[1] = -1; | ||
| 8 | return -1; | 9 | return -1; |
| 9 | } | 10 | } |
| 10 | 11 | ||
| @@ -1,9 +1,4 @@ | |||
| 1 | /* | 1 | #include "inc/priv.h" |
| 2 | pointer hash table | ||
| 3 | optimized for storing info about particular values | ||
| 4 | */ | ||
| 5 | |||
| 6 | #include "slpriv.h" | ||
| 7 | 2 | ||
| 8 | static inline sl_v | 3 | static inline sl_v |
| 9 | ptrhash(sl_v a) | 4 | ptrhash(sl_v a) |
| @@ -15,4 +10,4 @@ ptrhash(sl_v a) · 5 unmodified lines | |||
| 15 | #define HFUNC(v) ptrhash((sl_v)(v)) | 10 | #define HFUNC(v) ptrhash((sl_v)(v)) |
| 16 | #define EQFUNC(x, y) ((x) == (y)) | 11 | #define EQFUNC(x, y) ((x) == (y)) |
| 17 | 12 | ||
| 18 | #include "htable_c.h" | 13 | #include "inc/htable_c.h" |
| @@ -1,8 +1,8 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "equal.h" | 3 | #include "inc/equal.h" |
| 4 | #include "operators.h" | 4 | #include "inc/operators.h" |
| 5 | #include "types.h" | 5 | #include "inc/types.h" |
| 6 | #include "pcg_variants.h" | 6 | #include "pcg_variants.h" |
| 7 | 7 | ||
| 8 | typedef pcg32x2_random_t pcg_t; | 8 | typedef pcg32x2_random_t pcg_t; |
| @@ -1,11 +1,11 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "read.h" | 3 | #include "inc/read.h" |
| 4 | #include "nan.h" | 4 | #include "inc/nan.h" |
| 5 | #include "inc/str.h" | ||
| 6 | #include "inc/table.h" | ||
| 7 | #include "inc/equal.h" | ||
| 5 | #include "tbl.h" | 8 | #include "tbl.h" |
| 6 | #include "str.h" | ||
| 7 | #include "table.h" | ||
| 8 | #include "equal.h" | ||
| 9 | 9 | ||
| 10 | enum { | 10 | enum { |
| 11 | TOK_NONE, TOK_OPEN, TOK_CLOSE, TOK_DOT, TOK_QUOTE, TOK_SYM, TOK_NUM, | 11 | TOK_NONE, TOK_OPEN, TOK_CLOSE, TOK_DOT, TOK_QUOTE, TOK_SYM, TOK_NUM, |
| @@ -1,18 +1,18 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "bitvector.h" | 2 | #include "inc/bitvector.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "equal.h" | 4 | #include "inc/equal.h" |
| 5 | #include "hashing.h" | 5 | #include "inc/hashing.h" |
| 6 | #include "operators.h" | 6 | #include "inc/operators.h" |
| 7 | #include "print.h" | 7 | #include "inc/print.h" |
| 8 | #include "read.h" | 8 | #include "inc/read.h" |
| 9 | #include "sl_io.h" | 9 | #include "inc/io.h" |
| 10 | #include "sl_process.h" | 10 | #include "inc/process.h" |
| 11 | #include "str.h" | 11 | #include "inc/str.h" |
| 12 | #include "table.h" | 12 | #include "inc/table.h" |
| 13 | #include "inc/time.h" | ||
| 14 | #include "inc/types.h" | ||
| 13 | #include "tbl.h" | 15 | #include "tbl.h" |
| 14 | #include "timefuncs.h" | ||
| 15 | #include "types.h" | ||
| 16 | 16 | ||
| 17 | sl_v sl_builtinssym, sl_quote, sl_lambda, sl_comma, sl_commaat; | 17 | sl_v sl_builtinssym, sl_quote, sl_lambda, sl_comma, sl_commaat; |
| 18 | sl_v sl_commadot, sl_trycatch, sl_backquote; | 18 | sl_v sl_commadot, sl_trycatch, sl_backquote; |
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "print.h" | 3 | #include "inc/print.h" |
| 4 | #include "sl_io.h" | 4 | #include "inc/io.h" |
| 5 | #include "inc/nan.h" | ||
| 5 | #include "brieflz.h" | 6 | #include "brieflz.h" |
| 6 | #include "nan.h" | ||
| 7 | 7 | ||
| 8 | #if !defined(ARGBEGIN) | 8 | #if !defined(ARGBEGIN) |
| 9 | /* straight from 9front */ | 9 | /* straight from 9front */ |
| @@ -1,5 +1,5 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | 3 | ||
| 4 | BUILTIN("atan", atan) | 4 | BUILTIN("atan", atan) |
| 5 | { | 5 | { |
| @@ -1,11 +1,11 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "operators.h" | 2 | #include "inc/operators.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "print.h" | 4 | #include "inc/print.h" |
| 5 | #include "read.h" | 5 | #include "inc/read.h" |
| 6 | #include "equal.h" | 6 | #include "inc/equal.h" |
| 7 | #include "sl_io.h" | 7 | #include "inc/io.h" |
| 8 | #include "str.h" | 8 | #include "inc/str.h" |
| 9 | 9 | ||
| 10 | static sl_v basesym; | 10 | static sl_v basesym; |
| 11 | 11 | ||
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "equal.h" | 2 | #include "inc/equal.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "types.h" | 4 | #include "inc/types.h" |
| 5 | #include "print.h" | 5 | #include "inc/print.h" |
| 6 | #include "table.h" | 6 | #include "inc/table.h" |
| 7 | 7 | ||
| 8 | const sl_type *sl_tabletype; | 8 | const sl_type *sl_tabletype; |
| 9 | 9 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "cvalues.h" | 2 | #include "inc/cvalues.h" |
| 3 | #include "equal.h" | 3 | #include "inc/equal.h" |
| 4 | #include "types.h" | 4 | #include "inc/types.h" |
| 5 | 5 | ||
| 6 | sl_type * | 6 | sl_type * |
| 7 | get_type(sl_v t, usize sz) | 7 | get_type(sl_v t, usize sz) |
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "equal.h" | 2 | #include "inc/equal.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "sl_io.h" | 4 | #include "inc/io.h" |
| 5 | 5 | ||
| 6 | #define OP_ARGS \ | 6 | #define OP_ARGS \ |
| 7 | int nargs, const u8int *ip, usize top_frame, usize obp, \ | 7 | int nargs, const u8int *ip, usize top_frame, usize obp, \ |
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "slpriv.h" | 1 | #include "inc/priv.h" |
| 2 | #include "equal.h" | 2 | #include "inc/equal.h" |
| 3 | #include "cvalues.h" | 3 | #include "inc/cvalues.h" |
| 4 | #include "sl_io.h" | 4 | #include "inc/io.h" |
| 5 | 5 | ||
| 6 | #define ENTER do{ \ | 6 | #define ENTER do{ \ |
| 7 | sl.stack[ipd] = (uintptr)ip; \ | 7 | sl.stack[ipd] = (uintptr)ip; \ |
| @@ -52,7 +52,7 @@ int vdprintf(int fd, const char *fmt, va_list args); · 51 unmodified lines | |||
| 52 | #define sl_segfree(s, sz) MEM_FREE(s) | 52 | #define sl_segfree(s, sz) MEM_FREE(s) |
| 53 | #define sl_segused(s, sz, used) do{}while(0) | 53 | #define sl_segused(s, sz, used) do{}while(0) |
| 54 | 54 | ||
| 55 | #include "cc.h" | 55 | #include "inc/cc.h" |
| 56 | #include "mem.h" | 56 | #include "inc/mem.h" |
| 57 | #include "mp.h" | 57 | #include "mp.h" |
| 58 | #include "utf.h" | 58 | #include "utf.h" |
| @@ -1,12 +1,12 @@ | |||
| 1 | #define _CRT_RAND_S // rand_s | 1 | #define _CRT_RAND_S // rand_s |
| 2 | #define _GNU_SOURCE // vasprintf | 2 | #define _GNU_SOURCE // vasprintf |
| 3 | #include "slpriv.h" | ||
| 4 | #include "timefuncs.h" | ||
| 5 | #undef MEM_FREE | ||
| 6 | #include <time.h> | 3 | #include <time.h> |
| 7 | #include <fcntl.h> | 4 | #include <fcntl.h> |
| 8 | #include <locale.h> | 5 | #include <locale.h> |
| 9 | #include <windows.h> | 6 | #include <windows.h> |
| 7 | #undef MEM_FREE | ||
| 8 | #include "inc/priv.h" | ||
| 9 | #include "inc/time.h" | ||
| 10 | 10 | ||
| 11 | static void __stdcall (*get_sys_time)(LPFILETIME); | 11 | static void __stdcall (*get_sys_time)(LPFILETIME); |
| 12 | 12 | ||
| @@ -12,5 +12,6 @@ ninja -C "$B" && \ · 11 unmodified lines | |||
| 12 | cd "$P/boot" && \ | 12 | cd "$P/boot" && \ |
| 13 | $* "$T/mkboot1.sl" && \ | 13 | $* "$T/mkboot1.sl" && \ |
| 14 | sed -E 's/^ +//g' <sl.boot >sl.boot.cut && \ | 14 | sed -E 's/^ +//g' <sl.boot >sl.boot.cut && \ |
| 15 | echo >>sl.boot.cut && | ||
| 15 | mv sl.boot.cut sl.boot && \ | 16 | mv sl.boot.cut sl.boot && \ |
| 16 | ninja -C "$B" || { cp "$P/boot/sl.boot.bak" "$P/boot/sl.boot"; exit 1; } | 17 | ninja -C "$B" || { cp "$P/boot/sl.boot.bak" "$P/boot/sl.boot"; exit 1; } |
| @@ -498,7 +498,7 @@ · 497 unmodified lines | |||
| 498 | (c-code (buffer)) | 498 | (c-code (buffer)) |
| 499 | (instructions (new "instructions.sl")) | 499 | (instructions (new "instructions.sl")) |
| 500 | (builtins (new "builtins.sl")) | 500 | (builtins (new "builtins.sl")) |
| 501 | (docs-ops (new "docs_ops.sl")) | 501 | (docs-ops (new "docs/ops.sl")) |
| 502 | (op-to-u8 (table)) | 502 | (op-to-u8 (table)) |
| 503 | (c-op-to-op-arg (table)) | 503 | (c-op-to-op-arg (table)) |
| 504 | (op-to-argc (table)) | 504 | (op-to-argc (table)) |
| @@ -536,7 +536,7 @@ · 31 unmodified lines | |||
| 536 | (io-write c-header "\tN_OPCODES\n}sl_op;\n\n") | 536 | (io-write c-header "\tN_OPCODES\n}sl_op;\n\n") |
| 537 | (io-write c-header "extern const sl_builtin builtins[N_OPCODES];\n") | 537 | (io-write c-header "extern const sl_builtin builtins[N_OPCODES];\n") |
| 538 | 538 | ||
| 539 | (io-write c-code "#include \"slpriv.h\"\n\n") | 539 | (io-write c-code "#include \"inc/priv.h\"\n\n") |
| 540 | (io-write c-code "const sl_builtin builtins[N_OPCODES] = {\n") | 540 | (io-write c-code "const sl_builtin builtins[N_OPCODES] = {\n") |
| 541 | (for-each | 541 | (for-each |
| 542 | (λ (c la) (begin (io-write c-code (str "\t[" c)) | 542 | (λ (c la) (begin (io-write c-code (str "\t[" c)) |
| @@ -573,6 +573,6 @@ · 30 unmodified lines | |||
| 573 | 573 | ||
| 574 | ;; at last, copy the buffers to the actual files in git repo. | 574 | ;; at last, copy the buffers to the actual files in git repo. |
| 575 | (io-pos! c-header 0) | 575 | (io-pos! c-header 0) |
| 576 | (io-copy (new "opcodes.h") c-header) | 576 | (io-copy (new "inc/opcodes.h") c-header) |
| 577 | (io-pos! c-code 0) | 577 | (io-pos! c-code 0) |
| 578 | (io-copy (new "opcodes.c") c-code)) | 578 | (io-copy (new "opcodes.c") c-code)) |
| @@ -1,7 +1,7 @@ | |||
| 1 | (load "../src/builtins.sl") | 1 | (load "../src/builtins.sl") |
| 2 | (load "../src/instructions.sl") | 2 | (load "../src/instructions.sl") |
| 3 | (load "../src/system.sl") | 3 | (load "../src/system.sl") |
| 4 | #.(load "../src/docs.sl") | 4 | #.(load "../src/docs/docs.sl") |
| 5 | #.(load "../src/docs_ops.sl") | 5 | #.(load "../src/docs/ops.sl") |
| 6 | (load "../src/compiler.sl") | 6 | (load "../src/compiler.sl") |
| 7 | (make-system-image "sl.boot") | 7 | (make-system-image "sl.boot") |