diff --git a/README.md b/README.md
index 368590f..33f9969 100644
--- a/README.md
+++ b/README.md
@@ -300,6 +300,9 @@ Script interpreter. Works the same as ic3 but is not interactive.
- get (get key value)
- put (return a new map)
- structs
+ - struct type
+ - `TAG_STRUCT_TYPE`
+ - finish refactor (data_*)
- access
- get
- put
@@ -314,7 +317,14 @@ Script interpreter. Works the same as ic3 but is not interactive.
- switch/case/cond
- while
- quote
- - unquote
+ - increase quote level in env
+ - eval : do not eval if quote level > 0
+ - unquote
+ - if quote_level is zero return unquote(x) unchanged
+ - decrease quote level in env
+ - eval if quote level is zero
+ - macros
+ - unwind protect
- functions
- return
- def
diff --git a/ic3/.ic3_history b/ic3/.ic3_history
index 1582c71..49dc973 100644
--- a/ic3/.ic3_history
+++ b/ic3/.ic3_history
@@ -15,4 +15,10 @@ a = (U8) { 1, 2 }
a[0]
quote (GL.Vertex) {}
(GL.Vertex) {}
-
+(void) 0
+type(void)
+type((void) 0)
+quote (void) 0
+quote (Void) 0
+type((Void) 0)
+quote (Void) 0
diff --git a/lib/c3/0.1/array.facts b/lib/c3/0.1/array.facts
index df6c79d..ade2085 100644
--- a/lib/c3/0.1/array.facts
+++ b/lib/c3/0.1/array.facts
@@ -1,5 +1,7 @@
%{module: C3.Facts.Dump,
version: 1}
add {Array, :is_a, :module}
+add {Array, :symbol, Array.cast}
add {Array, :symbol, Array.data}
+replace {Array.cast, :cfn, cfn Array "array_init_cast" (Result, Tag)}
replace {Array.data, :cfn, cfn Tag "array_data_tag" (Tag, Tag, Result)}
diff --git a/lib/c3/0.1/void.facts b/lib/c3/0.1/void.facts
new file mode 100644
index 0000000..ff8456e
--- /dev/null
+++ b/lib/c3/0.1/void.facts
@@ -0,0 +1,5 @@
+%{module: C3.Facts.Dump,
+ version: 1}
+replace {Void, :is_a, :module}
+replace {Void, :symbol, Void.cast}
+replace {Void.cast, :cfn, cfn Void "void_init_cast" (Result, Tag)}
diff --git a/libc3/array.c b/libc3/array.c
index 1a11362..0a1a860 100644
--- a/libc3/array.c
+++ b/libc3/array.c
@@ -18,21 +18,21 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_parse.h"
+#include "data.h"
#include "io.h"
#include "sym.h"
#include "tag.h"
-#include "void.h"
s_array * array_allocate (s_array *a)
{
assert(a);
- a->data_free = calloc(1, a->size);
- if (! a->data_free) {
+ a->free_data = calloc(1, a->size);
+ if (! a->free_data) {
err_puts("array_allocate: failed to allocate memory");
assert(! "array_allocate: failed to allocate memory");
return NULL;
}
- a->data = a->data_free;
+ a->data = a->free_data;
return a;
}
@@ -49,14 +49,14 @@ void array_clean (s_array *a)
data = a->data;
i = 0;
while (i < a->count) {
- void_clean(a->type, data);
+ data_clean(a->type, data);
data += size;
i++;
}
}
}
- if (a->data_free)
- free(a->data_free);
+ if (a->free_data)
+ free(a->free_data);
if (a->tags) {
i = 0;
while (i < a->count) {
@@ -101,7 +101,7 @@ s_array * array_data_set (s_array *a, const uw *address,
assert(data);
a_data = array_data(a, address);
if (a_data) {
- if (! void_init_copy(a->type, a_data, data))
+ if (! data_init_copy(a->type, a_data, data))
return NULL;
return a;
}
@@ -144,7 +144,7 @@ s_tag * array_data_tag (const s_tag *a, const s_tag *address,
return NULL;
if (! sym_to_tag_type(a->data.array.type, &tmp.type) ||
! tag_to_pointer(&tmp, a->data.array.type, &tmp_data) ||
- ! void_init_copy(a->data.array.type, tmp_data, a_data))
+ ! data_init_copy(a->data.array.type, tmp_data, a_data))
return NULL;
*dest = tmp;
return dest;
@@ -235,6 +235,8 @@ s_array * array_init_cast (s_array *array, const s_tag *tag)
switch (tag->type) {
case TAG_ARRAY:
return array_init_copy(array, &tag->data.array);
+ case TAG_VOID:
+ return array_init_void(array);
default:
break;
}
@@ -268,7 +270,7 @@ s_array * array_init_copy (s_array *a, const s_array *src)
memcpy(tmp.dimensions, src->dimensions,
src->dimension * sizeof(s_array_dimension));
if (src->data) {
- tmp.data = tmp.data_free = calloc(1, src->size);
+ tmp.data = tmp.free_data = calloc(1, src->size);
if (! tmp.data) {
warnx("array_init_copy: failed to allocate memory");
assert(! "array_init_copy: failed to allocate memory");
@@ -280,7 +282,7 @@ s_array * array_init_copy (s_array *a, const s_array *src)
i = 0;
item_size = src->dimensions[src->dimension - 1].item_size;
while (i < src->count) {
- if (! void_init_copy(src->type, data_tmp, data_src))
+ if (! data_init_copy(src->type, data_tmp, data_src))
goto ko_data;
data_tmp += item_size;
data_src += item_size;
@@ -309,7 +311,7 @@ s_array * array_init_copy (s_array *a, const s_array *src)
if (i) {
while (--i) {
data_tmp -= item_size;
- void_clean(src->type, data_tmp);
+ data_clean(src->type, data_tmp);
}
}
free(tmp.data);
@@ -322,6 +324,14 @@ s_array * array_init_copy (s_array *a, const s_array *src)
return NULL;
}
+s_array * array_init_void (s_array *array)
+{
+ s_array tmp = {0};
+ tmp.type = sym_1("Void");
+ *array = tmp;
+ return array;
+}
+
s_str * array_inspect (const s_array *array, s_str *dest)
{
sw size;
diff --git a/libc3/array.h b/libc3/array.h
index 3a8f5e2..d44900c 100644
--- a/libc3/array.h
+++ b/libc3/array.h
@@ -22,6 +22,7 @@ s_array * array_init (s_array *a, const s_sym *type,
s_array * array_init_1 (s_array *a, s8 *p);
s_array * array_init_cast (s_array *a, const s_tag *tag);
s_array * array_init_copy (s_array *a, const s_array *src);
+s_array * array_init_void (s_array *array);
/* Observers */
s_str * array_inspect (const s_array *array, s_str *dest);
diff --git a/libc3/buf_inspect.c b/libc3/buf_inspect.c
index c749aaa..f6e8c3c 100644
--- a/libc3/buf_inspect.c
+++ b/libc3/buf_inspect.c
@@ -19,6 +19,7 @@
#include "buf_inspect.h"
#include "buf_save.h"
#include "character.h"
+#include "data.h"
#include "ident.h"
#include "integer.h"
#include "io.h"
@@ -26,7 +27,6 @@
#include "operator.h"
#include "str.h"
#include "tag.h"
-#include "void.h"
sw buf_inspect_array_data (s_buf *buf, const s_array *array);
sw buf_inspect_array_data_rec (s_buf *buf, const s_array *array,
@@ -102,7 +102,7 @@ sw buf_inspect_array_data_rec (s_buf *buf, const s_array *array,
while (1) {
if (dimension == array->dimension - 1) {
if (*data) {
- if ((r = void_buf_inspect(array->type, buf, *data)) <= 0)
+ if ((r = data_buf_inspect(array->type, buf, *data)) <= 0)
goto clean;
result += r;
*data += array->dimensions[dimension].item_size;
@@ -167,7 +167,7 @@ sw buf_inspect_array_data_size_rec (const s_array *array,
while (1) {
if (dimension == array->dimension - 1) {
if (*data) {
- if ((r = void_buf_inspect_size(array->type, *data)) <= 0)
+ if ((r = data_buf_inspect_size(array->type, *data)) <= 0)
goto clean;
result += r;
*data += array->dimensions[dimension].item_size;
@@ -1685,25 +1685,25 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
const s_sym *type;
assert(buf);
assert(s);
- assert(sym_is_module(s->type.module));
+ assert(sym_is_module(s->type->module));
if ((r = buf_write_1(buf, "%")) < 0)
return r;
result += r;
- if (! sym_is_module(s->type.module))
+ if (! sym_is_module(s->type->module))
return -1;
- if (sym_has_reserved_characters(s->type.module)) {
- if ((r = buf_write_str(buf, &s->type.module->str)) < 0)
+ if (sym_has_reserved_characters(s->type->module)) {
+ if ((r = buf_write_str(buf, &s->type->module->str)) < 0)
return r;
}
else
- if ((r = buf_write_1(buf, s->type.module->str.ptr.ps8)) < 0)
+ if ((r = buf_write_1(buf, s->type->module->str.ptr.ps8)) < 0)
return r;
result += r;
if ((r = buf_write_1(buf, "{")) < 0)
return r;
result += r;
- while (i < s->type.map.count) {
- k = s->type.map.key + i;
+ while (i < s->type->map.count) {
+ k = s->type->map.key + i;
if (k->type != TAG_SYM) {
err_write_1("buf_inspect_struct: key type is not a symbol: ");
err_inspect_tag(k);
@@ -1725,10 +1725,10 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
return r;
result += r;
if (s->data) {
- if (! tag_type(s->type.map.value + i, &type))
+ if (! tag_type(s->type->map.value + i, &type))
return -1;
- if ((r = void_buf_inspect(type, buf, (s8 *) s->data +
- s->type.offset[i])) < 0)
+ if ((r = data_buf_inspect(type, buf, (s8 *) s->data +
+ s->type->offset[i])) < 0)
return r;
result += r;
}
@@ -1738,12 +1738,12 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
result += r;
}
else {
- if ((r = buf_inspect_tag(buf, s->type.map.value + i)) < 0)
+ if ((r = buf_inspect_tag(buf, s->type->map.value + i)) < 0)
return r;
result += r;
}
i++;
- if (i < s->type.map.count) {
+ if (i < s->type->map.count) {
if ((r = buf_write_1(buf, ", ")) < 0)
return r;
result += r;
@@ -1857,6 +1857,8 @@ sw buf_inspect_tag (s_buf *buf, const s_tag *tag)
case TAG_SW: return buf_inspect_sw(buf, &tag->data.sw);
case TAG_STR: return buf_inspect_str(buf, &tag->data.str);
case TAG_STRUCT: return buf_inspect_struct(buf, &tag->data.struct_);
+ case TAG_STRUCT_TYPE:
+ return buf_inspect_struct_type(buf, tag->data.struct_type);
case TAG_SYM: return buf_inspect_sym(buf, &tag->data.sym);
case TAG_TUPLE: return buf_inspect_tuple(buf, &tag->data.tuple);
case TAG_U8: return buf_inspect_u8(buf, &tag->data.u8);
@@ -1904,6 +1906,8 @@ sw buf_inspect_tag_size (const s_tag *tag)
case TAG_SW: return buf_inspect_sw_size(&tag->data.sw);
case TAG_STR: return buf_inspect_str_size(&tag->data.str);
case TAG_STRUCT: return buf_inspect_struct_size(&tag->data.struct_);
+ case TAG_STRUCT_TYPE:
+ return buf_inspect_struct_type_size(tag->data.struct_type);
case TAG_SYM: return buf_inspect_sym_size(&tag->data.sym);
case TAG_TUPLE: return buf_inspect_tuple_size(&tag->data.tuple);
case TAG_U8: return buf_inspect_u8_size(&tag->data.u8);
@@ -1921,152 +1925,22 @@ sw buf_inspect_tag_size (const s_tag *tag)
sw buf_inspect_tag_type (s_buf *buf, e_tag_type type)
{
- switch(type) {
- case TAG_VOID:
- return buf_write_1(buf, "Void");
- case TAG_ARRAY:
- return buf_write_1(buf, "Array");
- case TAG_BOOL:
- return buf_write_1(buf, "Bool");
- case TAG_CALL:
- return buf_write_1(buf, "Call");
- case TAG_CFN:
- return buf_write_1(buf, "Cfn");
- case TAG_CHARACTER:
- return buf_write_1(buf, "Character");
- case TAG_F32:
- return buf_write_1(buf, "F32");
- case TAG_F64:
- return buf_write_1(buf, "F64");
- case TAG_FACT:
- return buf_write_1(buf, "Fact");
- case TAG_FN:
- return buf_write_1(buf, "Fn");
- case TAG_IDENT:
- return buf_write_1(buf, "Ident");
- case TAG_INTEGER:
- return buf_write_1(buf, "Integer");
- case TAG_LIST:
- return buf_write_1(buf, "List");
- case TAG_MAP:
- return buf_write_1(buf, "Map");
- case TAG_PTAG:
- return buf_write_1(buf, "Ptag");
- case TAG_PTR:
- return buf_write_1(buf, "Ptr");
- case TAG_PTR_FREE:
- return buf_write_1(buf, "PtrFree");
- case TAG_QUOTE:
- return buf_write_1(buf, "Quote");
- case TAG_S8:
- return buf_write_1(buf, "S8");
- case TAG_S16:
- return buf_write_1(buf, "S16");
- case TAG_S32:
- return buf_write_1(buf, "S32");
- case TAG_S64:
- return buf_write_1(buf, "S64");
- case TAG_SW:
- return buf_write_1(buf, "Sw");
- case TAG_STR:
- return buf_write_1(buf, "Str");
- case TAG_STRUCT:
- return buf_write_1(buf, "Struct");
- case TAG_SYM:
- return buf_write_1(buf, "Sym");
- case TAG_TUPLE:
- return buf_write_1(buf, "Tuple");
- case TAG_U8:
- return buf_write_1(buf, "U8");
- case TAG_U16:
- return buf_write_1(buf, "U16");
- case TAG_U32:
- return buf_write_1(buf, "U32");
- case TAG_U64:
- return buf_write_1(buf, "U64");
- case TAG_UW:
- return buf_write_1(buf, "Uw");
- case TAG_VAR:
- return buf_write_1(buf, "Var");
- }
- err_puts("buf_inspect_tag_type: unknown tag type");
- assert(! "buf_inspect_tag_type: unknown tag type");
- return -1;
+ const s8 *s;
+ assert(buf);
+ s = tag_type_to_string(type);
+ if (! s)
+ return -1;
+ return buf_write_1(buf, s);
}
sw buf_inspect_tag_type_size (e_tag_type type)
{
- switch(type) {
- case TAG_VOID:
- return strlen("Void");
- case TAG_ARRAY:
- return strlen("Array");
- case TAG_BOOL:
- return strlen("Bool");
- case TAG_CALL:
- return strlen("Call");
- case TAG_CFN:
- return strlen("Cfn");
- case TAG_CHARACTER:
- return strlen("Character");
- case TAG_F32:
- return strlen("F32");
- case TAG_F64:
- return strlen("F64");
- case TAG_FACT:
- return strlen("Fact");
- case TAG_FN:
- return strlen("Fn");
- case TAG_IDENT:
- return strlen("Ident");
- case TAG_INTEGER:
- return strlen("Integer");
- case TAG_LIST:
- return strlen("List");
- case TAG_MAP:
- return strlen("Map");
- case TAG_PTAG:
- return strlen("Ptag");
- case TAG_PTR:
- return strlen("Ptr");
- case TAG_PTR_FREE:
- return strlen("PtrFree");
- case TAG_QUOTE:
- return strlen("Quote");
- case TAG_S8:
- return strlen("S8");
- case TAG_S16:
- return strlen("S16");
- case TAG_S32:
- return strlen("S32");
- case TAG_S64:
- return strlen("S64");
- case TAG_SW:
- return strlen("Sw");
- case TAG_STR:
- return strlen("Str");
- case TAG_STRUCT:
- return strlen("Struct");
- case TAG_SYM:
- return strlen("Sym");
- case TAG_TUPLE:
- return strlen("Tuple");
- case TAG_U8:
- return strlen("U8");
- case TAG_U16:
- return strlen("U16");
- case TAG_U32:
- return strlen("U32");
- case TAG_U64:
- return strlen("U64");
- case TAG_UW:
- return strlen("Uw");
- case TAG_VAR:
- return strlen("Var");
- }
- err_puts("buf_inspect_tag_type_size: unknown tag type");
- assert(! "buf_inspect_tag_type_size: unknown tag type");
- return -1;
+ const s8 *s;
+ assert(buf);
+ s = tag_type_to_string(type);
+ if (! s)
+ return -1;
+ return strlen(s);
}
sw buf_inspect_tuple (s_buf *buf, const s_tuple *tuple)
diff --git a/libc3/buf_inspect.h b/libc3/buf_inspect.h
index ddc6cc5..199167c 100644
--- a/libc3/buf_inspect.h
+++ b/libc3/buf_inspect.h
@@ -125,6 +125,8 @@ sw buf_inspect_str_reserved_size (const s_str *str);
sw buf_inspect_str_size (const s_str *str);
sw buf_inspect_struct (s_buf *buf, const s_struct *s);
sw buf_inspect_struct_size (const s_struct *s);
+sw buf_inspect_struct_type (s_buf *buf, const s_struct_type *st);
+sw buf_inspect_struct_type_size (const s_struct_type *st);
sw buf_inspect_sym (s_buf *buf, const s_sym * const *sym);
sw buf_inspect_sym_reserved (s_buf *buf, const s_sym *sym);
sw buf_inspect_sym_reserved_size (const s_sym *sym);
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index f7e6ffc..8f9eb5b 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -2908,7 +2908,8 @@ sw buf_parse_tag_primary (s_buf *buf, s_tag *dest)
goto restore;
result += r;
}
- if ((r = buf_parse_tag_number(buf, dest)) != 0 ||
+ if ((r = buf_parse_tag_void(buf, dest)) != 0 ||
+ (r = buf_parse_tag_number(buf, dest)) != 0 ||
(r = buf_parse_tag_array(buf, dest)) != 0 ||
(r = buf_parse_tag_cast(buf, dest)) != 0 ||
(r = buf_parse_tag_call(buf, dest)) != 0 ||
@@ -2995,6 +2996,16 @@ sw buf_parse_tag_tuple (s_buf *buf, s_tag *dest)
return r;
}
+sw buf_parse_tag_void (s_buf *buf, s_tag *dest)
+{
+ sw r;
+ assert(buf);
+ assert(dest);
+ if ((r = buf_parse_void(buf, NULL)) > 0)
+ dest->type = TAG_VOID;
+ return r;
+}
+
sw buf_parse_tuple (s_buf *buf, s_tuple *tuple)
{
s_list **i;
@@ -3151,6 +3162,7 @@ sw buf_parse_void (s_buf *buf, void *dest)
r = 0;
goto restore;
}
+ goto clean;
restore:
buf_save_restore_rpos(buf, &save);
clean:
diff --git a/libc3/buf_parse.h b/libc3/buf_parse.h
index 9c6766b..0d1c8d4 100644
--- a/libc3/buf_parse.h
+++ b/libc3/buf_parse.h
@@ -121,6 +121,7 @@ sw buf_parse_tag_str (s_buf *buf, s_tag *dest);
sw buf_parse_tag_struct (s_buf *buf, s_tag *dest);
sw buf_parse_tag_sym (s_buf *buf, s_tag *dest);
sw buf_parse_tag_tuple (s_buf *buf, s_tag *dest);
+sw buf_parse_tag_void (s_buf *buf, s_tag *dest);
sw buf_parse_tuple (s_buf *buf, s_tuple *dest);
sw buf_parse_u64_hex (s_buf *buf, u64 *dest);
sw buf_parse_var (s_buf *buf, void *dest);
diff --git a/libc3/data.c b/libc3/data.c
new file mode 100644
index 0000000..ac8494d
--- /dev/null
+++ b/libc3/data.c
@@ -0,0 +1,565 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include "c3.h"
+
+sw data_buf_inspect (const s_sym *type, s_buf *buf, const void *data)
+{
+ s_struct_type *st;
+ if (type == sym_1("Array"))
+ return buf_inspect_array(buf, data);
+ if (type == sym_1("Bool"))
+ return buf_inspect_bool(buf, data);
+ if (type == sym_1("Call"))
+ return buf_inspect_call(buf, data);
+ if (type == sym_1("Cfn"))
+ return buf_inspect_cfn(buf, data);
+ if (type == sym_1("Character"))
+ return buf_inspect_character(buf, data);
+ if (type == sym_1("F32"))
+ return buf_inspect_f32(buf, data);
+ if (type == sym_1("F64"))
+ return buf_inspect_f64(buf, data);
+ if (type == sym_1("Fact"))
+ return buf_inspect_fact(buf, data);
+ if (type == sym_1("Fn"))
+ return buf_inspect_fn(buf, data);
+ if (type == sym_1("Ident"))
+ return buf_inspect_ident(buf, data);
+ if (type == sym_1("Integer"))
+ return buf_inspect_integer(buf, data);
+ if (type == sym_1("List"))
+ return buf_inspect_list(buf, data);
+ if (type == sym_1("Ptag"))
+ return buf_inspect_ptag(buf, data);
+ if (type == sym_1("Ptr"))
+ return buf_inspect_ptr(buf, data);
+ if (type == sym_1("PtrFree"))
+ return buf_inspect_ptr_free(buf, data);
+ if (type == sym_1("Quote"))
+ return buf_inspect_quote(buf, data);
+ if (type == sym_1("S8"))
+ return buf_inspect_s8(buf, data);
+ if (type == sym_1("S16"))
+ return buf_inspect_s16(buf, data);
+ if (type == sym_1("S32"))
+ return buf_inspect_s32(buf, data);
+ if (type == sym_1("S64"))
+ return buf_inspect_s64(buf, data);
+ if (type == sym_1("Str"))
+ return buf_inspect_str(buf, data);
+ if (type == sym_1("Struct"))
+ return buf_inspect_struct(buf, data);
+ if (type == sym_1("Sw"))
+ return buf_inspect_sw(buf, data);
+ if (type == sym_1("Sym"))
+ return buf_inspect_sym(buf, data);
+ if (type == sym_1("Tuple"))
+ return buf_inspect_tuple(buf, data);
+ if (type == sym_1("U8"))
+ return buf_inspect_u8(buf, data);
+ if (type == sym_1("U16"))
+ return buf_inspect_u16(buf, data);
+ if (type == sym_1("U32"))
+ return buf_inspect_u32(buf, data);
+ if (type == sym_1("U64"))
+ return buf_inspect_u64(buf, data);
+ if (type == sym_1("Uw"))
+ return buf_inspect_uw(buf, data);
+ if (type == sym_1("Var"))
+ return buf_inspect_var(buf, data);
+ if (type == sym_1("Void"))
+ return buf_inspect_void(buf, data);
+ /*
+ if (sym_is_array_type(type)) {
+ */
+ st = struct_type_find(type);
+ if (st) {
+ s_struct s = {0};
+ s.type = st;
+ s.data = (void *) data;
+ return buf_inspect_struct(buf, &s);
+ }
+ err_write_1("data_buf_inspect: unknown type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "data_buf_inspect: unknown type");
+ return -1;
+}
+
+sw data_buf_inspect_size (const s_sym *type, const void *data)
+{
+ s_struct_type *st;
+ if (type == sym_1("Array"))
+ return buf_inspect_array_size(data);
+ if (type == sym_1("Bool"))
+ return buf_inspect_bool_size(data);
+ if (type == sym_1("Call"))
+ return buf_inspect_call_size(data);
+ if (type == sym_1("Cfn"))
+ return buf_inspect_cfn_size(data);
+ if (type == sym_1("Character"))
+ return buf_inspect_character_size(data);
+ if (type == sym_1("F32"))
+ return buf_inspect_f32_size(data);
+ if (type == sym_1("F64"))
+ return buf_inspect_f64_size(data);
+ if (type == sym_1("Fact"))
+ return buf_inspect_fact_size(data);
+ if (type == sym_1("Fn"))
+ return buf_inspect_fn_size(data);
+ if (type == sym_1("Ident"))
+ return buf_inspect_ident_size(data);
+ if (type == sym_1("Integer"))
+ return buf_inspect_integer_size(data);
+ if (type == sym_1("List"))
+ return buf_inspect_list_size(data);
+ if (type == sym_1("Ptag"))
+ return buf_inspect_ptag_size(data);
+ if (type == sym_1("Ptr"))
+ return buf_inspect_ptr_size(data);
+ if (type == sym_1("PtrFree"))
+ return buf_inspect_ptr_free_size(data);
+ if (type == sym_1("Quote"))
+ return buf_inspect_quote_size(data);
+ if (type == sym_1("S8"))
+ return buf_inspect_s8_size(data);
+ if (type == sym_1("S16"))
+ return buf_inspect_s16_size(data);
+ if (type == sym_1("S32"))
+ return buf_inspect_s32_size(data);
+ if (type == sym_1("S64"))
+ return buf_inspect_s64_size(data);
+ if (type == sym_1("Str"))
+ return buf_inspect_str_size(data);
+ if (type == sym_1("Struct"))
+ return buf_inspect_struct_size(data);
+ if (type == sym_1("Sw"))
+ return buf_inspect_sw_size(data);
+ if (type == sym_1("Sym"))
+ return buf_inspect_sym_size(data);
+ if (type == sym_1("Tuple"))
+ return buf_inspect_tuple_size(data);
+ if (type == sym_1("U8"))
+ return buf_inspect_u8_size(data);
+ if (type == sym_1("U16"))
+ return buf_inspect_u16_size(data);
+ if (type == sym_1("U32"))
+ return buf_inspect_u32_size(data);
+ if (type == sym_1("U64"))
+ return buf_inspect_u64_size(data);
+ if (type == sym_1("Uw"))
+ return buf_inspect_uw_size(data);
+ if (type == sym_1("Var"))
+ return buf_inspect_var_size(data);
+ if (type == sym_1("Void"))
+ return buf_inspect_void_size(data);
+ /*
+ if (sym_is_array_type(type)) {
+ */
+ st = struct_type_find(type);
+ if (st) {
+ s_struct s = {0};
+ s.type = st;
+ s.data = (void *) data;
+ return buf_inspect_struct_size(&s);
+ }
+ err_write_1("data_buf_inspect_size: unknown type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "data_buf_inspect_size: unknown type");
+ return -1;
+}
+
+bool data_clean (const s_sym *type, void *data)
+{
+ s_struct_type *st;
+ assert(type);
+ if (type == sym_1("Array")) {
+ array_clean(data);
+ return true;
+ }
+ if (type == sym_1("Bool")) {
+ return true;
+ }
+ if (type == sym_1("Call")) {
+ call_clean(data);
+ return true;
+ }
+ if (type == sym_1("Cfn")) {
+ cfn_clean(data);
+ return true;
+ }
+ if (type == sym_1("Character")) {
+ return true;
+ }
+ if (type == sym_1("F32")) {
+ return true;
+ }
+ if (type == sym_1("F64")) {
+ return true;
+ }
+ if (type == sym_1("Fact")) {
+ return true;
+ }
+ if (type == sym_1("Fn")) {
+ fn_clean(data);
+ return true;
+ }
+ if (type == sym_1("Ident")) {
+ return true;
+ }
+ if (type == sym_1("Integer")) {
+ integer_clean(data);
+ return true;
+ }
+ if (type == sym_1("List")) {
+ list_f_clean(data);
+ return true;
+ }
+ if (type == sym_1("Map")) {
+ map_clean(data);
+ return true;
+ }
+ if (type == sym_1("Ptag")) {
+ return true;
+ }
+ if (type == sym_1("Ptr")) {
+ return true;
+ }
+ if (type == sym_1("PtrFree")) {
+ ptr_free_clean(data);
+ return true;
+ }
+ if (type == sym_1("Quote")) {
+ quote_clean(data);
+ return true;
+ }
+ if (type == sym_1("S8")) {
+ return true;
+ }
+ if (type == sym_1("S16")) {
+ return true;
+ }
+ if (type == sym_1("S32")) {
+ return true;
+ }
+ if (type == sym_1("S64")) {
+ return true;
+ }
+ if (type == sym_1("Str")) {
+ str_clean(data);
+ return true;
+ }
+ if (type == sym_1("Struct")) {
+ struct_clean(data);
+ return true;
+ }
+ if (type == sym_1("Sw")) {
+ return true;
+ }
+ if (type == sym_1("Sym")) {
+ return true;
+ }
+ if (type == sym_1("Tuple")) {
+ tuple_clean(data);
+ return true;
+ }
+ if (type == sym_1("U8")) {
+ return true;
+ }
+ if (type == sym_1("U16")) {
+ return true;
+ }
+ if (type == sym_1("U32")) {
+ return true;
+ }
+ if (type == sym_1("U64")) {
+ return true;
+ }
+ if (type == sym_1("Uw")) {
+ return true;
+ }
+ if (type == sym_1("Var")) {
+ return true;
+ }
+ if (type == sym_1("Void")) {
+ return true;
+ }
+ /*
+ if (sym_is_array_type(type)) {
+ */
+ st = struct_type_find(type);
+ if (st) {
+ s_struct s = {0};
+ s.type = st;
+ s.data = data;
+ struct_clean(&s);
+ return true;
+ }
+ err_write_1("data_clean: unknown type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "data_clean: unknown type");
+ return false;
+}
+
+bool data_hash_update (const s_sym *type, t_hash *hash, const void *data)
+{
+ s_struct_type *st;
+ if (type == sym_1("Array"))
+ return hash_update_array(hash, data);
+ if (type == sym_1("Bool"))
+ return hash_update_bool(hash, data);
+ if (type == sym_1("Call"))
+ return hash_update_call(hash, data);
+ if (type == sym_1("Cfn"))
+ return hash_update_cfn(hash, data);
+ if (type == sym_1("Character"))
+ return hash_update_character(hash, data);
+ if (type == sym_1("F32"))
+ return hash_update_f32(hash, data);
+ if (type == sym_1("F64"))
+ return hash_update_f64(hash, data);
+ if (type == sym_1("Fact"))
+ return hash_update_fact(hash, data);
+ if (type == sym_1("Fn"))
+ return hash_update_fn(hash, data);
+ if (type == sym_1("Ident"))
+ return hash_update_ident(hash, data);
+ if (type == sym_1("Integer"))
+ return hash_update_integer(hash, data);
+ if (type == sym_1("List"))
+ return hash_update_list(hash, data);
+ if (type == sym_1("Ptag"))
+ return hash_update_ptag(hash, data);
+ if (type == sym_1("Ptr"))
+ return hash_update_ptr(hash, data);
+ if (type == sym_1("PtrFree"))
+ return hash_update_ptr_free(hash, data);
+ if (type == sym_1("Quote"))
+ return hash_update_quote(hash, data);
+ if (type == sym_1("S8"))
+ return hash_update_s8(hash, data);
+ if (type == sym_1("S16"))
+ return hash_update_s16(hash, data);
+ if (type == sym_1("S32"))
+ return hash_update_s32(hash, data);
+ if (type == sym_1("S64"))
+ return hash_update_s64(hash, data);
+ if (type == sym_1("Str"))
+ return hash_update_str(hash, data);
+ if (type == sym_1("Struct"))
+ return hash_update_struct(hash, data);
+ if (type == sym_1("Sw"))
+ return hash_update_sw(hash, data);
+ if (type == sym_1("Sym"))
+ return hash_update_sym(hash, data);
+ if (type == sym_1("Tuple"))
+ return hash_update_tuple(hash, data);
+ if (type == sym_1("U8"))
+ return hash_update_u8(hash, data);
+ if (type == sym_1("U16"))
+ return hash_update_u16(hash, data);
+ if (type == sym_1("U32"))
+ return hash_update_u32(hash, data);
+ if (type == sym_1("U64"))
+ return hash_update_u64(hash, data);
+ if (type == sym_1("Uw"))
+ return hash_update_uw(hash, data);
+ if (type == sym_1("Var"))
+ return hash_update_var(hash, data);
+ if (type == sym_1("Void"))
+ return hash_update_void(hash, data);
+ /*
+ if (sym_is_array_type(type)) {
+ */
+ st = struct_type_find(type);
+ if (st) {
+ s_struct s = {0};
+ s.type = st;
+ s.data = (void *) data;
+ return hash_update_struct(hash, &s);
+ }
+ err_write_1("data_hash_update: unknown type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "data_hash_update: unknown type");
+ return false;
+}
+
+void * data_init_cast (const s_sym *type, void *data, const s_tag *tag)
+{
+ s_struct_type *st;
+ if (type == sym_1("Array"))
+ return array_init_cast(data, tag);
+ if (type == sym_1("Bool"))
+ return bool_init_cast(data, tag);
+ if (type == sym_1("Call"))
+ return call_init_cast(data, tag);
+ if (type == sym_1("Cfn"))
+ return cfn_init_cast(data, tag);
+ if (type == sym_1("Character"))
+ return character_init_cast(data, tag);
+ if (type == sym_1("F32"))
+ return f32_init_cast(data, tag);
+ if (type == sym_1("F64"))
+ return f64_init_cast(data, tag);
+ if (type == sym_1("Fact"))
+ return fact_init_cast(data, tag);
+ if (type == sym_1("Fn"))
+ return fn_init_cast(data, tag);
+ if (type == sym_1("Ident"))
+ return ident_init_cast(data, tag);
+ if (type == sym_1("Integer"))
+ return integer_init_cast(data, tag);
+ if (type == sym_1("List"))
+ return list_init_cast(data, tag);
+ if (type == sym_1("Ptag"))
+ return ptag_init_cast(data, tag);
+ if (type == sym_1("Ptr"))
+ return ptr_init_cast(data, tag);
+ if (type == sym_1("PtrFree"))
+ return ptr_free_init_cast(data, tag);
+ if (type == sym_1("Quote"))
+ return quote_init_cast(data, tag);
+ if (type == sym_1("S8"))
+ return s8_init_cast(data, tag);
+ if (type == sym_1("S16"))
+ return s16_init_cast(data, tag);
+ if (type == sym_1("S32"))
+ return s32_init_cast(data, tag);
+ if (type == sym_1("S64"))
+ return s64_init_cast(data, tag);
+ if (type == sym_1("Str"))
+ return str_init_cast(data, tag);
+ if (type == sym_1("Struct"))
+ return struct_init_cast(data, tag);
+ if (type == sym_1("Sw"))
+ return sw_init_cast(data, tag);
+ if (type == sym_1("Sym"))
+ return sym_init_cast(data, tag);
+ if (type == sym_1("Tuple"))
+ return tuple_init_cast(data, tag);
+ if (type == sym_1("U8"))
+ return u8_init_cast(data, tag);
+ if (type == sym_1("U16"))
+ return u16_init_cast(data, tag);
+ if (type == sym_1("U32"))
+ return u32_init_cast(data, tag);
+ if (type == sym_1("U64"))
+ return u64_init_cast(data, tag);
+ if (type == sym_1("Uw"))
+ return uw_init_cast(data, tag);
+ if (type == sym_1("Var"))
+ return data;
+ if (type == sym_1("Void"))
+ return data;
+ /*
+ if (sym_is_array_type(type)) {
+ */
+ st = struct_type_find(type);
+ if (st) {
+ s_struct s = {0};
+ s.type = st;
+ s.data = data;
+ return struct_init_cast(&s, tag);
+ }
+ err_write_1("data_init_cast: unknown type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "data_init_cast: unknown type");
+ return NULL;
+}
+
+void * data_init_copy (const s_sym *type, void *data, const void *src)
+{
+ s_struct_type *st;
+ if (type == sym_1("Array"))
+ return array_init_copy(data, src);
+ if (type == sym_1("Bool"))
+ return bool_init_copy(data, src);
+ if (type == sym_1("Call"))
+ return call_init_copy(data, src);
+ if (type == sym_1("Cfn"))
+ return cfn_init_copy(data, src);
+ if (type == sym_1("Character"))
+ return character_init_copy(data, src);
+ if (type == sym_1("F32"))
+ return f32_init_copy(data, src);
+ if (type == sym_1("F64"))
+ return f64_init_copy(data, src);
+ if (type == sym_1("Fact"))
+ return fact_init_copy(data, src);
+ if (type == sym_1("Fn"))
+ return fn_init_copy(data, src);
+ if (type == sym_1("Ident"))
+ return ident_init_copy(data, src);
+ if (type == sym_1("Integer"))
+ return integer_init_copy(data, src);
+ if (type == sym_1("List"))
+ return list_init_copy(data, src);
+ if (type == sym_1("Ptag"))
+ return ptag_init_copy(data, src);
+ if (type == sym_1("Ptr"))
+ return ptr_init_copy(data, src);
+ if (type == sym_1("PtrFree"))
+ return ptr_free_init_copy(data, src);
+ if (type == sym_1("Quote"))
+ return quote_init_copy(data, src);
+ if (type == sym_1("S8"))
+ return s8_init_copy(data, src);
+ if (type == sym_1("S16"))
+ return s16_init_copy(data, src);
+ if (type == sym_1("S32"))
+ return s32_init_copy(data, src);
+ if (type == sym_1("S64"))
+ return s64_init_copy(data, src);
+ if (type == sym_1("Str"))
+ return str_init_copy(data, src);
+ if (type == sym_1("Struct"))
+ return struct_init_copy(data, src);
+ if (type == sym_1("Sw"))
+ return sw_init_copy(data, src);
+ if (type == sym_1("Sym"))
+ return sym_init_copy(data, src);
+ if (type == sym_1("Tuple"))
+ return tuple_init_copy(data, src);
+ if (type == sym_1("U8"))
+ return u8_init_copy(data, src);
+ if (type == sym_1("U16"))
+ return u16_init_copy(data, src);
+ if (type == sym_1("U32"))
+ return u32_init_copy(data, src);
+ if (type == sym_1("U64"))
+ return u64_init_copy(data, src);
+ if (type == sym_1("Uw"))
+ return uw_init_copy(data, src);
+ if (type == sym_1("Var"))
+ return data;
+ if (type == sym_1("Void"))
+ return data;
+ st = struct_type_find(type);
+ if (st) {
+ s_struct s = {0};
+ s_struct t = {0};
+ t.type = s.type = st;
+ s.data = data;
+ t.data = (void *) src;
+ return struct_init_copy(&s, &t);
+ }
+ err_write_1("data_init_copy: unknown type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "data_init_copy: unknown type");
+ return NULL;
+}
diff --git a/libc3/data.h b/libc3/data.h
new file mode 100644
index 0000000..ed0d0c5
--- /dev/null
+++ b/libc3/data.h
@@ -0,0 +1,32 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/**
+ * @file void.h
+ * @brief Generic (void *) operations.
+ *
+ * Functions to manage (void *) operations.
+ */
+#ifndef LIBC3_DATA_H
+#define LIBC3_DATA_H
+
+#include "types.h"
+
+sw data_buf_inspect (const s_sym *type, s_buf *buf, const void *v);
+sw data_buf_inspect_size (const s_sym *type, const void *v);
+bool data_clean (const s_sym *type, void *v);
+bool data_hash_update (const s_sym *type, t_hash *hash,
+ const void *s);
+void * data_init_cast (const s_sym *type, void *v, const s_tag *src);
+void * data_init_copy (const s_sym *type, void *v, const void *src);
+
+#endif /* LIBC3_DATA_H */
diff --git a/libc3/env.c b/libc3/env.c
index 6646d05..4841078 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -27,6 +27,7 @@
#include "call.h"
#include "cfn.h"
#include "compare.h"
+#include "data.h"
#include "env.h"
#include "error.h"
#include "error_handler.h"
@@ -47,7 +48,6 @@
#include "struct_type.h"
#include "tag.h"
#include "tuple.h"
-#include "void.h"
s_env g_c3_env;
@@ -119,7 +119,7 @@ bool env_eval_array (s_env *env, const s_array *array, s_array *dest)
if (tmp.dimension) {
item_size = tmp.dimensions[tmp.dimension - 1].item_size;
if (! tmp.data && array->tags) {
- tmp.data = tmp.data_free = calloc(tmp.dimensions[0].count,
+ tmp.data = tmp.free_data = calloc(tmp.dimensions[0].count,
tmp.dimensions[0].item_size);
if (! tmp.data) {
warn("env_eval_array: failed to allocate memory");
@@ -132,7 +132,7 @@ bool env_eval_array (s_env *env, const s_array *array, s_array *dest)
while (i < tmp.count) {
if (! env_eval_tag(env, tag, &tag_eval))
goto ko;
- if (! void_init_cast(array->type, data, &tag_eval)) {
+ if (! data_init_cast(array->type, data, &tag_eval)) {
err_write_1("env_eval_array: cannot cast ");
err_inspect_tag(&tag_eval);
err_write_1(" to ");
@@ -683,20 +683,21 @@ bool env_eval_struct (s_env *env, const s_struct *s, s_tag *dest)
*dest = tmp;
return true;
}
- if (! struct_type_init_copy(&t->type, &s->type) ||
- ! struct_allocate(t))
+ t->type = s->type;
+ if (! struct_allocate(t))
return false;
i = 0;
- while (i < t->type.map.count) {
- if (! tag_type(t->type.map.value + i, &type) ||
+ while (i < t->type->map.count) {
+ if (! tag_type(t->type->map.value + i, &type) ||
! env_eval_tag(env, s->tag + i, &tag))
goto ko;
- if (! void_init_cast(type, (s8 *) t->data + t->type.offset[i], &tag)) {
+ if (! data_init_cast(type, (s8 *) t->data + t->type->offset[i],
+ &tag)) {
warnx("env_eval_struct:"
" invalid type %s for key %s, expected %s.",
tag_type_to_string(tag.type),
- t->type.map.key[i].data.sym->str.ptr.ps8,
- tag_type_to_string(t->type.map.value[i].type));
+ t->type->map.key[i].data.sym->str.ptr.ps8,
+ tag_type_to_string(t->type->map.value[i].type));
goto ko_tag;
}
i++;
@@ -1172,8 +1173,8 @@ bool env_struct_type_exists (s_env *env, const s_sym *module)
s_tag tag_var;
assert(env);
assert(module);
- tag_init_sym_1(&tag_defstruct, "defstruct");
tag_init_sym(&tag_module, module);
+ tag_init_sym_1(&tag_defstruct, "defstruct");
tag_init_var(&tag_var);
env_module_maybe_reload(env, module, &env->facts);
facts_with_tags(&env->facts, &cursor, &tag_module,
@@ -1183,6 +1184,41 @@ bool env_struct_type_exists (s_env *env, const s_sym *module)
return result;
}
+s_struct_type * env_struct_type_find (s_env *env, const s_sym *module)
+{
+ s_facts_cursor cursor;
+ s_struct_type *result;
+ s_tag tag_struct_type;
+ s_tag tag_module;
+ s_tag tag_var;
+ const s_sym *type;
+ assert(env);
+ assert(module);
+ tag_init_sym(&tag_module, module);
+ tag_init_sym_1(&tag_struct_type, "struct_type");
+ tag_init_var(&tag_var);
+ env_module_maybe_reload(env, module, &env->facts);
+ facts_with_tags(&env->facts, &cursor, &tag_module,
+ &tag_struct_type, &tag_var);
+ if (! facts_cursor_next(&cursor)) {
+ facts_cursor_clean(&cursor);
+ return NULL;
+ }
+ if (tag_var.type != TAG_STRUCT_TYPE) {
+ tag_type(&tag_var, &type);
+ err_write_1("env_struct_type_find: module ");
+ err_inspect_sym(module);
+ err_write_1(": :struct_type is actually a ");
+ err_inspect_sym(type);
+ err_write_1("\n");
+ assert(! "env_struct_type_find: invalid struct_type");
+ return NULL;
+ }
+ result = tag_var.data.struct_type;
+ facts_cursor_clean(&cursor);
+ return result;
+}
+
bool env_tag_ident_is_bound (const s_env *env, const s_tag *tag,
s_facts *facts)
{
diff --git a/libc3/env.h b/libc3/env.h
index 8edddfa..627212f 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -22,64 +22,72 @@ void env_clean (s_env *env);
s_env * env_init (s_env *env, int argc, s8 **argv);
/* Operators. */
-bool env_eval_array (s_env *env, const s_array *array,
- s_array *dest);
-bool env_eval_array_tag (s_env *env, const s_array *array,
+bool env_eval_array (s_env *env, const s_array *array,
+ s_array *dest);
+bool env_eval_array_tag (s_env *env, const s_array *array,
+ s_tag *dest);
+bool env_eval_call (s_env *env, const s_call *call,
+ s_tag *dest);
+bool env_eval_call_arguments (s_env *env, const s_list *args,
+ s_list **dest);
+bool env_eval_call_cfn (s_env *env, const s_call *call,
+ s_tag *dest);
+bool env_eval_call_fn (s_env *env, const s_call *call,
s_tag *dest);
-bool env_eval_call (s_env *env, const s_call *call,
- s_tag *dest);
-bool env_eval_call_arguments (s_env *env, const s_list *args,
- s_list **dest);
-bool env_eval_call_cfn (s_env *env, const s_call *call,
- s_tag *dest);
-bool env_eval_call_fn (s_env *env, const s_call *call,
+bool env_eval_call_resolve (s_env *env, s_call *call);
+bool env_eval_equal_list (s_env *env, const s_list *a,
+ const s_list *b, s_list **dest);
+bool env_eval_equal_struct (s_env *env, const s_struct *a,
+ const s_struct *b,
+ s_struct *dest);
+bool env_eval_equal_tag (s_env *env, const s_tag *a,
+ const s_tag *b, s_tag *dest);
+bool env_eval_equal_tuple (s_env *env, const s_tuple *a,
+ const s_tuple *b, s_tuple *dest);
+bool env_eval_fn (s_env *env, const s_fn *fn, s_tag *dest);
+bool env_eval_fn_call (s_env *env, const s_fn *fn,
+ const s_list *arguments, s_tag *dest);
+bool env_eval_ident (s_env *env, const s_ident *ident,
s_tag *dest);
-bool env_eval_call_resolve (s_env *env, s_call *call);
-bool env_eval_equal_list (s_env *env, const s_list *a,
- const s_list *b, s_list **dest);
-bool env_eval_equal_struct (s_env *env, const s_struct *a,
- const s_struct *b, s_struct *dest);
-bool env_eval_equal_tag (s_env *env, const s_tag *a,
- const s_tag *b, s_tag *dest);
-bool env_eval_equal_tuple (s_env *env, const s_tuple *a,
- const s_tuple *b, s_tuple *dest);
-bool env_eval_fn (s_env *env, const s_fn *fn, s_tag *dest);
-bool env_eval_fn_call (s_env *env, const s_fn *fn,
- const s_list *arguments, s_tag *dest);
-bool env_eval_ident (s_env *env, const s_ident *ident,
- s_tag *dest);
-bool env_eval_list (s_env *env, const s_list *list,
- s_tag *dest);
-bool env_eval_map (s_env *env, const s_map *map, s_tag *dest);
-bool env_eval_progn (s_env *env, const s_list *program,
- s_tag *dest);
-bool env_eval_quote (s_env *env, const s_quote *quote,
- s_tag *dest);
-bool env_eval_struct (s_env *env, const s_struct *s,
+bool env_eval_list (s_env *env, const s_list *list,
s_tag *dest);
-bool env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest);
-bool env_eval_tuple (s_env *env, const s_tuple *tuple,
+bool env_eval_map (s_env *env, const s_map *map,
s_tag *dest);
-bool env_eval_void (s_env *env, const void *_, s_tag *dest);
-s_list ** env_get_struct_type_spec (s_env *env, const s_sym *module,
- s_list **dest);
-bool env_module_load (s_env *env, const s_sym *module,
- s_facts *facts);
-bool env_module_maybe_reload (s_env *env, const s_sym *module,
- s_facts *facts);
-s8 env_operator_arity (s_env *env, const s_ident *op);
-bool env_operator_find (s_env *env, const s_ident *op);
-s_ident * env_operator_ident (s_env *env, const s_ident *op,
- s_ident *dest);
-bool env_operator_is_right_associative (s_env *env,
- const s_ident *op);
-s8 env_operator_precedence (s_env *env, const s_ident *op);
-s_ident * env_operator_resolve (s_env *env, const s_ident *op,
- u8 arity, s_ident *dest);
-const s_sym * env_operator_symbol (s_env *env, const s_ident *op);
-bool env_struct_type_exists (s_env *env, const s_sym *module);
-bool env_tag_ident_is_bound (const s_env *env,
- const s_tag *tag, s_facts *facts);
+bool env_eval_progn (s_env *env, const s_list *program,
+ s_tag *dest);
+bool env_eval_quote (s_env *env, const s_quote *quote,
+ s_tag *dest);
+bool env_eval_struct (s_env *env, const s_struct *s,
+ s_tag *dest);
+bool env_eval_tag (s_env *env, const s_tag *tag,
+ s_tag *dest);
+bool env_eval_tuple (s_env *env, const s_tuple *tuple,
+ s_tag *dest);
+bool env_eval_void (s_env *env, const void *_, s_tag *dest);
+s_list ** env_get_struct_type_spec (s_env *env,
+ const s_sym *module,
+ s_list **dest);
+bool env_module_load (s_env *env, const s_sym *module,
+ s_facts *facts);
+bool env_module_maybe_reload (s_env *env,
+ const s_sym *module,
+ s_facts *facts);
+s8 env_operator_arity (s_env *env, const s_ident *op);
+bool env_operator_find (s_env *env, const s_ident *op);
+s_ident * env_operator_ident (s_env *env, const s_ident *op,
+ s_ident *dest);
+bool env_operator_is_right_associative (s_env *env,
+ const s_ident *op);
+s8 env_operator_precedence (s_env *env, const s_ident *op);
+s_ident * env_operator_resolve (s_env *env, const s_ident *op,
+ u8 arity, s_ident *dest);
+const s_sym * env_operator_symbol (s_env *env, const s_ident *op);
+bool env_struct_type_exists (s_env *env,
+ const s_sym *module);
+s_struct_type * env_struct_type_find (s_env *env, const s_sym *module);
+bool env_tag_ident_is_bound (const s_env *env,
+ const s_tag *tag,
+ s_facts *facts);
/* Control structures. */
void env_error_f (s_env *env, const char *fmt, ...);
diff --git a/libc3/hash.c b/libc3/hash.c
index 6b83779..0831c2c 100644
--- a/libc3/hash.c
+++ b/libc3/hash.c
@@ -14,12 +14,12 @@
#include <err.h>
#include <stdlib.h>
#include <string.h>
+#include "data.h"
#include "hash.h"
#include "list.h"
#include "str.h"
#include "tag.h"
#include "tag_type.h"
-#include "void.h"
#define HASH_UPDATE_DEF(type) \
bool hash_update_##type (t_hash *hash, const type *x) \
@@ -361,7 +361,7 @@ bool hash_update_struct (t_hash *hash, const s_struct *s)
return false;
}
}
- if (! void_hash_update(sym, hash, data))
+ if (! data_hash_update(sym, hash, data))
return false;
i++;
}
diff --git a/libc3/list.c b/libc3/list.c
index 800127f..50000cf 100644
--- a/libc3/list.c
+++ b/libc3/list.c
@@ -17,11 +17,11 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_parse.h"
+#include "data.h"
#include "list.h"
#include "sym.h"
#include "tag.h"
#include "tuple.h"
-#include "void.h"
void list_clean (s_list *list)
{
@@ -296,7 +296,7 @@ s_array * list_to_array (const s_list *list, const s_sym *type,
if (! tag_to_const_pointer(&l->tag, type, &data_list))
goto ko;
if (data_list) {
- if (! void_init_copy(type, data, data_list))
+ if (! data_init_copy(type, data, data_list))
goto ko;
}
data += size;
@@ -308,7 +308,7 @@ s_array * list_to_array (const s_list *list, const s_sym *type,
ko:
while (data > (s8 *) tmp.data) {
data -= size;
- void_clean(type, data);
+ data_clean(type, data);
}
free(tmp.data);
free(tmp.dimensions);
diff --git a/libc3/sources.mk b/libc3/sources.mk
index 6c0f9e8..e7bd185 100644
--- a/libc3/sources.mk
+++ b/libc3/sources.mk
@@ -79,6 +79,7 @@ HEADERS = \
"character.h" \
"compare.h" \
"config.h" \
+ "data.h" \
"env.h" \
"error.h" \
"error_handler.h" \
@@ -224,6 +225,7 @@ SOURCES = \
"cfn.c" \
"character.c" \
"compare.c" \
+ "data.c" \
"env.c" \
"error.c" \
"error_handler.c" \
@@ -474,6 +476,7 @@ LO_SOURCES = \
"cfn.c" \
"character.c" \
"compare.c" \
+ "data.c" \
"env.c" \
"error.c" \
"error_handler.c" \
diff --git a/libc3/sources.sh b/libc3/sources.sh
index 86867d4..f77db9e 100644
--- a/libc3/sources.sh
+++ b/libc3/sources.sh
@@ -1,4 +1,4 @@
# sources.sh generated by update_sources
-HEADERS='abs.h arg.h array.h assert.h binding.h bool.h buf.h buf_file.h buf_inspect.h buf_inspect_s16.h buf_inspect_s16_binary.h buf_inspect_s16_decimal.h buf_inspect_s16_hexadecimal.h buf_inspect_s16_octal.h buf_inspect_s32.h buf_inspect_s32_binary.h buf_inspect_s32_decimal.h buf_inspect_s32_hexadecimal.h buf_inspect_s32_octal.h buf_inspect_s64.h buf_inspect_s64_binary.h buf_inspect_s64_decimal.h buf_inspect_s64_hexadecimal.h buf_inspect_s64_octal.h buf_inspect_s8.h buf_inspect_s8_binary.h buf_inspect_s8_decimal.h buf_inspect_s8_hexadecimal.h buf_inspect_s8_octal.h buf_inspect_sw.h buf_inspect_sw_binary.h buf_inspect_sw_decimal.h buf_inspect_sw_hexadecimal.h buf_inspect_sw_octal.h buf_inspect_u16.h buf_inspect_u16_binary.h buf_inspect_u16_decimal.h buf_inspect_u16_hexadecimal.h buf_inspect_u16_octal.h buf_inspect_u32.h buf_inspect_u32_binary.h buf_inspect_u32_decimal.h buf_inspect_u32_hexadecimal.h buf_inspect_u32_octal.h buf_inspect_u64.h buf_inspect_u64_binary.h buf_inspect_u64_decimal.h buf_inspect_u64_hexadecimal.h buf_inspect_u64_octal.h buf_inspect_u8.h buf_inspect_u8_binary.h buf_inspect_u8_decimal.h buf_inspect_u8_hexadecimal.h buf_inspect_u8_octal.h buf_inspect_uw.h buf_inspect_uw_binary.h buf_inspect_uw_decimal.h buf_inspect_uw_hexadecimal.h buf_inspect_uw_octal.h buf_parse.h buf_parse_s16.h buf_parse_s32.h buf_parse_s64.h buf_parse_s8.h buf_parse_sw.h buf_parse_u16.h buf_parse_u32.h buf_parse_u64.h buf_parse_u8.h buf_parse_uw.h buf_save.h c3.h c3_main.h call.h ceiling.h cfn.h character.h compare.h config.h env.h error.h error_handler.h eval.h f32.h f64.h fact.h facts.h facts_cursor.h facts_spec.h facts_spec_cursor.h facts_with.h facts_with_cursor.h file.h float.h fn.h fn_clause.h frame.h hash.h ident.h integer.h io.h list.h list_init.h log.h map.h module.h operator.h ptag.h ptr.h ptr_free.h quote.h s16.h s32.h s64.h s8.h sequence.h set__fact.h set__tag.h set_cursor__fact.h set_cursor__tag.h set_item__fact.h set_item__tag.h sha1.h sign.h skiplist__fact.h skiplist_node__fact.h str.h struct.h struct_type.h sw.h sym.h tag.h tag_init.h tag_type.h time.h tuple.h type.h types.h u16.h u32.h u64.h u8.h ucd.h uw.h var.h void.h '
-SOURCES='abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c list_init.c log.c map.c module.c operator.c ptag.c ptr.c ptr_free.c quote.c s16.c s32.c s64.c s8.c sequence.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_band.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_shift_left.c tag_shift_right.c tag_sub.c tag_type.c time.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c void.c '
-LO_SOURCES=' ../libtommath/bn_cutoffs.c ../libtommath/bn_mp_2expt.c ../libtommath/bn_mp_abs.c ../libtommath/bn_mp_add.c ../libtommath/bn_mp_add_d.c ../libtommath/bn_mp_and.c ../libtommath/bn_mp_clamp.c ../libtommath/bn_mp_clear.c ../libtommath/bn_mp_clear_multi.c ../libtommath/bn_mp_cmp.c ../libtommath/bn_mp_cmp_d.c ../libtommath/bn_mp_cmp_mag.c ../libtommath/bn_mp_cnt_lsb.c ../libtommath/bn_mp_complement.c ../libtommath/bn_mp_copy.c ../libtommath/bn_mp_count_bits.c ../libtommath/bn_mp_div.c ../libtommath/bn_mp_div_2.c ../libtommath/bn_mp_div_2d.c ../libtommath/bn_mp_div_3.c ../libtommath/bn_mp_div_d.c ../libtommath/bn_mp_dr_is_modulus.c ../libtommath/bn_mp_dr_reduce.c ../libtommath/bn_mp_dr_setup.c ../libtommath/bn_mp_error_to_string.c ../libtommath/bn_mp_exch.c ../libtommath/bn_mp_exptmod.c ../libtommath/bn_mp_gcd.c ../libtommath/bn_mp_get_double.c ../libtommath/bn_mp_get_i32.c ../libtommath/bn_mp_get_i64.c ../libtommath/bn_mp_get_mag_u32.c ../libtommath/bn_mp_get_mag_u64.c ../libtommath/bn_mp_grow.c ../libtommath/bn_mp_init.c ../libtommath/bn_mp_init_copy.c ../libtommath/bn_mp_init_multi.c ../libtommath/bn_mp_init_size.c ../libtommath/bn_mp_invmod.c ../libtommath/bn_mp_lcm.c ../libtommath/bn_mp_lshd.c ../libtommath/bn_mp_mod.c ../libtommath/bn_mp_mod_2d.c ../libtommath/bn_mp_montgomery_calc_normalization.c ../libtommath/bn_mp_montgomery_reduce.c ../libtommath/bn_mp_montgomery_setup.c ../libtommath/bn_mp_mul.c ../libtommath/bn_mp_mul_2.c ../libtommath/bn_mp_mul_2d.c ../libtommath/bn_mp_mul_d.c ../libtommath/bn_mp_mulmod.c ../libtommath/bn_mp_neg.c ../libtommath/bn_mp_or.c ../libtommath/bn_mp_radix_size.c ../libtommath/bn_mp_reduce.c ../libtommath/bn_mp_reduce_2k.c ../libtommath/bn_mp_reduce_2k_l.c ../libtommath/bn_mp_reduce_2k_setup.c ../libtommath/bn_mp_reduce_2k_setup_l.c ../libtommath/bn_mp_reduce_is_2k.c ../libtommath/bn_mp_reduce_is_2k_l.c ../libtommath/bn_mp_reduce_setup.c ../libtommath/bn_mp_rshd.c ../libtommath/bn_mp_set.c ../libtommath/bn_mp_set_double.c ../libtommath/bn_mp_set_i32.c ../libtommath/bn_mp_set_i64.c ../libtommath/bn_mp_set_l.c ../libtommath/bn_mp_set_u32.c ../libtommath/bn_mp_set_u64.c ../libtommath/bn_mp_set_ul.c ../libtommath/bn_mp_sqr.c ../libtommath/bn_mp_sqrt.c ../libtommath/bn_mp_sub.c ../libtommath/bn_mp_sub_d.c ../libtommath/bn_mp_xor.c ../libtommath/bn_mp_zero.c ../libtommath/bn_s_mp_add.c ../libtommath/bn_s_mp_balance_mul.c ../libtommath/bn_s_mp_exptmod.c ../libtommath/bn_s_mp_exptmod_fast.c ../libtommath/bn_s_mp_invmod_fast.c ../libtommath/bn_s_mp_invmod_slow.c ../libtommath/bn_s_mp_karatsuba_mul.c ../libtommath/bn_s_mp_karatsuba_sqr.c ../libtommath/bn_s_mp_montgomery_reduce_fast.c ../libtommath/bn_s_mp_mul_digs.c ../libtommath/bn_s_mp_mul_digs_fast.c ../libtommath/bn_s_mp_mul_high_digs.c ../libtommath/bn_s_mp_mul_high_digs_fast.c ../libtommath/bn_s_mp_rand_platform.c ../libtommath/bn_s_mp_sqr.c ../libtommath/bn_s_mp_sqr_fast.c ../libtommath/bn_s_mp_sub.c ../libtommath/bn_s_mp_toom_mul.c ../libtommath/bn_s_mp_toom_sqr.c abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c list_init.c log.c map.c module.c operator.c ptag.c ptr.c ptr_free.c quote.c s16.c s32.c s64.c s8.c sequence.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_band.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_shift_left.c tag_shift_right.c tag_sub.c tag_type.c time.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c void.c '
+HEADERS='abs.h arg.h array.h assert.h binding.h bool.h buf.h buf_file.h buf_inspect.h buf_inspect_s16.h buf_inspect_s16_binary.h buf_inspect_s16_decimal.h buf_inspect_s16_hexadecimal.h buf_inspect_s16_octal.h buf_inspect_s32.h buf_inspect_s32_binary.h buf_inspect_s32_decimal.h buf_inspect_s32_hexadecimal.h buf_inspect_s32_octal.h buf_inspect_s64.h buf_inspect_s64_binary.h buf_inspect_s64_decimal.h buf_inspect_s64_hexadecimal.h buf_inspect_s64_octal.h buf_inspect_s8.h buf_inspect_s8_binary.h buf_inspect_s8_decimal.h buf_inspect_s8_hexadecimal.h buf_inspect_s8_octal.h buf_inspect_sw.h buf_inspect_sw_binary.h buf_inspect_sw_decimal.h buf_inspect_sw_hexadecimal.h buf_inspect_sw_octal.h buf_inspect_u16.h buf_inspect_u16_binary.h buf_inspect_u16_decimal.h buf_inspect_u16_hexadecimal.h buf_inspect_u16_octal.h buf_inspect_u32.h buf_inspect_u32_binary.h buf_inspect_u32_decimal.h buf_inspect_u32_hexadecimal.h buf_inspect_u32_octal.h buf_inspect_u64.h buf_inspect_u64_binary.h buf_inspect_u64_decimal.h buf_inspect_u64_hexadecimal.h buf_inspect_u64_octal.h buf_inspect_u8.h buf_inspect_u8_binary.h buf_inspect_u8_decimal.h buf_inspect_u8_hexadecimal.h buf_inspect_u8_octal.h buf_inspect_uw.h buf_inspect_uw_binary.h buf_inspect_uw_decimal.h buf_inspect_uw_hexadecimal.h buf_inspect_uw_octal.h buf_parse.h buf_parse_s16.h buf_parse_s32.h buf_parse_s64.h buf_parse_s8.h buf_parse_sw.h buf_parse_u16.h buf_parse_u32.h buf_parse_u64.h buf_parse_u8.h buf_parse_uw.h buf_save.h c3.h c3_main.h call.h ceiling.h cfn.h character.h compare.h config.h data.h env.h error.h error_handler.h eval.h f32.h f64.h fact.h facts.h facts_cursor.h facts_spec.h facts_spec_cursor.h facts_with.h facts_with_cursor.h file.h float.h fn.h fn_clause.h frame.h hash.h ident.h integer.h io.h list.h list_init.h log.h map.h module.h operator.h ptag.h ptr.h ptr_free.h quote.h s16.h s32.h s64.h s8.h sequence.h set__fact.h set__tag.h set_cursor__fact.h set_cursor__tag.h set_item__fact.h set_item__tag.h sha1.h sign.h skiplist__fact.h skiplist_node__fact.h str.h struct.h struct_type.h sw.h sym.h tag.h tag_init.h tag_type.h time.h tuple.h type.h types.h u16.h u32.h u64.h u8.h ucd.h uw.h var.h void.h '
+SOURCES='abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c data.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c list_init.c log.c map.c module.c operator.c ptag.c ptr.c ptr_free.c quote.c s16.c s32.c s64.c s8.c sequence.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_band.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_shift_left.c tag_shift_right.c tag_sub.c tag_type.c time.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c void.c '
+LO_SOURCES=' ../libtommath/bn_cutoffs.c ../libtommath/bn_mp_2expt.c ../libtommath/bn_mp_abs.c ../libtommath/bn_mp_add.c ../libtommath/bn_mp_add_d.c ../libtommath/bn_mp_and.c ../libtommath/bn_mp_clamp.c ../libtommath/bn_mp_clear.c ../libtommath/bn_mp_clear_multi.c ../libtommath/bn_mp_cmp.c ../libtommath/bn_mp_cmp_d.c ../libtommath/bn_mp_cmp_mag.c ../libtommath/bn_mp_cnt_lsb.c ../libtommath/bn_mp_complement.c ../libtommath/bn_mp_copy.c ../libtommath/bn_mp_count_bits.c ../libtommath/bn_mp_div.c ../libtommath/bn_mp_div_2.c ../libtommath/bn_mp_div_2d.c ../libtommath/bn_mp_div_3.c ../libtommath/bn_mp_div_d.c ../libtommath/bn_mp_dr_is_modulus.c ../libtommath/bn_mp_dr_reduce.c ../libtommath/bn_mp_dr_setup.c ../libtommath/bn_mp_error_to_string.c ../libtommath/bn_mp_exch.c ../libtommath/bn_mp_exptmod.c ../libtommath/bn_mp_gcd.c ../libtommath/bn_mp_get_double.c ../libtommath/bn_mp_get_i32.c ../libtommath/bn_mp_get_i64.c ../libtommath/bn_mp_get_mag_u32.c ../libtommath/bn_mp_get_mag_u64.c ../libtommath/bn_mp_grow.c ../libtommath/bn_mp_init.c ../libtommath/bn_mp_init_copy.c ../libtommath/bn_mp_init_multi.c ../libtommath/bn_mp_init_size.c ../libtommath/bn_mp_invmod.c ../libtommath/bn_mp_lcm.c ../libtommath/bn_mp_lshd.c ../libtommath/bn_mp_mod.c ../libtommath/bn_mp_mod_2d.c ../libtommath/bn_mp_montgomery_calc_normalization.c ../libtommath/bn_mp_montgomery_reduce.c ../libtommath/bn_mp_montgomery_setup.c ../libtommath/bn_mp_mul.c ../libtommath/bn_mp_mul_2.c ../libtommath/bn_mp_mul_2d.c ../libtommath/bn_mp_mul_d.c ../libtommath/bn_mp_mulmod.c ../libtommath/bn_mp_neg.c ../libtommath/bn_mp_or.c ../libtommath/bn_mp_radix_size.c ../libtommath/bn_mp_reduce.c ../libtommath/bn_mp_reduce_2k.c ../libtommath/bn_mp_reduce_2k_l.c ../libtommath/bn_mp_reduce_2k_setup.c ../libtommath/bn_mp_reduce_2k_setup_l.c ../libtommath/bn_mp_reduce_is_2k.c ../libtommath/bn_mp_reduce_is_2k_l.c ../libtommath/bn_mp_reduce_setup.c ../libtommath/bn_mp_rshd.c ../libtommath/bn_mp_set.c ../libtommath/bn_mp_set_double.c ../libtommath/bn_mp_set_i32.c ../libtommath/bn_mp_set_i64.c ../libtommath/bn_mp_set_l.c ../libtommath/bn_mp_set_u32.c ../libtommath/bn_mp_set_u64.c ../libtommath/bn_mp_set_ul.c ../libtommath/bn_mp_sqr.c ../libtommath/bn_mp_sqrt.c ../libtommath/bn_mp_sub.c ../libtommath/bn_mp_sub_d.c ../libtommath/bn_mp_xor.c ../libtommath/bn_mp_zero.c ../libtommath/bn_s_mp_add.c ../libtommath/bn_s_mp_balance_mul.c ../libtommath/bn_s_mp_exptmod.c ../libtommath/bn_s_mp_exptmod_fast.c ../libtommath/bn_s_mp_invmod_fast.c ../libtommath/bn_s_mp_invmod_slow.c ../libtommath/bn_s_mp_karatsuba_mul.c ../libtommath/bn_s_mp_karatsuba_sqr.c ../libtommath/bn_s_mp_montgomery_reduce_fast.c ../libtommath/bn_s_mp_mul_digs.c ../libtommath/bn_s_mp_mul_digs_fast.c ../libtommath/bn_s_mp_mul_high_digs.c ../libtommath/bn_s_mp_mul_high_digs_fast.c ../libtommath/bn_s_mp_rand_platform.c ../libtommath/bn_s_mp_sqr.c ../libtommath/bn_s_mp_sqr_fast.c ../libtommath/bn_s_mp_sub.c ../libtommath/bn_s_mp_toom_mul.c ../libtommath/bn_s_mp_toom_sqr.c abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c data.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c list_init.c log.c map.c module.c operator.c ptag.c ptr.c ptr_free.c quote.c s16.c s32.c s64.c s8.c sequence.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_band.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_shift_left.c tag_shift_right.c tag_sub.c tag_type.c time.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c void.c '
diff --git a/libc3/struct.c b/libc3/struct.c
index ae55f34..62d56ce 100644
--- a/libc3/struct.c
+++ b/libc3/struct.c
@@ -14,6 +14,7 @@
#include <err.h>
#include <stdlib.h>
#include <string.h>
+#include "data.h"
#include "env.h"
#include "list.h"
#include "map.h"
@@ -22,7 +23,6 @@
#include "sym.h"
#include "tag.h"
#include "tag_type.h"
-#include "void.h"
s_struct * struct_allocate (s_struct *s)
{
@@ -50,7 +50,7 @@ void struct_clean (s_struct *s)
i = 0;
while (i < s->type.map.count) {
if (tag_type(s->type.map.value + i, &sym))
- void_clean(sym, (s8 *) s->data + s->type.offset[i]);
+ data_clean(sym, (s8 *) s->data + s->type.offset[i]);
i++;
}
if (s->free_data)
@@ -142,7 +142,7 @@ s_struct * struct_init_copy (s_struct *s, const s_struct *src)
i = 0;
while (i < tmp.type.map.count) {
if (! tag_type(tmp.type.map.value + i, &sym) ||
- ! void_init_copy(sym, (s8 *) tmp.data + tmp.type.offset[i],
+ ! data_init_copy(sym, (s8 *) tmp.data + tmp.type.offset[i],
(s8 *) src->data + tmp.type.offset[i]))
goto ko;
i++;
@@ -300,8 +300,8 @@ s_struct * struct_set (s_struct *s, const s_sym *key,
data = (s8 *) s->data + s->type.offset[i];
if (! tag_to_const_pointer(value, type_sym, &data_src))
return NULL;
- void_clean(type_sym, data);
- if (! void_init_copy(type_sym, data, data_src))
+ data_clean(type_sym, data);
+ if (! data_init_copy(type_sym, data, data_src))
return NULL;
return s;
}
diff --git a/libc3/struct_type.c b/libc3/struct_type.c
index 5eb0614..6a907c5 100644
--- a/libc3/struct_type.c
+++ b/libc3/struct_type.c
@@ -43,6 +43,11 @@ bool struct_type_exists (const s_sym *module)
return env_struct_type_exists(&g_c3_env, module);
}
+s_struct_type * struct_type_find (const s_sym *module)
+{
+ return env_struct_type_find(&g_c3_env, module);
+}
+
s_struct_type * struct_type_init (s_struct_type *st, const s_sym *module,
const s_list *spec)
{
diff --git a/libc3/struct_type.h b/libc3/struct_type.h
index 1d05648..2510aad 100644
--- a/libc3/struct_type.h
+++ b/libc3/struct_type.h
@@ -41,8 +41,9 @@ s_struct_type * struct_type_new (const s_sym *module,
const s_list *spec);
/* Utility functions. */
-bool struct_type_exists (const s_sym *module);
-uw struct_type_padding (uw offset, uw size);
+bool struct_type_exists (const s_sym *module);
+s_struct_type * struct_type_find (const s_sym *module);
+uw struct_type_padding (uw offset, uw size);
#endif /* LIBC3_STRUCT_TYPE_H */
diff --git a/libc3/types.h b/libc3/types.h
index 1c114c5..cf67e5c 100644
--- a/libc3/types.h
+++ b/libc3/types.h
@@ -115,6 +115,7 @@ typedef enum {
TAG_QUOTE,
TAG_STR,
TAG_STRUCT,
+ TAG_STRUCT_TYPE,
TAG_SYM,
TAG_TUPLE,
TAG_VAR,
@@ -319,7 +320,7 @@ struct struct_ {
void *data;
s_tag *tag;
bool free_data;
- s_struct_type type;
+ s_struct_type *type;
};
/* 3 */
@@ -373,7 +374,7 @@ struct array {
uw dimension;
s_array_dimension *dimensions;
void *data;
- void *data_free;
+ void *free_data;
uw size;
s_tag *tags;
const s_sym *type;
@@ -386,37 +387,38 @@ struct float_s {
/* 5 */
union tag_data {
- s_array array;
- bool bool;
- s_call call;
- s_cfn cfn;
- character character;
- f32 f32;
- f64 f64;
- s_fact fact;
- s_fn fn;
- s_ident ident;
- s_integer integer;
- s_list *list;
- s_map map;
- p_tag ptag;
- u_ptr_w ptr;
- u_ptr_w ptr_free;
- s_quote quote;
- s_str str;
- s_struct struct_;
- const s_sym *sym;
- s8 s8;
- s16 s16;
- s32 s32;
- s64 s64;
- sw sw;
- s_tuple tuple;
- u8 u8;
- u16 u16;
- u32 u32;
- u64 u64;
- uw uw;
+ s_array array;
+ bool bool;
+ s_call call;
+ s_cfn cfn;
+ character character;
+ f32 f32;
+ f64 f64;
+ s_fact fact;
+ s_fn fn;
+ s_ident ident;
+ s_integer integer;
+ s_list *list;
+ s_map map;
+ p_tag ptag;
+ u_ptr_w ptr;
+ u_ptr_w ptr_free;
+ s_quote quote;
+ s_str str;
+ s_struct struct_;
+ s_struct_type *struct_type;
+ const s_sym *sym;
+ s8 s8;
+ s16 s16;
+ s32 s32;
+ s64 s64;
+ sw sw;
+ s_tuple tuple;
+ u8 u8;
+ u16 u16;
+ u32 u32;
+ u64 u64;
+ uw uw;
};
/* 6 */
diff --git a/libc3/void.c b/libc3/void.c
index 348c8fe..cb3aa61 100644
--- a/libc3/void.c
+++ b/libc3/void.c
@@ -10,554 +10,10 @@
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
-#include "c3.h"
+#include "void.h"
-sw void_buf_inspect (const s_sym *type, s_buf *buf, const void *v)
+void * void_init_cast (void *v, const s_tag *src)
{
- sw r;
- if (type == sym_1("Array"))
- return buf_inspect_array(buf, v);
- if (type == sym_1("Bool"))
- return buf_inspect_bool(buf, v);
- if (type == sym_1("Call"))
- return buf_inspect_call(buf, v);
- if (type == sym_1("Cfn"))
- return buf_inspect_cfn(buf, v);
- if (type == sym_1("Character"))
- return buf_inspect_character(buf, v);
- if (type == sym_1("F32"))
- return buf_inspect_f32(buf, v);
- if (type == sym_1("F64"))
- return buf_inspect_f64(buf, v);
- if (type == sym_1("Fact"))
- return buf_inspect_fact(buf, v);
- if (type == sym_1("Fn"))
- return buf_inspect_fn(buf, v);
- if (type == sym_1("Ident"))
- return buf_inspect_ident(buf, v);
- if (type == sym_1("Integer"))
- return buf_inspect_integer(buf, v);
- if (type == sym_1("List"))
- return buf_inspect_list(buf, v);
- if (type == sym_1("Ptag"))
- return buf_inspect_ptag(buf, v);
- if (type == sym_1("Ptr"))
- return buf_inspect_ptr(buf, v);
- if (type == sym_1("PtrFree"))
- return buf_inspect_ptr_free(buf, v);
- if (type == sym_1("Quote"))
- return buf_inspect_quote(buf, v);
- if (type == sym_1("S8"))
- return buf_inspect_s8(buf, v);
- if (type == sym_1("S16"))
- return buf_inspect_s16(buf, v);
- if (type == sym_1("S32"))
- return buf_inspect_s32(buf, v);
- if (type == sym_1("S64"))
- return buf_inspect_s64(buf, v);
- if (type == sym_1("Str"))
- return buf_inspect_str(buf, v);
- if (type == sym_1("Struct"))
- return buf_inspect_struct(buf, v);
- if (type == sym_1("Sw"))
- return buf_inspect_sw(buf, v);
- if (type == sym_1("Sym"))
- return buf_inspect_sym(buf, v);
- if (type == sym_1("Tuple"))
- return buf_inspect_tuple(buf, v);
- if (type == sym_1("U8"))
- return buf_inspect_u8(buf, v);
- if (type == sym_1("U16"))
- return buf_inspect_u16(buf, v);
- if (type == sym_1("U32"))
- return buf_inspect_u32(buf, v);
- if (type == sym_1("U64"))
- return buf_inspect_u64(buf, v);
- if (type == sym_1("Uw"))
- return buf_inspect_uw(buf, v);
- if (type == sym_1("Var"))
- return buf_inspect_var(buf, v);
- if (type == sym_1("Void"))
- return buf_inspect_void(buf, v);
- /*
- if (sym_is_array_type(type)) {
- */
- if (struct_type_exists(type)) {
- s_struct s = {0};
- struct_init_with_data(&s, type, false, (void *) v);
- r = buf_inspect_struct(buf, &s);
- struct_type_clean(&s.type);
- return r;
- }
- err_write_1("void_buf_inspect: unknown type: ");
- err_inspect_sym(&type);
- err_write_1("\n");
- assert(! "void_buf_inspect: unknown type");
- return -1;
-}
-
-sw void_buf_inspect_size (const s_sym *type, const void *v)
-{
- sw r;
- if (type == sym_1("Array"))
- return buf_inspect_array_size(v);
- if (type == sym_1("Bool"))
- return buf_inspect_bool_size(v);
- if (type == sym_1("Call"))
- return buf_inspect_call_size(v);
- if (type == sym_1("Cfn"))
- return buf_inspect_cfn_size(v);
- if (type == sym_1("Character"))
- return buf_inspect_character_size(v);
- if (type == sym_1("F32"))
- return buf_inspect_f32_size(v);
- if (type == sym_1("F64"))
- return buf_inspect_f64_size(v);
- if (type == sym_1("Fact"))
- return buf_inspect_fact_size(v);
- if (type == sym_1("Fn"))
- return buf_inspect_fn_size(v);
- if (type == sym_1("Ident"))
- return buf_inspect_ident_size(v);
- if (type == sym_1("Integer"))
- return buf_inspect_integer_size(v);
- if (type == sym_1("List"))
- return buf_inspect_list_size(v);
- if (type == sym_1("Ptag"))
- return buf_inspect_ptag_size(v);
- if (type == sym_1("Ptr"))
- return buf_inspect_ptr_size(v);
- if (type == sym_1("PtrFree"))
- return buf_inspect_ptr_free_size(v);
- if (type == sym_1("Quote"))
- return buf_inspect_quote_size(v);
- if (type == sym_1("S8"))
- return buf_inspect_s8_size(v);
- if (type == sym_1("S16"))
- return buf_inspect_s16_size(v);
- if (type == sym_1("S32"))
- return buf_inspect_s32_size(v);
- if (type == sym_1("S64"))
- return buf_inspect_s64_size(v);
- if (type == sym_1("Str"))
- return buf_inspect_str_size(v);
- if (type == sym_1("Struct"))
- return buf_inspect_struct_size(v);
- if (type == sym_1("Sw"))
- return buf_inspect_sw_size(v);
- if (type == sym_1("Sym"))
- return buf_inspect_sym_size(v);
- if (type == sym_1("Tuple"))
- return buf_inspect_tuple_size(v);
- if (type == sym_1("U8"))
- return buf_inspect_u8_size(v);
- if (type == sym_1("U16"))
- return buf_inspect_u16_size(v);
- if (type == sym_1("U32"))
- return buf_inspect_u32_size(v);
- if (type == sym_1("U64"))
- return buf_inspect_u64_size(v);
- if (type == sym_1("Uw"))
- return buf_inspect_uw_size(v);
- if (type == sym_1("Var"))
- return buf_inspect_var_size(v);
- if (type == sym_1("Void"))
- return buf_inspect_void_size(v);
- /*
- if (sym_is_array_type(type)) {
- */
- if (struct_type_exists(type)) {
- s_struct s = {0};
- struct_init_with_data(&s, type, false, (void *) v);
- r = buf_inspect_struct_size(&s);
- struct_type_clean(&s.type);
- return r;
- }
- err_write_1("void_buf_inspect_size: unknown type: ");
- err_inspect_sym(&type);
- err_write_1("\n");
- assert(! "void_buf_inspect_size: unknown type");
- return -1;
-}
-
-bool void_clean (const s_sym *type, void *data)
-{
- assert(type);
- if (type == sym_1("Array")) {
- array_clean(data);
- return true;
- }
- if (type == sym_1("Bool")) {
- return true;
- }
- if (type == sym_1("Call")) {
- call_clean(data);
- return true;
- }
- if (type == sym_1("Cfn")) {
- cfn_clean(data);
- return true;
- }
- if (type == sym_1("Character")) {
- return true;
- }
- if (type == sym_1("F32")) {
- return true;
- }
- if (type == sym_1("F64")) {
- return true;
- }
- if (type == sym_1("Fact")) {
- return true;
- }
- if (type == sym_1("Fn")) {
- fn_clean(data);
- return true;
- }
- if (type == sym_1("Ident")) {
- return true;
- }
- if (type == sym_1("Integer")) {
- integer_clean(data);
- return true;
- }
- if (type == sym_1("List")) {
- list_f_clean(data);
- return true;
- }
- if (type == sym_1("Map")) {
- map_clean(data);
- return true;
- }
- if (type == sym_1("Ptag")) {
- return true;
- }
- if (type == sym_1("Ptr")) {
- return true;
- }
- if (type == sym_1("PtrFree")) {
- ptr_free_clean(data);
- return true;
- }
- if (type == sym_1("Quote")) {
- quote_clean(data);
- return true;
- }
- if (type == sym_1("S8")) {
- return true;
- }
- if (type == sym_1("S16")) {
- return true;
- }
- if (type == sym_1("S32")) {
- return true;
- }
- if (type == sym_1("S64")) {
- return true;
- }
- if (type == sym_1("Str")) {
- str_clean(data);
- return true;
- }
- if (type == sym_1("Struct")) {
- struct_clean(data);
- return true;
- }
- if (type == sym_1("Sw")) {
- return true;
- }
- if (type == sym_1("Sym")) {
- return true;
- }
- if (type == sym_1("Tuple")) {
- tuple_clean(data);
- return true;
- }
- if (type == sym_1("U8")) {
- return true;
- }
- if (type == sym_1("U16")) {
- return true;
- }
- if (type == sym_1("U32")) {
- return true;
- }
- if (type == sym_1("U64")) {
- return true;
- }
- if (type == sym_1("Uw")) {
- return true;
- }
- if (type == sym_1("Var")) {
- return true;
- }
- if (type == sym_1("Void")) {
- return true;
- }
- /*
- if (sym_is_array_type(type)) {
- */
- if (struct_type_exists(type)) {
- s_struct s = {0};
- struct_init_with_data(&s, type, false, data);
- struct_clean(&s);
- return true;
- }
- err_write_1("void_clean: unknown type: ");
- err_inspect_sym(&type);
- err_write_1("\n");
- assert(! "void_clean: unknown type");
- return false;
-}
-
-bool void_hash_update (const s_sym *type, t_hash *hash, const void *v)
-{
- bool r;
- if (type == sym_1("Array"))
- return hash_update_array(hash, v);
- if (type == sym_1("Bool"))
- return hash_update_bool(hash, v);
- if (type == sym_1("Call"))
- return hash_update_call(hash, v);
- if (type == sym_1("Cfn"))
- return hash_update_cfn(hash, v);
- if (type == sym_1("Character"))
- return hash_update_character(hash, v);
- if (type == sym_1("F32"))
- return hash_update_f32(hash, v);
- if (type == sym_1("F64"))
- return hash_update_f64(hash, v);
- if (type == sym_1("Fact"))
- return hash_update_fact(hash, v);
- if (type == sym_1("Fn"))
- return hash_update_fn(hash, v);
- if (type == sym_1("Ident"))
- return hash_update_ident(hash, v);
- if (type == sym_1("Integer"))
- return hash_update_integer(hash, v);
- if (type == sym_1("List"))
- return hash_update_list(hash, v);
- if (type == sym_1("Ptag"))
- return hash_update_ptag(hash, v);
- if (type == sym_1("Ptr"))
- return hash_update_ptr(hash, v);
- if (type == sym_1("PtrFree"))
- return hash_update_ptr_free(hash, v);
- if (type == sym_1("Quote"))
- return hash_update_quote(hash, v);
- if (type == sym_1("S8"))
- return hash_update_s8(hash, v);
- if (type == sym_1("S16"))
- return hash_update_s16(hash, v);
- if (type == sym_1("S32"))
- return hash_update_s32(hash, v);
- if (type == sym_1("S64"))
- return hash_update_s64(hash, v);
- if (type == sym_1("Str"))
- return hash_update_str(hash, v);
- if (type == sym_1("Struct"))
- return hash_update_struct(hash, v);
- if (type == sym_1("Sw"))
- return hash_update_sw(hash, v);
- if (type == sym_1("Sym"))
- return hash_update_sym(hash, v);
- if (type == sym_1("Tuple"))
- return hash_update_tuple(hash, v);
- if (type == sym_1("U8"))
- return hash_update_u8(hash, v);
- if (type == sym_1("U16"))
- return hash_update_u16(hash, v);
- if (type == sym_1("U32"))
- return hash_update_u32(hash, v);
- if (type == sym_1("U64"))
- return hash_update_u64(hash, v);
- if (type == sym_1("Uw"))
- return hash_update_uw(hash, v);
- if (type == sym_1("Var"))
- return hash_update_var(hash, v);
- if (type == sym_1("Void"))
- return hash_update_void(hash, v);
- /*
- if (sym_is_array_type(type)) {
- */
- if (struct_type_exists(type)) {
- s_struct s = {0};
- struct_init_with_data(&s, type, false, (void *) v);
- r = hash_update_struct(hash, &s);
- struct_type_clean(&s.type);
- return r;
- }
- err_write_1("void_hash_update: unknown type: ");
- err_inspect_sym(&type);
- err_write_1("\n");
- assert(! "void_hash_update: unknown type");
- return false;
-}
-
-void * void_init_cast (const s_sym *type, void *v, const s_tag *tag)
-{
- void *r;
- if (type == sym_1("Array"))
- return array_init_cast(v, tag);
- if (type == sym_1("Bool"))
- return bool_init_cast(v, tag);
- if (type == sym_1("Call"))
- return call_init_cast(v, tag);
- if (type == sym_1("Cfn"))
- return cfn_init_cast(v, tag);
- if (type == sym_1("Character"))
- return character_init_cast(v, tag);
- if (type == sym_1("F32"))
- return f32_init_cast(v, tag);
- if (type == sym_1("F64"))
- return f64_init_cast(v, tag);
- if (type == sym_1("Fact"))
- return fact_init_cast(v, tag);
- if (type == sym_1("Fn"))
- return fn_init_cast(v, tag);
- if (type == sym_1("Ident"))
- return ident_init_cast(v, tag);
- if (type == sym_1("Integer"))
- return integer_init_cast(v, tag);
- if (type == sym_1("List"))
- return list_init_cast(v, tag);
- if (type == sym_1("Ptag"))
- return ptag_init_cast(v, tag);
- if (type == sym_1("Ptr"))
- return ptr_init_cast(v, tag);
- if (type == sym_1("PtrFree"))
- return ptr_free_init_cast(v, tag);
- if (type == sym_1("Quote"))
- return quote_init_cast(v, tag);
- if (type == sym_1("S8"))
- return s8_init_cast(v, tag);
- if (type == sym_1("S16"))
- return s16_init_cast(v, tag);
- if (type == sym_1("S32"))
- return s32_init_cast(v, tag);
- if (type == sym_1("S64"))
- return s64_init_cast(v, tag);
- if (type == sym_1("Str"))
- return str_init_cast(v, tag);
- if (type == sym_1("Struct"))
- return struct_init_cast(v, tag);
- if (type == sym_1("Sw"))
- return sw_init_cast(v, tag);
- if (type == sym_1("Sym"))
- return sym_init_cast(v, tag);
- if (type == sym_1("Tuple"))
- return tuple_init_cast(v, tag);
- if (type == sym_1("U8"))
- return u8_init_cast(v, tag);
- if (type == sym_1("U16"))
- return u16_init_cast(v, tag);
- if (type == sym_1("U32"))
- return u32_init_cast(v, tag);
- if (type == sym_1("U64"))
- return u64_init_cast(v, tag);
- if (type == sym_1("Uw"))
- return uw_init_cast(v, tag);
- if (type == sym_1("Var"))
- return v;
- if (type == sym_1("Void"))
- return v;
- /*
- if (sym_is_array_type(type)) {
- */
- if (struct_type_exists(type)) {
- s_struct s = {0};
- struct_init_with_data(&s, type, false, v);
- r = struct_init_cast(&s, tag);
- struct_type_clean(&s.type);
- return r;
- }
- err_write_1("void_init_cast: unknown type: ");
- err_inspect_sym(&type);
- err_write_1("\n");
- assert(! "void_init_cast: unknown type");
- return NULL;
-}
-
-void * void_init_copy (const s_sym *type, void *v, const void *src)
-{
- void *r;
- if (type == sym_1("Array"))
- return array_init_copy(v, src);
- if (type == sym_1("Bool"))
- return bool_init_copy(v, src);
- if (type == sym_1("Call"))
- return call_init_copy(v, src);
- if (type == sym_1("Cfn"))
- return cfn_init_copy(v, src);
- if (type == sym_1("Character"))
- return character_init_copy(v, src);
- if (type == sym_1("F32"))
- return f32_init_copy(v, src);
- if (type == sym_1("F64"))
- return f64_init_copy(v, src);
- if (type == sym_1("Fact"))
- return fact_init_copy(v, src);
- if (type == sym_1("Fn"))
- return fn_init_copy(v, src);
- if (type == sym_1("Ident"))
- return ident_init_copy(v, src);
- if (type == sym_1("Integer"))
- return integer_init_copy(v, src);
- if (type == sym_1("List"))
- return list_init_copy(v, src);
- if (type == sym_1("Ptag"))
- return ptag_init_copy(v, src);
- if (type == sym_1("Ptr"))
- return ptr_init_copy(v, src);
- if (type == sym_1("PtrFree"))
- return ptr_free_init_copy(v, src);
- if (type == sym_1("Quote"))
- return quote_init_copy(v, src);
- if (type == sym_1("S8"))
- return s8_init_copy(v, src);
- if (type == sym_1("S16"))
- return s16_init_copy(v, src);
- if (type == sym_1("S32"))
- return s32_init_copy(v, src);
- if (type == sym_1("S64"))
- return s64_init_copy(v, src);
- if (type == sym_1("Str"))
- return str_init_copy(v, src);
- if (type == sym_1("Struct"))
- return struct_init_copy(v, src);
- if (type == sym_1("Sw"))
- return sw_init_copy(v, src);
- if (type == sym_1("Sym"))
- return sym_init_copy(v, src);
- if (type == sym_1("Tuple"))
- return tuple_init_copy(v, src);
- if (type == sym_1("U8"))
- return u8_init_copy(v, src);
- if (type == sym_1("U16"))
- return u16_init_copy(v, src);
- if (type == sym_1("U32"))
- return u32_init_copy(v, src);
- if (type == sym_1("U64"))
- return u64_init_copy(v, src);
- if (type == sym_1("Uw"))
- return uw_init_copy(v, src);
- if (type == sym_1("Var"))
- return v;
- if (type == sym_1("Void"))
- return v;
- if (struct_type_exists(type)) {
- s_struct s = {0};
- s_struct t = {0};
- struct_init_with_data(&s, type, false, v);
- struct_init_with_data(&t, type, false, (void *) src);
- r = struct_init_copy(&s, &t);
- struct_type_clean(&s.type);
- struct_type_clean(&t.type);
- return r;
- }
- err_write_1("void_init_copy: unknown type: ");
- err_inspect_sym(&type);
- err_write_1("\n");
- assert(! "void_init_copy: unknown type");
- return NULL;
+ (void) src;
+ return v;
}
diff --git a/libc3/void.h b/libc3/void.h
index 280fde3..3e8168b 100644
--- a/libc3/void.h
+++ b/libc3/void.h
@@ -21,12 +21,7 @@
#include "types.h"
-sw void_buf_inspect (const s_sym *type, s_buf *buf, const void *v);
-sw void_buf_inspect_size (const s_sym *type, const void *v);
-bool void_clean (const s_sym *type, void *v);
-bool void_hash_update (const s_sym *type, t_hash *hash,
- const void *s);
-void * void_init_cast (const s_sym *type, void *v, const s_tag *src);
-void * void_init_copy (const s_sym *type, void *v, const void *src);
+/* Operators. */
+void * void_init_cast (void *v, const s_tag *src);
#endif /* LIBC3_VOID_H */
diff --git a/libc3/window/sdl2/demo/earth.c b/libc3/window/sdl2/demo/earth.c
index 891e4d4..e1d6470 100644
--- a/libc3/window/sdl2/demo/earth.c
+++ b/libc3/window/sdl2/demo/earth.c
@@ -58,7 +58,7 @@ bool earth_render (s_sequence *seq)
f64 *camera_rot_x_speed;
s_map *map;
s_gl_sphere *sphere;
- f64 sphere_radius;
+ //f64 sphere_radius;
s_window_sdl2 *window;
assert(seq);
window = seq->window;
@@ -96,42 +96,43 @@ bool earth_render (s_sequence *seq)
assert(glGetError() == GL_NO_ERROR);
//glEnable(GL_LIGHT0);
assert(glGetError() == GL_NO_ERROR);
- f32 ambiant[4] = {0.1f, 0.1f, 0.1f, 1.0f};
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambiant);
- f32 diffuse[4] = {1.0f, 0.92f, 0.83f, 1.0f};
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, diffuse);
- f32 position[4] = {-1000.0, 0.0, 0.0, 1.0};
- glLightfv(GL_LIGHT0, GL_POSITION, position);
- glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1f);
- glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.0f);
- glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.0f);
+ //f32 ambiant[4] = {0.1f, 0.1f, 0.1f, 1.0f};
+ //glLightfv(GL_LIGHT0, GL_AMBIENT, ambiant);
+ //f32 diffuse[4] = {1.0f, 0.92f, 0.83f, 1.0f};
+ //glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ //glLightfv(GL_LIGHT0, GL_SPECULAR, diffuse);
+ //f32 position[4] = {-1000.0, 0.0, 0.0, 1.0};
+ //glLightfv(GL_LIGHT0, GL_POSITION, position);
+ //glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1f);
+ //glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.0f);
+ //glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.0f);
assert(glGetError() == GL_NO_ERROR);
glEnable(GL_DEPTH_TEST);
assert(glGetError() == GL_NO_ERROR);
- glPushMatrix(); {
- sphere_radius = 5.0;
+ //glPushMatrix();
+ {
+ //sphere_radius = 5.0;
+ assert(glGetError() == GL_NO_ERROR);
+ //glScalef(sphere_radius, sphere_radius, sphere_radius);
+ assert(glGetError() == GL_NO_ERROR);
+ //glEnable(GL_TEXTURE_2D);
assert(glGetError() == GL_NO_ERROR);
- glScalef(sphere_radius, sphere_radius, sphere_radius);
- assert(glGetError() == GL_NO_ERROR);
- glEnable(GL_TEXTURE_2D);
- assert(glGetError() == GL_NO_ERROR);
gl_sprite_bind(&g_sprite_earth, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
assert(glGetError() == GL_NO_ERROR);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ glBlendColor(1.0f, 1.0f, 1.0f, 1.0f);
gl_sphere_render(sphere);
/*
glDisable(GL_TEXTURE_2D);
glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
gl_sphere_render_wireframe(sphere);
*/
- } glPopMatrix();
- glDisable(GL_TEXTURE_2D);
+ } // glPopMatrix();
+ //glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHT0);
- glDisable(GL_LIGHTING);
+ //glDisable(GL_LIGHT0);
+ //glDisable(GL_LIGHTING);
return true;
}
diff --git a/libc3/window/sdl2/demo/flies.c b/libc3/window/sdl2/demo/flies.c
index 3176666..cc9e6be 100644
--- a/libc3/window/sdl2/demo/flies.c
+++ b/libc3/window/sdl2/demo/flies.c
@@ -13,6 +13,8 @@
#include <math.h>
#include <libc3/c3.h>
#include "../gl_font.h"
+#include "../gl_matrix_4d.h"
+#include "../gl_ortho.h"
#include "../gl_text.h"
#include "../gl_sprite.h"
#include "../window_sdl2.h"
@@ -33,8 +35,8 @@ static const u8 g_board_item_block = BOARD_ITEM_BLOCK;
static const u8 g_board_item_fly = BOARD_ITEM_FLY;
static const u8 g_board_item_dead_fly = BOARD_ITEM_DEAD_FLY;
s_gl_font g_font_flies = {0};
-s_gl_sprite g_sprite_dead_fly = {0};
-s_gl_sprite g_sprite_fly = {0};
+s_gl_sprite g_sprite_dead_fly = {0};
+s_gl_sprite g_sprite_fly = {0};
s_gl_text g_text_flies_in = {0};
s_gl_text g_text_flies_out = {0};
static const f64 g_xy_ratio = 0.666;
@@ -126,6 +128,8 @@ bool flies_load (s_sequence *seq)
i++;
}
fly_init(map);
+ gl_text_init_1(&g_text_flies_in, &g_font_flies, "In 0");
+ gl_text_init_1(&g_text_flies_out, &g_font_flies, "Out 0");
return true;
}
@@ -154,6 +158,9 @@ bool flies_render (s_sequence *seq)
uw i;
uw j;
s_map *map;
+ s_gl_matrix_4d matrix;
+ s_gl_matrix_4d matrix_1;
+ s_gl_matrix_4d matrix_2;
uw r;
uw random_bits = 0;
f64 x;
@@ -187,54 +194,60 @@ bool flies_render (s_sequence *seq)
dead_fly_scale = 2.0 * board_item_w / g_sprite_dead_fly.w;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
- glPushMatrix(); {
- glTranslated(board_x, 60.0, 0.0);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- buf_init(&buf, false, sizeof(a), a);
- buf_write_1(&buf, "In ");
- buf_inspect_uw(&buf, fly_in);
- buf_write_u8(&buf, 0);
- gl_font_set_size(&g_font_flies, board_item_h,
- (f64) window->gl_h / window->h);
- gl_text_update_1(&g_text_flies_in, a);
- gl_text_render(&g_text_flies_in);
- buf_init(&buf, false, sizeof(a), a);
- buf_write_1(&buf, "Out ");
- buf_inspect_uw(&buf, fly_out);
- buf_write_u8(&buf, 0);
- x = board_item_w * (BOARD_SIZE / 2 + 1);
- glPushMatrix(); {
- glTranslated(x, 0.0, 0.0);
- gl_text_update_1(&g_text_flies_out, a);
- gl_text_render(&g_text_flies_out);
- } glPopMatrix();
- glTranslated(0.0, board_item_h, 0.0);
- glColor4f(0.6f, 0.7f, 0.9f, 1.0f);
- glRectd(0, 0, board_w, board_h);
+ gl_matrix_4d_init_identity(&g_ortho.model_matrix);
+ gl_matrix_4d_translate(&g_ortho.model_matrix, board_x, 60.0, 0.0);
+ glBlendColor(1.0f, 1.0f, 1.0f, 1.0f);
+ buf_init(&buf, false, sizeof(a), a);
+ buf_write_1(&buf, "In ");
+ buf_inspect_uw(&buf, fly_in);
+ buf_write_u8(&buf, 0);
+ gl_font_set_size(&g_font_flies, board_item_h,
+ (f64) window->gl_h / window->h);
+ gl_text_update_1(&g_text_flies_in, a);
+ gl_text_render(&g_text_flies_in);
+ buf_init(&buf, false, sizeof(a), a);
+ buf_write_1(&buf, "Out ");
+ buf_inspect_uw(&buf, fly_out);
+ buf_write_u8(&buf, 0);
+ x = board_item_w * (BOARD_SIZE / 2 + 1);
+ matrix = g_ortho.model_matrix; {
+ gl_matrix_4d_translate(&g_ortho.model_matrix, x, 0.0, 0.0);
+ gl_ortho_update_model_matrix(&g_ortho);
+ gl_text_update_1(&g_text_flies_out, a);
+ gl_text_render(&g_text_flies_out);
+ g_ortho.model_matrix = matrix;
+ gl_matrix_4d_translate(&g_ortho.model_matrix, 0.0, board_item_h, 0.0);
+ glBlendColor(0.6f, 0.7f, 0.9f, 1.0f);
+ //glRectd(0, 0, board_w, board_h);
address[1] = 0;
while (address[1] < BOARD_SIZE) {
y = board_item_h * address[1];
address[0] = 0;
while (address[0] < BOARD_SIZE) {
x = board_item_w * address[0];
- glPushMatrix(); {
- glTranslated(x, board_h - board_item_h - y, 0.0);
+ matrix_1 = g_ortho.model_matrix; {
+ gl_matrix_4d_translate(&g_ortho.model_matrix, x,
+ board_h - board_item_h - y, 0.0);
board_item = (u8 *) array_data(board, address);
assert(board_item);
switch (*board_item) {
case BOARD_ITEM_SPACE:
break;
case BOARD_ITEM_BLOCK:
- glDisable(GL_TEXTURE_2D);
- glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
- glRectd(0, 0, board_item_w + 1.0, board_item_h + 1.0);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glBlendColor(0.0f, 0.0f, 1.0f, 1.0f);
+ //glRectd(0, 0, board_item_w + 1.0, board_item_h + 1.0);
break;
case BOARD_ITEM_FLY:
- glPushMatrix(); {
- glTranslated(-board_item_w / 2.0, -board_item_h / 2.0, 0.0);
- glScaled(fly_scale, fly_scale, 1.0);
+ matrix_2 = g_ortho.model_matrix; {
+ gl_matrix_4d_translate(&g_ortho.model_matrix,
+ -board_item_w / 2.0,
+ -board_item_h / 2.0, 0.0);
+ gl_matrix_4d_scale(&g_ortho.model_matrix, fly_scale,
+ fly_scale, 1.0);
+ gl_ortho_update_model_matrix(&g_ortho);
gl_sprite_render(&g_sprite_fly, 0);
- } glPopMatrix();
+ } g_ortho.model_matrix = matrix_2;
if (address[0] == BOARD_SIZE / 2 &&
address[1] == BOARD_SIZE - 1) {
array_data_set(board, address, &g_board_item_space);
@@ -302,25 +315,30 @@ bool flies_render (s_sequence *seq)
}
break;
case BOARD_ITEM_DEAD_FLY:
- glPushMatrix(); {
- glTranslated(-board_item_w / 2.0, -board_item_h / 2.0,
- 0.0);
- glScaled(dead_fly_scale, dead_fly_scale, 1.0);
+ matrix_2 = g_ortho.model_matrix; {
+ gl_matrix_4d_translate(&g_ortho.model_matrix,
+ -board_item_w / 2.0,
+ -board_item_h / 2.0, 0.0);
+ gl_matrix_4d_scale(&g_ortho.model_matrix, dead_fly_scale,
+ dead_fly_scale, 1.0);
+ gl_ortho_update_model_matrix(&g_ortho);
gl_sprite_render(&g_sprite_dead_fly, 0);
- } glPopMatrix();
+ } g_ortho.model_matrix = matrix_2;
break;
}
- } glPopMatrix();
+ } g_ortho.model_matrix = matrix_1;;
address[0]++;
}
address[1]++;
}
- } glPopMatrix();
+ } g_ortho.model_matrix = matrix;
return true;
}
bool flies_unload (s_sequence *seq)
{
(void) seq;
+ gl_text_clean(&g_text_flies_in);
+ gl_text_clean(&g_text_flies_out);
return true;
}
diff --git a/libc3/window/sdl2/demo/toasters.c b/libc3/window/sdl2/demo/toasters.c
index 21057d2..2f0b103 100644
--- a/libc3/window/sdl2/demo/toasters.c
+++ b/libc3/window/sdl2/demo/toasters.c
@@ -12,8 +12,11 @@
*/
#include <math.h>
#include <libc3/c3.h>
+#include "../gl_matrix_4d.h"
+#include "../gl_ortho.h"
#include "../gl_sprite.h"
#include "toasters.h"
+#include "window_sdl2_demo.h"
#define TOASTERS_SCALE_TOAST 0.52
#define TOASTERS_SCALE_TOASTER 0.4
@@ -46,6 +49,7 @@ static s_tag * toast_init (s_tag *toast, f64 x, f64 y)
static void toast_render (s_tag *toast, s_window_sdl2 *window,
s_sequence *seq)
{
+ s_gl_matrix_4d matrix;
f64 *x;
f64 *y;
if (toast->type == TAG_MAP) {
@@ -58,11 +62,15 @@ static void toast_render (s_tag *toast, s_window_sdl2 *window,
toast->type = TAG_VOID;
return;
}
- glPushMatrix();
- glTranslated(*x, *y + g_sprite_toast.h, 0.0);
- glScalef(TOASTERS_SCALE_TOAST, -TOASTERS_SCALE_TOAST, 1);
+ matrix = g_ortho.model_matrix;
+ gl_matrix_4d_translate(&g_ortho.model_matrix, *x,
+ *y + g_sprite_toast.h, 0.0);
+ gl_matrix_4d_scale(&g_ortho.model_matrix,
+ TOASTERS_SCALE_TOAST,
+ -TOASTERS_SCALE_TOAST, 1);
+ gl_ortho_update_model_matrix(&g_ortho);
gl_sprite_render(&g_sprite_toast, 0);
- glPopMatrix();
+ g_ortho.model_matrix = matrix;
}
}
@@ -79,6 +87,7 @@ static s_tag * toaster_init (s_tag *toaster, f64 y)
static void toaster_render (s_tag *toaster, s_window_sdl2 *window,
s_sequence *seq)
{
+ s_gl_matrix_4d matrix;
f64 *x;
f64 *y;
if (toaster->type == TAG_MAP) {
@@ -91,13 +100,17 @@ static void toaster_render (s_tag *toaster, s_window_sdl2 *window,
toaster->type = TAG_VOID;
return;
}
- glPushMatrix();
- glTranslated(*x, *y + g_sprite_toaster.h, 0.0);
- glScalef(TOASTERS_SCALE_TOASTER, -TOASTERS_SCALE_TOASTER, 1);
+ matrix = g_ortho.model_matrix;
+ gl_matrix_4d_translate(&g_ortho.model_matrix, *x,
+ *y + g_sprite_toaster.h, 0.0);
+ gl_matrix_4d_scale(&g_ortho.model_matrix,
+ TOASTERS_SCALE_TOASTER,
+ -TOASTERS_SCALE_TOASTER, 1);
+ gl_ortho_update_model_matrix(&g_ortho);
gl_sprite_render(&g_sprite_toaster,
fmod(seq->t * g_sprite_toaster.frame_count,
g_sprite_toaster.frame_count));
- glPopMatrix();
+ g_ortho.model_matrix = matrix;
}
}
@@ -123,9 +136,9 @@ bool toasters_render (s_sequence *seq)
assert(window);
glClearColor(0.7f, 0.95f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
- glPushMatrix();
- glTranslated(0, window->h, 0);
- glScalef(1, -1, 1);
+ gl_matrix_4d_init_identity(&g_ortho.model_matrix);
+ gl_matrix_4d_translate(&g_ortho.model_matrix, 0, window->h, 0);
+ gl_matrix_4d_scale(&g_ortho.model_matrix, 1, -1, 1);
/* io_inspect(&seq->tag); */
if (seq->tag.type == TAG_MAP) {
toasters = &seq->tag.data.map.value[0].data.list;
@@ -135,7 +148,6 @@ bool toasters_render (s_sequence *seq)
toasters_render_toasts(toasts, window, seq);
toasters_render_toasters(toasters, window, seq);
}
- glPopMatrix();
return true;
}
diff --git a/libc3/window/sdl2/demo/window_sdl2_demo.c b/libc3/window/sdl2/demo/window_sdl2_demo.c
index 536eae9..cc942c8 100644
--- a/libc3/window/sdl2/demo/window_sdl2_demo.c
+++ b/libc3/window/sdl2/demo/window_sdl2_demo.c
@@ -257,6 +257,7 @@ bool window_sdl2_demo_render (s_window_sdl2 *window)
if (! window_animate((s_window *) window))
return false;
seq = window->seq;
+ gl_ortho_resize(&g_ortho, 0, window->w, 0, window->h, -1, 1);
gl_matrix_4d_init_identity(&g_ortho.model_matrix);
gl_ortho_render(&g_ortho);
glEnable(GL_BLEND);
@@ -267,6 +268,7 @@ bool window_sdl2_demo_render (s_window_sdl2 *window)
return false;
assert(glGetError() == GL_NO_ERROR);
/* 2D */
+ gl_ortho_render(&g_ortho);
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
diff --git a/libc3/window/sdl2/gl_matrix_4d.c b/libc3/window/sdl2/gl_matrix_4d.c
index f0fe807..a10f928 100644
--- a/libc3/window/sdl2/gl_matrix_4d.c
+++ b/libc3/window/sdl2/gl_matrix_4d.c
@@ -147,17 +147,18 @@ s_gl_matrix_4d * gl_matrix_4d_ortho (s_gl_matrix_4d *m, f64 x1, f64 x2,
f64 dx;
f64 dy;
f64 dz;
- s_gl_matrix_4d ortho = {0};
+ s_gl_matrix_4d ortho;
assert(m);
dx = x2 - x1;
dy = y2 - y1;
- dz = clip_z_near - clip_z_far;
+ dz = clip_z_far - clip_z_near;
+ gl_matrix_4d_init_zero(&ortho);
ortho.xx = 2.0 / dx;
ortho.yy = 2.0 / dy;
- ortho.zz = 2.0 / dz;
+ ortho.zz = -2.0 / dz;
ortho.xt = -(x1 + x2) / dx;
ortho.yt = -(y1 + y2) / dy;
- ortho.zt = (clip_z_near + clip_z_far) / dz;
+ ortho.zt = -(clip_z_near + clip_z_far) / dz;
ortho.tt = 1.0;
gl_matrix_4d_product(m, &ortho);
return m;
@@ -169,12 +170,13 @@ s_gl_matrix_4d * gl_matrix_4d_perspective (s_gl_matrix_4d *m, f64 fov_y,
f64 z_far)
{
f64 dz;
- s_gl_matrix_4d perspective = {0};
+ s_gl_matrix_4d perspective;
f64 f;
f64 fov_y_2;
fov_y_2 = fov_y / 2.0;
f = cos(fov_y_2) / sin(fov_y_2);
dz = z_near - z_far;
+ gl_matrix_4d_init_zero(&perspective);
perspective.xx = f / aspect_ratio;
perspective.yy = f;
perspective.zz = (z_near + z_far) / dz;
diff --git a/libc3/window/sdl2/gl_object.c b/libc3/window/sdl2/gl_object.c
index 57da027..f2124fe 100644
--- a/libc3/window/sdl2/gl_object.c
+++ b/libc3/window/sdl2/gl_object.c
@@ -56,12 +56,13 @@ void gl_object_render (const s_gl_object *object)
{
assert(object);
assert(glGetError() == GL_NO_ERROR);
+ //glBindVertexArray(object->gl_vao);
+ //assert(glGetError() == GL_NO_ERROR);
glBindBuffer(GL_ARRAY_BUFFER, object->gl_vbo);
assert(glGetError() == GL_NO_ERROR);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, object->gl_ebo);
assert(glGetError() == GL_NO_ERROR);
- glDrawArrays(GL_TRIANGLES, object->triangle.count * 3,
- GL_UNSIGNED_INT);
+ glDrawArrays(GL_TRIANGLES, 0, object->triangle.count * 3);
assert(glGetError() == GL_NO_ERROR);
}
diff --git a/libc3/window/sdl2/gl_ortho.c b/libc3/window/sdl2/gl_ortho.c
index 08ddbc1..f9c3870 100644
--- a/libc3/window/sdl2/gl_ortho.c
+++ b/libc3/window/sdl2/gl_ortho.c
@@ -50,7 +50,7 @@ s_gl_ortho * gl_ortho_init (s_gl_ortho *ortho)
u32 vertex_shader;
assert(ortho);
gl_matrix_4d_init_identity(&ortho->projection_matrix);
- gl_matrix_4d_ortho(&ortho->projection_matrix, -1, 1, -1, 1, -1, 1);
+ //gl_matrix_4d_ortho(&ortho->projection_matrix, -1, 1, -1, 1, -1, 1);
ortho->position.x = 0.0;
ortho->position.y = 0.0;
ortho->position.z = 0.0;
diff --git a/libc3/window/sdl2/gl_sprite.c b/libc3/window/sdl2/gl_sprite.c
index fb1c54e..6f956f2 100644
--- a/libc3/window/sdl2/gl_sprite.c
+++ b/libc3/window/sdl2/gl_sprite.c
@@ -381,4 +381,5 @@ void gl_sprite_render (const s_gl_sprite *sprite, uw frame)
assert(glGetError() == GL_NO_ERROR);
glBindTexture(GL_TEXTURE_2D, 0);
assert(glGetError() == GL_NO_ERROR);
+ gl_object_render_wireframe(&sprite->object);
}
diff --git a/libc3/window/sdl2/window_sdl2.c b/libc3/window/sdl2/window_sdl2.c
index 83b9a98..fc885cd 100644
--- a/libc3/window/sdl2/window_sdl2.c
+++ b/libc3/window/sdl2/window_sdl2.c
@@ -149,6 +149,15 @@ bool window_sdl2_run (s_window_sdl2 *window)
SDL_GetError());
return false;
}
+ SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
+ SDL_GL_CONTEXT_PROFILE_CORE);
sdl_window = SDL_CreateWindow(window->title,
window->x, window->y,
window->w, window->h,
@@ -163,15 +172,6 @@ bool window_sdl2_run (s_window_sdl2 *window)
}
SDL_SetWindowBordered(sdl_window, SDL_TRUE);
window->sdl_window = sdl_window;
- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
- SDL_GL_CONTEXT_PROFILE_CORE);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6);
context = SDL_GL_CreateContext(sdl_window);
if (! context) {
warnx("window_sdl2_run: failed to create OpenGL context: %s",
@@ -184,13 +184,6 @@ bool window_sdl2_run (s_window_sdl2 *window)
gl_error_string(gl_error));
goto ko;
}
- glEnable(GL_DEBUG_OUTPUT);
- glDebugMessageCallback(gl_debug, NULL);
- if (SDL_GL_MakeCurrent(sdl_window, context) < 0) {
- warnx("window_sdl2_run: failed to make OpenGL context current: %s",
- SDL_GetError());
- goto ko;
- }
glewExperimental = GL_TRUE;
if (glewInit() != GLEW_OK) {
warnx("window_sdl2_run: failed to initialize GLEW");
@@ -204,6 +197,13 @@ bool window_sdl2_run (s_window_sdl2 *window)
err_puts("window_sdl2_run: failed to retrieve OpenGL version");
goto ko;
}
+ glEnable(GL_DEBUG_OUTPUT);
+ glDebugMessageCallback(gl_debug, NULL);
+ if (SDL_GL_MakeCurrent(sdl_window, context) < 0) {
+ warnx("window_sdl2_run: failed to make OpenGL context current: %s",
+ SDL_GetError());
+ goto ko;
+ }
int gl_w = window->w;
int gl_h = window->h;
SDL_GL_GetDrawableSize(sdl_window, &gl_w, &gl_h);
diff --git a/sources.mk b/sources.mk
index 55f65da..4bfe568 100644
--- a/sources.mk
+++ b/sources.mk
@@ -268,6 +268,8 @@ C3_C_SOURCES = \
"libc3/character.h" \
"libc3/compare.c" \
"libc3/compare.h" \
+ "libc3/data.c" \
+ "libc3/data.h" \
"libc3/env.c" \
"libc3/env.h" \
"libc3/error.c" \
@@ -475,10 +477,14 @@ C3_C_SOURCES = \
"libc3/window/sdl2/disabled/mandelbrot.h" \
"libc3/window/sdl2/disabled/sdl2_font.c" \
"libc3/window/sdl2/disabled/sdl2_font.h" \
+ "libc3/window/sdl2/disabled/sdl2_sprite.c" \
+ "libc3/window/sdl2/disabled/sdl2_sprite.h" \
"libc3/window/sdl2/gl_camera.c" \
"libc3/window/sdl2/gl_camera.h" \
"libc3/window/sdl2/gl_cylinder.c" \
"libc3/window/sdl2/gl_cylinder.h" \
+ "libc3/window/sdl2/gl_deprecated.c" \
+ "libc3/window/sdl2/gl_deprecated.h" \
"libc3/window/sdl2/gl_font.c" \
"libc3/window/sdl2/gl_font.h" \
"libc3/window/sdl2/gl_ft2.h" \
@@ -507,8 +513,6 @@ C3_C_SOURCES = \
"libc3/window/sdl2/gl_triangle.h" \
"libc3/window/sdl2/gl_vertex.c" \
"libc3/window/sdl2/gl_vertex.h" \
- "libc3/window/sdl2/sdl2_sprite.c" \
- "libc3/window/sdl2/sdl2_sprite.h" \
"libc3/window/sdl2/types.h" \
"libc3/window/sdl2/window_sdl2.c" \
"libc3/window/sdl2/window_sdl2.h" \
@@ -638,6 +642,7 @@ C3_OTHER_SOURCES = \
"lib/c3/0.1/u64.facts" \
"lib/c3/0.1/u8.facts" \
"lib/c3/0.1/uw.facts" \
+ "lib/c3/0.1/void.facts" \
"libc3/tag_init.rb" \
"license.h" \
"sources.mk" \
@@ -766,6 +771,9 @@ C3_OTHER_SOURCES = \
"test/ic3/tuple.in" \
"test/ic3/tuple.out.expected" \
"test/ic3/tuple.ret.expected" \
+ "test/ic3/void.in" \
+ "test/ic3/void.out.expected" \
+ "test/ic3/void.ret.expected" \
"test/ic3_test" \
"test/replace_lines.rb" \
"test/test.rb" \
diff --git a/sources.sh b/sources.sh
index 018bb33..690b90c 100644
--- a/sources.sh
+++ b/sources.sh
@@ -1,7 +1,7 @@
# sources.sh generated by update_sources
C3_CONFIGURES='c3c/configure c3s/configure c3s/sources.sh c3s/update_sources ic3/configure ic3/sources.sh ic3/update_sources libc3/configure libc3/sources.sh libc3/update_sources libc3/window/cairo/configure libc3/window/cairo/demo/configure libc3/window/cairo/demo/sources.sh libc3/window/cairo/demo/update_sources libc3/window/cairo/quartz/configure libc3/window/cairo/quartz/demo/configure libc3/window/cairo/quartz/demo/sources.sh libc3/window/cairo/quartz/demo/update_sources libc3/window/cairo/quartz/sources.sh libc3/window/cairo/quartz/update_sources libc3/window/cairo/sources.sh libc3/window/cairo/update_sources libc3/window/cairo/win32/configure libc3/window/cairo/win32/demo/configure libc3/window/cairo/win32/demo/sources.sh libc3/window/cairo/win32/demo/update_sources libc3/window/cairo/win32/sources.sh libc3/window/cairo/win32/update_sources libc3/window/cairo/xcb/configure libc3/window/cairo/xcb/demo/configure libc3/window/cairo/xcb/demo/sources.sh libc3/window/cairo/xcb/demo/update_sources libc3/window/cairo/xcb/sources.sh libc3/window/cairo/xcb/update_sources libc3/window/configure libc3/window/sdl2/configure libc3/window/sdl2/demo/configure libc3/window/sdl2/demo/macos/configure libc3/window/sdl2/demo/sources.sh libc3/window/sdl2/demo/update_sources libc3/window/sdl2/sources.sh libc3/window/sdl2/update_sources libc3/window/sources.sh libc3/window/update_sources libtommath/configure libtommath/sources.sh libtommath/update_sources test/configure test/sources.sh test/update_sources ucd2c/configure '
C3_MAKEFILES='c3c/Makefile c3s/Makefile c3s/sources.mk ic3/Makefile ic3/sources.mk libc3/Makefile libc3/gen.mk libc3/sources.mk libc3/window/Makefile libc3/window/cairo/Makefile libc3/window/cairo/demo/Makefile libc3/window/cairo/demo/sources.mk libc3/window/cairo/quartz/Makefile libc3/window/cairo/quartz/demo/Makefile libc3/window/cairo/quartz/demo/sources.mk libc3/window/cairo/quartz/sources.mk libc3/window/cairo/sources.mk libc3/window/cairo/win32/Makefile libc3/window/cairo/win32/demo/Makefile libc3/window/cairo/win32/demo/sources.mk libc3/window/cairo/win32/sources.mk libc3/window/cairo/xcb/Makefile libc3/window/cairo/xcb/demo/Makefile libc3/window/cairo/xcb/demo/sources.mk libc3/window/cairo/xcb/sources.mk libc3/window/sdl2/Makefile libc3/window/sdl2/demo/Makefile libc3/window/sdl2/demo/macos/Makefile libc3/window/sdl2/demo/sources.mk libc3/window/sdl2/sources.mk libc3/window/sources.mk libtommath/Makefile libtommath/sources.mk test/Makefile test/sources.mk ucd2c/Makefile '
-C3_C_SOURCES='c3c/c3c.c c3s/buf_readline.c c3s/buf_readline.h c3s/c3s.c ic3/buf_linenoise.c ic3/buf_linenoise.h ic3/buf_wineditline.c ic3/buf_wineditline.h ic3/config.h ic3/ic3.c ic3/linenoise.c libc3/abs.c libc3/abs.h libc3/arg.c libc3/arg.h libc3/array.c libc3/array.h libc3/assert.h libc3/binding.c libc3/binding.h libc3/bool.c libc3/bool.h libc3/buf.c libc3/buf.h libc3/buf_file.c libc3/buf_file.h libc3/buf_inspect.c libc3/buf_inspect.h libc3/buf_inspect_s.c.in libc3/buf_inspect_s.h.in libc3/buf_inspect_s16.c libc3/buf_inspect_s16.h libc3/buf_inspect_s16_binary.c libc3/buf_inspect_s16_binary.h libc3/buf_inspect_s16_decimal.c libc3/buf_inspect_s16_decimal.h libc3/buf_inspect_s16_hexadecimal.c libc3/buf_inspect_s16_hexadecimal.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s16_octal.h libc3/buf_inspect_s32.c libc3/buf_inspect_s32.h libc3/buf_inspect_s32_binary.c libc3/buf_inspect_s32_binary.h libc3/buf_inspect_s32_decimal.c libc3/buf_inspect_s32_decimal.h libc3/buf_inspect_s32_hexadecimal.c libc3/buf_inspect_s32_hexadecimal.h libc3/buf_inspect_s32_octal.c libc3/buf_inspect_s32_octal.h libc3/buf_inspect_s64.c libc3/buf_inspect_s64.h libc3/buf_inspect_s64_binary.c libc3/buf_inspect_s64_binary.h libc3/buf_inspect_s64_decimal.c libc3/buf_inspect_s64_decimal.h libc3/buf_inspect_s64_hexadecimal.c libc3/buf_inspect_s64_hexadecimal.h libc3/buf_inspect_s64_octal.c libc3/buf_inspect_s64_octal.h libc3/buf_inspect_s8.c libc3/buf_inspect_s8.h libc3/buf_inspect_s8_binary.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect_s8_decimal.h libc3/buf_inspect_s8_hexadecimal.c libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_s8_octal.c libc3/buf_inspect_s8_octal.h libc3/buf_inspect_s_base.c.in libc3/buf_inspect_s_base.h.in libc3/buf_inspect_sw.c libc3/buf_inspect_sw.h libc3/buf_inspect_sw_binary.c libc3/buf_inspect_sw_binary.h libc3/buf_inspect_sw_decimal.c libc3/buf_inspect_sw_decimal.h libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_sw_hexadecimal.h libc3/buf_inspect_sw_octal.c libc3/buf_inspect_sw_octal.h libc3/buf_inspect_u.c.in libc3/buf_inspect_u.h.in libc3/buf_inspect_u16.c libc3/buf_inspect_u16.h libc3/buf_inspect_u16_binary.c libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u16_decimal.c libc3/buf_inspect_u16_decimal.h libc3/buf_inspect_u16_hexadecimal.c libc3/buf_inspect_u16_hexadecimal.h libc3/buf_inspect_u16_octal.c libc3/buf_inspect_u16_octal.h libc3/buf_inspect_u32.c libc3/buf_inspect_u32.h libc3/buf_inspect_u32_binary.c libc3/buf_inspect_u32_binary.h libc3/buf_inspect_u32_decimal.c libc3/buf_inspect_u32_decimal.h libc3/buf_inspect_u32_hexadecimal.c libc3/buf_inspect_u32_hexadecimal.h libc3/buf_inspect_u32_octal.c libc3/buf_inspect_u32_octal.h libc3/buf_inspect_u64.c libc3/buf_inspect_u64.h libc3/buf_inspect_u64_binary.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_u64_decimal.c libc3/buf_inspect_u64_decimal.h libc3/buf_inspect_u64_hexadecimal.c libc3/buf_inspect_u64_hexadecimal.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u64_octal.h libc3/buf_inspect_u8.c libc3/buf_inspect_u8.h libc3/buf_inspect_u8_binary.c libc3/buf_inspect_u8_binary.h libc3/buf_inspect_u8_decimal.c libc3/buf_inspect_u8_decimal.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u8_hexadecimal.h libc3/buf_inspect_u8_octal.c libc3/buf_inspect_u8_octal.h libc3/buf_inspect_u_base.c.in libc3/buf_inspect_u_base.h.in libc3/buf_inspect_uw.c libc3/buf_inspect_uw.h libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_binary.h libc3/buf_inspect_uw_decimal.c libc3/buf_inspect_uw_decimal.h libc3/buf_inspect_uw_hexadecimal.c libc3/buf_inspect_uw_hexadecimal.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_uw_octal.h libc3/buf_parse.c libc3/buf_parse.h libc3/buf_parse_s.c.in libc3/buf_parse_s.h.in libc3/buf_parse_s16.c libc3/buf_parse_s16.h libc3/buf_parse_s32.c libc3/buf_parse_s32.h libc3/buf_parse_s64.c libc3/buf_parse_s64.h libc3/buf_parse_s8.c libc3/buf_parse_s8.h libc3/buf_parse_sw.c libc3/buf_parse_sw.h libc3/buf_parse_u.c.in libc3/buf_parse_u.h.in libc3/buf_parse_u16.c libc3/buf_parse_u16.h libc3/buf_parse_u32.c libc3/buf_parse_u32.h libc3/buf_parse_u64.c libc3/buf_parse_u64.h libc3/buf_parse_u8.c libc3/buf_parse_u8.h libc3/buf_parse_uw.c libc3/buf_parse_uw.h libc3/buf_save.c libc3/buf_save.h libc3/c3.c libc3/c3.h libc3/c3_main.h libc3/call.c libc3/call.h libc3/ceiling.c libc3/ceiling.h libc3/cfn.c libc3/cfn.h libc3/character.c libc3/character.h libc3/compare.c libc3/compare.h libc3/env.c libc3/env.h libc3/error.c libc3/error.h libc3/error_handler.c libc3/error_handler.h libc3/eval.c libc3/eval.h libc3/f32.c libc3/f32.h libc3/f64.c libc3/f64.h libc3/fact.c libc3/fact.h libc3/facts.c libc3/facts.h libc3/facts_cursor.c libc3/facts_cursor.h libc3/facts_spec.c libc3/facts_spec.h libc3/facts_spec_cursor.c libc3/facts_spec_cursor.h libc3/facts_with.c libc3/facts_with.h libc3/facts_with_cursor.c libc3/facts_with_cursor.h libc3/file.c libc3/file.h libc3/float.h libc3/fn.c libc3/fn.h libc3/fn_clause.c libc3/fn_clause.h libc3/frame.c libc3/frame.h libc3/hash.c libc3/hash.h libc3/ident.c libc3/ident.h libc3/integer.c libc3/integer.h libc3/io.c libc3/io.h libc3/license.c libc3/list.c libc3/list.h libc3/list_init.c libc3/list_init.h libc3/log.c libc3/log.h libc3/map.c libc3/map.h libc3/module.c libc3/module.h libc3/operator.c libc3/operator.h libc3/point.h.in libc3/ptag.c libc3/ptag.h libc3/ptr.c libc3/ptr.h libc3/ptr_free.c libc3/ptr_free.h libc3/quote.c libc3/quote.h libc3/s.c.in libc3/s.h.in libc3/s16.c libc3/s16.h libc3/s32.c libc3/s32.h libc3/s64.c libc3/s64.h libc3/s8.c libc3/s8.h libc3/sequence.c libc3/sequence.h libc3/set.c.in libc3/set.h.in libc3/set__fact.c libc3/set__fact.h libc3/set__tag.c libc3/set__tag.h libc3/set_cursor.c.in libc3/set_cursor.h.in libc3/set_cursor__fact.c libc3/set_cursor__fact.h libc3/set_cursor__tag.c libc3/set_cursor__tag.h libc3/set_item.c.in libc3/set_item.h.in libc3/set_item__fact.c libc3/set_item__fact.h libc3/set_item__tag.c libc3/set_item__tag.h libc3/sha1.h libc3/sign.c libc3/sign.h libc3/skiplist.c.in libc3/skiplist.h.in libc3/skiplist__fact.c libc3/skiplist__fact.h libc3/skiplist_node.c.in libc3/skiplist_node.h.in libc3/skiplist_node__fact.c libc3/skiplist_node__fact.h libc3/str.c libc3/str.h libc3/struct.c libc3/struct.h libc3/struct_type.c libc3/struct_type.h libc3/sw.c libc3/sw.h libc3/sym.c libc3/sym.h libc3/tag.c libc3/tag.h libc3/tag_add.c libc3/tag_band.c libc3/tag_bor.c libc3/tag_bxor.c libc3/tag_div.c libc3/tag_init.c libc3/tag_init.h libc3/tag_mod.c libc3/tag_mul.c libc3/tag_shift_left.c libc3/tag_shift_right.c libc3/tag_sub.c libc3/tag_type.c libc3/tag_type.h libc3/time.c libc3/time.h libc3/tuple.c libc3/tuple.h libc3/type.c libc3/type.h libc3/types.h libc3/u.c.in libc3/u.h.in libc3/u16.c libc3/u16.h libc3/u32.c libc3/u32.h libc3/u64.c libc3/u64.h libc3/u8.c libc3/u8.h libc3/ucd.c libc3/ucd.h libc3/uw.c libc3/uw.h libc3/var.c libc3/var.h libc3/void.c libc3/void.h libc3/window/cairo/cairo_font.c libc3/window/cairo/cairo_font.h libc3/window/cairo/cairo_sprite.c libc3/window/cairo/cairo_sprite.h libc3/window/cairo/demo/bg_rect.c libc3/window/cairo/demo/bg_rect.h libc3/window/cairo/demo/flies.c libc3/window/cairo/demo/flies.h libc3/window/cairo/demo/lightspeed.c libc3/window/cairo/demo/lightspeed.h libc3/window/cairo/demo/toasters.c libc3/window/cairo/demo/toasters.h libc3/window/cairo/demo/window_cairo_demo.c libc3/window/cairo/demo/window_cairo_demo.h libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c libc3/window/cairo/quartz/quartz_to_xkbcommon.c libc3/window/cairo/quartz/quartz_to_xkbcommon.h libc3/window/cairo/quartz/window_cairo_quartz.h libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.h libc3/window/cairo/quartz/window_cairo_quartz_view.h libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h libc3/window/cairo/quartz/xkbquartz.h libc3/window/cairo/types.h libc3/window/cairo/win32/demo/window_cairo_win32_demo.c libc3/window/cairo/win32/vk_to_xkbcommon.c libc3/window/cairo/win32/vk_to_xkbcommon.h libc3/window/cairo/win32/window_cairo_win32.c libc3/window/cairo/win32/window_cairo_win32.h libc3/window/cairo/window_cairo.c libc3/window/cairo/window_cairo.h libc3/window/cairo/xcb/config.h libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/sdl2/demo/bg_rect.c libc3/window/sdl2/demo/bg_rect.h libc3/window/sdl2/demo/earth.c libc3/window/sdl2/demo/earth.h libc3/window/sdl2/demo/flies.c libc3/window/sdl2/demo/flies.h libc3/window/sdl2/demo/lightspeed.c libc3/window/sdl2/demo/lightspeed.h libc3/window/sdl2/demo/toasters.c libc3/window/sdl2/demo/toasters.h libc3/window/sdl2/demo/window_sdl2_demo.c libc3/window/sdl2/demo/window_sdl2_demo.h libc3/window/sdl2/disabled/mandelbrot.c libc3/window/sdl2/disabled/mandelbrot.h libc3/window/sdl2/disabled/sdl2_font.c libc3/window/sdl2/disabled/sdl2_font.h libc3/window/sdl2/gl_camera.c libc3/window/sdl2/gl_camera.h libc3/window/sdl2/gl_cylinder.c libc3/window/sdl2/gl_cylinder.h libc3/window/sdl2/gl_font.c libc3/window/sdl2/gl_font.h libc3/window/sdl2/gl_ft2.h libc3/window/sdl2/gl_lines.c libc3/window/sdl2/gl_lines.h libc3/window/sdl2/gl_matrix_3d.h libc3/window/sdl2/gl_matrix_4d.c libc3/window/sdl2/gl_matrix_4d.h libc3/window/sdl2/gl_object.c libc3/window/sdl2/gl_object.h libc3/window/sdl2/gl_ortho.c libc3/window/sdl2/gl_ortho.h libc3/window/sdl2/gl_point_2d.c libc3/window/sdl2/gl_point_2d.h libc3/window/sdl2/gl_point_3d.c libc3/window/sdl2/gl_point_3d.h libc3/window/sdl2/gl_sphere.c libc3/window/sdl2/gl_sphere.h libc3/window/sdl2/gl_sprite.c libc3/window/sdl2/gl_sprite.h libc3/window/sdl2/gl_square.c libc3/window/sdl2/gl_square.h libc3/window/sdl2/gl_text.c libc3/window/sdl2/gl_text.h libc3/window/sdl2/gl_triangle.c libc3/window/sdl2/gl_triangle.h libc3/window/sdl2/gl_vertex.c libc3/window/sdl2/gl_vertex.h libc3/window/sdl2/sdl2_sprite.c libc3/window/sdl2/sdl2_sprite.h libc3/window/sdl2/types.h libc3/window/sdl2/window_sdl2.c libc3/window/sdl2/window_sdl2.h libc3/window/types.h libc3/window/window.c libc3/window/window.h test/array_test.c test/bool_test.c test/buf_file_test.c test/buf_inspect_test.c test/buf_parse_test.c test/buf_parse_test.h test/buf_parse_test_s16.c test/buf_parse_test_s32.c test/buf_parse_test_s64.c test/buf_parse_test_s8.c test/buf_parse_test_su.h test/buf_parse_test_u16.c test/buf_parse_test_u32.c test/buf_parse_test_u64.c test/buf_parse_test_u8.c test/buf_test.c test/call_test.c test/cfn_test.c test/character_test.c test/compare_test.c test/compare_test.h test/env_test.c test/fact_test.c test/fact_test.h test/facts_cursor_test.c test/facts_test.c test/facts_with_test.c test/fn_test.c test/hash_test.c test/ident_test.c test/libc3_test.c test/list_test.c test/set__fact_test.c test/set__tag_test.c test/skiplist__fact_test.c test/str_test.c test/sym_test.c test/tag_test.c test/tag_test.h test/test.c test/test.h test/tuple_test.c test/types_test.c ucd2c/ucd.h ucd2c/ucd2c.c '
+C3_C_SOURCES='c3c/c3c.c c3s/buf_readline.c c3s/buf_readline.h c3s/c3s.c ic3/buf_linenoise.c ic3/buf_linenoise.h ic3/buf_wineditline.c ic3/buf_wineditline.h ic3/config.h ic3/ic3.c ic3/linenoise.c libc3/abs.c libc3/abs.h libc3/arg.c libc3/arg.h libc3/array.c libc3/array.h libc3/assert.h libc3/binding.c libc3/binding.h libc3/bool.c libc3/bool.h libc3/buf.c libc3/buf.h libc3/buf_file.c libc3/buf_file.h libc3/buf_inspect.c libc3/buf_inspect.h libc3/buf_inspect_s.c.in libc3/buf_inspect_s.h.in libc3/buf_inspect_s16.c libc3/buf_inspect_s16.h libc3/buf_inspect_s16_binary.c libc3/buf_inspect_s16_binary.h libc3/buf_inspect_s16_decimal.c libc3/buf_inspect_s16_decimal.h libc3/buf_inspect_s16_hexadecimal.c libc3/buf_inspect_s16_hexadecimal.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s16_octal.h libc3/buf_inspect_s32.c libc3/buf_inspect_s32.h libc3/buf_inspect_s32_binary.c libc3/buf_inspect_s32_binary.h libc3/buf_inspect_s32_decimal.c libc3/buf_inspect_s32_decimal.h libc3/buf_inspect_s32_hexadecimal.c libc3/buf_inspect_s32_hexadecimal.h libc3/buf_inspect_s32_octal.c libc3/buf_inspect_s32_octal.h libc3/buf_inspect_s64.c libc3/buf_inspect_s64.h libc3/buf_inspect_s64_binary.c libc3/buf_inspect_s64_binary.h libc3/buf_inspect_s64_decimal.c libc3/buf_inspect_s64_decimal.h libc3/buf_inspect_s64_hexadecimal.c libc3/buf_inspect_s64_hexadecimal.h libc3/buf_inspect_s64_octal.c libc3/buf_inspect_s64_octal.h libc3/buf_inspect_s8.c libc3/buf_inspect_s8.h libc3/buf_inspect_s8_binary.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect_s8_decimal.h libc3/buf_inspect_s8_hexadecimal.c libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_s8_octal.c libc3/buf_inspect_s8_octal.h libc3/buf_inspect_s_base.c.in libc3/buf_inspect_s_base.h.in libc3/buf_inspect_sw.c libc3/buf_inspect_sw.h libc3/buf_inspect_sw_binary.c libc3/buf_inspect_sw_binary.h libc3/buf_inspect_sw_decimal.c libc3/buf_inspect_sw_decimal.h libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_sw_hexadecimal.h libc3/buf_inspect_sw_octal.c libc3/buf_inspect_sw_octal.h libc3/buf_inspect_u.c.in libc3/buf_inspect_u.h.in libc3/buf_inspect_u16.c libc3/buf_inspect_u16.h libc3/buf_inspect_u16_binary.c libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u16_decimal.c libc3/buf_inspect_u16_decimal.h libc3/buf_inspect_u16_hexadecimal.c libc3/buf_inspect_u16_hexadecimal.h libc3/buf_inspect_u16_octal.c libc3/buf_inspect_u16_octal.h libc3/buf_inspect_u32.c libc3/buf_inspect_u32.h libc3/buf_inspect_u32_binary.c libc3/buf_inspect_u32_binary.h libc3/buf_inspect_u32_decimal.c libc3/buf_inspect_u32_decimal.h libc3/buf_inspect_u32_hexadecimal.c libc3/buf_inspect_u32_hexadecimal.h libc3/buf_inspect_u32_octal.c libc3/buf_inspect_u32_octal.h libc3/buf_inspect_u64.c libc3/buf_inspect_u64.h libc3/buf_inspect_u64_binary.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_u64_decimal.c libc3/buf_inspect_u64_decimal.h libc3/buf_inspect_u64_hexadecimal.c libc3/buf_inspect_u64_hexadecimal.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u64_octal.h libc3/buf_inspect_u8.c libc3/buf_inspect_u8.h libc3/buf_inspect_u8_binary.c libc3/buf_inspect_u8_binary.h libc3/buf_inspect_u8_decimal.c libc3/buf_inspect_u8_decimal.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u8_hexadecimal.h libc3/buf_inspect_u8_octal.c libc3/buf_inspect_u8_octal.h libc3/buf_inspect_u_base.c.in libc3/buf_inspect_u_base.h.in libc3/buf_inspect_uw.c libc3/buf_inspect_uw.h libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_binary.h libc3/buf_inspect_uw_decimal.c libc3/buf_inspect_uw_decimal.h libc3/buf_inspect_uw_hexadecimal.c libc3/buf_inspect_uw_hexadecimal.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_uw_octal.h libc3/buf_parse.c libc3/buf_parse.h libc3/buf_parse_s.c.in libc3/buf_parse_s.h.in libc3/buf_parse_s16.c libc3/buf_parse_s16.h libc3/buf_parse_s32.c libc3/buf_parse_s32.h libc3/buf_parse_s64.c libc3/buf_parse_s64.h libc3/buf_parse_s8.c libc3/buf_parse_s8.h libc3/buf_parse_sw.c libc3/buf_parse_sw.h libc3/buf_parse_u.c.in libc3/buf_parse_u.h.in libc3/buf_parse_u16.c libc3/buf_parse_u16.h libc3/buf_parse_u32.c libc3/buf_parse_u32.h libc3/buf_parse_u64.c libc3/buf_parse_u64.h libc3/buf_parse_u8.c libc3/buf_parse_u8.h libc3/buf_parse_uw.c libc3/buf_parse_uw.h libc3/buf_save.c libc3/buf_save.h libc3/c3.c libc3/c3.h libc3/c3_main.h libc3/call.c libc3/call.h libc3/ceiling.c libc3/ceiling.h libc3/cfn.c libc3/cfn.h libc3/character.c libc3/character.h libc3/compare.c libc3/compare.h libc3/data.c libc3/data.h libc3/env.c libc3/env.h libc3/error.c libc3/error.h libc3/error_handler.c libc3/error_handler.h libc3/eval.c libc3/eval.h libc3/f32.c libc3/f32.h libc3/f64.c libc3/f64.h libc3/fact.c libc3/fact.h libc3/facts.c libc3/facts.h libc3/facts_cursor.c libc3/facts_cursor.h libc3/facts_spec.c libc3/facts_spec.h libc3/facts_spec_cursor.c libc3/facts_spec_cursor.h libc3/facts_with.c libc3/facts_with.h libc3/facts_with_cursor.c libc3/facts_with_cursor.h libc3/file.c libc3/file.h libc3/float.h libc3/fn.c libc3/fn.h libc3/fn_clause.c libc3/fn_clause.h libc3/frame.c libc3/frame.h libc3/hash.c libc3/hash.h libc3/ident.c libc3/ident.h libc3/integer.c libc3/integer.h libc3/io.c libc3/io.h libc3/license.c libc3/list.c libc3/list.h libc3/list_init.c libc3/list_init.h libc3/log.c libc3/log.h libc3/map.c libc3/map.h libc3/module.c libc3/module.h libc3/operator.c libc3/operator.h libc3/point.h.in libc3/ptag.c libc3/ptag.h libc3/ptr.c libc3/ptr.h libc3/ptr_free.c libc3/ptr_free.h libc3/quote.c libc3/quote.h libc3/s.c.in libc3/s.h.in libc3/s16.c libc3/s16.h libc3/s32.c libc3/s32.h libc3/s64.c libc3/s64.h libc3/s8.c libc3/s8.h libc3/sequence.c libc3/sequence.h libc3/set.c.in libc3/set.h.in libc3/set__fact.c libc3/set__fact.h libc3/set__tag.c libc3/set__tag.h libc3/set_cursor.c.in libc3/set_cursor.h.in libc3/set_cursor__fact.c libc3/set_cursor__fact.h libc3/set_cursor__tag.c libc3/set_cursor__tag.h libc3/set_item.c.in libc3/set_item.h.in libc3/set_item__fact.c libc3/set_item__fact.h libc3/set_item__tag.c libc3/set_item__tag.h libc3/sha1.h libc3/sign.c libc3/sign.h libc3/skiplist.c.in libc3/skiplist.h.in libc3/skiplist__fact.c libc3/skiplist__fact.h libc3/skiplist_node.c.in libc3/skiplist_node.h.in libc3/skiplist_node__fact.c libc3/skiplist_node__fact.h libc3/str.c libc3/str.h libc3/struct.c libc3/struct.h libc3/struct_type.c libc3/struct_type.h libc3/sw.c libc3/sw.h libc3/sym.c libc3/sym.h libc3/tag.c libc3/tag.h libc3/tag_add.c libc3/tag_band.c libc3/tag_bor.c libc3/tag_bxor.c libc3/tag_div.c libc3/tag_init.c libc3/tag_init.h libc3/tag_mod.c libc3/tag_mul.c libc3/tag_shift_left.c libc3/tag_shift_right.c libc3/tag_sub.c libc3/tag_type.c libc3/tag_type.h libc3/time.c libc3/time.h libc3/tuple.c libc3/tuple.h libc3/type.c libc3/type.h libc3/types.h libc3/u.c.in libc3/u.h.in libc3/u16.c libc3/u16.h libc3/u32.c libc3/u32.h libc3/u64.c libc3/u64.h libc3/u8.c libc3/u8.h libc3/ucd.c libc3/ucd.h libc3/uw.c libc3/uw.h libc3/var.c libc3/var.h libc3/void.c libc3/void.h libc3/window/cairo/cairo_font.c libc3/window/cairo/cairo_font.h libc3/window/cairo/cairo_sprite.c libc3/window/cairo/cairo_sprite.h libc3/window/cairo/demo/bg_rect.c libc3/window/cairo/demo/bg_rect.h libc3/window/cairo/demo/flies.c libc3/window/cairo/demo/flies.h libc3/window/cairo/demo/lightspeed.c libc3/window/cairo/demo/lightspeed.h libc3/window/cairo/demo/toasters.c libc3/window/cairo/demo/toasters.h libc3/window/cairo/demo/window_cairo_demo.c libc3/window/cairo/demo/window_cairo_demo.h libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c libc3/window/cairo/quartz/quartz_to_xkbcommon.c libc3/window/cairo/quartz/quartz_to_xkbcommon.h libc3/window/cairo/quartz/window_cairo_quartz.h libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.h libc3/window/cairo/quartz/window_cairo_quartz_view.h libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h libc3/window/cairo/quartz/xkbquartz.h libc3/window/cairo/types.h libc3/window/cairo/win32/demo/window_cairo_win32_demo.c libc3/window/cairo/win32/vk_to_xkbcommon.c libc3/window/cairo/win32/vk_to_xkbcommon.h libc3/window/cairo/win32/window_cairo_win32.c libc3/window/cairo/win32/window_cairo_win32.h libc3/window/cairo/window_cairo.c libc3/window/cairo/window_cairo.h libc3/window/cairo/xcb/config.h libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/sdl2/demo/bg_rect.c libc3/window/sdl2/demo/bg_rect.h libc3/window/sdl2/demo/earth.c libc3/window/sdl2/demo/earth.h libc3/window/sdl2/demo/flies.c libc3/window/sdl2/demo/flies.h libc3/window/sdl2/demo/lightspeed.c libc3/window/sdl2/demo/lightspeed.h libc3/window/sdl2/demo/toasters.c libc3/window/sdl2/demo/toasters.h libc3/window/sdl2/demo/window_sdl2_demo.c libc3/window/sdl2/demo/window_sdl2_demo.h libc3/window/sdl2/disabled/mandelbrot.c libc3/window/sdl2/disabled/mandelbrot.h libc3/window/sdl2/disabled/sdl2_font.c libc3/window/sdl2/disabled/sdl2_font.h libc3/window/sdl2/disabled/sdl2_sprite.c libc3/window/sdl2/disabled/sdl2_sprite.h libc3/window/sdl2/gl_camera.c libc3/window/sdl2/gl_camera.h libc3/window/sdl2/gl_cylinder.c libc3/window/sdl2/gl_cylinder.h libc3/window/sdl2/gl_deprecated.c libc3/window/sdl2/gl_deprecated.h libc3/window/sdl2/gl_font.c libc3/window/sdl2/gl_font.h libc3/window/sdl2/gl_ft2.h libc3/window/sdl2/gl_lines.c libc3/window/sdl2/gl_lines.h libc3/window/sdl2/gl_matrix_3d.h libc3/window/sdl2/gl_matrix_4d.c libc3/window/sdl2/gl_matrix_4d.h libc3/window/sdl2/gl_object.c libc3/window/sdl2/gl_object.h libc3/window/sdl2/gl_ortho.c libc3/window/sdl2/gl_ortho.h libc3/window/sdl2/gl_point_2d.c libc3/window/sdl2/gl_point_2d.h libc3/window/sdl2/gl_point_3d.c libc3/window/sdl2/gl_point_3d.h libc3/window/sdl2/gl_sphere.c libc3/window/sdl2/gl_sphere.h libc3/window/sdl2/gl_sprite.c libc3/window/sdl2/gl_sprite.h libc3/window/sdl2/gl_square.c libc3/window/sdl2/gl_square.h libc3/window/sdl2/gl_text.c libc3/window/sdl2/gl_text.h libc3/window/sdl2/gl_triangle.c libc3/window/sdl2/gl_triangle.h libc3/window/sdl2/gl_vertex.c libc3/window/sdl2/gl_vertex.h libc3/window/sdl2/types.h libc3/window/sdl2/window_sdl2.c libc3/window/sdl2/window_sdl2.h libc3/window/types.h libc3/window/window.c libc3/window/window.h test/array_test.c test/bool_test.c test/buf_file_test.c test/buf_inspect_test.c test/buf_parse_test.c test/buf_parse_test.h test/buf_parse_test_s16.c test/buf_parse_test_s32.c test/buf_parse_test_s64.c test/buf_parse_test_s8.c test/buf_parse_test_su.h test/buf_parse_test_u16.c test/buf_parse_test_u32.c test/buf_parse_test_u64.c test/buf_parse_test_u8.c test/buf_test.c test/call_test.c test/cfn_test.c test/character_test.c test/compare_test.c test/compare_test.h test/env_test.c test/fact_test.c test/fact_test.h test/facts_cursor_test.c test/facts_test.c test/facts_with_test.c test/fn_test.c test/hash_test.c test/ident_test.c test/libc3_test.c test/list_test.c test/set__fact_test.c test/set__tag_test.c test/skiplist__fact_test.c test/str_test.c test/sym_test.c test/tag_test.c test/tag_test.h test/test.c test/test.h test/tuple_test.c test/types_test.c ucd2c/ucd.h ucd2c/ucd2c.c '
C3_OBJC_SOURCES='libc3/window/cairo/quartz/window_cairo_quartz.m libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.m libc3/window/cairo/quartz/window_cairo_quartz_view.m libc3/window/cairo/quartz/window_cairo_quartz_view_controller.m '
-C3_OTHER_SOURCES='AUTHORS Makefile README.md c3.index c3.version config.subr configure fonts/Courier New/Courier New.ttf img/c3.1.xcf img/c3.1080.jpg img/c3.1080.png img/c3.128.jpg img/c3.128.png img/c3.16.png img/c3.256.jpg img/c3.256.png img/c3.32.jpg img/c3.32.png img/c3.48.jpg img/c3.48.png img/c3.512.jpg img/c3.512.png img/c3.64.jpg img/c3.64.png img/c3.640.jpg img/c3.640.png img/c3.720.jpg img/c3.720.png img/c3.iconset/icon_128x128.png img/c3.iconset/icon_16x16.png img/c3.iconset/icon_256x256.png img/c3.iconset/icon_32x32.png img/c3.iconset/icon_512x512.png img/c3.iconset/icon_64x64.png img/c3.xcf img/earth.jpg img/earth.png img/flaps.256.png img/flaps.png img/fly-dead.png img/fly-noto.png img/iris-c3-004.jpeg img/iris-c3-004.png img/thodg_No_Prompt_073261d5-2c81-4b6e-9572-e0b840c55f1f.jpeg img/toast.128.png img/toast.png lib/c3/0.1/array.facts lib/c3/0.1/c3.facts lib/c3/0.1/f32.facts lib/c3/0.1/f64.facts lib/c3/0.1/gl/object.facts lib/c3/0.1/gl/point2d.facts lib/c3/0.1/gl/point3d.facts lib/c3/0.1/gl/sphere.facts lib/c3/0.1/gl/triangle.facts lib/c3/0.1/gl/vertex.facts lib/c3/0.1/integer.facts lib/c3/0.1/list.facts lib/c3/0.1/map.facts lib/c3/0.1/ptr_free.facts lib/c3/0.1/s16.facts lib/c3/0.1/s32.facts lib/c3/0.1/s64.facts lib/c3/0.1/s8.facts lib/c3/0.1/sw.facts lib/c3/0.1/u16.facts lib/c3/0.1/u32.facts lib/c3/0.1/u64.facts lib/c3/0.1/u8.facts lib/c3/0.1/uw.facts libc3/tag_init.rb license.h sources.mk sources.sh test/buf_parse_test_su.rb test/facts_test_dump_file.expected.facts test/facts_test_load_file.facts test/facts_test_log_add.expected.facts test/facts_test_log_remove.expected.facts test/facts_test_open_file.1.expected.facts test/facts_test_open_file.1.in.facts test/facts_test_open_file.2.expected.facts test/facts_test_open_file.2.in.facts test/facts_test_open_file.3.expected.facts test/facts_test_open_file.3.in.facts test/facts_test_save.expected.facts test/ic3/array.err.expected test/ic3/array.in test/ic3/array.out.expected test/ic3/array.ret.expected test/ic3/bool.err.expected test/ic3/bool.in test/ic3/bool.out.expected test/ic3/bool.ret.expected test/ic3/call.err.expected test/ic3/call.in test/ic3/call.out.expected test/ic3/call.ret.expected test/ic3/cast.in test/ic3/cast.out.expected test/ic3/cast.ret.expected test/ic3/character.err.expected test/ic3/character.in test/ic3/character.out.expected test/ic3/character.ret.expected test/ic3/comment.err.expected test/ic3/comment.in test/ic3/comment.out.expected test/ic3/comment.ret.expected test/ic3/equal.err.expected test/ic3/equal.in test/ic3/equal.out.expected test/ic3/equal.ret.expected test/ic3/fn.err.expected test/ic3/fn.in test/ic3/fn.out.expected test/ic3/fn.ret.expected test/ic3/function_call.err.expected test/ic3/function_call.out.expected test/ic3/function_call.ret.expected test/ic3/hello.err.expected test/ic3/hello.in test/ic3/hello.out.expected test/ic3/hello.ret.expected test/ic3/ident.err.expected test/ic3/ident.in test/ic3/ident.out.expected test/ic3/ident.ret.expected test/ic3/integer.in test/ic3/integer.lisp test/ic3/integer.out.expected test/ic3/integer.ret.expected test/ic3/integer_add.in test/ic3/integer_add.out.expected test/ic3/integer_add.ret.expected test/ic3/integer_band.in test/ic3/integer_band.out.expected test/ic3/integer_band.ret.expected test/ic3/integer_bnot.in test/ic3/integer_bnot.out.expected test/ic3/integer_bnot.ret.expected test/ic3/integer_bor-2.in test/ic3/integer_bor-2.out.expected test/ic3/integer_bor-2.ret.expected test/ic3/integer_bxor.in test/ic3/integer_bxor.out.expected test/ic3/integer_bxor.ret.expected test/ic3/integer_div.in test/ic3/integer_div.out.expected test/ic3/integer_div.ret.expected test/ic3/integer_eq.in test/ic3/integer_eq.out.expected test/ic3/integer_eq.ret.expected test/ic3/integer_gt.in test/ic3/integer_gt.out.expected test/ic3/integer_gt.ret.expected test/ic3/integer_lt.in test/ic3/integer_lt.out.expected test/ic3/integer_lt.ret.expected test/ic3/integer_mod-2.in test/ic3/integer_mod-2.out.expected test/ic3/integer_mod-2.ret.expected test/ic3/integer_mul.in test/ic3/integer_mul.out.expected test/ic3/integer_mul.ret.expected test/ic3/integer_neg.in test/ic3/integer_neg.out.expected test/ic3/integer_neg.ret.expected test/ic3/integer_sub.in test/ic3/integer_sub.out.expected test/ic3/integer_sub.ret.expected test/ic3/list.err.expected test/ic3/list.in test/ic3/list.out.expected test/ic3/list.ret.expected test/ic3/map.in test/ic3/map.out.expected test/ic3/map.ret.expected test/ic3/op.err.expected test/ic3/op.in test/ic3/op.out.expected test/ic3/op.ret.expected test/ic3/plist.err.expected test/ic3/plist.in test/ic3/plist.out.expected test/ic3/plist.ret.expected test/ic3/str.err.expected test/ic3/str.in test/ic3/str.out.expected test/ic3/str.ret.expected test/ic3/sym.err.expected test/ic3/sym.in test/ic3/sym.out.expected test/ic3/sym.ret.expected test/ic3/tuple.err.expected test/ic3/tuple.in test/ic3/tuple.out.expected test/ic3/tuple.ret.expected test/ic3_test test/replace_lines.rb test/test.rb test/test_case_end.rb test/zero '
+C3_OTHER_SOURCES='AUTHORS Makefile README.md c3.index c3.version config.subr configure fonts/Courier New/Courier New.ttf img/c3.1.xcf img/c3.1080.jpg img/c3.1080.png img/c3.128.jpg img/c3.128.png img/c3.16.png img/c3.256.jpg img/c3.256.png img/c3.32.jpg img/c3.32.png img/c3.48.jpg img/c3.48.png img/c3.512.jpg img/c3.512.png img/c3.64.jpg img/c3.64.png img/c3.640.jpg img/c3.640.png img/c3.720.jpg img/c3.720.png img/c3.iconset/icon_128x128.png img/c3.iconset/icon_16x16.png img/c3.iconset/icon_256x256.png img/c3.iconset/icon_32x32.png img/c3.iconset/icon_512x512.png img/c3.iconset/icon_64x64.png img/c3.xcf img/earth.jpg img/earth.png img/flaps.256.png img/flaps.png img/fly-dead.png img/fly-noto.png img/iris-c3-004.jpeg img/iris-c3-004.png img/thodg_No_Prompt_073261d5-2c81-4b6e-9572-e0b840c55f1f.jpeg img/toast.128.png img/toast.png lib/c3/0.1/array.facts lib/c3/0.1/c3.facts lib/c3/0.1/f32.facts lib/c3/0.1/f64.facts lib/c3/0.1/gl/object.facts lib/c3/0.1/gl/point2d.facts lib/c3/0.1/gl/point3d.facts lib/c3/0.1/gl/sphere.facts lib/c3/0.1/gl/triangle.facts lib/c3/0.1/gl/vertex.facts lib/c3/0.1/integer.facts lib/c3/0.1/list.facts lib/c3/0.1/map.facts lib/c3/0.1/ptr_free.facts lib/c3/0.1/s16.facts lib/c3/0.1/s32.facts lib/c3/0.1/s64.facts lib/c3/0.1/s8.facts lib/c3/0.1/sw.facts lib/c3/0.1/u16.facts lib/c3/0.1/u32.facts lib/c3/0.1/u64.facts lib/c3/0.1/u8.facts lib/c3/0.1/uw.facts lib/c3/0.1/void.facts libc3/tag_init.rb license.h sources.mk sources.sh test/buf_parse_test_su.rb test/facts_test_dump_file.expected.facts test/facts_test_load_file.facts test/facts_test_log_add.expected.facts test/facts_test_log_remove.expected.facts test/facts_test_open_file.1.expected.facts test/facts_test_open_file.1.in.facts test/facts_test_open_file.2.expected.facts test/facts_test_open_file.2.in.facts test/facts_test_open_file.3.expected.facts test/facts_test_open_file.3.in.facts test/facts_test_save.expected.facts test/ic3/array.err.expected test/ic3/array.in test/ic3/array.out.expected test/ic3/array.ret.expected test/ic3/bool.err.expected test/ic3/bool.in test/ic3/bool.out.expected test/ic3/bool.ret.expected test/ic3/call.err.expected test/ic3/call.in test/ic3/call.out.expected test/ic3/call.ret.expected test/ic3/cast.in test/ic3/cast.out.expected test/ic3/cast.ret.expected test/ic3/character.err.expected test/ic3/character.in test/ic3/character.out.expected test/ic3/character.ret.expected test/ic3/comment.err.expected test/ic3/comment.in test/ic3/comment.out.expected test/ic3/comment.ret.expected test/ic3/equal.err.expected test/ic3/equal.in test/ic3/equal.out.expected test/ic3/equal.ret.expected test/ic3/fn.err.expected test/ic3/fn.in test/ic3/fn.out.expected test/ic3/fn.ret.expected test/ic3/function_call.err.expected test/ic3/function_call.out.expected test/ic3/function_call.ret.expected test/ic3/hello.err.expected test/ic3/hello.in test/ic3/hello.out.expected test/ic3/hello.ret.expected test/ic3/ident.err.expected test/ic3/ident.in test/ic3/ident.out.expected test/ic3/ident.ret.expected test/ic3/integer.in test/ic3/integer.lisp test/ic3/integer.out.expected test/ic3/integer.ret.expected test/ic3/integer_add.in test/ic3/integer_add.out.expected test/ic3/integer_add.ret.expected test/ic3/integer_band.in test/ic3/integer_band.out.expected test/ic3/integer_band.ret.expected test/ic3/integer_bnot.in test/ic3/integer_bnot.out.expected test/ic3/integer_bnot.ret.expected test/ic3/integer_bor-2.in test/ic3/integer_bor-2.out.expected test/ic3/integer_bor-2.ret.expected test/ic3/integer_bxor.in test/ic3/integer_bxor.out.expected test/ic3/integer_bxor.ret.expected test/ic3/integer_div.in test/ic3/integer_div.out.expected test/ic3/integer_div.ret.expected test/ic3/integer_eq.in test/ic3/integer_eq.out.expected test/ic3/integer_eq.ret.expected test/ic3/integer_gt.in test/ic3/integer_gt.out.expected test/ic3/integer_gt.ret.expected test/ic3/integer_lt.in test/ic3/integer_lt.out.expected test/ic3/integer_lt.ret.expected test/ic3/integer_mod-2.in test/ic3/integer_mod-2.out.expected test/ic3/integer_mod-2.ret.expected test/ic3/integer_mul.in test/ic3/integer_mul.out.expected test/ic3/integer_mul.ret.expected test/ic3/integer_neg.in test/ic3/integer_neg.out.expected test/ic3/integer_neg.ret.expected test/ic3/integer_sub.in test/ic3/integer_sub.out.expected test/ic3/integer_sub.ret.expected test/ic3/list.err.expected test/ic3/list.in test/ic3/list.out.expected test/ic3/list.ret.expected test/ic3/map.in test/ic3/map.out.expected test/ic3/map.ret.expected test/ic3/op.err.expected test/ic3/op.in test/ic3/op.out.expected test/ic3/op.ret.expected test/ic3/plist.err.expected test/ic3/plist.in test/ic3/plist.out.expected test/ic3/plist.ret.expected test/ic3/str.err.expected test/ic3/str.in test/ic3/str.out.expected test/ic3/str.ret.expected test/ic3/sym.err.expected test/ic3/sym.in test/ic3/sym.out.expected test/ic3/sym.ret.expected test/ic3/tuple.err.expected test/ic3/tuple.in test/ic3/tuple.out.expected test/ic3/tuple.ret.expected test/ic3/void.in test/ic3/void.out.expected test/ic3/void.ret.expected test/ic3_test test/replace_lines.rb test/test.rb test/test_case_end.rb test/zero '
C3_EXTERNAL_SOURCES='libffi/ChangeLog.old libffi/LICENSE libffi/LICENSE-BUILDTOOLS libffi/Makefile libffi/Makefile.am libffi/Makefile.in libffi/README.md libffi/a.out libffi/acinclude.m4 libffi/aclocal.m4 libffi/autogen.sh libffi/autom4te.cache/output.0 libffi/autom4te.cache/output.1 libffi/autom4te.cache/output.2 libffi/autom4te.cache/output.3 libffi/autom4te.cache/output.4 libffi/autom4te.cache/output.5 libffi/autom4te.cache/output.6 libffi/autom4te.cache/requests libffi/autom4te.cache/traces.0 libffi/autom4te.cache/traces.1 libffi/autom4te.cache/traces.2 libffi/autom4te.cache/traces.3 libffi/autom4te.cache/traces.4 libffi/autom4te.cache/traces.5 libffi/autom4te.cache/traces.6 libffi/compile libffi/config.guess libffi/config.log libffi/config.status libffi/config.sub libffi/configure libffi/configure.ac libffi/configure.host libffi/depcomp libffi/doc/Makefile libffi/doc/Makefile.am libffi/doc/Makefile.in libffi/doc/libffi.info libffi/doc/libffi.texi libffi/doc/mdate-sh libffi/doc/texinfo.tex libffi/doc/version.texi libffi/fficonfig.h libffi/fficonfig.h.in libffi/generate-darwin-source-and-headers.py libffi/include/Makefile libffi/include/Makefile.am libffi/include/Makefile.in libffi/include/ffi.h libffi/include/ffi.h.in libffi/include/ffi_cfi.h libffi/include/ffi_common.h libffi/include/ffitarget.h libffi/include/tramp.h libffi/install-sh libffi/libffi.la libffi/libffi.map.in libffi/libffi.pc libffi/libffi.pc.in libffi/libffi.xcodeproj/project.pbxproj libffi/libffi_convenience.la libffi/libtool libffi/libtool-ldflags libffi/libtool-version libffi/local.exp libffi/ltmain.sh libffi/m4/asmcfi.m4 libffi/m4/ax_append_flag.m4 libffi/m4/ax_cc_maxopt.m4 libffi/m4/ax_cflags_warn_all.m4 libffi/m4/ax_check_compile_flag.m4 libffi/m4/ax_compiler_vendor.m4 libffi/m4/ax_configure_args.m4 libffi/m4/ax_enable_builddir.m4 libffi/m4/ax_gcc_archflag.m4 libffi/m4/ax_gcc_x86_cpuid.m4 libffi/m4/ax_prepend_flag.m4 libffi/m4/ax_require_defined.m4 libffi/m4/libtool.m4 libffi/m4/ltoptions.m4 libffi/m4/ltsugar.m4 libffi/m4/ltversion.m4 libffi/m4/lt~obsolete.m4 libffi/make_sunver.pl libffi/man/Makefile libffi/man/Makefile.am libffi/man/Makefile.in libffi/man/ffi.3 libffi/man/ffi_call.3 libffi/man/ffi_prep_cif.3 libffi/man/ffi_prep_cif_var.3 libffi/missing libffi/msvc_build/aarch64/Ffi_staticLib.sln libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user libffi/msvc_build/aarch64/aarch64_include/ffi.h libffi/msvc_build/aarch64/aarch64_include/fficonfig.h libffi/msvcc.sh libffi/src/aarch64/ffi.c libffi/src/aarch64/ffitarget.h libffi/src/aarch64/internal.h libffi/src/aarch64/sysv.S libffi/src/aarch64/win64_armasm.S libffi/src/alpha/ffi.c libffi/src/alpha/ffitarget.h libffi/src/alpha/internal.h libffi/src/alpha/osf.S libffi/src/arc/arcompact.S libffi/src/arc/ffi.c libffi/src/arc/ffitarget.h libffi/src/arm/ffi.c libffi/src/arm/ffitarget.h libffi/src/arm/internal.h libffi/src/arm/sysv.S libffi/src/arm/sysv_msvc_arm32.S libffi/src/avr32/ffi.c libffi/src/avr32/ffitarget.h libffi/src/avr32/sysv.S libffi/src/bfin/ffi.c libffi/src/bfin/ffitarget.h libffi/src/bfin/sysv.S libffi/src/closures.c libffi/src/closures.lo libffi/src/closures.o libffi/src/cris/ffi.c libffi/src/cris/ffitarget.h libffi/src/cris/sysv.S libffi/src/csky/ffi.c libffi/src/csky/ffitarget.h libffi/src/csky/sysv.S libffi/src/debug.c libffi/src/dlmalloc.c libffi/src/frv/eabi.S libffi/src/frv/ffi.c libffi/src/frv/ffitarget.h libffi/src/ia64/ffi.c libffi/src/ia64/ffitarget.h libffi/src/ia64/ia64_flags.h libffi/src/ia64/unix.S libffi/src/java_raw_api.c libffi/src/java_raw_api.lo libffi/src/java_raw_api.o libffi/src/kvx/asm.h libffi/src/kvx/ffi.c libffi/src/kvx/ffitarget.h libffi/src/kvx/sysv.S libffi/src/loongarch64/ffi.c libffi/src/loongarch64/ffitarget.h libffi/src/loongarch64/sysv.S libffi/src/m32r/ffi.c libffi/src/m32r/ffitarget.h libffi/src/m32r/sysv.S libffi/src/m68k/ffi.c libffi/src/m68k/ffitarget.h libffi/src/m68k/sysv.S libffi/src/m88k/ffi.c libffi/src/m88k/ffitarget.h libffi/src/m88k/obsd.S libffi/src/metag/ffi.c libffi/src/metag/ffitarget.h libffi/src/metag/sysv.S libffi/src/microblaze/ffi.c libffi/src/microblaze/ffitarget.h libffi/src/microblaze/sysv.S libffi/src/mips/ffi.c libffi/src/mips/ffitarget.h libffi/src/mips/n32.S libffi/src/mips/o32.S libffi/src/moxie/eabi.S libffi/src/moxie/ffi.c libffi/src/moxie/ffitarget.h libffi/src/nios2/ffi.c libffi/src/nios2/ffitarget.h libffi/src/nios2/sysv.S libffi/src/or1k/ffi.c libffi/src/or1k/ffitarget.h libffi/src/or1k/sysv.S libffi/src/pa/ffi.c libffi/src/pa/ffi64.c libffi/src/pa/ffitarget.h libffi/src/pa/hpux32.S libffi/src/pa/hpux64.S libffi/src/pa/linux.S libffi/src/powerpc/aix.S libffi/src/powerpc/aix_closure.S libffi/src/powerpc/asm.h libffi/src/powerpc/darwin.S libffi/src/powerpc/darwin_closure.S libffi/src/powerpc/ffi.c libffi/src/powerpc/ffi_darwin.c libffi/src/powerpc/ffi_linux64.c libffi/src/powerpc/ffi_powerpc.h libffi/src/powerpc/ffi_sysv.c libffi/src/powerpc/ffitarget.h libffi/src/powerpc/linux64.S libffi/src/powerpc/linux64_closure.S libffi/src/powerpc/ppc_closure.S libffi/src/powerpc/sysv.S libffi/src/powerpc/t-aix libffi/src/prep_cif.c libffi/src/prep_cif.lo libffi/src/prep_cif.o libffi/src/raw_api.c libffi/src/raw_api.lo libffi/src/raw_api.o libffi/src/riscv/ffi.c libffi/src/riscv/ffitarget.h libffi/src/riscv/sysv.S libffi/src/s390/ffi.c libffi/src/s390/ffitarget.h libffi/src/s390/internal.h libffi/src/s390/sysv.S libffi/src/sh/ffi.c libffi/src/sh/ffitarget.h libffi/src/sh/sysv.S libffi/src/sh64/ffi.c libffi/src/sh64/ffitarget.h libffi/src/sh64/sysv.S libffi/src/sparc/ffi.c libffi/src/sparc/ffi64.c libffi/src/sparc/ffitarget.h libffi/src/sparc/internal.h libffi/src/sparc/v8.S libffi/src/sparc/v9.S libffi/src/tile/ffi.c libffi/src/tile/ffitarget.h libffi/src/tile/tile.S libffi/src/tramp.c libffi/src/tramp.lo libffi/src/tramp.o libffi/src/types.c libffi/src/types.lo libffi/src/types.o libffi/src/vax/elfbsd.S libffi/src/vax/ffi.c libffi/src/vax/ffitarget.h libffi/src/wasm32/ffi.c libffi/src/wasm32/ffitarget.h libffi/src/x86/asmnames.h libffi/src/x86/ffi.c libffi/src/x86/ffi64.c libffi/src/x86/ffi64.lo libffi/src/x86/ffi64.o libffi/src/x86/ffitarget.h libffi/src/x86/ffiw64.c libffi/src/x86/ffiw64.lo libffi/src/x86/ffiw64.o libffi/src/x86/internal.h libffi/src/x86/internal64.h libffi/src/x86/sysv.S libffi/src/x86/sysv_intel.S libffi/src/x86/unix64.S libffi/src/x86/unix64.lo libffi/src/x86/unix64.o libffi/src/x86/win64.S libffi/src/x86/win64.lo libffi/src/x86/win64.o libffi/src/x86/win64_intel.S libffi/src/xtensa/ffi.c libffi/src/xtensa/ffitarget.h libffi/src/xtensa/sysv.S libffi/stamp-h.in libffi/stamp-h1 libffi/testsuite/Makefile libffi/testsuite/Makefile.am libffi/testsuite/Makefile.in libffi/testsuite/config/default.exp libffi/testsuite/emscripten/build-tests.sh libffi/testsuite/emscripten/build.sh libffi/testsuite/emscripten/conftest.py libffi/testsuite/emscripten/node-tests.sh libffi/testsuite/emscripten/test.html libffi/testsuite/emscripten/test_libffi.py libffi/testsuite/lib/libffi.exp libffi/testsuite/lib/target-libpath.exp libffi/testsuite/lib/wrapper.exp libffi/testsuite/libffi.bhaible/Makefile libffi/testsuite/libffi.bhaible/README libffi/testsuite/libffi.bhaible/alignof.h libffi/testsuite/libffi.bhaible/bhaible.exp libffi/testsuite/libffi.bhaible/test-call.c libffi/testsuite/libffi.bhaible/test-callback.c libffi/testsuite/libffi.bhaible/testcases.c libffi/testsuite/libffi.call/align_mixed.c libffi/testsuite/libffi.call/align_stdcall.c libffi/testsuite/libffi.call/bpo_38748.c libffi/testsuite/libffi.call/call.exp libffi/testsuite/libffi.call/err_bad_typedef.c libffi/testsuite/libffi.call/ffitest.h libffi/testsuite/libffi.call/float.c libffi/testsuite/libffi.call/float1.c libffi/testsuite/libffi.call/float2.c libffi/testsuite/libffi.call/float3.c libffi/testsuite/libffi.call/float4.c libffi/testsuite/libffi.call/float_va.c libffi/testsuite/libffi.call/many.c libffi/testsuite/libffi.call/many2.c libffi/testsuite/libffi.call/many_double.c libffi/testsuite/libffi.call/many_mixed.c libffi/testsuite/libffi.call/negint.c libffi/testsuite/libffi.call/offsets.c libffi/testsuite/libffi.call/pr1172638.c libffi/testsuite/libffi.call/promotion.c libffi/testsuite/libffi.call/pyobjc_tc.c libffi/testsuite/libffi.call/return_dbl.c libffi/testsuite/libffi.call/return_dbl1.c libffi/testsuite/libffi.call/return_dbl2.c libffi/testsuite/libffi.call/return_fl.c libffi/testsuite/libffi.call/return_fl1.c libffi/testsuite/libffi.call/return_fl2.c libffi/testsuite/libffi.call/return_fl3.c libffi/testsuite/libffi.call/return_ldl.c libffi/testsuite/libffi.call/return_ll.c libffi/testsuite/libffi.call/return_ll1.c libffi/testsuite/libffi.call/return_sc.c libffi/testsuite/libffi.call/return_sl.c libffi/testsuite/libffi.call/return_uc.c libffi/testsuite/libffi.call/return_ul.c libffi/testsuite/libffi.call/s55.c libffi/testsuite/libffi.call/strlen.c libffi/testsuite/libffi.call/strlen2.c libffi/testsuite/libffi.call/strlen3.c libffi/testsuite/libffi.call/strlen4.c libffi/testsuite/libffi.call/struct1.c libffi/testsuite/libffi.call/struct10.c libffi/testsuite/libffi.call/struct2.c libffi/testsuite/libffi.call/struct3.c libffi/testsuite/libffi.call/struct4.c libffi/testsuite/libffi.call/struct5.c libffi/testsuite/libffi.call/struct6.c libffi/testsuite/libffi.call/struct7.c libffi/testsuite/libffi.call/struct8.c libffi/testsuite/libffi.call/struct9.c libffi/testsuite/libffi.call/struct_by_value_2.c libffi/testsuite/libffi.call/struct_by_value_3.c libffi/testsuite/libffi.call/struct_by_value_4.c libffi/testsuite/libffi.call/struct_by_value_big.c libffi/testsuite/libffi.call/struct_by_value_small.c libffi/testsuite/libffi.call/struct_return_2H.c libffi/testsuite/libffi.call/struct_return_8H.c libffi/testsuite/libffi.call/uninitialized.c libffi/testsuite/libffi.call/va_1.c libffi/testsuite/libffi.call/va_2.c libffi/testsuite/libffi.call/va_3.c libffi/testsuite/libffi.call/va_struct1.c libffi/testsuite/libffi.call/va_struct2.c libffi/testsuite/libffi.call/va_struct3.c libffi/testsuite/libffi.closures/closure.exp libffi/testsuite/libffi.closures/closure_fn0.c libffi/testsuite/libffi.closures/closure_fn1.c libffi/testsuite/libffi.closures/closure_fn2.c libffi/testsuite/libffi.closures/closure_fn3.c libffi/testsuite/libffi.closures/closure_fn4.c libffi/testsuite/libffi.closures/closure_fn5.c libffi/testsuite/libffi.closures/closure_fn6.c libffi/testsuite/libffi.closures/closure_loc_fn0.c libffi/testsuite/libffi.closures/closure_simple.c libffi/testsuite/libffi.closures/cls_12byte.c libffi/testsuite/libffi.closures/cls_16byte.c libffi/testsuite/libffi.closures/cls_18byte.c libffi/testsuite/libffi.closures/cls_19byte.c libffi/testsuite/libffi.closures/cls_1_1byte.c libffi/testsuite/libffi.closures/cls_20byte.c libffi/testsuite/libffi.closures/cls_20byte1.c libffi/testsuite/libffi.closures/cls_24byte.c libffi/testsuite/libffi.closures/cls_2byte.c libffi/testsuite/libffi.closures/cls_3_1byte.c libffi/testsuite/libffi.closures/cls_3byte1.c libffi/testsuite/libffi.closures/cls_3byte2.c libffi/testsuite/libffi.closures/cls_3float.c libffi/testsuite/libffi.closures/cls_4_1byte.c libffi/testsuite/libffi.closures/cls_4byte.c libffi/testsuite/libffi.closures/cls_5_1_byte.c libffi/testsuite/libffi.closures/cls_5byte.c libffi/testsuite/libffi.closures/cls_64byte.c libffi/testsuite/libffi.closures/cls_6_1_byte.c libffi/testsuite/libffi.closures/cls_6byte.c libffi/testsuite/libffi.closures/cls_7_1_byte.c libffi/testsuite/libffi.closures/cls_7byte.c libffi/testsuite/libffi.closures/cls_8byte.c libffi/testsuite/libffi.closures/cls_9byte1.c libffi/testsuite/libffi.closures/cls_9byte2.c libffi/testsuite/libffi.closures/cls_align_double.c libffi/testsuite/libffi.closures/cls_align_float.c libffi/testsuite/libffi.closures/cls_align_longdouble.c libffi/testsuite/libffi.closures/cls_align_longdouble_split.c libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c libffi/testsuite/libffi.closures/cls_align_pointer.c libffi/testsuite/libffi.closures/cls_align_sint16.c libffi/testsuite/libffi.closures/cls_align_sint32.c libffi/testsuite/libffi.closures/cls_align_sint64.c libffi/testsuite/libffi.closures/cls_align_uint16.c libffi/testsuite/libffi.closures/cls_align_uint32.c libffi/testsuite/libffi.closures/cls_align_uint64.c libffi/testsuite/libffi.closures/cls_dbls_struct.c libffi/testsuite/libffi.closures/cls_double.c libffi/testsuite/libffi.closures/cls_double_va.c libffi/testsuite/libffi.closures/cls_float.c libffi/testsuite/libffi.closures/cls_longdouble.c libffi/testsuite/libffi.closures/cls_longdouble_va.c libffi/testsuite/libffi.closures/cls_many_mixed_args.c libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c libffi/testsuite/libffi.closures/cls_multi_schar.c libffi/testsuite/libffi.closures/cls_multi_sshort.c libffi/testsuite/libffi.closures/cls_multi_sshortchar.c libffi/testsuite/libffi.closures/cls_multi_uchar.c libffi/testsuite/libffi.closures/cls_multi_ushort.c libffi/testsuite/libffi.closures/cls_multi_ushortchar.c libffi/testsuite/libffi.closures/cls_pointer.c libffi/testsuite/libffi.closures/cls_pointer_stack.c libffi/testsuite/libffi.closures/cls_schar.c libffi/testsuite/libffi.closures/cls_sint.c libffi/testsuite/libffi.closures/cls_sshort.c libffi/testsuite/libffi.closures/cls_struct_va1.c libffi/testsuite/libffi.closures/cls_uchar.c libffi/testsuite/libffi.closures/cls_uint.c libffi/testsuite/libffi.closures/cls_uint_va.c libffi/testsuite/libffi.closures/cls_ulong_va.c libffi/testsuite/libffi.closures/cls_ulonglong.c libffi/testsuite/libffi.closures/cls_ushort.c libffi/testsuite/libffi.closures/err_bad_abi.c libffi/testsuite/libffi.closures/ffitest.h libffi/testsuite/libffi.closures/huge_struct.c libffi/testsuite/libffi.closures/nested_struct.c libffi/testsuite/libffi.closures/nested_struct1.c libffi/testsuite/libffi.closures/nested_struct10.c libffi/testsuite/libffi.closures/nested_struct11.c libffi/testsuite/libffi.closures/nested_struct12.c libffi/testsuite/libffi.closures/nested_struct13.c libffi/testsuite/libffi.closures/nested_struct2.c libffi/testsuite/libffi.closures/nested_struct3.c libffi/testsuite/libffi.closures/nested_struct4.c libffi/testsuite/libffi.closures/nested_struct5.c libffi/testsuite/libffi.closures/nested_struct6.c libffi/testsuite/libffi.closures/nested_struct7.c libffi/testsuite/libffi.closures/nested_struct8.c libffi/testsuite/libffi.closures/nested_struct9.c libffi/testsuite/libffi.closures/problem1.c libffi/testsuite/libffi.closures/single_entry_structs1.c libffi/testsuite/libffi.closures/single_entry_structs2.c libffi/testsuite/libffi.closures/single_entry_structs3.c libffi/testsuite/libffi.closures/stret_large.c libffi/testsuite/libffi.closures/stret_large2.c libffi/testsuite/libffi.closures/stret_medium.c libffi/testsuite/libffi.closures/stret_medium2.c libffi/testsuite/libffi.closures/testclosure.c libffi/testsuite/libffi.closures/unwindtest.cc libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc libffi/testsuite/libffi.complex/cls_align_complex.inc libffi/testsuite/libffi.complex/cls_align_complex_double.c libffi/testsuite/libffi.complex/cls_align_complex_float.c libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c libffi/testsuite/libffi.complex/cls_complex.inc libffi/testsuite/libffi.complex/cls_complex_double.c libffi/testsuite/libffi.complex/cls_complex_float.c libffi/testsuite/libffi.complex/cls_complex_longdouble.c libffi/testsuite/libffi.complex/cls_complex_struct.inc libffi/testsuite/libffi.complex/cls_complex_struct_double.c libffi/testsuite/libffi.complex/cls_complex_struct_float.c libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c libffi/testsuite/libffi.complex/cls_complex_va.inc libffi/testsuite/libffi.complex/cls_complex_va_double.c libffi/testsuite/libffi.complex/cls_complex_va_float.c libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c libffi/testsuite/libffi.complex/complex.exp libffi/testsuite/libffi.complex/complex.inc libffi/testsuite/libffi.complex/complex_defs_double.inc libffi/testsuite/libffi.complex/complex_defs_float.inc libffi/testsuite/libffi.complex/complex_defs_longdouble.inc libffi/testsuite/libffi.complex/complex_double.c libffi/testsuite/libffi.complex/complex_float.c libffi/testsuite/libffi.complex/complex_int.c libffi/testsuite/libffi.complex/complex_longdouble.c libffi/testsuite/libffi.complex/ffitest.h libffi/testsuite/libffi.complex/many_complex.inc libffi/testsuite/libffi.complex/many_complex_double.c libffi/testsuite/libffi.complex/many_complex_float.c libffi/testsuite/libffi.complex/many_complex_longdouble.c libffi/testsuite/libffi.complex/return_complex.inc libffi/testsuite/libffi.complex/return_complex1.inc libffi/testsuite/libffi.complex/return_complex1_double.c libffi/testsuite/libffi.complex/return_complex1_float.c libffi/testsuite/libffi.complex/return_complex1_longdouble.c libffi/testsuite/libffi.complex/return_complex2.inc libffi/testsuite/libffi.complex/return_complex2_double.c libffi/testsuite/libffi.complex/return_complex2_float.c libffi/testsuite/libffi.complex/return_complex2_longdouble.c libffi/testsuite/libffi.complex/return_complex_double.c libffi/testsuite/libffi.complex/return_complex_float.c libffi/testsuite/libffi.complex/return_complex_longdouble.c libffi/testsuite/libffi.go/aa-direct.c libffi/testsuite/libffi.go/closure1.c libffi/testsuite/libffi.go/ffitest.h libffi/testsuite/libffi.go/go.exp libffi/testsuite/libffi.go/static-chain.h libtommath/LICENSE libtommath/README.md libtommath/bn_cutoffs.c libtommath/bn_deprecated.c libtommath/bn_mp_2expt.c libtommath/bn_mp_abs.c libtommath/bn_mp_add.c libtommath/bn_mp_add_d.c libtommath/bn_mp_addmod.c libtommath/bn_mp_and.c libtommath/bn_mp_clamp.c libtommath/bn_mp_clear.c libtommath/bn_mp_clear_multi.c libtommath/bn_mp_cmp.c libtommath/bn_mp_cmp_d.c libtommath/bn_mp_cmp_mag.c libtommath/bn_mp_cnt_lsb.c libtommath/bn_mp_complement.c libtommath/bn_mp_copy.c libtommath/bn_mp_count_bits.c libtommath/bn_mp_decr.c libtommath/bn_mp_div.c libtommath/bn_mp_div_2.c libtommath/bn_mp_div_2d.c libtommath/bn_mp_div_3.c libtommath/bn_mp_div_d.c libtommath/bn_mp_dr_is_modulus.c libtommath/bn_mp_dr_reduce.c libtommath/bn_mp_dr_setup.c libtommath/bn_mp_error_to_string.c libtommath/bn_mp_exch.c libtommath/bn_mp_expt_u32.c libtommath/bn_mp_exptmod.c libtommath/bn_mp_exteuclid.c libtommath/bn_mp_fread.c libtommath/bn_mp_from_sbin.c libtommath/bn_mp_from_ubin.c libtommath/bn_mp_fwrite.c libtommath/bn_mp_gcd.c libtommath/bn_mp_get_double.c libtommath/bn_mp_get_i32.c libtommath/bn_mp_get_i64.c libtommath/bn_mp_get_l.c libtommath/bn_mp_get_ll.c libtommath/bn_mp_get_mag_u32.c libtommath/bn_mp_get_mag_u64.c libtommath/bn_mp_get_mag_ul.c libtommath/bn_mp_get_mag_ull.c libtommath/bn_mp_grow.c libtommath/bn_mp_incr.c libtommath/bn_mp_init.c libtommath/bn_mp_init_copy.c libtommath/bn_mp_init_i32.c libtommath/bn_mp_init_i64.c libtommath/bn_mp_init_l.c libtommath/bn_mp_init_ll.c libtommath/bn_mp_init_multi.c libtommath/bn_mp_init_set.c libtommath/bn_mp_init_size.c libtommath/bn_mp_init_u32.c libtommath/bn_mp_init_u64.c libtommath/bn_mp_init_ul.c libtommath/bn_mp_init_ull.c libtommath/bn_mp_invmod.c libtommath/bn_mp_is_square.c libtommath/bn_mp_iseven.c libtommath/bn_mp_isodd.c libtommath/bn_mp_kronecker.c libtommath/bn_mp_lcm.c libtommath/bn_mp_log_u32.c libtommath/bn_mp_lshd.c libtommath/bn_mp_mod.c libtommath/bn_mp_mod_2d.c libtommath/bn_mp_mod_d.c libtommath/bn_mp_montgomery_calc_normalization.c libtommath/bn_mp_montgomery_reduce.c libtommath/bn_mp_montgomery_setup.c libtommath/bn_mp_mul.c libtommath/bn_mp_mul_2.c libtommath/bn_mp_mul_2d.c libtommath/bn_mp_mul_d.c libtommath/bn_mp_mulmod.c libtommath/bn_mp_neg.c libtommath/bn_mp_or.c libtommath/bn_mp_pack.c libtommath/bn_mp_pack_count.c libtommath/bn_mp_prime_fermat.c libtommath/bn_mp_prime_frobenius_underwood.c libtommath/bn_mp_prime_is_prime.c libtommath/bn_mp_prime_miller_rabin.c libtommath/bn_mp_prime_next_prime.c libtommath/bn_mp_prime_rabin_miller_trials.c libtommath/bn_mp_prime_rand.c libtommath/bn_mp_prime_strong_lucas_selfridge.c libtommath/bn_mp_radix_size.c libtommath/bn_mp_radix_smap.c libtommath/bn_mp_rand.c libtommath/bn_mp_read_radix.c libtommath/bn_mp_reduce.c libtommath/bn_mp_reduce_2k.c libtommath/bn_mp_reduce_2k_l.c libtommath/bn_mp_reduce_2k_setup.c libtommath/bn_mp_reduce_2k_setup_l.c libtommath/bn_mp_reduce_is_2k.c libtommath/bn_mp_reduce_is_2k_l.c libtommath/bn_mp_reduce_setup.c libtommath/bn_mp_root_u32.c libtommath/bn_mp_rshd.c libtommath/bn_mp_sbin_size.c libtommath/bn_mp_set.c libtommath/bn_mp_set_double.c libtommath/bn_mp_set_i32.c libtommath/bn_mp_set_i64.c libtommath/bn_mp_set_l.c libtommath/bn_mp_set_ll.c libtommath/bn_mp_set_u32.c libtommath/bn_mp_set_u64.c libtommath/bn_mp_set_ul.c libtommath/bn_mp_set_ull.c libtommath/bn_mp_shrink.c libtommath/bn_mp_signed_rsh.c libtommath/bn_mp_sqr.c libtommath/bn_mp_sqrmod.c libtommath/bn_mp_sqrt.c libtommath/bn_mp_sqrtmod_prime.c libtommath/bn_mp_sub.c libtommath/bn_mp_sub_d.c libtommath/bn_mp_submod.c libtommath/bn_mp_to_radix.c libtommath/bn_mp_to_sbin.c libtommath/bn_mp_to_ubin.c libtommath/bn_mp_ubin_size.c libtommath/bn_mp_unpack.c libtommath/bn_mp_xor.c libtommath/bn_mp_zero.c libtommath/bn_prime_tab.c libtommath/bn_s_mp_add.c libtommath/bn_s_mp_balance_mul.c libtommath/bn_s_mp_exptmod.c libtommath/bn_s_mp_exptmod_fast.c libtommath/bn_s_mp_get_bit.c libtommath/bn_s_mp_invmod_fast.c libtommath/bn_s_mp_invmod_slow.c libtommath/bn_s_mp_karatsuba_mul.c libtommath/bn_s_mp_karatsuba_sqr.c libtommath/bn_s_mp_montgomery_reduce_fast.c libtommath/bn_s_mp_mul_digs.c libtommath/bn_s_mp_mul_digs_fast.c libtommath/bn_s_mp_mul_high_digs.c libtommath/bn_s_mp_mul_high_digs_fast.c libtommath/bn_s_mp_prime_is_divisible.c libtommath/bn_s_mp_rand_jenkins.c libtommath/bn_s_mp_rand_platform.c libtommath/bn_s_mp_reverse.c libtommath/bn_s_mp_sqr.c libtommath/bn_s_mp_sqr_fast.c libtommath/bn_s_mp_sub.c libtommath/bn_s_mp_toom_mul.c libtommath/bn_s_mp_toom_sqr.c libtommath/demo/mtest_opponent.c libtommath/demo/shared.c libtommath/demo/shared.h libtommath/demo/test.c libtommath/demo/timing.c libtommath/etc/2kprime.c libtommath/etc/drprime.c libtommath/etc/mersenne.c libtommath/etc/mont.c libtommath/etc/pprime.c libtommath/etc/tune.c libtommath/mtest/logtab.h libtommath/mtest/mpi-config.h libtommath/mtest/mpi-types.h libtommath/mtest/mpi.c libtommath/mtest/mpi.h libtommath/mtest/mtest.c libtommath/tommath.h libtommath/tommath_class.h libtommath/tommath_cutoffs.h libtommath/tommath_private.h libtommath/tommath_superclass.h linenoise/LICENSE linenoise/Makefile linenoise/README.markdown linenoise/example.c linenoise/linenoise.c linenoise/linenoise.h ucd2c/Makefile ucd2c/UCD.zip ucd2c/UCD/ArabicShaping.txt ucd2c/UCD/BidiBrackets.txt ucd2c/UCD/BidiCharacterTest.txt ucd2c/UCD/BidiMirroring.txt ucd2c/UCD/BidiTest.txt ucd2c/UCD/Blocks.txt ucd2c/UCD/CJKRadicals.txt ucd2c/UCD/CaseFolding.txt ucd2c/UCD/CompositionExclusions.txt ucd2c/UCD/DerivedAge.txt ucd2c/UCD/DerivedCoreProperties.txt ucd2c/UCD/DerivedNormalizationProps.txt ucd2c/UCD/EastAsianWidth.txt ucd2c/UCD/EmojiSources.txt ucd2c/UCD/EquivalentUnifiedIdeograph.txt ucd2c/UCD/HangulSyllableType.txt ucd2c/UCD/Index.txt ucd2c/UCD/IndicPositionalCategory.txt ucd2c/UCD/IndicSyllabicCategory.txt ucd2c/UCD/Jamo.txt ucd2c/UCD/LineBreak.txt ucd2c/UCD/NameAliases.txt ucd2c/UCD/NamedSequences.txt ucd2c/UCD/NamedSequencesProv.txt ucd2c/UCD/NamesList.html ucd2c/UCD/NamesList.txt ucd2c/UCD/NormalizationCorrections.txt ucd2c/UCD/NormalizationTest.txt ucd2c/UCD/NushuSources.txt ucd2c/UCD/PropList.txt ucd2c/UCD/PropertyAliases.txt ucd2c/UCD/PropertyValueAliases.txt ucd2c/UCD/ReadMe.txt ucd2c/UCD/ScriptExtensions.txt ucd2c/UCD/Scripts.txt ucd2c/UCD/SpecialCasing.txt ucd2c/UCD/StandardizedVariants.txt ucd2c/UCD/TangutSources.txt ucd2c/UCD/USourceData.txt ucd2c/UCD/USourceGlyphs.pdf ucd2c/UCD/USourceRSChart.pdf ucd2c/UCD/UnicodeData.txt ucd2c/UCD/VerticalOrientation.txt ucd2c/UCD/auxiliary/GraphemeBreakProperty.txt ucd2c/UCD/auxiliary/GraphemeBreakTest.html ucd2c/UCD/auxiliary/GraphemeBreakTest.txt ucd2c/UCD/auxiliary/LineBreakTest.html ucd2c/UCD/auxiliary/LineBreakTest.txt ucd2c/UCD/auxiliary/SentenceBreakProperty.txt ucd2c/UCD/auxiliary/SentenceBreakTest.html ucd2c/UCD/auxiliary/SentenceBreakTest.txt ucd2c/UCD/auxiliary/WordBreakProperty.txt ucd2c/UCD/auxiliary/WordBreakTest.html ucd2c/UCD/auxiliary/WordBreakTest.txt ucd2c/UCD/emoji/ReadMe.txt ucd2c/UCD/emoji/emoji-data.txt ucd2c/UCD/emoji/emoji-variation-sequences.txt ucd2c/UCD/extracted/DerivedBidiClass.txt ucd2c/UCD/extracted/DerivedBinaryProperties.txt ucd2c/UCD/extracted/DerivedCombiningClass.txt ucd2c/UCD/extracted/DerivedDecompositionType.txt ucd2c/UCD/extracted/DerivedEastAsianWidth.txt ucd2c/UCD/extracted/DerivedGeneralCategory.txt ucd2c/UCD/extracted/DerivedJoiningGroup.txt ucd2c/UCD/extracted/DerivedJoiningType.txt ucd2c/UCD/extracted/DerivedLineBreak.txt ucd2c/UCD/extracted/DerivedName.txt ucd2c/UCD/extracted/DerivedNumericType.txt ucd2c/UCD/extracted/DerivedNumericValues.txt ucd2c/config.mk ucd2c/configure ucd2c/license.txt ucd2c/ucd.c ucd2c/ucd.h ucd2c/ucd2c ucd2c/ucd2c.c ucd2c/ucd2c.lo ucd2c/ucd2c.o '
diff --git a/test/ic3/void.in b/test/ic3/void.in
new file mode 100644
index 0000000..833c6d8
--- /dev/null
+++ b/test/ic3/void.in
@@ -0,0 +1,8 @@
+quote void
+void
+quote type(void)
+type(void)
+quote (Void) 0
+(Void) 0
+quote type((Void) 0)
+type((Void) 0)
diff --git a/test/ic3/void.out.expected b/test/ic3/void.out.expected
new file mode 100644
index 0000000..323132a
--- /dev/null
+++ b/test/ic3/void.out.expected
@@ -0,0 +1,8 @@
+void
+void
+type(void)
+Void
+(Void) 0
+void
+type((Void) 0)
+Void
diff --git a/test/ic3/void.ret.expected b/test/ic3/void.ret.expected
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/ic3/void.ret.expected
@@ -0,0 +1 @@
+0