diff options
author | Keith Packard <keithp@keithp.com> | 2018-01-06 17:29:10 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2018-01-06 17:31:43 -0800 |
commit | 16061947d4376b41e596d87f97ec53ec29d17644 (patch) | |
tree | f7ad08f8810b0ea78cf282048eacb46d441a2ee1 /src/scheme/ao_scheme_poly.c | |
parent | 39df849f0717d92a7d5bdf8aa5904bd4db1b467f (diff) |
altos/scheme: Add ports. Split scheme code up.
And lots of other changes, including freeing unreferenced atoms.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/scheme/ao_scheme_poly.c')
-rw-r--r-- | src/scheme/ao_scheme_poly.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/scheme/ao_scheme_poly.c b/src/scheme/ao_scheme_poly.c index 0cffc196..8a92c9f2 100644 --- a/src/scheme/ao_scheme_poly.c +++ b/src/scheme/ao_scheme_poly.c @@ -14,13 +14,13 @@ #include "ao_scheme.h" -static void ao_scheme_invalid_write(ao_poly p, bool write) { - printf("??? type %d poly 0x%04x ???", ao_scheme_poly_type (p), p); +static void ao_scheme_invalid_write(FILE *out, ao_poly p, bool write) { + fprintf(out, "??? type %d poly 0x%04x ???", ao_scheme_poly_type (p), p); (void) write; ao_scheme_abort(); } -static void (*const ao_scheme_write_funcs[AO_SCHEME_NUM_TYPE]) (ao_poly p, bool write) = { +static void (*const ao_scheme_write_funcs[AO_SCHEME_NUM_TYPE]) (FILE *out, ao_poly p, bool write) = { [AO_SCHEME_CONS] = ao_scheme_cons_write, #ifdef AO_SCHEME_FEATURE_BIGINT [AO_SCHEME_BIGINT] = ao_scheme_bigint_write, @@ -40,9 +40,12 @@ static void (*const ao_scheme_write_funcs[AO_SCHEME_NUM_TYPE]) (ao_poly p, bool #ifdef AO_SCHEME_FEATURE_VECTOR [AO_SCHEME_VECTOR] = ao_scheme_vector_write, #endif +#ifdef AO_SCHEME_FEATURE_PORT + [AO_SCHEME_PORT] = ao_scheme_port_write, +#endif }; -void (*ao_scheme_poly_write_func(ao_poly p))(ao_poly p, bool write) +void (*ao_scheme_poly_write_func(ao_poly p))(FILE *out, ao_poly p, bool write) { uint8_t type = ao_scheme_poly_type(p); |