diff --git a/src/arith/integer.c b/src/arith/integer.c index 06ef8a3..eef171b 100644 --- a/src/arith/integer.c +++ b/src/arith/integer.c @@ -18,12 +18,12 @@ #include #include -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "equal.h" -#include "lispops.h" -#include "peano.h" +#include "ops/equal.h" +#include "ops/lispops.h" +#include "arith/peano.h" /** * hexadecimal digits for printing numbers. diff --git a/src/arith/peano.c b/src/arith/peano.c index 5589f1f..ae23a00 100644 --- a/src/arith/peano.c +++ b/src/arith/peano.c @@ -14,19 +14,19 @@ #include #include -#include "consspaceobject.h" -#include "conspage.h" +#include "memory/consspaceobject.h" +#include "memory/conspage.h" #include "debug.h" -#include "equal.h" -#include "integer.h" -#include "intern.h" -#include "lispops.h" -#include "peano.h" -#include "print.h" -#include "ratio.h" -#include "read.h" -#include "real.h" -#include "stack.h" +#include "ops/equal.h" +#include "arith/integer.h" +#include "ops/intern.h" +#include "ops/lispops.h" +#include "arith/peano.h" +#include "io/print.h" +#include "arith/ratio.h" +#include "io/read.h" +#include "arith/real.h" +#include "memory/stack.h" long double to_long_double( struct cons_pointer arg ); int64_t to_long_int( struct cons_pointer arg ); diff --git a/src/arith/ratio.c b/src/arith/ratio.c index 8100ec2..5135d6b 100644 --- a/src/arith/ratio.c +++ b/src/arith/ratio.c @@ -11,15 +11,15 @@ #include #include -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "equal.h" -#include "integer.h" -#include "lispops.h" -#include "peano.h" -#include "print.h" -#include "ratio.h" +#include "ops/equal.h" +#include "arith/integer.h" +#include "ops/lispops.h" +#include "arith/peano.h" +#include "io/print.h" +#include "arith/ratio.h" /** diff --git a/src/arith/real.c b/src/arith/real.c index a59a125..34d29d0 100644 --- a/src/arith/real.c +++ b/src/arith/real.c @@ -7,10 +7,10 @@ * Licensed under GPL version 2.0, or, at your option, any later version. */ -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "read.h" +#include "io/read.h" /** * Allocate a real number cell representing this value and return a cons diff --git a/src/debug.c b/src/debug.c index c8b9771..233e154 100644 --- a/src/debug.c +++ b/src/debug.c @@ -18,11 +18,11 @@ #include #include -#include "consspaceobject.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "dump.h" -#include "io.h" -#include "print.h" +#include "memory/dump.h" +#include "io/io.h" +#include "io/print.h" /** * the controlling flags for `debug_print`; set in `init.c`, q.v. diff --git a/src/init.c b/src/init.c index a47f008..12187fd 100644 --- a/src/init.c +++ b/src/init.c @@ -20,18 +20,20 @@ #include #include "version.h" -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" +#include "memory/stack.h" #include "debug.h" -#include "hashmap.h" -#include "intern.h" -#include "io.h" -#include "lispops.h" -#include "meta.h" -#include "peano.h" -#include "print.h" +#include "memory/hashmap.h" +#include "ops/intern.h" +#include "io/io.h" +#include "ops/lispops.h" +#include "ops/meta.h" +#include "arith/peano.h" +#include "io/print.h" #include "repl.h" -#include "psse_time.h" +#include "io/fopen.h" +#include "time/psse_time.h" // extern char *optarg; /* defined in unistd.h */ diff --git a/src/io/fopen.c b/src/io/fopen.c index 3a66806..e4fafdd 100644 --- a/src/io/fopen.c +++ b/src/io/fopen.c @@ -47,12 +47,12 @@ #include -#include "fopen.h" +#include "io/fopen.h" #ifdef FOPEN_STANDALONE CURLSH *io_share; #else -#include "consspaceobject.h" -#include "io.h" +#include "memory/consspaceobject.h" +#include "io/io.h" #include "utils.h" #endif diff --git a/src/io/io.c b/src/io/io.c index fe08a77..0125488 100644 --- a/src/io/io.c +++ b/src/io/io.c @@ -28,13 +28,13 @@ #include -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "fopen.h" -#include "integer.h" -#include "intern.h" -#include "lispops.h" +#include "io/fopen.h" +#include "arith/integer.h" +#include "ops/intern.h" +#include "ops/lispops.h" #include "utils.h" /** @@ -56,8 +56,6 @@ wint_t ungotten = 0; * @return 0 on success; any other value means failure. */ int io_init( ) { - CURL *curl; - CURLcode res; int result = curl_global_init( CURL_GLOBAL_SSL ); io_share = curl_share_init( ); diff --git a/src/io/print.c b/src/io/print.c index 64d7b37..8f4b88e 100644 --- a/src/io/print.c +++ b/src/io/print.c @@ -17,15 +17,15 @@ #include #include -#include "conspage.h" -#include "consspaceobject.h" -#include "hashmap.h" -#include "integer.h" -#include "intern.h" -#include "stack.h" -#include "print.h" -#include "psse_time.h" -#include "vectorspace.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" +#include "memory/hashmap.h" +#include "arith/integer.h" +#include "ops/intern.h" +#include "memory/stack.h" +#include "io/print.h" +#include "time/psse_time.h" +#include "memory/vectorspace.h" /** * print all the characters in the symbol or string indicated by `pointer` diff --git a/src/io/read.c b/src/io/read.c index 4425b77..45d1045 100644 --- a/src/io/read.c +++ b/src/io/read.c @@ -17,25 +17,29 @@ #include #include -#include "consspaceobject.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "dump.h" -#include "hashmap.h" -#include "integer.h" -#include "intern.h" -#include "io.h" -#include "lispops.h" -#include "peano.h" -#include "print.h" -#include "ratio.h" -#include "read.h" -#include "real.h" -#include "vectorspace.h" +#include "memory/dump.h" +#include "memory/hashmap.h" +#include "arith/integer.h" +#include "ops/intern.h" +#include "io/io.h" +#include "ops/lispops.h" +#include "arith/peano.h" +#include "io/print.h" +#include "arith/ratio.h" +#include "io/read.h" +#include "arith/real.h" +#include "memory/vectorspace.h" /* - * for the time being things which may be read are: strings numbers - either - * integer or real, but not yet including ratios or bignums lists Can't read - * atoms because I don't yet know what an atom is or how it's stored. + * for the time being things which may be read are: + * * strings + * * numbers - either integer, ratio or real + * * lists + * * maps + * * keywords + * * atoms */ struct cons_pointer read_number( struct stack_frame *frame, diff --git a/src/memory/conspage.c b/src/memory/conspage.c index f967c74..6cc4814 100644 --- a/src/memory/conspage.c +++ b/src/memory/conspage.c @@ -16,12 +16,12 @@ #include #include -#include "consspaceobject.h" -#include "conspage.h" +#include "memory/consspaceobject.h" +#include "memory/conspage.h" #include "debug.h" -#include "dump.h" -#include "stack.h" -#include "vectorspace.h" +#include "memory/dump.h" +#include "memory/stack.h" +#include "memory/vectorspace.h" /** * Flag indicating whether conspage initialisation has been done. @@ -267,4 +267,4 @@ void initialise_cons_pages( ) { void summarise_allocation() { fwprintf(stderr, L"Allocation summary: allocated %lld; deallocated %lld.\n", total_cells_allocated, total_cells_freed ); -} \ No newline at end of file +} diff --git a/src/memory/consspaceobject.c b/src/memory/consspaceobject.c index 0eef3d5..579e84b 100644 --- a/src/memory/consspaceobject.c +++ b/src/memory/consspaceobject.c @@ -19,13 +19,13 @@ #include #include "authorise.h" -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "intern.h" -#include "print.h" -#include "stack.h" -#include "vectorspace.h" +#include "ops/intern.h" +#include "io/print.h" +#include "memory/stack.h" +#include "memory/vectorspace.h" /** * True if the value of the tag on the cell at this `pointer` is this `value`, diff --git a/src/memory/dump.c b/src/memory/dump.c index 81182a8..3148ac1 100644 --- a/src/memory/dump.c +++ b/src/memory/dump.c @@ -18,15 +18,15 @@ #include #include -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "hashmap.h" -#include "intern.h" -#include "io.h" -#include "print.h" -#include "stack.h" -#include "vectorspace.h" +#include "memory/hashmap.h" +#include "ops/intern.h" +#include "io/io.h" +#include "io/print.h" +#include "memory/stack.h" +#include "memory/vectorspace.h" void dump_string_cell( URL_FILE * output, wchar_t *prefix, diff --git a/src/memory/hashmap.c b/src/memory/hashmap.c index d6909ba..a9bc336 100644 --- a/src/memory/hashmap.c +++ b/src/memory/hashmap.c @@ -11,7 +11,7 @@ #include "arith/peano.h" #include "authorise.h" #include "debug.h" -#include "intern.h" +#include "ops/intern.h" #include "io/print.h" #include "memory/conspage.h" #include "memory/consspaceobject.h" diff --git a/src/memory/stack.c b/src/memory/stack.c index 8b0e610..4b70ed1 100644 --- a/src/memory/stack.c +++ b/src/memory/stack.c @@ -17,14 +17,14 @@ #include -#include "consspaceobject.h" -#include "conspage.h" +#include "memory/consspaceobject.h" +#include "memory/conspage.h" #include "debug.h" -#include "dump.h" -#include "lispops.h" -#include "print.h" -#include "stack.h" -#include "vectorspace.h" +#include "memory/dump.h" +#include "ops/lispops.h" +#include "io/print.h" +#include "memory/stack.h" +#include "memory/vectorspace.h" /** * set a register in a stack frame. Alwaye use this to do so, diff --git a/src/memory/vectorspace.c b/src/memory/vectorspace.c index 0c1b159..4bbeb51 100644 --- a/src/memory/vectorspace.c +++ b/src/memory/vectorspace.c @@ -19,12 +19,12 @@ #include #include -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "hashmap.h" -#include "stack.h" -#include "vectorspace.h" +#include "memory/hashmap.h" +#include "memory/stack.h" +#include "memory/vectorspace.h" /** diff --git a/src/ops/intern.c b/src/ops/intern.c index 05d5822..cd80612 100644 --- a/src/ops/intern.c +++ b/src/ops/intern.c @@ -19,12 +19,12 @@ #include -#include "conspage.h" -#include "consspaceobject.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "equal.h" -#include "hashmap.h" -#include "lispops.h" +#include "ops/equal.h" +#include "memory/hashmap.h" +#include "ops/lispops.h" // #include "print.h" /** diff --git a/src/ops/lispops.c b/src/ops/lispops.c index fa3c68d..4ff14a1 100644 --- a/src/ops/lispops.c +++ b/src/ops/lispops.c @@ -24,19 +24,19 @@ #include #include -#include "consspaceobject.h" -#include "conspage.h" +#include "memory/consspaceobject.h" +#include "memory/conspage.h" #include "debug.h" -#include "dump.h" -#include "equal.h" -#include "integer.h" -#include "intern.h" -#include "io.h" -#include "lispops.h" -#include "print.h" -#include "read.h" -#include "stack.h" -#include "vectorspace.h" +#include "memory/dump.h" +#include "ops/equal.h" +#include "arith/integer.h" +#include "ops/intern.h" +#include "io/io.h" +#include "ops/lispops.h" +#include "io/print.h" +#include "io/read.h" +#include "memory/stack.h" +#include "memory/vectorspace.h" /* * also to create in this section: diff --git a/src/ops/meta.c b/src/ops/meta.c index a27d2af..f00824f 100644 --- a/src/ops/meta.c +++ b/src/ops/meta.c @@ -7,7 +7,7 @@ * Licensed under GPL version 2.0, or, at your option, any later version. */ -#include "conspage.h" +#include "memory/conspage.h" #include "debug.h" /** diff --git a/src/repl.c b/src/repl.c index 39bbde6..bef08b1 100644 --- a/src/repl.c +++ b/src/repl.c @@ -11,11 +11,11 @@ #include #include -#include "consspaceobject.h" +#include "memory/consspaceobject.h" #include "debug.h" -#include "intern.h" -#include "lispops.h" -#include "stack.h" +#include "ops/intern.h" +#include "ops/lispops.h" +#include "memory/stack.h" /** diff --git a/src/time/psse_time.c b/src/time/psse_time.c index 1f24b0e..06c1b58 100644 --- a/src/time/psse_time.c +++ b/src/time/psse_time.c @@ -16,10 +16,10 @@ #include #include -#include "conspage.h" -#include "consspaceobject.h" -#include "integer.h" -#include "psse_time.h" +#include "memory/conspage.h" +#include "memory/consspaceobject.h" +#include "arith/integer.h" +#include "time/psse_time.h" #define _GNU_SOURCE #define seconds_per_year 31557600L @@ -63,7 +63,6 @@ struct cons_pointer make_time( struct cons_pointer integer_or_nil ) { if ( integerp( integer_or_nil ) ) { cell->payload.time.value = pointer2cell( integer_or_nil ).payload.integer.value; - // \todo: if integer is a bignum, deal with it. } else { cell->payload.time.value = unix_time_to_lisp_time( time( NULL ) ); }