diff --git a/.ic3_history b/.ic3_history
index 8ac1327..b9d63da 100644
--- a/.ic3_history
+++ b/.ic3_history
@@ -1,5 +1,3 @@
- defoperator :operator_add :+ cfn Tag "tag_mul" (Tag, Tag, Result) 10 :left
- def sq = fn (x) { x + x }
end
Plop.sq(4)
defmodule Plop do defoperator :operator_add :+ cfn Tag "tag_mul" (Tag, Tag, Result) 10 :left end
@@ -97,3 +95,5 @@ cow 1
type(cow 1)
cow 1 + cow 1
cow(1) + cow(1)
+quote [a: 1, b: 2]
+quote [{:a, 1}, {:b, 2}]
diff --git a/lib/c3/0.1/gl/vec2.c3 b/lib/c3/0.1/gl/vec2.c3
index 621a0b1..5cc7a88 100644
--- a/lib/c3/0.1/gl/vec2.c3
+++ b/lib/c3/0.1/gl/vec2.c3
@@ -1,6 +1,6 @@
defmodule GL.Vec2 do
- defstruct, [x: (F32) 0,
- y: (F32) 0]
+ defstruct [x: (F32) 0,
+ y: (F32) 0]
end
diff --git a/libc3/buf_inspect.c b/libc3/buf_inspect.c
index 5a5d060..3786730 100644
--- a/libc3/buf_inspect.c
+++ b/libc3/buf_inspect.c
@@ -360,7 +360,8 @@ sw buf_inspect_call (s_buf *buf, const s_call *call)
if (call->ident.module == &g_sym_C3 &&
call->ident.sym == &g_sym_if_then_else)
return buf_inspect_call_if_then_else(buf, call);
- op = operator_find(&call->ident);
+ if (! operator_find(&call->ident, &op))
+ return -1;
if (op && operator_symbol(&call->ident) == &g_sym__brackets)
return buf_inspect_call_brackets(buf, call);
if (call->ident.sym == &g_sym_cast)
@@ -548,6 +549,7 @@ sw buf_inspect_call_op (s_buf *buf, const s_call *call, s8 op_precedence)
{
s_ident ident;
s_tag *left;
+ bool op;
bool paren;
s8 precedence;
sw r;
@@ -556,8 +558,10 @@ sw buf_inspect_call_op (s_buf *buf, const s_call *call, s8 op_precedence)
left = &call->arguments->tag;
assert(list_next(call->arguments));
right = &list_next(call->arguments)->tag;
+ if (! operator_find(&left->data.call.ident, &op))
+ return -1;
if (left->type == TAG_CALL &&
- operator_find(&left->data.call.ident) &&
+ op &&
(precedence = operator_precedence(&left->data.call.ident))
< op_precedence) {
paren = true;
@@ -586,17 +590,20 @@ sw buf_inspect_call_op (s_buf *buf, const s_call *call, s8 op_precedence)
if ((r = buf_write_1(buf, " ")) < 0)
return r;
result += r;
- if (right->type == TAG_CALL &&
- operator_find(&right->data.call.ident) &&
- (precedence = operator_precedence(&right->data.call.ident))
- < op_precedence) {
- paren = true;
- if ((r = buf_write_1(buf, "(")) < 0)
- return r;
- result += r;
+ if (right->type == TAG_CALL) {
+ if (! operator_find(&right->data.call.ident, &op))
+ return -1;
+ if (op &&
+ (precedence = operator_precedence(&right->data.call.ident))
+ < op_precedence) {
+ paren = true;
+ if ((r = buf_write_1(buf, "(")) < 0)
+ return r;
+ result += r;
+ }
+ else
+ paren = false;
}
- else
- paren = false;
if ((r = buf_inspect_tag(buf, right)) < 0)
return r;
result += r;
@@ -672,7 +679,8 @@ sw buf_inspect_call_size (const s_call *call)
if (call->ident.module == &g_sym_C3 &&
call->ident.sym == &g_sym_if_then_else)
return buf_inspect_call_if_then_else_size(call);
- op = operator_find(&call->ident);
+ if (! operator_find(&call->ident, &op))
+ return -1;
if (op && operator_symbol(&call->ident) == &g_sym__brackets)
return buf_inspect_call_brackets_size(call);
if (call->ident.sym == &g_sym_cast)
@@ -2223,51 +2231,48 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
if ((r = buf_write_1(buf, "{")) < 0)
return r;
result += r;
- 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);
- err_write_1(" (");
- err_write_1(tag_type_to_string(k->type));
- err_puts(")");
- assert(k->type == TAG_SYM);
- return -1;
- }
- if (sym_has_reserved_characters(k->data.sym)) {
- if ((r = buf_write_str(buf, &k->data.sym->str)) < 0)
- return r;
- }
- else
- if ((r = buf_write_1(buf, k->data.sym->str.ptr.pchar)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, ": ")) < 0)
- return r;
- result += r;
- if (s->data) {
- if (! tag_type(s->type->map.value + i, &type))
+ if (s->data || s->tag) {
+ 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);
+ err_write_1(" (");
+ err_write_1(tag_type_to_string(k->type));
+ err_puts(")");
+ assert(k->type == TAG_SYM);
return -1;
- if ((r = data_buf_inspect(type, buf, (char *) s->data +
- s->type->offset[i])) < 0)
- return r;
- result += r;
- }
- else if (s->tag) {
- if ((r = buf_inspect_tag(buf, s->tag + i)) < 0)
- return r;
- result += r;
- }
- else {
- if ((r = buf_inspect_tag(buf, s->type->map.value + i)) < 0)
- return r;
+ }
+ if (sym_has_reserved_characters(k->data.sym)) {
+ if ((r = buf_write_str(buf, &k->data.sym->str)) < 0)
+ return r;
+ }
+ else
+ if ((r = buf_write_1(buf, k->data.sym->str.ptr.pchar)) < 0)
+ return r;
result += r;
- }
- i++;
- if (i < s->type->map.count) {
- if ((r = buf_write_1(buf, ", ")) < 0)
+ if ((r = buf_write_1(buf, ": ")) < 0)
return r;
result += r;
+ if (s->data) {
+ if (! tag_type(s->type->map.value + i, &type))
+ return -1;
+ if ((r = data_buf_inspect(type, buf, (char *) s->data +
+ s->type->offset[i])) < 0)
+ return r;
+ result += r;
+ }
+ else if (s->tag) {
+ if ((r = buf_inspect_tag(buf, s->tag + i)) < 0)
+ return r;
+ result += r;
+ }
+ i++;
+ if (i < s->type->map.count) {
+ if ((r = buf_write_1(buf, ", ")) < 0)
+ return r;
+ result += r;
+ }
}
}
if ((r = buf_write_1(buf, "}")) < 0)
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index f907c22..9b7c95f 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -785,6 +785,7 @@ sw buf_parse_call_op (s_buf *buf, s_call *dest)
sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
{
+ bool b;
character c;
s_tag *left;
s_ident next_op;
@@ -840,10 +841,19 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
! operator_resolve(&next_op, 1, &next_op))
break;
next_op_precedence = operator_precedence(&next_op);
- while (r > 0 && operator_arity(&next_op) == 2 &&
- (next_op_precedence > op_precedence ||
- (operator_is_right_associative(&next_op) &&
- next_op_precedence == op_precedence))) {
+ while (1) {
+ if (r <= 0 ||
+ operator_arity(&next_op) != 2)
+ break;
+ if (next_op_precedence <= op_precedence) {
+ if (! operator_is_right_associative(&next_op, &b)) {
+ r = -1;
+ break;
+ }
+ if (! b ||
+ next_op_precedence != op_precedence)
+ break;
+ }
call_init_op(&tmp2);
tmp2.arguments->tag = *right;
if ((r = buf_parse_call_op_rec(buf, &tmp2,
diff --git a/libc3/c3.c b/libc3/c3.c
index c0a67c9..d559628 100644
--- a/libc3/c3.c
+++ b/libc3/c3.c
@@ -66,14 +66,14 @@ s_tag * c3_defoperator (const s_sym **name, const s_sym **sym,
operator_associativity, dest);
}
-s_tag * c3_defstruct (const s_list *spec, s_tag *dest)
+s_tag * c3_defstruct (const s_list * const *spec, s_tag *dest)
{
s_tag tmp;
assert(spec);
if (! spec)
return NULL;
tmp.type = TAG_SYM;
- tmp.data.sym = env_defstruct(&g_c3_env, spec);
+ tmp.data.sym = env_defstruct(&g_c3_env, *spec);
*dest = tmp;
return dest;
}
diff --git a/libc3/c3_main.h b/libc3/c3_main.h
index 5a995ab..93ea0fc 100644
--- a/libc3/c3_main.h
+++ b/libc3/c3_main.h
@@ -43,7 +43,7 @@ s_tag * c3_defoperator (const s_sym **name, const s_sym **sym,
u8 operator_precedence,
const s_sym **operator_associativity,
s_tag *dest);
-s_tag * c3_defstruct (const s_list *spec, s_tag *dest);
+s_tag * c3_defstruct (const s_list * const *spec, s_tag *dest);
void ** c3_dlopen (const s_str *path, void **dest);
void c3_exit (sw code);
s_tag * c3_pin (const s_tag *a, s_tag *dest);
diff --git a/libc3/call.c b/libc3/call.c
index 0a733d0..5736faa 100644
--- a/libc3/call.c
+++ b/libc3/call.c
@@ -39,6 +39,7 @@ void call_clean (s_call *call)
bool call_get (s_call *call, s_facts *facts)
{
s_facts_cursor cursor;
+ const s_fact *fact;
s_tag tag_ident;
s_tag tag_is_a;
s_tag tag_macro;
@@ -58,22 +59,29 @@ bool call_get (s_call *call, s_facts *facts)
tag_init_sym( &tag_sym, call->ident.sym);
tag_init_sym( &tag_symbol, &g_sym_symbol);
tag_init_sym( &tag_symbol_value, &g_sym_symbol_value);
- tag_init_var( &tag_var);
+ tag_init_var( &tag_var, &g_sym_Tag);
if (! facts_find_fact_by_tags(facts, &tag_module_name,
- &tag_symbol, &tag_ident) &&
- ! facts_find_fact_by_tags(facts, &tag_module_name,
- &tag_operator, &tag_ident)) {
- err_write_1("call_get: symbol ");
- err_write_1(call->ident.sym->str.ptr.pchar);
- err_write_1(" not found in module ");
- err_write_1(call->ident.module->str.ptr.pchar);
- err_write_1("\n");
+ &tag_symbol, &tag_ident, &fact))
return false;
+ if (! fact) {
+ if (! facts_find_fact_by_tags(facts, &tag_module_name,
+ &tag_operator, &tag_ident, &fact))
+ return false;
+ if (! fact) {
+ err_write_1("call_get: symbol ");
+ err_write_1(call->ident.sym->str.ptr.pchar);
+ err_write_1(" not found in module ");
+ err_write_1(call->ident.module->str.ptr.pchar);
+ err_write_1("\n");
+ return false;
+ }
}
if (! facts_with_tags(facts, &cursor, &tag_ident,
&tag_symbol_value, &tag_var))
return false;
- if (facts_cursor_next(&cursor)) {
+ if (! facts_cursor_next(&cursor, &fact))
+ return false;
+ if (fact) {
if (tag_var.type == TAG_FN)
call->fn = fn_new_copy(&tag_var.data.fn);
else if (tag_var.type == TAG_CFN)
@@ -87,15 +95,19 @@ bool call_get (s_call *call, s_facts *facts)
}
}
facts_cursor_clean(&cursor);
- if (facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
- &tag_macro)) {
+ if (! facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
+ &tag_macro, &fact))
+ return false;
+ if (fact) {
if (call->fn)
call->fn->macro = true;
if (call->cfn)
call->cfn->macro = true;
}
- if (facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
- &tag_special_operator)) {
+ if (! facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
+ &tag_special_operator, &fact))
+ return false;
+ if (fact) {
if (call->fn)
call->fn->special_operator = true;
if (call->cfn)
@@ -229,6 +241,7 @@ s_str * call_inspect (const s_call *call, s_str *dest)
bool call_op_get (s_call *call, s_facts *facts)
{
s_facts_cursor cursor;
+ const s_fact *fact;
s_tag tag_ident;
s_tag tag_is_a;
s_tag tag_macro;
@@ -246,9 +259,11 @@ bool call_op_get (s_call *call, s_facts *facts)
tag_init_sym( &tag_sym, call->ident.sym);
tag_init_sym( &tag_symbol, &g_sym_symbol);
tag_init_sym( &tag_symbol, &g_sym_symbol_value);
- tag_init_var( &tag_var);
+ tag_init_var( &tag_var, &g_sym_Tag);
if (! facts_find_fact_by_tags(facts, &tag_module_name,
- &tag_symbol, &tag_ident)) {
+ &tag_symbol, &tag_ident, &fact))
+ return false;
+ if (! fact) {
err_write_1("call_op_get: symbol ");
err_write_1(call->ident.sym->str.ptr.pchar);
err_write_1(" not found in module ");
@@ -259,7 +274,9 @@ bool call_op_get (s_call *call, s_facts *facts)
if (! facts_with_tags(facts, &cursor, &tag_ident, &tag_symbol_value,
&tag_var))
return false;
- if (facts_cursor_next(&cursor)) {
+ if (! facts_cursor_next(&cursor, &fact))
+ return false;
+ if (fact) {
if (tag_var.type == TAG_CFN)
call->cfn = cfn_new_copy(&tag_var.data.cfn);
else if (tag_var.type == TAG_FN)
@@ -273,15 +290,19 @@ bool call_op_get (s_call *call, s_facts *facts)
}
}
facts_cursor_clean(&cursor);
- if (facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
- &tag_macro)) {
+ if (! facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
+ &tag_macro, &fact))
+ return false;
+ if (fact) {
if (call->fn)
call->fn->macro = true;
if (call->cfn)
call->cfn->macro = true;
}
- if (facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
- &tag_special_operator)) {
+ if (! facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
+ &tag_special_operator, &fact))
+ return false;
+ if (fact) {
if (call->fn)
call->fn->special_operator = true;
if (call->cfn)
diff --git a/libc3/env.c b/libc3/env.c
index 73e092f..79b753a 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -541,6 +541,7 @@ bool env_eval_call_fn_args (s_env *env, const s_fn *fn,
bool env_eval_call_resolve (s_env *env, s_call *call)
{
+ bool b;
s_ident tmp_ident;
const s_tag *value;
assert(env);
@@ -560,13 +561,15 @@ bool env_eval_call_resolve (s_env *env, s_call *call)
if (! env_ident_resolve_module(env, &tmp_ident, &call->ident) ||
! module_ensure_loaded(call->ident.module, &env->facts) ||
! module_has_ident(call->ident.module, &call->ident,
- &env->facts) ||
+ &env->facts, &b) ||
+ ! b ||
! call_get(call, &env->facts)) {
ident_init_copy(&call->ident, &tmp_ident);
call->ident.module = &g_sym_C3;
if (! module_ensure_loaded(call->ident.module, &env->facts) ||
! module_has_ident(call->ident.module, &call->ident,
- &env->facts) ||
+ &env->facts, &b) ||
+ ! b ||
! call_get(call, &env->facts)) {
ident_init_copy(&call->ident, &tmp_ident);
return false;
@@ -1601,9 +1604,11 @@ const s_tag * env_frames_get (const s_env *env, const s_sym *name)
return NULL;
}
-bool env_ident_is_special_operator (s_env *env,
- const s_ident *ident)
+bool * env_ident_is_special_operator (s_env *env,
+ const s_ident *ident,
+ bool *dest)
{
+ const s_fact *fact;
s_tag tag_ident;
s_tag tag_is_a;
s_tag tag_special_operator;
@@ -1611,13 +1616,14 @@ bool env_ident_is_special_operator (s_env *env,
assert(ident);
tag_ident.type = TAG_IDENT;
if (! env_ident_resolve_module(env, ident, &tag_ident.data.ident))
- return false;
+ return NULL;
tag_init_sym(&tag_is_a, &g_sym_is_a);
tag_init_sym(&tag_special_operator, &g_sym_special_operator);
- if (facts_find_fact_by_tags(&env->facts, &tag_ident, &tag_is_a,
- &tag_special_operator))
- return true;
- return false;
+ if (! facts_find_fact_by_tags(&env->facts, &tag_ident, &tag_is_a,
+ &tag_special_operator, &fact))
+ return NULL;
+ *dest = fact ? true : false;
+ return dest;
}
s_ident * env_ident_resolve_module (s_env *env,
@@ -1777,8 +1783,10 @@ const s_sym ** env_module (s_env *env, const s_sym **dest)
return dest;
}
-bool env_module_is_loading (s_env *env, const s_sym *module)
+bool * env_module_is_loading (s_env *env, const s_sym *module,
+ bool *dest)
{
+ const s_fact *fact;
s_tag tag_module;
s_tag tag_is_loading;
s_tag tag_true;
@@ -1787,14 +1795,18 @@ bool env_module_is_loading (s_env *env, const s_sym *module)
tag_init_sym(&tag_module, module);
tag_init_sym(&tag_is_loading, &g_sym_is_loading);
tag_init_bool(&tag_true, true);
- return facts_find_fact_by_tags(&env->facts, &tag_module,
- &tag_is_loading, &tag_true) ?
- true : false;
+ if (! facts_find_fact_by_tags(&env->facts, &tag_module,
+ &tag_is_loading, &tag_true,
+ &fact))
+ return NULL;
+ *dest = fact ? true : false;
+ return dest;
}
bool env_module_is_loading_set (s_env *env, const s_sym *module,
bool is_loading)
{
+ bool b;
s_tag tag_module;
s_tag tag_is_loading;
s_tag tag_true;
@@ -1810,13 +1822,15 @@ bool env_module_is_loading_set (s_env *env, const s_sym *module,
}
else
if (! facts_remove_fact_tags(&env->facts, &tag_module,
- &tag_is_loading, &tag_true))
+ &tag_is_loading, &tag_true, &b) ||
+ ! b)
return false;
return true;
}
bool env_module_load (s_env *env, const s_sym *module, s_facts *facts)
{
+ bool b;
bool has_spec;
s_str path = {0};
s_tag tag_module_name;
@@ -1826,7 +1840,9 @@ bool env_module_load (s_env *env, const s_sym *module, s_facts *facts)
assert(env);
assert(module);
assert(facts);
- if (env_module_is_loading(env, module))
+ if (! env_module_is_loading(env, module, &b))
+ return false;
+ if (b)
return true;
facts_transaction_start(&env->facts, &transaction);
if (! env_module_is_loading_set(env, module, true))
@@ -1974,6 +1990,7 @@ s_list ** env_module_search_modules (s_env *env, const s_sym *module, s_list **d
s8 env_operator_arity (s_env *env, const s_ident *op)
{
s_facts_cursor cursor;
+ const s_fact *fact;
s8 r = -1;
s_tag tag_op;
s_tag tag_arity;
@@ -1982,12 +1999,12 @@ s8 env_operator_arity (s_env *env, const s_ident *op)
assert(op);
tag_init_ident(&tag_op, op);
tag_init_sym( &tag_arity, &g_sym_arity);
- tag_init_var( &tag_var);
+ tag_init_var( &tag_var, &g_sym_U8);
facts_with_tags(&env->facts, &cursor, &tag_op, &tag_arity, &tag_var);
- if (facts_cursor_next(&cursor) &&
- tag_var.type == TAG_U8) {
+ if (! facts_cursor_next(&cursor, &fact))
+ return -1;
+ if (fact)
r = tag_var.data.u8;
- }
else {
err_write_1("env_operator_arity: arity for operator ");
err_write_1(op->sym->str.ptr.pchar);
@@ -1999,8 +2016,9 @@ s8 env_operator_arity (s_env *env, const s_ident *op)
return r;
}
-bool env_operator_find (s_env *env, const s_ident *op)
+bool * env_operator_find (s_env *env, const s_ident *op, bool *dest)
{
+ const s_fact *fact;
s_tag tag_is_a;
s_tag tag_op;
s_tag tag_operator;
@@ -2009,8 +2027,11 @@ bool env_operator_find (s_env *env, const s_ident *op)
tag_init_sym( &tag_is_a, &g_sym_is_a);
tag_init_ident(&tag_op, op);
tag_init_sym( &tag_operator, &g_sym_operator);
- return facts_find_fact_by_tags(&env->facts, &tag_op, &tag_is_a,
- &tag_operator) ? true : false;
+ if (! facts_find_fact_by_tags(&env->facts, &tag_op, &tag_is_a,
+ &tag_operator, &fact))
+ return NULL;
+ *dest = fact ? true : false;
+ return dest;
}
s_ident * env_operator_ident (s_env *env, const s_ident *op,
@@ -2027,8 +2048,10 @@ s_ident * env_operator_ident (s_env *env, const s_ident *op,
return dest;
}
-bool env_operator_is_right_associative (s_env *env, const s_ident *op)
+bool * env_operator_is_right_associative (s_env *env, const s_ident *op,
+ bool *dest)
{
+ const s_fact *fact;
s_tag tag_assoc;
s_tag tag_op;
s_tag tag_right;
@@ -2037,13 +2060,17 @@ bool env_operator_is_right_associative (s_env *env, const s_ident *op)
tag_init_sym( &tag_assoc, &g_sym_operator_associativity);
tag_init_ident(&tag_op, op);
tag_init_sym( &tag_right, &g_sym_right);
- return facts_find_fact_by_tags(&env->facts, &tag_op, &tag_assoc,
- &tag_right) ? true : false;
+ if (! facts_find_fact_by_tags(&env->facts, &tag_op, &tag_assoc,
+ &tag_right, &fact))
+ return NULL;
+ *dest = fact ? true : false;
+ return dest;
}
s8 env_operator_precedence (s_env *env, const s_ident *op)
{
s_facts_cursor cursor;
+ const s_fact *fact;
s8 r = -1;
s_tag tag_op;
s_tag tag_precedence;
@@ -2052,11 +2079,13 @@ s8 env_operator_precedence (s_env *env, const s_ident *op)
assert(op);
tag_init_ident(&tag_op, op);
tag_init_sym( &tag_precedence, &g_sym_operator_precedence);
- tag_init_var( &tag_var);
- facts_with_tags(&env->facts, &cursor, &tag_op, &tag_precedence,
- &tag_var);
- if (facts_cursor_next(&cursor) &&
- tag_var.type == TAG_U8) {
+ tag_init_var( &tag_var, &g_sym_U8);
+ if (! facts_with_tags(&env->facts, &cursor, &tag_op, &tag_precedence,
+ &tag_var))
+ return -1;
+ if (! facts_cursor_next(&cursor, &fact))
+ return -1;
+ if (fact) {
r = tag_var.data.u8;
}
else {
@@ -2074,6 +2103,7 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
u8 arity, s_ident *dest)
{
s_facts_with_cursor cursor;
+ const s_fact *fact;
s_tag tag_arity;
s_tag tag_arity_u8;
s_tag tag_is_a;
@@ -2091,7 +2121,7 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
tag_init_sym(&tag_module, &g_sym_module);
tag_init_sym(&tag_module_name, tmp.module);
tag_init_sym(&tag_operator, &g_sym_operator);
- tag_init_var(&tag_var);
+ tag_init_var(&tag_var, &g_sym_Ident);
tag_init_sym(&tag_sym, tmp.sym);
tag_init_sym(&tag_symbol, &g_sym_symbol);
facts_with(&env->facts, &cursor, (t_facts_spec) {
@@ -2100,7 +2130,9 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
&tag_var, &tag_symbol, &tag_sym,
&tag_arity, &tag_arity_u8,
NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
+ if (! facts_with_cursor_next(&cursor, &fact))
+ return NULL;
+ if (fact) {
if (tag_var.type == TAG_IDENT) {
*dest = tag_var.data.ident;
facts_with_cursor_clean(&cursor);
@@ -2114,6 +2146,7 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
const s_sym * env_operator_symbol (s_env *env, const s_ident *op)
{
s_facts_cursor cursor;
+ const s_fact *fact;
const s_sym *r;
s_tag tag_op;
s_tag tag_symbol;
@@ -2122,12 +2155,15 @@ const s_sym * env_operator_symbol (s_env *env, const s_ident *op)
assert(op);
tag_init_ident(&tag_op, op);
tag_init_sym( &tag_symbol, &g_sym_symbol);
- tag_init_var( &tag_var);
- facts_with_tags(&env->facts, &cursor, &tag_op, &tag_symbol, &tag_var);
- if (facts_cursor_next(&cursor) &&
- tag_var.type == TAG_SYM) {
+ tag_init_var( &tag_var, &g_sym_Sym);
+ if (! facts_with_tags(&env->facts, &cursor, &tag_op, &tag_symbol,
+ &tag_var))
+ return NULL;
+ if (! facts_cursor_next(&cursor, &fact))
+ return NULL;
+ if (fact &&
+ tag_var.type == TAG_SYM)
r = tag_var.data.sym;
- }
else {
err_write_1("env_operator_symbol: symbol for operator ");
err_write_1(op->sym->str.ptr.pchar);
@@ -2177,6 +2213,7 @@ s_list ** env_search_modules (s_env *env, s_list **dest)
bool env_sym_search_modules (s_env *env, const s_sym *sym,
const s_sym **dest)
{
+ bool b;
const s_sym *module;
s_list *search_module;
assert(env);
@@ -2190,7 +2227,9 @@ bool env_sym_search_modules (s_env *env, const s_sym *sym,
assert(! "env_sym_search_modules: invalid env->search_modules");
return false;
}
- if (module_has_symbol(module, sym, &env->facts)) {
+ if (! module_has_symbol(module, sym, &env->facts, &b))
+ return false;
+ if (b) {
*dest = module;
return true;
}
@@ -2203,6 +2242,7 @@ u8 env_special_operator_arity (s_env *env, const s_ident *ident)
{
u8 arity;
s_facts_cursor cursor;
+ const s_fact *fact;
s_tag tag_arity;
s_tag tag_ident;
s_tag tag_var;
@@ -2211,10 +2251,13 @@ u8 env_special_operator_arity (s_env *env, const s_ident *ident)
tag_ident.type = TAG_IDENT;
env_ident_resolve_module(env, ident, &tag_ident.data.ident);
tag_init_sym( &tag_arity, &g_sym_arity);
- tag_init_var( &tag_var);
- facts_with_tags(&env->facts, &cursor,
- &tag_ident, &tag_arity, &tag_var);
- if (facts_cursor_next(&cursor)) {
+ tag_init_var( &tag_var, &g_sym_U8);
+ if (! facts_with_tags(&env->facts, &cursor,
+ &tag_ident, &tag_arity, &tag_var))
+ return 0;
+ if (! facts_cursor_next(&cursor, &fact))
+ return 0;
+ if (fact) {
if (tag_var.type != TAG_U8 || ! tag_var.data.u8) {
err_write_1("env_special_operator_arity: "
"invalid arity for special operator ");
@@ -2235,10 +2278,11 @@ u8 env_special_operator_arity (s_env *env, const s_ident *ident)
return 0;
}
-bool env_struct_type_exists (s_env *env, const s_sym *module)
+bool * env_struct_type_exists (s_env *env, const s_sym *module,
+ bool *dest)
{
s_facts_cursor cursor;
- bool result;
+ const s_fact *fact;
s_tag tag_defstruct;
s_tag tag_module;
s_tag tag_var;
@@ -2246,20 +2290,23 @@ bool env_struct_type_exists (s_env *env, const s_sym *module)
assert(module);
tag_init_sym(&tag_module, module);
tag_init_sym(&tag_defstruct, &g_sym_defstruct);
- tag_init_var(&tag_var);
+ tag_init_var(&tag_var, &g_sym_Tag);
env_module_maybe_reload(env, module, &env->facts);
- facts_with_tags(&env->facts, &cursor, &tag_module,
- &tag_defstruct, &tag_var);
- result = facts_cursor_next(&cursor) ? true : false;
+ if (! facts_with_tags(&env->facts, &cursor, &tag_module,
+ &tag_defstruct, &tag_var))
+ return NULL;
+ if (! facts_cursor_next(&cursor, &fact))
+ return NULL;
facts_cursor_clean(&cursor);
- return result;
+ *dest = fact ? true : false;
+ return dest;
}
const s_struct_type * env_struct_type_find (s_env *env,
const s_sym *module)
{
s_facts_with_cursor cursor;
- s_fact *found;
+ const s_fact *found;
const s_struct_type *result;
s_tag tag_struct_type;
s_tag tag_module;
@@ -2269,11 +2316,12 @@ const s_struct_type * env_struct_type_find (s_env *env,
assert(module);
tag_init_sym(&tag_module, module);
tag_init_sym(&tag_struct_type, &g_sym_struct_type);
- tag_init_var(&tag_var);
+ tag_init_var(&tag_var, &g_sym_Tag);
env_module_maybe_reload(env, module, &env->facts);
facts_with(&env->facts, &cursor, (t_facts_spec) {
&tag_module, &tag_struct_type, &tag_var, NULL, NULL });
- found = facts_with_cursor_next(&cursor);
+ if (! facts_with_cursor_next(&cursor, &found))
+ return NULL;
if (! found) {
facts_with_cursor_clean(&cursor);
return NULL;
@@ -2296,7 +2344,7 @@ const s_struct_type * env_struct_type_find (s_env *env,
f_clean env_struct_type_get_clean (s_env *env, const s_sym *module)
{
s_facts_with_cursor cursor;
- s_fact *found;
+ const s_fact *found;
s_tag tag_clean;
s_tag tag_module;
s_tag tag_var;
@@ -2304,10 +2352,11 @@ f_clean env_struct_type_get_clean (s_env *env, const s_sym *module)
const s_sym *type;
tag_init_sym(&tag_module, module);
tag_init_sym(&tag_clean, &g_sym_clean);
- tag_init_var(&tag_var);
+ tag_init_var(&tag_var, &g_sym_Tag);
facts_with(&env->facts, &cursor, (t_facts_spec) {
&tag_module, &tag_clean, &tag_var, NULL, NULL });
- found = facts_with_cursor_next(&cursor);
+ if (! facts_with_cursor_next(&cursor, &found))
+ return NULL;
if (! found) {
facts_with_cursor_clean(&cursor);
return NULL;
@@ -2342,7 +2391,7 @@ s_list ** env_struct_type_get_spec (s_env *env,
const s_sym *module,
s_list **dest)
{
- s_fact *found;
+ const s_fact *found;
s_tag tag_defstruct;
s_tag tag_module;
s_tag tag_var;
@@ -2352,9 +2401,10 @@ s_list ** env_struct_type_get_spec (s_env *env,
assert(dest);
tag_init_sym(&tag_defstruct, &g_sym_defstruct);
tag_init_sym(&tag_module, module);
- tag_init_var(&tag_var);
- found = facts_find_fact_by_tags(&env->facts, &tag_module,
- &tag_defstruct, &tag_var);
+ tag_init_var(&tag_var, &g_sym_Tag);
+ if (! facts_find_fact_by_tags(&env->facts, &tag_module,
+ &tag_defstruct, &tag_var, &found))
+ return NULL;
if (! found) {
err_write_1("env_struct_type_get_spec: ");
err_inspect_sym(&module);
@@ -2380,7 +2430,7 @@ bool * env_struct_type_has_spec (s_env *env, const s_sym *module,
bool *dest)
{
s_facts_cursor cursor;
- s_fact *found;
+ const s_fact *fact;
s_tag tag_defstruct;
s_tag tag_module;
s_tag tag_var;
@@ -2388,12 +2438,14 @@ bool * env_struct_type_has_spec (s_env *env, const s_sym *module,
assert(module);
tag_init_sym(&tag_defstruct, &g_sym_defstruct);
tag_init_sym(&tag_module, module);
- tag_init_var(&tag_var);
+ tag_init_var(&tag_var, &g_sym_Tag);
if (! facts_with_tags(&env->facts, &cursor, &tag_module,
&tag_defstruct, &tag_var))
return NULL;
- found = facts_cursor_next(&cursor);
- *dest = found ? true : false;
+ if (! facts_cursor_next(&cursor, &fact))
+ return NULL;
+ facts_cursor_clean(&cursor);
+ *dest = fact ? true : false;
return dest;
}
diff --git a/libc3/env.h b/libc3/env.h
index eb90ced..26abfca 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -161,10 +161,12 @@ bool env_eval_tag (s_env *env, const s_tag *tag,
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);
-bool env_ident_is_special_operator (s_env *env,
- const s_ident *ident);
+bool * env_ident_is_special_operator (s_env *env,
+ const s_ident *ident,
+ bool *dest);
bool env_load (s_env *env, const s_str *path);
-bool env_module_is_loading (s_env *env, const s_sym *module);
+bool * env_module_is_loading (s_env *env, const s_sym *module,
+ bool *dest);
bool env_module_is_loading_set (s_env *env,
const s_sym *module,
bool value);
@@ -174,19 +176,21 @@ 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);
+bool * env_operator_find (s_env *env, const s_ident *op,
+ bool *dest);
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);
+bool * env_operator_is_right_associative (s_env *env,
+ const s_ident *op,
+ bool *dest);
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);
u8 env_special_operator_arity (s_env *env,
const s_ident *ident);
-bool env_struct_type_exists (s_env *env,
- const s_sym *module);
+bool * env_struct_type_exists (s_env *env, const s_sym *module,
+ bool *dest);
const s_struct_type *
env_struct_type_find (s_env *env, const s_sym *module);
f_clean env_struct_type_get_clean (s_env *env,
diff --git a/libc3/fact_action.c b/libc3/fact_action.c
new file mode 100644
index 0000000..d44f1af
--- /dev/null
+++ b/libc3/fact_action.c
@@ -0,0 +1,24 @@
+/* c3
+ * Copyright 2022-2024 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 <stdlib.h>
+#include "fact_action.h"
+
+void fact_action_delete_all (s_fact_action *action)
+{
+ s_fact_action *next;
+ while (action) {
+ next = action->next;
+ free(action);
+ action = next;
+ }
+}
diff --git a/libc3/fact_action.h b/libc3/fact_action.h
new file mode 100644
index 0000000..1fba1c9
--- /dev/null
+++ b/libc3/fact_action.h
@@ -0,0 +1,20 @@
+/* c3
+ * Copyright 2022-2024 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.
+ */
+#ifndef LIBC3_FACT_ACTION_H
+#define LIBC3_FACT_ACTION_H
+
+#include "types.h"
+
+void fact_action_delete_all (s_fact_action *action);
+
+#endif /* LIBC3_FACT_ACTION_H */
diff --git a/libc3/facts.c b/libc3/facts.c
index 00db580..313e92e 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -23,6 +23,7 @@
#include "fact_list.h"
#include "facts.h"
#include "facts_cursor.h"
+#include "facts_transaction.h"
#include "facts_with.h"
#include "file.h"
#include "io.h"
@@ -32,6 +33,7 @@
#include "set__tag.h"
#include "set_cursor__fact.h"
#include "skiplist__fact.h"
+#include "sym.h"
#include "tag.h"
static int facts_compare_pfact_id_reverse (const void *a,
@@ -39,18 +41,34 @@ static int facts_compare_pfact_id_reverse (const void *a,
static sw facts_open_file_create (s_facts *facts, const s_str *path);
static sw facts_open_log (s_facts *facts, s_buf *buf);
-s_fact * facts_add_fact (s_facts *facts, const s_fact *fact)
+const s_fact * facts_add_fact (s_facts *facts, const s_fact *fact)
{
s_fact tmp;
s_fact *f = NULL;
s_set_item__fact *item;
assert(facts);
assert(fact);
- facts_lock_w(facts);
- tmp.subject = facts_ref_tag(facts, fact->subject);
+ if (! facts_lock_w(facts))
+ return NULL;
+ tmp.subject = facts_ref_tag(facts, fact->subject);
+ if (! tmp.subject) {
+ facts_lock_unlock_w(facts);
+ return NULL;
+ }
tmp.predicate = facts_ref_tag(facts, fact->predicate);
- tmp.object = facts_ref_tag(facts, fact->object);
- tmp.id = 0;
+ if (! tmp.predicate) {
+ facts_unref_tag(facts, tmp.subject);
+ facts_lock_unlock_w(facts);
+ return NULL;
+ }
+ tmp.object = facts_ref_tag(facts, fact->object);
+ if (! tmp.object) {
+ facts_unref_tag(facts, tmp.subject);
+ facts_unref_tag(facts, tmp.predicate);
+ facts_lock_unlock_w(facts);
+ return NULL;
+ }
+ tmp.id = 0;
if ((item = set_get__fact(&facts->facts, &tmp))) {
facts_lock_unlock_w(facts);
return &item->data;
@@ -59,23 +77,49 @@ s_fact * facts_add_fact (s_facts *facts, const s_fact *fact)
if (facts->next_id == UW_MAX) {
err_puts("facts_add_fact: facts serial id exhausted");
assert(! "facts_add_fact: facts serial id exhausted");
- return NULL;
+ goto ko;
}
- facts->next_id++;
- if (facts->log)
- facts_log_add(facts->log, &tmp);
item = set_add__fact(&facts->facts, &tmp);
+ if (! item)
+ goto ko;
f = &item->data;
- skiplist_insert__fact(facts->index_spo, f);
- skiplist_insert__fact(facts->index_pos, f);
- skiplist_insert__fact(facts->index_osp, f);
+ if (! skiplist_insert__fact(facts->index_spo, f)) {
+ set_remove__fact(&facts->facts, f);
+ goto ko;
+ }
+ if (! skiplist_insert__fact(facts->index_pos, f)) {
+ skiplist_remove__fact(facts->index_spo, f);
+ set_remove__fact(&facts->facts, f);
+ goto ko;
+ }
+ if (! skiplist_insert__fact(facts->index_osp, f)) {
+ skiplist_remove__fact(facts->index_spo, f);
+ skiplist_remove__fact(facts->index_pos, f);
+ set_remove__fact(&facts->facts, f);
+ goto ko;
+ }
+ if (facts->log &&
+ ! facts_log_add(facts->log, &tmp)) {
+ skiplist_remove__fact(facts->index_spo, f);
+ skiplist_remove__fact(facts->index_pos, f);
+ skiplist_remove__fact(facts->index_osp, f);
+ set_remove__fact(&facts->facts, f);
+ goto ko;
+ }
+ facts->next_id++;
facts_lock_unlock_w(facts);
return f;
+ ko:
+ facts_unref_tag(facts, tmp.subject);
+ facts_unref_tag(facts, tmp.predicate);
+ facts_unref_tag(facts, tmp.object);
+ facts_lock_unlock_w(facts);
+ return NULL;
}
-s_fact * facts_add_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object)
+const s_fact * facts_add_tags (s_facts *facts, const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object)
{
s_fact fact;
fact_init(&fact, subject, predicate, object);
@@ -132,7 +176,7 @@ void facts_delete (s_facts *facts)
sw facts_dump (s_facts *facts, s_buf *buf)
{
s_facts_cursor cursor;
- s_fact *fact;
+ const s_fact *fact;
s_tag predicate;
s_tag object;
sw r;
@@ -140,9 +184,9 @@ sw facts_dump (s_facts *facts, s_buf *buf)
s_tag subject;
assert(facts);
assert(buf);
- tag_init_var(&subject);
- tag_init_var(&predicate);
- tag_init_var(&object);
+ tag_init_var(&subject, &g_sym_Tag);
+ tag_init_var(&predicate, &g_sym_Tag);
+ tag_init_var(&object, &g_sym_Tag);
if ((r = buf_write_1(buf,
"%{module: C3.Facts.Dump,\n"
" version: 1}\n")) < 0)
@@ -150,7 +194,9 @@ sw facts_dump (s_facts *facts, s_buf *buf)
result += r;
facts_lock_r(facts);
facts_with_0(facts, &cursor, &subject, &predicate, &object);
- while ((fact = facts_cursor_next(&cursor))) {
+ if (! facts_cursor_next(&cursor, &fact))
+ goto clean;
+ while (fact) {
if ((r = buf_write_1(buf, "add ")) < 0)
goto clean;
result += r;
@@ -160,6 +206,8 @@ sw facts_dump (s_facts *facts, s_buf *buf)
if ((r = buf_write_1(buf, "\n")) < 0)
goto clean;
result += r;
+ if (! facts_cursor_next(&cursor, &fact))
+ goto clean;
}
r = result;
clean:
@@ -186,42 +234,52 @@ sw facts_dump_file (s_facts *facts, const char *path)
return r;
}
-s_fact * facts_find_fact (s_facts *facts, const s_fact *fact)
+const s_fact ** facts_find_fact (s_facts *facts, const s_fact *fact,
+ const s_fact **dest)
{
s_fact f;
s_set_item__fact *item;
- s_fact *result = NULL;
assert(facts);
assert(fact);
- facts_lock_r(facts);
- if ((f.subject = facts_find_tag(facts, fact->subject)) &&
- (f.predicate = facts_find_tag(facts, fact->predicate)) &&
- (f.object = facts_find_tag(facts, fact->object)) &&
+ if (! facts_lock_r(facts))
+ return NULL;
+ if (! facts_find_tag(facts, fact->subject, &f.subject))
+ return NULL;
+ if (! facts_find_tag(facts, fact->predicate, &f.predicate))
+ return NULL;
+ if (! facts_find_tag(facts, fact->object, &f.object))
+ return NULL;
+ *dest = NULL;
+ if (f.subject && f.predicate && f.object &&
(item = set_get__fact((const s_set__fact *) &facts->facts, &f)))
- result = &item->data;
+ *dest = &item->data;
facts_lock_unlock_r(facts);
- return result;
+ return dest;
}
-s_fact * facts_find_fact_by_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object)
+const s_fact ** facts_find_fact_by_tags (s_facts *facts,
+ const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object,
+ const s_fact **dest)
{
s_fact f = {subject, predicate, object, 0};
- return facts_find_fact(facts, &f);
+ return facts_find_fact(facts, &f, dest);
}
-s_tag * facts_find_tag (s_facts *facts, const s_tag *tag)
+const s_tag ** facts_find_tag (s_facts *facts, const s_tag *tag,
+ const s_tag **dest)
{
s_set_item__tag *item;
- s_tag *result = NULL;
assert(facts);
assert(tag);
- facts_lock_r(facts);
+ if (! facts_lock_r(facts))
+ return NULL;
+ *dest = NULL;
if ((item = set_get__tag(&facts->tags, tag)))
- result = &item->data;
+ *dest = &item->data;
facts_lock_unlock_r(facts);
- return result;
+ return dest;
}
s_facts * facts_init (s_facts *facts)
@@ -532,6 +590,7 @@ sw facts_open_file_create (s_facts *facts, const s_str *path)
sw facts_open_log (s_facts *facts, s_buf *buf)
{
+ bool b;
s_fact_w fact;
s_fact *factp;
sw r;
@@ -547,7 +606,8 @@ sw facts_open_log (s_facts *facts, s_buf *buf)
break;
result += r;
factp = fact_r(&fact);
- facts_add_fact(facts, factp);
+ if (! facts_add_fact(facts, factp))
+ return -1;
goto ok;
}
if ((r = buf_read_1(buf, "remove ")) <= 0)
@@ -557,7 +617,8 @@ sw facts_open_log (s_facts *facts, s_buf *buf)
break;
result += r;
factp = fact_r(&fact);
- facts_remove_fact(facts, factp);
+ if (! facts_remove_fact(facts, factp, &b))
+ return -1;
ok:
fact_w_clean(&fact);
if ((r = buf_read_1(buf, "\n")) <= 0)
@@ -567,7 +628,7 @@ sw facts_open_log (s_facts *facts, s_buf *buf)
return result;
}
-s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag)
+const s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag)
{
s_set_item__tag *item;
assert(facts);
@@ -584,8 +645,9 @@ s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag)
return &item->data;
}
-void facts_remove_all (s_facts *facts)
+s_facts * facts_remove_all (s_facts *facts)
{
+ bool b;
uw count;
s_set_cursor__fact cursor;
s_fact **f;
@@ -595,12 +657,10 @@ void facts_remove_all (s_facts *facts)
assert(facts);
count = facts->facts.count;
if (! count)
- return;
+ return facts;
f = alloc(count * sizeof(s_fact *));
- if (! f) {
- abort();
- return;
- }
+ if (! f)
+ return NULL;
i = 0;
set_cursor_init__fact(&facts->facts, &cursor);
while (i < count &&
@@ -611,21 +671,28 @@ void facts_remove_all (s_facts *facts)
qsort(f, i, sizeof(s_fact *), facts_compare_pfact_id_reverse);
j = 0;
while (j < i) {
- facts_remove_fact(facts, f[j]);
+ if (! facts_remove_fact(facts, f[j], &b) ||
+ ! b) {
+ free(f);
+ return NULL;
+ }
j++;
}
free(f);
+ return facts;
}
-bool facts_remove_fact (s_facts *facts, const s_fact *fact)
+bool * facts_remove_fact (s_facts *facts, const s_fact *fact,
+ bool *dest)
{
s_fact f;
- s_fact *found;
- e_bool result = false;
+ const s_fact *found;
assert(facts);
assert(fact);
facts_lock_w(facts);
- found = facts_find_fact(facts, fact);
+ if (! facts_find_fact(facts, fact, &found))
+ return NULL;
+ *dest = false;
if (found) {
if (facts->log)
facts_log_remove(facts->log, found);
@@ -637,15 +704,16 @@ bool facts_remove_fact (s_facts *facts, const s_fact *fact)
facts_unref_tag(facts, f.subject);
facts_unref_tag(facts, f.predicate);
facts_unref_tag(facts, f.object);
- result = true;
+ *dest = true;
}
facts_lock_unlock_w(facts);
- return result;
+ return dest;
}
-bool facts_remove_fact_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object)
+bool * facts_remove_fact_tags (s_facts *facts, const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object,
+ bool *dest)
{
s_fact fact;
assert(facts);
@@ -655,10 +723,10 @@ bool facts_remove_fact_tags (s_facts *facts, const s_tag *subject,
fact.subject = subject;
fact.predicate = predicate;
fact.object = object;
- return facts_remove_fact(facts, &fact);
+ return facts_remove_fact(facts, &fact, dest);
}
-s_fact * facts_replace_fact (s_facts *facts, const s_fact *fact)
+const s_fact * facts_replace_fact (s_facts *facts, const s_fact *fact)
{
assert(facts);
assert(fact);
@@ -666,34 +734,57 @@ s_fact * facts_replace_fact (s_facts *facts, const s_fact *fact)
fact->object);
}
-s_fact * facts_replace_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object)
+const s_fact * facts_replace_tags (s_facts *facts, const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object)
{
+ bool b;
s_facts_cursor cursor;
+ const s_fact *fact;
s_list *list = NULL;
- s_fact *f;
+ s_facts_transaction transaction;
s_tag var;
assert(facts);
assert(subject);
assert(predicate);
assert(object);
- tag_init_var(&var);
- facts_lock_w(facts);
- facts_with_tags(facts, &cursor, (s_tag *) subject,
- (s_tag *) predicate, &var);
- while ((f = facts_cursor_next(&cursor))) {
+ tag_init_var(&var, &g_sym_Tag);
+ if (! facts_lock_w(facts))
+ return NULL;
+ if (! facts_with_tags(facts, &cursor, (s_tag *) subject,
+ (s_tag *) predicate, &var)) {
+ facts_lock_unlock_w(facts);
+ return NULL;
+ }
+ if (! facts_cursor_next(&cursor, &fact)) {
+ facts_lock_unlock_w(facts);
+ return NULL;
+ }
+ while (fact) {
list = list_new(list);
- list->tag.data.fact = *f;
+ list->tag.data.fact = *fact;
+ if (! facts_cursor_next(&cursor, &fact)) {
+ facts_lock_unlock_w(facts);
+ list_delete_all(list);
+ return NULL;
+ }
}
+ facts_transaction_start(facts, &transaction);
while (list) {
- facts_remove_fact(facts, &list->tag.data.fact);
+ if (! facts_remove_fact(facts, &list->tag.data.fact, &b) ||
+ ! b) {
+ list_delete_all(list);
+ facts_transaction_rollback(facts, &transaction);
+ facts_lock_unlock_w(facts);
+ return NULL;
+ }
list = list_delete(list);
}
facts_cursor_clean(&cursor);
- f = facts_add_tags(facts, subject, predicate, object);
+ fact = facts_add_tags(facts, subject, predicate, object);
+ facts_transaction_clean(&transaction);
facts_lock_unlock_w(facts);
- return f;
+ return fact;
}
sw facts_save_file (s_facts *facts, const char *path)
@@ -727,53 +818,6 @@ sw facts_save_file (s_facts *facts, const char *path)
return r;
}
-s_facts * facts_transaction_rollback (s_facts *facts,
- s_facts_transaction *transaction)
-{
- s_fact_action *log;
- s_facts_transaction *t;
- t = facts->transaction;
- while (t) {
- if (t == transaction)
- goto rollback;
- t = t->next;
- }
- err_puts("facts_transaction_rollback: transaction not found");
- assert(! "facts_transaction_rollback: transaction not found");
- return NULL;
- rollback:
- while (t) {
- log = t->log;
- while (log) {
- if (log->remove) {
- if (! facts_add_fact(facts, &log->fact))
- return NULL;
- }
- else {
- if (! facts_remove_fact(facts, &log->fact))
- return NULL;
- }
- log = log->next;
- }
- if (t == transaction)
- return facts;
- t = t->next;
- }
- err_puts("facts_transaction_rollback: unknown error");
- assert(! "facts_transaction_rollback: unknown error");
- exit(1);
- return NULL;
-}
-
-void facts_transaction_start (s_facts *facts,
- s_facts_transaction *transaction)
-{
- assert(facts);
- assert(transaction);
- transaction->next = facts->transaction;
- facts->transaction = transaction;
-}
-
bool facts_unref_tag (s_facts *facts, const s_tag *tag)
{
s_set_item__tag *item;
diff --git a/libc3/facts.h b/libc3/facts.h
index e4549f8..97af5bd 100644
--- a/libc3/facts.h
+++ b/libc3/facts.h
@@ -30,46 +30,57 @@ s_facts * facts_new (void);
void facts_delete (s_facts *facts);
/* Modifiers */
-s_fact * facts_add_fact (s_facts *facts, const s_fact *fact);
-s_fact * facts_add_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object);
-void facts_close (s_facts *facts);
-sw facts_load (s_facts *facts, s_buf *buf, const s_str *path);
-sw facts_load_file (s_facts *facts, const s_str *path);
-s_facts * facts_lock_clean (s_facts *facts);
-s_facts * facts_lock_init (s_facts *facts);
-s_facts * facts_lock_r (s_facts *facts);
-s_facts * facts_lock_unlock_r (s_facts *facts);
-s_facts * facts_lock_unlock_w (s_facts *facts);
-s_facts * facts_lock_w (s_facts *facts);
-sw facts_open_file (s_facts *facts, const s_str *path);
-s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag);
-bool facts_remove_fact (s_facts *facts, const s_fact *fact);
-bool facts_remove_fact_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object);
-void facts_remove_all (s_facts *facts);
-s_fact * facts_replace_fact (s_facts *facts, const s_fact *fact);
-s_fact * facts_replace_tags (s_facts *facts, const s_tag *subject,
+const s_fact * facts_add_fact (s_facts *facts, const s_fact *fact);
+const s_fact * facts_add_tags (s_facts *facts, const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object);
+void facts_close (s_facts *facts);
+sw facts_load (s_facts *facts, s_buf *buf,
+ const s_str *path);
+sw facts_load_file (s_facts *facts, const s_str *path);
+s_facts * facts_lock_clean (s_facts *facts);
+s_facts * facts_lock_init (s_facts *facts);
+s_facts * facts_lock_r (s_facts *facts);
+s_facts * facts_lock_unlock_r (s_facts *facts);
+s_facts * facts_lock_unlock_w (s_facts *facts);
+s_facts * facts_lock_w (s_facts *facts);
+sw facts_open_file (s_facts *facts, const s_str *path);
+const s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag);
+bool * facts_remove_fact (s_facts *facts, const s_fact *fact,
+ bool *dest);
+bool * facts_remove_fact_tags (s_facts *facts,
+ const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object,
+ bool *dest);
+s_facts * facts_remove_all (s_facts *facts);
+const s_fact * facts_replace_fact (s_facts *facts, const s_fact *fact);
+const s_fact * facts_replace_tags (s_facts *facts, const s_tag *subject,
const s_tag *predicate,
const s_tag *object);
-sw facts_save_file (s_facts *facts, const char *path);
-s_facts * facts_transaction_rollback (s_facts *facts,
- s_facts_transaction *transaction);
-void facts_transaction_start (s_facts *facts,
- s_facts_transaction *transaction);
-bool facts_unref_tag (s_facts *facts, const s_tag *tag);
+sw facts_save_file (s_facts *facts, const char *path);
+s_facts_transaction * facts_transaction_clean
+(s_facts_transaction *transaction);
+s_facts * facts_transaction_rollback
+ (s_facts *facts,
+ const s_facts_transaction *transaction);
+void facts_transaction_start
+ (s_facts *facts, s_facts_transaction *transaction);
+bool facts_unref_tag (s_facts *facts, const s_tag *tag);
/* Observers */
-sw facts_dump (s_facts *facts, s_buf *buf);
-sw facts_dump_file (s_facts *facts, const char *path);
-s_fact * facts_find_fact (s_facts *facts, const s_fact *fact);
-s_fact * facts_find_fact_by_tags (s_facts *facts, const s_tag *subject,
- const s_tag *predicate,
- const s_tag *object);
-s_tag * facts_find_tag (s_facts *facts, const s_tag *tag);
-sw facts_log_add (s_log *log, const s_fact *fact);
-sw facts_log_remove (s_log *log, const s_fact *fact);
+sw facts_dump (s_facts *facts, s_buf *buf);
+sw facts_dump_file (s_facts *facts, const char *path);
+const s_fact ** facts_find_fact (s_facts *facts, const s_fact *fact,
+ const s_fact **dest);
+const s_fact ** facts_find_fact_by_tags (s_facts *facts,
+ const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object,
+ const s_fact **dest);
+const s_tag ** facts_find_tag (s_facts *facts, const s_tag *tag,
+ const s_tag **dest);
+sw facts_log_add (s_log *log, const s_fact *fact);
+sw facts_log_remove (s_log *log, const s_fact *fact);
#endif /* LIBC3_FACTS_H */
diff --git a/libc3/facts_cursor.c b/libc3/facts_cursor.c
index 979531e..634b2af 100644
--- a/libc3/facts_cursor.c
+++ b/libc3/facts_cursor.c
@@ -10,12 +10,14 @@
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
+#include <stdlib.h>
#include "assert.h"
#include "facts.h"
#include "facts_cursor.h"
#include "skiplist__fact.h"
#include "skiplist_node__fact.h"
#include "tag.h"
+#include "var.h"
void facts_cursor_clean (s_facts_cursor *cursor)
{
@@ -52,9 +54,12 @@ s_facts_cursor * facts_cursor_init (s_facts *facts,
cursor->end.predicate = TAG_LAST;
cursor->end.object = TAG_LAST;
}
- cursor->var_subject = NULL;
- cursor->var_predicate = NULL;
- cursor->var_object = NULL;
+ cursor->var_subject = NULL;
+ cursor->var_subject_type = NULL;
+ cursor->var_predicate = NULL;
+ cursor->var_predicate_type = NULL;
+ cursor->var_object = NULL;
+ cursor->var_object_type = NULL;
cursor->facts = facts;
if (! facts_cursor_lock_init(cursor)) {
facts_cursor_clean(cursor);
@@ -104,38 +109,56 @@ s_facts_cursor * facts_cursor_lock_unlock (s_facts_cursor *cursor)
if (pthread_mutex_unlock(&cursor->mutex)) {
err_puts("facts_cursor_lock_unlock: pthread_mutex_unlock");
assert(! "facts_cursor_lock_unlock: pthread_mutex_unlock");
+ exit(1);
return NULL;
}
return cursor;
}
-s_fact * facts_cursor_next (s_facts_cursor *cursor)
+const s_fact ** facts_cursor_next (s_facts_cursor *cursor,
+ const s_fact **dest)
{
+ const s_fact *fact;
assert(cursor);
- facts_cursor_lock(cursor);
+ if (! facts_cursor_lock(cursor))
+ return NULL;
if (cursor->node) {
cursor->node = SKIPLIST_NODE_NEXT__fact(cursor->node, 0);
if (cursor->node &&
cursor->index->compare(&cursor->end, cursor->node->fact) < 0)
cursor->node = NULL;
}
- if (cursor->node) {
- s_fact *fact = cursor->node->fact;
+ if (! cursor->node) {
if (cursor->var_subject)
- *cursor->var_subject = *fact->subject;
+ tag_init_var(cursor->var_subject, cursor->var_subject_type);
if (cursor->var_predicate)
- *cursor->var_predicate = *fact->predicate;
+ tag_init_var(cursor->var_predicate, cursor->var_predicate_type);
if (cursor->var_object)
- *cursor->var_object = *fact->object;
+ tag_init_var(cursor->var_object, cursor->var_object_type);
facts_cursor_lock_unlock(cursor);
- return fact;
+ *dest = NULL;
+ return dest;
}
+ fact = cursor->node->fact;
+ if (cursor->var_subject)
+ if (! var_set(cursor->var_subject, fact->subject))
+ goto ko;
+ if (cursor->var_predicate)
+ if (! var_set(cursor->var_predicate, fact->predicate))
+ goto ko;
+ if (cursor->var_object)
+ if (! var_set(cursor->var_object, fact->object))
+ goto ko;
+ facts_cursor_lock_unlock(cursor);
+ *dest = fact;
+ return dest;
+ ko:
if (cursor->var_subject)
- tag_init_var(cursor->var_subject);
+ tag_init_var(cursor->var_subject, cursor->var_subject_type);
if (cursor->var_predicate)
- tag_init_var(cursor->var_predicate);
+ tag_init_var(cursor->var_predicate, cursor->var_predicate_type);
if (cursor->var_object)
- tag_init_var(cursor->var_object);
+ tag_init_var(cursor->var_object, cursor->var_object_type);
facts_cursor_lock_unlock(cursor);
return NULL;
}
diff --git a/libc3/facts_cursor.h b/libc3/facts_cursor.h
index 278e5ff..0e923ce 100644
--- a/libc3/facts_cursor.h
+++ b/libc3/facts_cursor.h
@@ -28,6 +28,7 @@ s_facts_cursor * facts_cursor_lock (s_facts_cursor *cursor);
s_facts_cursor * facts_cursor_lock_clean (s_facts_cursor *cursor);
s_facts_cursor * facts_cursor_lock_init (s_facts_cursor *cursor);
s_facts_cursor * facts_cursor_lock_unlock (s_facts_cursor *cursor);
-s_fact * facts_cursor_next (s_facts_cursor *cursor);
+const s_fact ** facts_cursor_next (s_facts_cursor *cursor,
+ const s_fact **dest);
#endif /* LIBC3_FACTS_H */
diff --git a/libc3/facts_transaction.c b/libc3/facts_transaction.c
new file mode 100644
index 0000000..7e663a0
--- /dev/null
+++ b/libc3/facts_transaction.c
@@ -0,0 +1,76 @@
+/* c3
+ * Copyright 2022-2024 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 <stdlib.h>
+#include "assert.h"
+#include "fact_action.h"
+#include "facts.h"
+#include "facts_transaction.h"
+#include "list.h"
+
+s_facts_transaction * facts_transaction_clean
+(s_facts_transaction *transaction)
+{
+ assert(transaction);
+ fact_action_delete_all(transaction->log);
+ return transaction->next;
+}
+
+s_facts * facts_transaction_rollback
+(s_facts *facts, const s_facts_transaction *transaction)
+{
+ bool b;
+ s_fact_action *log;
+ const s_facts_transaction *t;
+ t = facts->transaction;
+ while (t) {
+ if (t == transaction)
+ goto rollback;
+ t = t->next;
+ }
+ err_puts("facts_transaction_rollback: transaction not found");
+ assert(! "facts_transaction_rollback: transaction not found");
+ return NULL;
+ rollback:
+ while (t) {
+ log = t->log;
+ while (log) {
+ if (log->remove) {
+ if (! facts_add_fact(facts, &log->fact))
+ return NULL;
+ }
+ else {
+ if (! facts_remove_fact(facts, &log->fact, &b) ||
+ ! b)
+ return NULL;
+ }
+ log = log->next;
+ }
+ if (t == transaction)
+ return facts;
+ t = t->next;
+ }
+ err_puts("facts_transaction_rollback: unknown error");
+ assert(! "facts_transaction_rollback: unknown error");
+ exit(1);
+ return NULL;
+}
+
+void facts_transaction_start (s_facts *facts,
+ s_facts_transaction *transaction)
+{
+ assert(facts);
+ assert(transaction);
+ transaction->log = NULL;
+ transaction->next = facts->transaction;
+ facts->transaction = transaction;
+}
diff --git a/libc3/facts_transaction.h b/libc3/facts_transaction.h
new file mode 100644
index 0000000..fb139a0
--- /dev/null
+++ b/libc3/facts_transaction.h
@@ -0,0 +1,28 @@
+/* c3
+ * Copyright 2022-2024 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.
+ */
+#ifndef LIBC3_FACTS_TRANSACTION_H
+#define LIBC3_FACTS_TRANSACTION_H
+
+#include "types.h"
+
+/* Stack allocation compatible functions */
+s_facts_transaction * facts_transaction_clean
+(s_facts_transaction *transaction);
+
+/* Operators. */
+s_facts * facts_transaction_rollback
+(s_facts *facts, const s_facts_transaction *transaction);
+void facts_transaction_start
+(s_facts *facts, s_facts_transaction *transaction);
+
+#endif /* LIBC3_FACTS_TRANSACTION_H */
diff --git a/libc3/facts_with.c b/libc3/facts_with.c
index dd69a3a..c8e26b7 100644
--- a/libc3/facts_with.c
+++ b/libc3/facts_with.c
@@ -69,8 +69,14 @@ s_facts_cursor * facts_with_0 (s_facts *facts,
assert(cursor);
facts_cursor_init(facts, cursor, facts->index_spo, NULL, NULL);
cursor->var_subject = var_subject;
+ cursor->var_subject_type =
+ var_subject ? var_subject->data.var.type : NULL;
cursor->var_predicate = var_predicate;
+ cursor->var_predicate_type =
+ var_predicate ? var_predicate->data.var.type : NULL;
cursor->var_object = var_object;
+ cursor->var_object_type =
+ var_object ? var_object->data.var.type : NULL;
return cursor;
}
@@ -106,8 +112,14 @@ s_facts_cursor * facts_with_1_2 (s_facts *facts,
tree = facts->index_osp;
facts_cursor_init(facts, cursor, tree, &start, &end);
cursor->var_subject = var_subject;
+ cursor->var_subject_type =
+ var_subject ? var_subject->data.var.type : NULL;
cursor->var_predicate = var_predicate;
+ cursor->var_predicate_type =
+ var_predicate ? var_predicate->data.var.type : NULL;
cursor->var_object = var_object;
+ cursor->var_object_type =
+ var_object ? var_object->data.var.type : NULL;
return cursor;
}
diff --git a/libc3/facts_with_cursor.c b/libc3/facts_with_cursor.c
index 92fdb97..279cc38 100644
--- a/libc3/facts_with_cursor.c
+++ b/libc3/facts_with_cursor.c
@@ -39,9 +39,10 @@ void facts_with_cursor_clean (s_facts_with_cursor *cursor)
}
}
-s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
+const s_fact ** facts_with_cursor_next (s_facts_with_cursor *cursor,
+ const s_fact **dest)
{
- s_fact *fact = NULL;
+ const s_fact *fact = NULL;
s_facts_with_cursor_level *level;
p_facts_spec parent_spec;
assert(cursor);
@@ -62,7 +63,8 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
err_write_1(" ");
err_inspect_fact(level->fact);
#endif
- level->fact = facts_cursor_next(&level->cursor);
+ if (! facts_cursor_next(&level->cursor, &level->fact))
+ goto ko;
#ifdef DEBUG_FACTS
err_write_1(" -> ");
err_inspect_fact(level->fact);
@@ -75,7 +77,8 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
assert(! "facts_with_cursor_next: pthread_mutex_unlock");
exit(1);
}
- return level->fact;
+ *dest = level->fact;
+ return dest;
}
free(level->spec);
level->spec = NULL;
@@ -106,7 +109,8 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
buf_write_1(&g_c3_env.err, " ");
buf_inspect_fact(&g_c3_env.err, level->fact);
#endif
- fact = facts_cursor_next(&level->cursor);
+ if (! facts_cursor_next(&level->cursor, &fact))
+ goto ko;
level->fact = fact;
#ifdef DEBUG_FACTS
buf_write_1(&g_c3_env.err, " -> ");
@@ -131,7 +135,8 @@ s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor)
assert(! "facts_with_cursor_next: pthread_mutex_unlock");
exit(1);
}
- return fact;
+ *dest = fact;
+ return dest;
ko:
if (pthread_mutex_unlock(&cursor->mutex)) {
err_puts("facts_with_cursor_next: pthread_mutex_unlock");
diff --git a/libc3/facts_with_cursor.h b/libc3/facts_with_cursor.h
index 5252741..4ba7ca1 100644
--- a/libc3/facts_with_cursor.h
+++ b/libc3/facts_with_cursor.h
@@ -16,6 +16,7 @@
#include "types.h"
void facts_with_cursor_clean (s_facts_with_cursor *cursor);
-s_fact * facts_with_cursor_next (s_facts_with_cursor *cursor);
+const s_fact ** facts_with_cursor_next (s_facts_with_cursor *cursor,
+ const s_fact **dest);
#endif /* LIBC3_FACTS_WITH_CURSOR_H */
diff --git a/libc3/ident.c b/libc3/ident.c
index f8d58b8..be54bc3 100644
--- a/libc3/ident.c
+++ b/libc3/ident.c
@@ -57,6 +57,7 @@ bool ident_first_character_is_reserved (character c)
s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
{
s_facts_with_cursor cursor;
+ const s_fact *fact;
const s_sym *module;
s_tag tag_ident;
s_tag tag_is_a;
@@ -88,30 +89,43 @@ s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
tag_init_sym( &tag_sym, ident->sym);
tag_init_sym( &tag_symbol, &g_sym_symbol);
tag_init_sym( &tag_symbol_value, &g_sym_symbol_value);
- tag_init_var( &tag_var);
+ tag_init_var( &tag_var, &g_sym_Tag);
if (! facts_find_fact_by_tags(facts, &tag_module, &tag_symbol,
- &tag_ident))
+ &tag_ident, &fact) ||
+ ! fact)
return NULL;
- facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_symbol_value, &tag_var,
- NULL, NULL });
- if (! facts_with_cursor_next(&cursor)) {
+ if (! facts_with(facts, &cursor, (t_facts_spec) {
+ &tag_ident, &tag_symbol_value, &tag_var,
+ NULL, NULL }))
+ return NULL;
+ if (! facts_with_cursor_next(&cursor, &fact) ||
+ ! fact) {
facts_with_cursor_clean(&cursor);
return NULL;
}
facts_with_cursor_clean(&cursor);
- facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_is_a, &tag_macro, NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
+ if (! facts_with(facts, &cursor, (t_facts_spec) {
+ &tag_ident, &tag_is_a, &tag_macro, NULL, NULL }))
+ return NULL;
+ if (! facts_with_cursor_next(&cursor, &fact)) {
+ facts_with_cursor_clean(&cursor);
+ return NULL;
+ }
+ if (fact) {
if (tag_var.type == TAG_CFN)
tag_var.data.cfn.macro = true;
else if (tag_var.type == TAG_FN)
tag_var.data.fn.macro = true;
}
facts_with_cursor_clean(&cursor);
- facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_is_a, &tag_special_operator, NULL, NULL});
- if (facts_with_cursor_next(&cursor)) {
+ if (! facts_with(facts, &cursor, (t_facts_spec) {
+ &tag_ident, &tag_is_a, &tag_special_operator, NULL, NULL}))
+ return NULL;
+ if (! facts_with_cursor_next(&cursor, &fact)) {
+ facts_with_cursor_clean(&cursor);
+ return NULL;
+ }
+ if (fact) {
if (tag_var.type == TAG_CFN)
tag_var.data.cfn.special_operator = true;
else if (tag_var.type == TAG_FN)
@@ -206,9 +220,9 @@ s_str * ident_inspect (const s_ident *ident, s_str *dest)
return buf_to_str(&buf, dest);
}
-bool ident_is_special_operator (const s_ident *ident)
+bool * ident_is_special_operator (const s_ident *ident, bool *dest)
{
- return env_ident_is_special_operator(&g_c3_env, ident);
+ return env_ident_is_special_operator(&g_c3_env, ident, dest);
}
s_ident * ident_resolve_module (const s_ident *ident, s_ident *dest)
diff --git a/libc3/list_init.c b/libc3/list_init.c
index d4d9c91..b0ca300 100644
--- a/libc3/list_init.c
+++ b/libc3/list_init.c
@@ -526,12 +526,12 @@ s_list * list_init_uw (s_list *list, uw i, s_list *next)
return list;
}
-s_list * list_init_var (s_list *list, s_list *next)
+s_list * list_init_var (s_list *list, const s_sym *type, s_list *next)
{
s_list tmp;
assert(list);
list_init(&tmp, next);
- if (! tag_init_var(&tmp.tag))
+ if (! tag_init_var(&tmp.tag, type))
return NULL;
*list = tmp;
return list;
@@ -1125,13 +1125,13 @@ s_list * list_new_uw (uw i, s_list *next)
return list;
}
-s_list * list_new_var (s_list *next)
+s_list * list_new_var (const s_sym *type, s_list *next)
{
s_list *list;
list = list_new(next);
if (! list)
return NULL;
- if (! tag_init_var(&list->tag)) {
+ if (! tag_init_var(&list->tag, type)) {
free(list);
return NULL;
}
diff --git a/libc3/list_init.h b/libc3/list_init.h
index d12d3e7..1b1d5a3 100644
--- a/libc3/list_init.h
+++ b/libc3/list_init.h
@@ -69,7 +69,7 @@ s_list * list_init_unquote_copy (s_list *list,
const s_unquote *unquote,
s_list *next);
s_list * list_init_uw (s_list *list, uw i, s_list *next);
-s_list * list_init_var (s_list *list, s_list *next);
+s_list * list_init_var (s_list *list, const s_sym *type, s_list *next);
s_list * list_init_void (s_list *list, s_list *next);
/* Heap-allocation functions, call list_delete after use. */
@@ -126,7 +126,7 @@ s_list * list_new_u32 (u32 i, s_list *next);
s_list * list_new_u64 (u64 i, s_list *next);
s_list * list_new_unquote_copy (const s_unquote *unquote, s_list *next);
s_list * list_new_uw (uw i, s_list *next);
-s_list * list_new_var (s_list *next);
+s_list * list_new_var (const s_sym *type, s_list *next);
s_list * list_new_void (s_list *next);
/* Setters. */
@@ -179,7 +179,7 @@ s_list * list_u32 (s_list *list, u32 i);
s_list * list_u64 (s_list *list, u64 i);
s_list * list_unquote_copy (s_list *list, const s_unquote *unquote);
s_list * list_uw (s_list *list, uw i);
-s_list * list_var (s_list *list);
+s_list * list_var (s_list *list, const s_sym *type);
s_list * list_void (s_list *list);
#endif /* LIBC3_LIST_INIT_H */
diff --git a/libc3/module.c b/libc3/module.c
index 3eddc90..6d66c60 100644
--- a/libc3/module.c
+++ b/libc3/module.c
@@ -26,16 +26,22 @@
bool module_ensure_loaded (const s_sym *module, s_facts *facts)
{
+ bool b;
+ const s_fact *fact;
s_tag tag_module_name;
s_tag tag_is_a;
s_tag tag_module;
- if (module_is_loading(module))
+ if (! module_is_loading(module, &b))
+ return false;
+ if (b)
return true;
tag_init_sym(&tag_is_a, &g_sym_is_a);
tag_init_sym(&tag_module, &g_sym_module);
tag_init_sym(&tag_module_name, module);
if (! facts_find_fact_by_tags(facts, &tag_module_name, &tag_is_a,
- &tag_module)) {
+ &tag_module, &fact))
+ return false;
+ if (! fact) {
if (! module_load(module, facts)) {
err_write_1("module_ensure_loaded: module not found: ");
err_puts(module->str.ptr.pchar);
@@ -48,9 +54,10 @@ bool module_ensure_loaded (const s_sym *module, s_facts *facts)
return true;
}
-bool module_has_ident (const s_sym *module, const s_ident *ident,
- s_facts *facts)
+bool * module_has_ident (const s_sym *module, const s_ident *ident,
+ s_facts *facts, bool *dest)
{
+ const s_fact *fact;
s_tag tag_ident;
s_tag tag_module_name;
s_tag tag_operator;
@@ -59,24 +66,29 @@ bool module_has_ident (const s_sym *module, const s_ident *ident,
tag_init_sym( &tag_module_name, module);
tag_init_sym( &tag_operator, &g_sym_operator);
tag_init_sym( &tag_symbol, &g_sym_symbol);
- return facts_find_fact_by_tags(facts, &tag_module_name,
- &tag_symbol, &tag_ident) ||
- facts_find_fact_by_tags(facts, &tag_module_name,
- &tag_operator, &tag_ident);
+ if (! facts_find_fact_by_tags(facts, &tag_module_name,
+ &tag_symbol, &tag_ident, &fact))
+ return NULL;
+ if (! fact &&
+ ! facts_find_fact_by_tags(facts, &tag_module_name,
+ &tag_operator, &tag_ident, &fact))
+ return NULL;
+ *dest = fact ? true : false;
+ return dest;
}
-bool module_has_symbol (const s_sym *module, const s_sym *sym,
- s_facts *facts)
+bool * module_has_symbol (const s_sym *module, const s_sym *sym,
+ s_facts *facts, bool *dest)
{
s_ident ident;
ident.module = module;
ident.sym = sym;
- return module_has_ident(module, &ident, facts);
+ return module_has_ident(module, &ident, facts, dest);
}
-bool module_is_loading (const s_sym *module)
+bool * module_is_loading (const s_sym *module, bool *dest)
{
- return env_module_is_loading(&g_c3_env, module);
+ return env_module_is_loading(&g_c3_env, module, dest);
}
bool module_load (const s_sym *module, s_facts *facts)
@@ -88,15 +100,18 @@ s_tag * module_load_time (const s_sym *module, s_facts *facts,
s_tag *dest)
{
s_facts_with_cursor cursor;
+ const s_fact *fact;
s_tag tag_module_name;
s_tag tag_load_time;
s_tag tag_time_var;
tag_init_sym(&tag_module_name, module);
tag_init_sym(&tag_load_time, &g_sym_load_time);
- tag_init_var(&tag_time_var);
- facts_with(facts, &cursor, (t_facts_spec) {
- &tag_module_name, &tag_load_time, &tag_time_var, NULL, NULL });
- if (! facts_with_cursor_next(&cursor)) {
+ tag_init_var(&tag_time_var, &g_sym_Tag);
+ if (! facts_with(facts, &cursor, (t_facts_spec) {
+ &tag_module_name, &tag_load_time, &tag_time_var, NULL, NULL }))
+ return NULL;
+ if (! facts_with_cursor_next(&cursor, &fact) ||
+ ! fact) {
facts_with_cursor_clean(&cursor);
return NULL;
}
diff --git a/libc3/module.h b/libc3/module.h
index c06c7b1..f9f6553 100644
--- a/libc3/module.h
+++ b/libc3/module.h
@@ -28,13 +28,13 @@ bool module_load (const s_sym *module, s_facts *facts);
bool module_maybe_reload (const s_sym *module, s_facts *facts);
/* Observers */
-bool module_has_ident (const s_sym *module,
+bool * module_has_ident (const s_sym *module,
const s_ident *ident,
- s_facts *facts);
-bool module_has_symbol (const s_sym *module,
+ s_facts *facts, bool *dest);
+bool * module_has_symbol (const s_sym *module,
const s_sym *sym,
- s_facts *facts);
-bool module_is_loading (const s_sym *module);
+ s_facts *facts, bool *dest);
+bool * module_is_loading (const s_sym *module, bool *dest);
s_tag * module_load_time (const s_sym *module, s_facts *facts,
s_tag *dest);
s_str * module_path (const s_sym *module, const s_str *prefix,
diff --git a/libc3/operator.c b/libc3/operator.c
index 519edd3..00ccf89 100644
--- a/libc3/operator.c
+++ b/libc3/operator.c
@@ -18,9 +18,9 @@ s8 operator_arity (const s_ident *op)
return env_operator_arity(&g_c3_env, op);
}
-bool operator_find (const s_ident *op)
+bool * operator_find (const s_ident *op, bool *dest)
{
- return env_operator_find(&g_c3_env, op);
+ return env_operator_find(&g_c3_env, op, dest);
}
s_ident * operator_ident (const s_ident *op, s_ident *dest)
@@ -28,9 +28,9 @@ s_ident * operator_ident (const s_ident *op, s_ident *dest)
return env_operator_ident(&g_c3_env, op, dest);
}
-bool operator_is_right_associative (const s_ident *op)
+bool * operator_is_right_associative (const s_ident *op, bool *dest)
{
- return env_operator_is_right_associative(&g_c3_env, op);
+ return env_operator_is_right_associative(&g_c3_env, op, dest);
}
s8 operator_precedence (const s_ident *op)
diff --git a/libc3/operator.h b/libc3/operator.h
index cc3ddd4..3038f57 100644
--- a/libc3/operator.h
+++ b/libc3/operator.h
@@ -17,9 +17,10 @@
/* Observers */
s8 operator_arity (const s_ident *op);
-bool operator_find (const s_ident *op);
+bool * operator_find (const s_ident *op, bool *dest);
s_ident * operator_ident (const s_ident *op, s_ident *dest);
-bool operator_is_right_associative (const s_ident *op);
+bool * operator_is_right_associative (const s_ident *op,
+ bool *dest);
s8 operator_precedence (const s_ident *op);
s_ident * operator_resolve (const s_ident *ident, u8 arity,
s_ident *dest);
diff --git a/libc3/skiplist.c.in b/libc3/skiplist.c.in
index 92d0ff2..83cff33 100644
--- a/libc3/skiplist.c.in
+++ b/libc3/skiplist.c.in
@@ -79,7 +79,7 @@ skiplist_delete___NAME$ (s_skiplist___NAME$ *skiplist)
}
s_skiplist_node___NAME$ *
-skiplist_find___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ _NAME$)
+skiplist_find___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ _NAME$)
{
s_skiplist_node___NAME$ *node = skiplist->head;
u8 level = node->height;
@@ -127,7 +127,7 @@ skiplist_init___NAME$ (s_skiplist___NAME$ *skiplist, u8 max_height, f64 spacing)
}
s_skiplist_node___NAME$ *
-skiplist_insert___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ _NAME$)
+skiplist_insert___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ _NAME$)
{
s_skiplist_node___NAME$ *pred;
s_skiplist_node___NAME$ *next;
@@ -161,7 +161,7 @@ skiplist_new___NAME$ (u8 max_height, f64 spacing)
}
s_skiplist_node___NAME$ *
-skiplist_pred___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ _NAME$)
+skiplist_pred___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ _NAME$)
{
int level;
s_skiplist_node___NAME$ *pred;
@@ -209,7 +209,7 @@ skiplist_random_height___NAME$ (s_skiplist___NAME$ *skiplist)
}
bool
-skiplist_remove___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ _NAME$)
+skiplist_remove___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ _NAME$)
{
uw level;
s_skiplist_node___NAME$ *pred;
diff --git a/libc3/skiplist.h.in b/libc3/skiplist.h.in
index e0b3a1b..d715aa5 100644
--- a/libc3/skiplist.h.in
+++ b/libc3/skiplist.h.in
@@ -35,25 +35,25 @@ void
skiplist_delete___NAME$ (s_skiplist___NAME$ *skiplist);
s_skiplist_node___NAME$ *
-skiplist_find___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ value);
+skiplist_find___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ value);
/* do not call directly */
s_skiplist___NAME$ *
skiplist_init___NAME$ (s_skiplist___NAME$ *skiplist, u8 max_height, f64 spacing);
s_skiplist_node___NAME$ *
-skiplist_insert___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ value);
+skiplist_insert___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ value);
s_skiplist___NAME$ *
skiplist_new___NAME$ (u8 max_height, f64 spacing);
s_skiplist_node___NAME$ *
-skiplist_pred___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ value);
+skiplist_pred___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ value);
u8
skiplist_random_height___NAME$ (s_skiplist___NAME$ *skiplist);
bool
-skiplist_remove___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ value);
+skiplist_remove___NAME$ (s_skiplist___NAME$ *skiplist, const _TYPE$ value);
#endif /* LIBC3_SKIPLIST___NAME$_H */
diff --git a/libc3/skiplist__fact.c b/libc3/skiplist__fact.c
index 32b4994..a497c32 100644
--- a/libc3/skiplist__fact.c
+++ b/libc3/skiplist__fact.c
@@ -79,7 +79,7 @@ skiplist_delete__fact (s_skiplist__fact *skiplist)
}
s_skiplist_node__fact *
-skiplist_find__fact (s_skiplist__fact *skiplist, s_fact * fact)
+skiplist_find__fact (s_skiplist__fact *skiplist, const s_fact * fact)
{
s_skiplist_node__fact *node = skiplist->head;
u8 level = node->height;
@@ -127,7 +127,7 @@ skiplist_init__fact (s_skiplist__fact *skiplist, u8 max_height, f64 spacing)
}
s_skiplist_node__fact *
-skiplist_insert__fact (s_skiplist__fact *skiplist, s_fact * fact)
+skiplist_insert__fact (s_skiplist__fact *skiplist, const s_fact * fact)
{
s_skiplist_node__fact *pred;
s_skiplist_node__fact *next;
@@ -161,7 +161,7 @@ skiplist_new__fact (u8 max_height, f64 spacing)
}
s_skiplist_node__fact *
-skiplist_pred__fact (s_skiplist__fact *skiplist, s_fact * fact)
+skiplist_pred__fact (s_skiplist__fact *skiplist, const s_fact * fact)
{
int level;
s_skiplist_node__fact *pred;
@@ -209,7 +209,7 @@ skiplist_random_height__fact (s_skiplist__fact *skiplist)
}
bool
-skiplist_remove__fact (s_skiplist__fact *skiplist, s_fact * fact)
+skiplist_remove__fact (s_skiplist__fact *skiplist, const s_fact * fact)
{
uw level;
s_skiplist_node__fact *pred;
diff --git a/libc3/skiplist__fact.h b/libc3/skiplist__fact.h
index 1f6b13c..80772bf 100644
--- a/libc3/skiplist__fact.h
+++ b/libc3/skiplist__fact.h
@@ -35,25 +35,25 @@ void
skiplist_delete__fact (s_skiplist__fact *skiplist);
s_skiplist_node__fact *
-skiplist_find__fact (s_skiplist__fact *skiplist, s_fact * value);
+skiplist_find__fact (s_skiplist__fact *skiplist, const s_fact * value);
/* do not call directly */
s_skiplist__fact *
skiplist_init__fact (s_skiplist__fact *skiplist, u8 max_height, f64 spacing);
s_skiplist_node__fact *
-skiplist_insert__fact (s_skiplist__fact *skiplist, s_fact * value);
+skiplist_insert__fact (s_skiplist__fact *skiplist, const s_fact * value);
s_skiplist__fact *
skiplist_new__fact (u8 max_height, f64 spacing);
s_skiplist_node__fact *
-skiplist_pred__fact (s_skiplist__fact *skiplist, s_fact * value);
+skiplist_pred__fact (s_skiplist__fact *skiplist, const s_fact * value);
u8
skiplist_random_height__fact (s_skiplist__fact *skiplist);
bool
-skiplist_remove__fact (s_skiplist__fact *skiplist, s_fact * value);
+skiplist_remove__fact (s_skiplist__fact *skiplist, const s_fact * value);
#endif /* LIBC3_SKIPLIST__fact_H */
diff --git a/libc3/skiplist_node.c.in b/libc3/skiplist_node.c.in
index 61200d1..1e050bd 100644
--- a/libc3/skiplist_node.c.in
+++ b/libc3/skiplist_node.c.in
@@ -16,7 +16,7 @@
#include "skiplist_node___NAME$.h"
s_skiplist_node___NAME$ *
-skiplist_node_init (s_skiplist_node___NAME$ *node, _TYPE$ _NAME$, u8 height)
+skiplist_node_init (s_skiplist_node___NAME$ *node, const _TYPE$ _NAME$, u8 height)
{
node->_NAME$ = _NAME$;
node->height = height;
@@ -26,7 +26,7 @@ skiplist_node_init (s_skiplist_node___NAME$ *node, _TYPE$ _NAME$, u8 height)
}
s_skiplist_node___NAME$ *
-skiplist_node_new___NAME$ (_TYPE$ _NAME$, u8 height)
+skiplist_node_new___NAME$ (const _TYPE$ _NAME$, u8 height)
{
s_skiplist_node___NAME$ *node;
node = alloc(SKIPLIST_NODE_SIZE___NAME$(height));
diff --git a/libc3/skiplist_node.h.in b/libc3/skiplist_node.h.in
index 7ffa2de..2a6faa0 100644
--- a/libc3/skiplist_node.h.in
+++ b/libc3/skiplist_node.h.in
@@ -32,10 +32,10 @@
(sizeof(s_skiplist_node___NAME$) + (height) * sizeof(_TYPE$))
s_skiplist_node___NAME$ *
-skiplist_node_init (s_skiplist_node___NAME$ *node, _TYPE$ value, u8 height);
+skiplist_node_init (s_skiplist_node___NAME$ *node, const _TYPE$ value, u8 height);
s_skiplist_node___NAME$ *
-skiplist_node_new___NAME$ (_TYPE$ value, u8 height);
+skiplist_node_new___NAME$ (const _TYPE$ value, u8 height);
void
skiplist_node_delete___NAME$ (s_skiplist_node___NAME$ *node);
diff --git a/libc3/skiplist_node__fact.c b/libc3/skiplist_node__fact.c
index 7a373bc..0d76153 100644
--- a/libc3/skiplist_node__fact.c
+++ b/libc3/skiplist_node__fact.c
@@ -16,7 +16,7 @@
#include "skiplist_node__fact.h"
s_skiplist_node__fact *
-skiplist_node_init (s_skiplist_node__fact *node, s_fact * fact, u8 height)
+skiplist_node_init (s_skiplist_node__fact *node, const s_fact * fact, u8 height)
{
node->fact = fact;
node->height = height;
@@ -26,7 +26,7 @@ skiplist_node_init (s_skiplist_node__fact *node, s_fact * fact, u8 height)
}
s_skiplist_node__fact *
-skiplist_node_new__fact (s_fact * fact, u8 height)
+skiplist_node_new__fact (const s_fact * fact, u8 height)
{
s_skiplist_node__fact *node;
node = alloc(SKIPLIST_NODE_SIZE__fact(height));
diff --git a/libc3/skiplist_node__fact.h b/libc3/skiplist_node__fact.h
index 4da60b9..899b621 100644
--- a/libc3/skiplist_node__fact.h
+++ b/libc3/skiplist_node__fact.h
@@ -32,10 +32,10 @@
(sizeof(s_skiplist_node__fact) + (height) * sizeof(s_fact *))
s_skiplist_node__fact *
-skiplist_node_init (s_skiplist_node__fact *node, s_fact * value, u8 height);
+skiplist_node_init (s_skiplist_node__fact *node, const s_fact * value, u8 height);
s_skiplist_node__fact *
-skiplist_node_new__fact (s_fact * value, u8 height);
+skiplist_node_new__fact (const s_fact * value, u8 height);
void
skiplist_node_delete__fact (s_skiplist_node__fact *node);
diff --git a/libc3/sources.mk b/libc3/sources.mk
index ec01e8e..be8fc2c 100644
--- a/libc3/sources.mk
+++ b/libc3/sources.mk
@@ -94,11 +94,13 @@ HEADERS = \
"f32.h" \
"f64.h" \
"fact.h" \
+ "fact_action.h" \
"fact_list.h" \
"facts.h" \
"facts_cursor.h" \
"facts_spec.h" \
"facts_spec_cursor.h" \
+ "facts_transaction.h" \
"facts_with.h" \
"facts_with_cursor.h" \
"file.h" \
@@ -253,11 +255,13 @@ SOURCES = \
"f32.c" \
"f64.c" \
"fact.c" \
+ "fact_action.c" \
"fact_list.c" \
"facts.c" \
"facts_cursor.c" \
"facts_spec.c" \
"facts_spec_cursor.c" \
+ "facts_transaction.c" \
"facts_with.c" \
"facts_with_cursor.c" \
"file.c" \
@@ -521,11 +525,13 @@ LO_SOURCES = \
"f32.c" \
"f64.c" \
"fact.c" \
+ "fact_action.c" \
"fact_list.c" \
"facts.c" \
"facts_cursor.c" \
"facts_spec.c" \
"facts_spec_cursor.c" \
+ "facts_transaction.c" \
"facts_with.c" \
"facts_with_cursor.c" \
"file.c" \
diff --git a/libc3/sources.sh b/libc3/sources.sh
index a72c7e7..db4eb2e 100644
--- a/libc3/sources.sh
+++ b/libc3/sources.sh
@@ -1,4 +1,4 @@
# sources.sh generated by update_sources
-HEADERS='abs.h alloc.h arg.h array.h assert.h binding.h block.h bool.h buf.h buf_file.h buf_getc.h buf_getchar.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 complex.h config.h cow.h data.h env.h error.h error_handler.h eval.h f128.h f32.h f64.h fact.h fact_list.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 pcomplex.h pcow.h ptag.h ptr.h ptr_free.h queue.h quote.h ratio.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 special_operator.h str.h struct.h struct_type.h sw.h sym.h tag.h tag_init.h tag_type.h time.h tuple.h types.h u16.h u32.h u64.h u8.h ucd.h unquote.h uw.h var.h void.h '
-SOURCES='abs.c alloc.c arg.c array.c binding.c block.c bool.c buf.c buf_file.c buf_getc.c buf_getchar.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 complex.c cow.c data.c env.c error.c error_handler.c eval.c f128.c f32.c f64.c fact.c fact_list.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 pcomplex.c pcow.c ptag.c ptr.c ptr_free.c queue.c quote.c ratio.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 special_operator.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_addi.c tag_band.c tag_bnot.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_neg.c tag_shift_left.c tag_shift_right.c tag_sqrt.c tag_sub.c tag_type.c time.c tuple.c u16.c u32.c u64.c u8.c ucd.c unquote.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 alloc.c arg.c array.c binding.c block.c bool.c buf.c buf_file.c buf_getc.c buf_getchar.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 complex.c cow.c data.c env.c error.c error_handler.c eval.c f128.c f32.c f64.c fact.c fact_list.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 pcomplex.c pcow.c ptag.c ptr.c ptr_free.c queue.c quote.c ratio.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 special_operator.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_addi.c tag_band.c tag_bnot.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_neg.c tag_shift_left.c tag_shift_right.c tag_sqrt.c tag_sub.c tag_type.c time.c tuple.c u16.c u32.c u64.c u8.c ucd.c unquote.c uw.c var.c void.c '
+HEADERS='abs.h alloc.h arg.h array.h assert.h binding.h block.h bool.h buf.h buf_file.h buf_getc.h buf_getchar.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 complex.h config.h cow.h data.h env.h error.h error_handler.h eval.h f128.h f32.h f64.h fact.h fact_action.h fact_list.h facts.h facts_cursor.h facts_spec.h facts_spec_cursor.h facts_transaction.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 pcomplex.h pcow.h ptag.h ptr.h ptr_free.h queue.h quote.h ratio.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 special_operator.h str.h struct.h struct_type.h sw.h sym.h tag.h tag_init.h tag_type.h time.h tuple.h types.h u16.h u32.h u64.h u8.h ucd.h unquote.h uw.h var.h void.h '
+SOURCES='abs.c alloc.c arg.c array.c binding.c block.c bool.c buf.c buf_file.c buf_getc.c buf_getchar.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 complex.c cow.c data.c env.c error.c error_handler.c eval.c f128.c f32.c f64.c fact.c fact_action.c fact_list.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_transaction.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 pcomplex.c pcow.c ptag.c ptr.c ptr_free.c queue.c quote.c ratio.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 special_operator.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_addi.c tag_band.c tag_bnot.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_neg.c tag_shift_left.c tag_shift_right.c tag_sqrt.c tag_sub.c tag_type.c time.c tuple.c u16.c u32.c u64.c u8.c ucd.c unquote.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 alloc.c arg.c array.c binding.c block.c bool.c buf.c buf_file.c buf_getc.c buf_getchar.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 complex.c cow.c data.c env.c error.c error_handler.c eval.c f128.c f32.c f64.c fact.c fact_action.c fact_list.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_transaction.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 pcomplex.c pcow.c ptag.c ptr.c ptr_free.c queue.c quote.c ratio.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 special_operator.c str.c struct.c struct_type.c sw.c sym.c tag.c tag_add.c tag_addi.c tag_band.c tag_bnot.c tag_bor.c tag_bxor.c tag_div.c tag_init.c tag_mod.c tag_mul.c tag_neg.c tag_shift_left.c tag_shift_right.c tag_sqrt.c tag_sub.c tag_type.c time.c tuple.c u16.c u32.c u64.c u8.c ucd.c unquote.c uw.c var.c void.c '
diff --git a/libc3/struct_type.c b/libc3/struct_type.c
index a5e5d95..0074aaa 100644
--- a/libc3/struct_type.c
+++ b/libc3/struct_type.c
@@ -37,9 +37,9 @@ void struct_type_delete (s_struct_type *st)
free(st);
}
-bool struct_type_exists (const s_sym *module)
+bool * struct_type_exists (const s_sym *module, bool *dest)
{
- return env_struct_type_exists(&g_c3_env, module);
+ return env_struct_type_exists(&g_c3_env, module, dest);
}
const s_struct_type * struct_type_find (const s_sym *module)
diff --git a/libc3/struct_type.h b/libc3/struct_type.h
index a4f3e4e..f6db05f 100644
--- a/libc3/struct_type.h
+++ b/libc3/struct_type.h
@@ -38,7 +38,8 @@ s_struct_type * struct_type_new (const s_sym *module,
const s_list *spec);
/* Utility functions. */
-bool struct_type_exists (const s_sym *module);
+bool * struct_type_exists (const s_sym *module,
+ bool *dest);
const s_struct_type * struct_type_find (const s_sym *module);
uw struct_type_padding (uw offset, uw size);
diff --git a/libc3/sym.c b/libc3/sym.c
index 2ecc442..1b6c28c 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -663,6 +663,7 @@ bool sym_search_modules (const s_sym *sym, const s_sym **dest)
bool sym_to_ffi_type (const s_sym *sym, ffi_type *result_type,
ffi_type **dest)
{
+ bool b;
assert(sym);
if (sym == &g_sym_Result) {
if (! result_type) {
@@ -805,7 +806,9 @@ bool sym_to_ffi_type (const s_sym *sym, ffi_type *result_type,
*dest = &ffi_type_void;
return true;
}
- if (struct_type_exists(sym)) {
+ if (! struct_type_exists(sym, &b))
+ return false;
+ if (b) {
*dest = &ffi_type_pointer;
return true;
}
@@ -818,6 +821,7 @@ bool sym_to_ffi_type (const s_sym *sym, ffi_type *result_type,
bool sym_to_tag_type (const s_sym *sym, e_tag_type *dest)
{
+ bool b;
if (sym == &g_sym_Array ||
sym_is_array_type(sym)) {
*dest = TAG_ARRAY;
@@ -967,7 +971,9 @@ bool sym_to_tag_type (const s_sym *sym, e_tag_type *dest)
*dest = TAG_VOID;
return true;
}
- if (struct_type_exists(sym)) {
+ if (! struct_type_exists(sym, &b))
+ return false;
+ if (b) {
*dest = TAG_STRUCT;
return true;
}
diff --git a/libc3/tag_init.c b/libc3/tag_init.c
index 64cf500..8fc74e6 100644
--- a/libc3/tag_init.c
+++ b/libc3/tag_init.c
@@ -27,6 +27,7 @@
#include "time.h"
#include "tuple.h"
#include "unquote.h"
+#include "var.h"
s_tag * tag_init_array (s_tag *tag, const s_sym *type, uw dimension,
const uw *dimensions)
@@ -507,11 +508,13 @@ s_tag * tag_init_uw (s_tag *tag, uw i)
return tag;
}
-s_tag * tag_init_var (s_tag *tag)
+s_tag * tag_init_var (s_tag *tag, const s_sym *type)
{
s_tag tmp = {0};
assert(tag);
tmp.type = TAG_VAR;
+ if (! var_init(&tmp.data.var, type))
+ return NULL;
*tag = tmp;
return tag;
}
@@ -1101,13 +1104,17 @@ s_tag * tag_new_uw (uw i)
return tag;
}
-s_tag * tag_new_var (void)
+s_tag * tag_new_var (const s_sym *type)
{
s_tag *tag;
tag = alloc(sizeof(s_tag));
if (! tag)
return NULL;
tag->type = TAG_VAR;
+ if (! var_init(&tag->data.var, type)) {
+ free(tag);
+ return NULL;
+ }
return tag;
}
@@ -1645,12 +1652,14 @@ s_tag * tag_uw (s_tag *tag, uw i)
return tag;
}
-s_tag * tag_var (s_tag *tag)
+s_tag * tag_var (s_tag *tag, const s_sym *type)
{
s_tag tmp = {0};
assert(tag);
tag_clean(tag);
tmp.type = TAG_VAR;
+ if (! var_init(&tmp.data.var, type))
+ return NULL;
*tag = tmp;
return tag;
}
diff --git a/libc3/tag_init.h b/libc3/tag_init.h
index 873add5..4c1e36d 100644
--- a/libc3/tag_init.h
+++ b/libc3/tag_init.h
@@ -54,7 +54,7 @@ s_tag * tag_init_u32 (s_tag *tag, u32 i);
s_tag * tag_init_u64 (s_tag *tag, u64 i);
s_tag * tag_init_unquote_copy (s_tag *tag, const s_unquote *unquote);
s_tag * tag_init_uw (s_tag *tag, uw i);
-s_tag * tag_init_var (s_tag *tag);
+s_tag * tag_init_var (s_tag *tag, const s_sym *type);
s_tag * tag_init_void (s_tag *tag);
/* Heap-allocation functions, call tag_delete after use. */
@@ -107,7 +107,7 @@ s_tag * tag_new_u32 (u32 i);
s_tag * tag_new_u64 (u64 i);
s_tag * tag_new_unquote_copy (const s_unquote *unquote);
s_tag * tag_new_uw (uw i);
-s_tag * tag_new_var (void);
+s_tag * tag_new_var (const s_sym *type);
s_tag * tag_new_void (void);
/* Setters. */
@@ -160,7 +160,7 @@ s_tag * tag_u32 (s_tag *tag, u32 i);
s_tag * tag_u64 (s_tag *tag, u64 i);
s_tag * tag_unquote_copy (s_tag *tag, const s_unquote *unquote);
s_tag * tag_uw (s_tag *tag, uw i);
-s_tag * tag_var (s_tag *tag);
+s_tag * tag_var (s_tag *tag, const s_sym *type);
s_tag * tag_void (s_tag *tag);
#endif /* LIBC3_TAG_INIT_H */
diff --git a/libc3/tag_init.rb b/libc3/tag_init.rb
index 6ab6d11..b83ed33 100644
--- a/libc3/tag_init.rb
+++ b/libc3/tag_init.rb
@@ -400,7 +400,8 @@ class TagInitList
[Arg.new("const s_unquote *", "unquote")]),
TagInit.new("uw", "TAG_UW", :init_mode_direct,
[Arg.new("uw", "i")]),
- TagInit.new("var", "TAG_VAR", :init_mode_none, []),
+ TagInit.new("var", "TAG_VAR", :init_mode_init,
+ [Arg.new("const s_sym *", "type")]),
TagInit.new("void", "TAG_VOID", :init_mode_none, [])])
end
@@ -536,6 +537,7 @@ tag_init_c.content = <<EOF
#include "time.h"
#include "tuple.h"
#include "unquote.h"
+#include "var.h"
#{inits.def_tag_init.c_word_wrap}
#{inits.def_tag_new.c_word_wrap}
#{inits.def_tag.c_word_wrap}
diff --git a/libc3/types.h b/libc3/types.h
index 789e1de..0f2609b 100644
--- a/libc3/types.h
+++ b/libc3/types.h
@@ -245,12 +245,6 @@ struct fact_w {
uw id; /* serial id */
};
-struct fact_action {
- bool remove;
- s_fact fact;
- s_fact_action *next;
-};
-
struct facts_transaction {
s_fact_action *log;
s_facts_transaction *next;
@@ -357,6 +351,12 @@ struct buf {
uw wpos;
};
+struct fact_action {
+ bool remove;
+ s_fact fact;
+ s_fact_action *next;
+};
+
struct facts_spec_cursor {
p_facts_spec spec;
const s_tag *subject;
@@ -588,7 +588,7 @@ TYPEDEF_SET_CURSOR(fact);
#define TYPEDEF_SKIPLIST_NODE(name, type) \
typedef struct skiplist_node__##name { \
- type name; \
+ const type name; \
u8 height; \
} s_skiplist_node__##name
@@ -627,8 +627,11 @@ struct facts_cursor {
s_fact start;
s_fact end;
s_tag *var_subject;
+ const s_sym *var_subject_type;
s_tag *var_predicate;
+ const s_sym *var_predicate_type;
s_tag *var_object;
+ const s_sym *var_object_type;
pthread_mutex_t mutex;
};
@@ -658,7 +661,7 @@ struct env {
struct facts_with_cursor_level {
s_facts_cursor cursor;
- s_fact *fact;
+ const s_fact *fact;
p_facts_spec spec;
};
diff --git a/libc3/var.c b/libc3/var.c
index 103f605..d2d34cd 100644
--- a/libc3/var.c
+++ b/libc3/var.c
@@ -16,6 +16,21 @@
#include "tag.h"
#include "var.h"
+s_var * var_init (s_var *var, const s_sym *type)
+{
+ assert(var);
+ assert(type);
+ if (! sym_is_module(type)) {
+ err_write_1("var_init: invalid type: ");
+ err_inspect_sym(&type);
+ err_write_1("\n");
+ assert(! "var_init: invalid type");
+ return NULL;
+ }
+ var->type = type;
+ return var;
+}
+
s_tag * var_init_cast (s_tag *tag, const s_sym * const *type,
const s_tag *src)
{
@@ -50,3 +65,30 @@ s_tag * var_init_copy (s_tag *tag, const s_tag *src)
tag->data.var = src->data.var;
return tag;
}
+
+s_tag * var_set (s_tag *var, const s_tag *value)
+{
+ const s_sym *value_type;
+ const s_sym *var_type;
+ assert(var);
+ assert(value);
+ if (var->type != TAG_VAR) {
+ err_puts("var_set: not a Var");
+ assert(! "var_set: not a Var");
+ return NULL;
+ }
+ var_type = var->data.var.type;
+ if (var_type != &g_sym_Tag) {
+ if (! tag_type(value, &value_type))
+ return NULL;
+ if (var_type != value_type) {
+ err_write_1("var_set: type mismatch: ");
+ err_inspect_sym(&var_type);
+ err_write_1(" != ");
+ err_inspect_sym(&value_type);
+ assert(! "var_set: type mismatch");
+ return NULL;
+ }
+ }
+ return tag_init_copy(var, value);
+}
diff --git a/libc3/var.h b/libc3/var.h
index 31a4018..56fd77d 100644
--- a/libc3/var.h
+++ b/libc3/var.h
@@ -15,8 +15,13 @@
#include "types.h"
+/* Stack-allocation compatible functions. */
+s_var * var_init (s_var *var, const s_sym *type);
s_tag * var_init_cast (s_tag *tag, const s_sym * const *type,
const s_tag *src);
s_tag * var_init_copy (s_tag *tag, const s_tag *src);
+/* Operators. */
+s_tag * var_set (s_tag *var, const s_tag *value);
+
#endif /* LIBC3_VAR_H */
diff --git a/sources.mk b/sources.mk
index da23a10..a697e01 100644
--- a/sources.mk
+++ b/sources.mk
@@ -298,6 +298,8 @@ C3_C_SOURCES = \
"libc3/f64.h" \
"libc3/fact.c" \
"libc3/fact.h" \
+ "libc3/fact_action.c" \
+ "libc3/fact_action.h" \
"libc3/fact_list.c" \
"libc3/fact_list.h" \
"libc3/facts.c" \
@@ -308,6 +310,8 @@ C3_C_SOURCES = \
"libc3/facts_spec.h" \
"libc3/facts_spec_cursor.c" \
"libc3/facts_spec_cursor.h" \
+ "libc3/facts_transaction.c" \
+ "libc3/facts_transaction.h" \
"libc3/facts_with.c" \
"libc3/facts_with.h" \
"libc3/facts_with_cursor.c" \
@@ -642,6 +646,7 @@ C3_OTHER_SOURCES = \
"fonts/Computer Modern/cmunss.otf" \
"fonts/Computer Modern/cmunsx-webfont.ttf" \
"fonts/Computer Modern/cmunsx.otf" \
+ "fonts/Courier New/Courier New.ttf" \
"fonts/Courier Prime/CourierPrime-Bold.ttf" \
"fonts/Courier Prime/CourierPrime-BoldItalic.ttf" \
"fonts/Courier Prime/CourierPrime-Italic.ttf" \
@@ -954,6 +959,9 @@ C3_OTHER_SOURCES = \
"test/ic3/defoperator.in" \
"test/ic3/defoperator.out.expected" \
"test/ic3/defoperator.ret.expected" \
+ "test/ic3/defstruct.in" \
+ "test/ic3/defstruct.out.expected" \
+ "test/ic3/defstruct.ret.expected" \
"test/ic3/equal.err.expected" \
"test/ic3/equal.in" \
"test/ic3/equal.out.expected" \
diff --git a/sources.sh b/sources.sh
index 3f7a61f..8853c86 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/alloc.c libc3/alloc.h libc3/arg.c libc3/arg.h libc3/array.c libc3/array.h libc3/assert.h libc3/binding.c libc3/binding.h libc3/block.c libc3/block.h libc3/bool.c libc3/bool.h libc3/buf.c libc3/buf.h libc3/buf_file.c libc3/buf_file.h libc3/buf_getc.c libc3/buf_getc.h libc3/buf_getchar.c libc3/buf_getchar.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/complex.c libc3/complex.h libc3/cow.c libc3/cow.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/f128.c libc3/f128.h libc3/f32.c libc3/f32.h libc3/f64.c libc3/f64.h libc3/fact.c libc3/fact.h libc3/fact_list.c libc3/fact_list.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/pcomplex.c libc3/pcomplex.h libc3/pcow.c libc3/pcow.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/queue.c libc3/queue.h libc3/quote.c libc3/quote.h libc3/ratio.c libc3/ratio.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/special_operator.c libc3/special_operator.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_addi.c libc3/tag_band.c libc3/tag_bnot.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_neg.c libc3/tag_shift_left.c libc3/tag_shift_right.c libc3/tag_sqrt.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/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/unquote.c libc3/unquote.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/cairo_text.c libc3_window/cairo/cairo_text.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/mandelbrot_f128.c libc3_window/cairo/demo/mandelbrot_f128.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/mandelbrot_f128.c libc3_window/sdl2/demo/mandelbrot_f128.h libc3_window/sdl2/demo/matrix.c libc3_window/sdl2/demo/matrix.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/dmat3.h libc3_window/sdl2/dmat4.c libc3_window/sdl2/dmat4.h libc3_window/sdl2/dvec2.c libc3_window/sdl2/dvec2.h libc3_window/sdl2/dvec3.c libc3_window/sdl2/dvec3.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_lines.c libc3_window/sdl2/gl_lines.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_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/gl_vtext.c libc3_window/sdl2/gl_vtext.h libc3_window/sdl2/mat3.h libc3_window/sdl2/mat4.c libc3_window/sdl2/mat4.h libc3_window/sdl2/types.h libc3_window/sdl2/vec2.c libc3_window/sdl2/vec2.h libc3_window/sdl2/vec3.c libc3_window/sdl2/vec3.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/ratio_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/alloc.c libc3/alloc.h libc3/arg.c libc3/arg.h libc3/array.c libc3/array.h libc3/assert.h libc3/binding.c libc3/binding.h libc3/block.c libc3/block.h libc3/bool.c libc3/bool.h libc3/buf.c libc3/buf.h libc3/buf_file.c libc3/buf_file.h libc3/buf_getc.c libc3/buf_getc.h libc3/buf_getchar.c libc3/buf_getchar.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/complex.c libc3/complex.h libc3/cow.c libc3/cow.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/f128.c libc3/f128.h libc3/f32.c libc3/f32.h libc3/f64.c libc3/f64.h libc3/fact.c libc3/fact.h libc3/fact_action.c libc3/fact_action.h libc3/fact_list.c libc3/fact_list.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_transaction.c libc3/facts_transaction.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/pcomplex.c libc3/pcomplex.h libc3/pcow.c libc3/pcow.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/queue.c libc3/queue.h libc3/quote.c libc3/quote.h libc3/ratio.c libc3/ratio.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/special_operator.c libc3/special_operator.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_addi.c libc3/tag_band.c libc3/tag_bnot.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_neg.c libc3/tag_shift_left.c libc3/tag_shift_right.c libc3/tag_sqrt.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/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/unquote.c libc3/unquote.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/cairo_text.c libc3_window/cairo/cairo_text.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/mandelbrot_f128.c libc3_window/cairo/demo/mandelbrot_f128.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/mandelbrot_f128.c libc3_window/sdl2/demo/mandelbrot_f128.h libc3_window/sdl2/demo/matrix.c libc3_window/sdl2/demo/matrix.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/dmat3.h libc3_window/sdl2/dmat4.c libc3_window/sdl2/dmat4.h libc3_window/sdl2/dvec2.c libc3_window/sdl2/dvec2.h libc3_window/sdl2/dvec3.c libc3_window/sdl2/dvec3.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_lines.c libc3_window/sdl2/gl_lines.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_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/gl_vtext.c libc3_window/sdl2/gl_vtext.h libc3_window/sdl2/mat3.h libc3_window/sdl2/mat4.c libc3_window/sdl2/mat4.h libc3_window/sdl2/types.h libc3_window/sdl2/vec2.c libc3_window/sdl2/vec2.h libc3_window/sdl2/vec3.c libc3_window/sdl2/vec3.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/ratio_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/Computer Modern/cmunbl-webfont.ttf fonts/Computer Modern/cmunbl.otf fonts/Computer Modern/cmunbx-webfont.ttf fonts/Computer Modern/cmunbx.otf fonts/Computer Modern/cmunbxo-webfont.ttf fonts/Computer Modern/cmunbxo.otf fonts/Computer Modern/cmunrm-webfont.ttf fonts/Computer Modern/cmunrm.otf fonts/Computer Modern/cmunsi-webfont.ttf fonts/Computer Modern/cmunsi.otf fonts/Computer Modern/cmunsl-webfont.ttf fonts/Computer Modern/cmunsl.otf fonts/Computer Modern/cmunss-webfont.ttf fonts/Computer Modern/cmunss.otf fonts/Computer Modern/cmunsx-webfont.ttf fonts/Computer Modern/cmunsx.otf fonts/Courier Prime/CourierPrime-Bold.ttf fonts/Courier Prime/CourierPrime-BoldItalic.ttf fonts/Courier Prime/CourierPrime-Italic.ttf fonts/Courier Prime/CourierPrime-Regular.ttf fonts/Courier/fonts/OGCourier-Bold.otf fonts/Courier/fonts/OGCourier-Bold.ttf fonts/Courier/fonts/OGCourier-BoldItalic.otf fonts/Courier/fonts/OGCourier-BoldItalic.ttf fonts/Courier/fonts/OGCourier-Italic.otf fonts/Courier/fonts/OGCourier-Italic.ttf fonts/Courier/fonts/OGCourier.otf fonts/Courier/fonts/OGCourier.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Bold.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Bold.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-BoldItalic.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-BoldItalic.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Italic.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Italic.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Bold.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Bold.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-BoldItalic.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-BoldItalic.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Italic.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Italic.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash.ttf fonts/Courier/sfd/OGCourier-Bold.sfd.ttf fonts/Courier/sfd/OGCourier-BoldItalic.sfd.ttf fonts/Courier/sfd/OGCourier-Italic.sfd.ttf fonts/Courier/sfd/OGCourier.sfd.ttf fonts/Inter/InterVariable-Italic.ttf fonts/Inter/InterVariable.ttf fonts/Inter/extras/otf/Inter-Black.otf fonts/Inter/extras/otf/Inter-BlackItalic.otf fonts/Inter/extras/otf/Inter-Bold.otf fonts/Inter/extras/otf/Inter-BoldItalic.otf fonts/Inter/extras/otf/Inter-ExtraBold.otf fonts/Inter/extras/otf/Inter-ExtraBoldItalic.otf fonts/Inter/extras/otf/Inter-ExtraLight.otf fonts/Inter/extras/otf/Inter-ExtraLightItalic.otf fonts/Inter/extras/otf/Inter-Italic.otf fonts/Inter/extras/otf/Inter-Light.otf fonts/Inter/extras/otf/Inter-LightItalic.otf fonts/Inter/extras/otf/Inter-Medium.otf fonts/Inter/extras/otf/Inter-MediumItalic.otf fonts/Inter/extras/otf/Inter-Regular.otf fonts/Inter/extras/otf/Inter-SemiBold.otf fonts/Inter/extras/otf/Inter-SemiBoldItalic.otf fonts/Inter/extras/otf/Inter-Thin.otf fonts/Inter/extras/otf/Inter-ThinItalic.otf fonts/Inter/extras/otf/InterDisplay-Black.otf fonts/Inter/extras/otf/InterDisplay-BlackItalic.otf fonts/Inter/extras/otf/InterDisplay-Bold.otf fonts/Inter/extras/otf/InterDisplay-BoldItalic.otf fonts/Inter/extras/otf/InterDisplay-ExtraBold.otf fonts/Inter/extras/otf/InterDisplay-ExtraBoldItalic.otf fonts/Inter/extras/otf/InterDisplay-ExtraLight.otf fonts/Inter/extras/otf/InterDisplay-ExtraLightItalic.otf fonts/Inter/extras/otf/InterDisplay-Italic.otf fonts/Inter/extras/otf/InterDisplay-Light.otf fonts/Inter/extras/otf/InterDisplay-LightItalic.otf fonts/Inter/extras/otf/InterDisplay-Medium.otf fonts/Inter/extras/otf/InterDisplay-MediumItalic.otf fonts/Inter/extras/otf/InterDisplay-Regular.otf fonts/Inter/extras/otf/InterDisplay-SemiBold.otf fonts/Inter/extras/otf/InterDisplay-SemiBoldItalic.otf fonts/Inter/extras/otf/InterDisplay-Thin.otf fonts/Inter/extras/otf/InterDisplay-ThinItalic.otf fonts/Inter/extras/ttf/Inter-Black.ttf fonts/Inter/extras/ttf/Inter-BlackItalic.ttf fonts/Inter/extras/ttf/Inter-Bold.ttf fonts/Inter/extras/ttf/Inter-BoldItalic.ttf fonts/Inter/extras/ttf/Inter-ExtraBold.ttf fonts/Inter/extras/ttf/Inter-ExtraBoldItalic.ttf fonts/Inter/extras/ttf/Inter-ExtraLight.ttf fonts/Inter/extras/ttf/Inter-ExtraLightItalic.ttf fonts/Inter/extras/ttf/Inter-Italic.ttf fonts/Inter/extras/ttf/Inter-Light.ttf fonts/Inter/extras/ttf/Inter-LightItalic.ttf fonts/Inter/extras/ttf/Inter-Medium.ttf fonts/Inter/extras/ttf/Inter-MediumItalic.ttf fonts/Inter/extras/ttf/Inter-Regular.ttf fonts/Inter/extras/ttf/Inter-SemiBold.ttf fonts/Inter/extras/ttf/Inter-SemiBoldItalic.ttf fonts/Inter/extras/ttf/Inter-Thin.ttf fonts/Inter/extras/ttf/Inter-ThinItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Black.ttf fonts/Inter/extras/ttf/InterDisplay-BlackItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Bold.ttf fonts/Inter/extras/ttf/InterDisplay-BoldItalic.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraBold.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraBoldItalic.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraLight.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraLightItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Italic.ttf fonts/Inter/extras/ttf/InterDisplay-Light.ttf fonts/Inter/extras/ttf/InterDisplay-LightItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Medium.ttf fonts/Inter/extras/ttf/InterDisplay-MediumItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Regular.ttf fonts/Inter/extras/ttf/InterDisplay-SemiBold.ttf fonts/Inter/extras/ttf/InterDisplay-SemiBoldItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Thin.ttf fonts/Inter/extras/ttf/InterDisplay-ThinItalic.ttf fonts/Noto Sans/NotoSans-Black.ttf fonts/Noto Sans/NotoSans-BlackItalic.ttf fonts/Noto Sans/NotoSans-Bold.ttf fonts/Noto Sans/NotoSans-BoldItalic.ttf fonts/Noto Sans/NotoSans-ExtraBold.ttf fonts/Noto Sans/NotoSans-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans-ExtraLight.ttf fonts/Noto Sans/NotoSans-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans-Italic-VariableFont_wdth,wght.ttf fonts/Noto Sans/NotoSans-Italic.ttf fonts/Noto Sans/NotoSans-Light.ttf fonts/Noto Sans/NotoSans-LightItalic.ttf fonts/Noto Sans/NotoSans-Medium.ttf fonts/Noto Sans/NotoSans-MediumItalic.ttf fonts/Noto Sans/NotoSans-Regular.ttf fonts/Noto Sans/NotoSans-SemiBold.ttf fonts/Noto Sans/NotoSans-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans-Thin.ttf fonts/Noto Sans/NotoSans-ThinItalic.ttf fonts/Noto Sans/NotoSans-VariableFont_wdth,wght.ttf fonts/Noto Sans/NotoSans_Condensed-Black.ttf fonts/Noto Sans/NotoSans_Condensed-BlackItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Bold.ttf fonts/Noto Sans/NotoSans_Condensed-BoldItalic.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraBold.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraLight.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Italic.ttf fonts/Noto Sans/NotoSans_Condensed-Light.ttf fonts/Noto Sans/NotoSans_Condensed-LightItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Medium.ttf fonts/Noto Sans/NotoSans_Condensed-MediumItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Regular.ttf fonts/Noto Sans/NotoSans_Condensed-SemiBold.ttf fonts/Noto Sans/NotoSans_Condensed-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Thin.ttf fonts/Noto Sans/NotoSans_Condensed-ThinItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Black.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-BlackItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Bold.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-BoldItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraBold.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraLight.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Italic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Light.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-LightItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Medium.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-MediumItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Regular.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-SemiBold.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Thin.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ThinItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Black.ttf fonts/Noto Sans/NotoSans_SemiCondensed-BlackItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Bold.ttf fonts/Noto Sans/NotoSans_SemiCondensed-BoldItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraBold.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraLight.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Italic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Light.ttf fonts/Noto Sans/NotoSans_SemiCondensed-LightItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Medium.ttf fonts/Noto Sans/NotoSans_SemiCondensed-MediumItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Regular.ttf fonts/Noto Sans/NotoSans_SemiCondensed-SemiBold.ttf fonts/Noto Sans/NotoSans_SemiCondensed-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Thin.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ThinItalic.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/mandelbrot_f128_limit.1.png img/mandelbrot_f128_limit.2.png img/mandelbrot_f128_limit.3.png img/mandelbrot_f128_limit.png img/matrix_shade.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/c3/operator.facts lib/c3/0.1/complex.facts lib/c3/0.1/f128.facts lib/c3/0.1/f32.facts lib/c3/0.1/f64.facts lib/c3/0.1/gl/dvec2.facts lib/c3/0.1/gl/dvec3.facts lib/c3/0.1/gl/object.facts lib/c3/0.1/gl/sphere.facts lib/c3/0.1/gl/triangle.facts lib/c3/0.1/gl/vec2.facts lib/c3/0.1/gl/vec3.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.facts lib/c3/0.1/ptr_free.facts lib/c3/0.1/ratio.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/str.facts lib/c3/0.1/sw.facts lib/c3/0.1/sym.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/var.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/block.in test/ic3/block.out.expected test/ic3/block.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/complex.in test/ic3/complex.out.expected test/ic3/complex.ret.expected test/ic3/def.in test/ic3/def.out.expected test/ic3/def.ret.expected test/ic3/defmodule.in test/ic3/defmodule.out.expected test/ic3/defmodule.ret.expected test/ic3/defoperator.in test/ic3/defoperator.out.expected test/ic3/defoperator.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/if.in test/ic3/if.out.expected test/ic3/if.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/macro.in test/ic3/macro.out.expected test/ic3/macro.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/quote.in test/ic3/quote.out.expected test/ic3/quote.ret.expected test/ic3/ratio.in test/ic3/ratio.out.expected test/ic3/ratio.ret.expected test/ic3/str.err.expected test/ic3/str.in test/ic3/str.out.expected test/ic3/str.ret.expected test/ic3/struct.in test/ic3/struct.out.expected test/ic3/struct.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/var.in test/ic3/var.out.expected test/ic3/var.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_OTHER_SOURCES='AUTHORS Makefile README.md c3.index c3.version config.subr configure fonts/Computer Modern/cmunbl-webfont.ttf fonts/Computer Modern/cmunbl.otf fonts/Computer Modern/cmunbx-webfont.ttf fonts/Computer Modern/cmunbx.otf fonts/Computer Modern/cmunbxo-webfont.ttf fonts/Computer Modern/cmunbxo.otf fonts/Computer Modern/cmunrm-webfont.ttf fonts/Computer Modern/cmunrm.otf fonts/Computer Modern/cmunsi-webfont.ttf fonts/Computer Modern/cmunsi.otf fonts/Computer Modern/cmunsl-webfont.ttf fonts/Computer Modern/cmunsl.otf fonts/Computer Modern/cmunss-webfont.ttf fonts/Computer Modern/cmunss.otf fonts/Computer Modern/cmunsx-webfont.ttf fonts/Computer Modern/cmunsx.otf fonts/Courier New/Courier New.ttf fonts/Courier Prime/CourierPrime-Bold.ttf fonts/Courier Prime/CourierPrime-BoldItalic.ttf fonts/Courier Prime/CourierPrime-Italic.ttf fonts/Courier Prime/CourierPrime-Regular.ttf fonts/Courier/fonts/OGCourier-Bold.otf fonts/Courier/fonts/OGCourier-Bold.ttf fonts/Courier/fonts/OGCourier-BoldItalic.otf fonts/Courier/fonts/OGCourier-BoldItalic.ttf fonts/Courier/fonts/OGCourier-Italic.otf fonts/Courier/fonts/OGCourier-Italic.ttf fonts/Courier/fonts/OGCourier.otf fonts/Courier/fonts/OGCourier.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Bold.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Bold.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-BoldItalic.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-BoldItalic.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Italic.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot-Italic.ttf fonts/Courier/fonts/zero-dot/OGCourierZeroDot.otf fonts/Courier/fonts/zero-dot/OGCourierZeroDot.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Bold.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Bold.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-BoldItalic.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-BoldItalic.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Italic.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash-Italic.ttf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash.otf fonts/Courier/fonts/zero-slash/OGCourierZeroSlash.ttf fonts/Courier/sfd/OGCourier-Bold.sfd.ttf fonts/Courier/sfd/OGCourier-BoldItalic.sfd.ttf fonts/Courier/sfd/OGCourier-Italic.sfd.ttf fonts/Courier/sfd/OGCourier.sfd.ttf fonts/Inter/InterVariable-Italic.ttf fonts/Inter/InterVariable.ttf fonts/Inter/extras/otf/Inter-Black.otf fonts/Inter/extras/otf/Inter-BlackItalic.otf fonts/Inter/extras/otf/Inter-Bold.otf fonts/Inter/extras/otf/Inter-BoldItalic.otf fonts/Inter/extras/otf/Inter-ExtraBold.otf fonts/Inter/extras/otf/Inter-ExtraBoldItalic.otf fonts/Inter/extras/otf/Inter-ExtraLight.otf fonts/Inter/extras/otf/Inter-ExtraLightItalic.otf fonts/Inter/extras/otf/Inter-Italic.otf fonts/Inter/extras/otf/Inter-Light.otf fonts/Inter/extras/otf/Inter-LightItalic.otf fonts/Inter/extras/otf/Inter-Medium.otf fonts/Inter/extras/otf/Inter-MediumItalic.otf fonts/Inter/extras/otf/Inter-Regular.otf fonts/Inter/extras/otf/Inter-SemiBold.otf fonts/Inter/extras/otf/Inter-SemiBoldItalic.otf fonts/Inter/extras/otf/Inter-Thin.otf fonts/Inter/extras/otf/Inter-ThinItalic.otf fonts/Inter/extras/otf/InterDisplay-Black.otf fonts/Inter/extras/otf/InterDisplay-BlackItalic.otf fonts/Inter/extras/otf/InterDisplay-Bold.otf fonts/Inter/extras/otf/InterDisplay-BoldItalic.otf fonts/Inter/extras/otf/InterDisplay-ExtraBold.otf fonts/Inter/extras/otf/InterDisplay-ExtraBoldItalic.otf fonts/Inter/extras/otf/InterDisplay-ExtraLight.otf fonts/Inter/extras/otf/InterDisplay-ExtraLightItalic.otf fonts/Inter/extras/otf/InterDisplay-Italic.otf fonts/Inter/extras/otf/InterDisplay-Light.otf fonts/Inter/extras/otf/InterDisplay-LightItalic.otf fonts/Inter/extras/otf/InterDisplay-Medium.otf fonts/Inter/extras/otf/InterDisplay-MediumItalic.otf fonts/Inter/extras/otf/InterDisplay-Regular.otf fonts/Inter/extras/otf/InterDisplay-SemiBold.otf fonts/Inter/extras/otf/InterDisplay-SemiBoldItalic.otf fonts/Inter/extras/otf/InterDisplay-Thin.otf fonts/Inter/extras/otf/InterDisplay-ThinItalic.otf fonts/Inter/extras/ttf/Inter-Black.ttf fonts/Inter/extras/ttf/Inter-BlackItalic.ttf fonts/Inter/extras/ttf/Inter-Bold.ttf fonts/Inter/extras/ttf/Inter-BoldItalic.ttf fonts/Inter/extras/ttf/Inter-ExtraBold.ttf fonts/Inter/extras/ttf/Inter-ExtraBoldItalic.ttf fonts/Inter/extras/ttf/Inter-ExtraLight.ttf fonts/Inter/extras/ttf/Inter-ExtraLightItalic.ttf fonts/Inter/extras/ttf/Inter-Italic.ttf fonts/Inter/extras/ttf/Inter-Light.ttf fonts/Inter/extras/ttf/Inter-LightItalic.ttf fonts/Inter/extras/ttf/Inter-Medium.ttf fonts/Inter/extras/ttf/Inter-MediumItalic.ttf fonts/Inter/extras/ttf/Inter-Regular.ttf fonts/Inter/extras/ttf/Inter-SemiBold.ttf fonts/Inter/extras/ttf/Inter-SemiBoldItalic.ttf fonts/Inter/extras/ttf/Inter-Thin.ttf fonts/Inter/extras/ttf/Inter-ThinItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Black.ttf fonts/Inter/extras/ttf/InterDisplay-BlackItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Bold.ttf fonts/Inter/extras/ttf/InterDisplay-BoldItalic.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraBold.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraBoldItalic.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraLight.ttf fonts/Inter/extras/ttf/InterDisplay-ExtraLightItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Italic.ttf fonts/Inter/extras/ttf/InterDisplay-Light.ttf fonts/Inter/extras/ttf/InterDisplay-LightItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Medium.ttf fonts/Inter/extras/ttf/InterDisplay-MediumItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Regular.ttf fonts/Inter/extras/ttf/InterDisplay-SemiBold.ttf fonts/Inter/extras/ttf/InterDisplay-SemiBoldItalic.ttf fonts/Inter/extras/ttf/InterDisplay-Thin.ttf fonts/Inter/extras/ttf/InterDisplay-ThinItalic.ttf fonts/Noto Sans/NotoSans-Black.ttf fonts/Noto Sans/NotoSans-BlackItalic.ttf fonts/Noto Sans/NotoSans-Bold.ttf fonts/Noto Sans/NotoSans-BoldItalic.ttf fonts/Noto Sans/NotoSans-ExtraBold.ttf fonts/Noto Sans/NotoSans-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans-ExtraLight.ttf fonts/Noto Sans/NotoSans-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans-Italic-VariableFont_wdth,wght.ttf fonts/Noto Sans/NotoSans-Italic.ttf fonts/Noto Sans/NotoSans-Light.ttf fonts/Noto Sans/NotoSans-LightItalic.ttf fonts/Noto Sans/NotoSans-Medium.ttf fonts/Noto Sans/NotoSans-MediumItalic.ttf fonts/Noto Sans/NotoSans-Regular.ttf fonts/Noto Sans/NotoSans-SemiBold.ttf fonts/Noto Sans/NotoSans-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans-Thin.ttf fonts/Noto Sans/NotoSans-ThinItalic.ttf fonts/Noto Sans/NotoSans-VariableFont_wdth,wght.ttf fonts/Noto Sans/NotoSans_Condensed-Black.ttf fonts/Noto Sans/NotoSans_Condensed-BlackItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Bold.ttf fonts/Noto Sans/NotoSans_Condensed-BoldItalic.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraBold.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraLight.ttf fonts/Noto Sans/NotoSans_Condensed-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Italic.ttf fonts/Noto Sans/NotoSans_Condensed-Light.ttf fonts/Noto Sans/NotoSans_Condensed-LightItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Medium.ttf fonts/Noto Sans/NotoSans_Condensed-MediumItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Regular.ttf fonts/Noto Sans/NotoSans_Condensed-SemiBold.ttf fonts/Noto Sans/NotoSans_Condensed-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans_Condensed-Thin.ttf fonts/Noto Sans/NotoSans_Condensed-ThinItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Black.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-BlackItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Bold.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-BoldItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraBold.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraLight.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Italic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Light.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-LightItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Medium.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-MediumItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Regular.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-SemiBold.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-Thin.ttf fonts/Noto Sans/NotoSans_ExtraCondensed-ThinItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Black.ttf fonts/Noto Sans/NotoSans_SemiCondensed-BlackItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Bold.ttf fonts/Noto Sans/NotoSans_SemiCondensed-BoldItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraBold.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraBoldItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraLight.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ExtraLightItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Italic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Light.ttf fonts/Noto Sans/NotoSans_SemiCondensed-LightItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Medium.ttf fonts/Noto Sans/NotoSans_SemiCondensed-MediumItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Regular.ttf fonts/Noto Sans/NotoSans_SemiCondensed-SemiBold.ttf fonts/Noto Sans/NotoSans_SemiCondensed-SemiBoldItalic.ttf fonts/Noto Sans/NotoSans_SemiCondensed-Thin.ttf fonts/Noto Sans/NotoSans_SemiCondensed-ThinItalic.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/mandelbrot_f128_limit.1.png img/mandelbrot_f128_limit.2.png img/mandelbrot_f128_limit.3.png img/mandelbrot_f128_limit.png img/matrix_shade.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/c3/operator.facts lib/c3/0.1/complex.facts lib/c3/0.1/f128.facts lib/c3/0.1/f32.facts lib/c3/0.1/f64.facts lib/c3/0.1/gl/dvec2.facts lib/c3/0.1/gl/dvec3.facts lib/c3/0.1/gl/object.facts lib/c3/0.1/gl/sphere.facts lib/c3/0.1/gl/triangle.facts lib/c3/0.1/gl/vec2.facts lib/c3/0.1/gl/vec3.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.facts lib/c3/0.1/ptr_free.facts lib/c3/0.1/ratio.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/str.facts lib/c3/0.1/sw.facts lib/c3/0.1/sym.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/var.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/block.in test/ic3/block.out.expected test/ic3/block.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/complex.in test/ic3/complex.out.expected test/ic3/complex.ret.expected test/ic3/def.in test/ic3/def.out.expected test/ic3/def.ret.expected test/ic3/defmodule.in test/ic3/defmodule.out.expected test/ic3/defmodule.ret.expected test/ic3/defoperator.in test/ic3/defoperator.out.expected test/ic3/defoperator.ret.expected test/ic3/defstruct.in test/ic3/defstruct.out.expected test/ic3/defstruct.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/if.in test/ic3/if.out.expected test/ic3/if.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/macro.in test/ic3/macro.out.expected test/ic3/macro.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/quote.in test/ic3/quote.out.expected test/ic3/quote.ret.expected test/ic3/ratio.in test/ic3/ratio.out.expected test/ic3/ratio.ret.expected test/ic3/str.err.expected test/ic3/str.in test/ic3/str.out.expected test/ic3/str.ret.expected test/ic3/struct.in test/ic3/struct.out.expected test/ic3/struct.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/var.in test/ic3/var.out.expected test/ic3/var.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='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.main.lo ucd2c/ucd2c.main.o '
diff --git a/test/fact_test.h b/test/fact_test.h
index 89d0368..d49c066 100644
--- a/test/fact_test.h
+++ b/test/fact_test.h
@@ -17,8 +17,8 @@
#define FACT_TEST_EQ(test, expected) \
do { \
- s_fact *fact_expected; \
- s_fact *fact_test; \
+ const s_fact *fact_expected; \
+ const s_fact *fact_test; \
fact_expected = (expected); \
fact_test = (test); \
if (compare_fact(fact_test, fact_expected) == 0) { \
diff --git a/test/facts_cursor_test.c b/test/facts_cursor_test.c
index e6b1b95..8079457 100644
--- a/test/facts_cursor_test.c
+++ b/test/facts_cursor_test.c
@@ -112,6 +112,7 @@ TEST_CASE_END(facts_cursor_init)
TEST_CASE(facts_cursor_next)
{
s_facts_cursor cursor;
+ const s_fact *cursor_fact;
uw i = 0;
char *p[24] = {
"-0x10000000000000000",
@@ -150,80 +151,121 @@ TEST_CASE(facts_cursor_next)
facts_cursor_init(&facts, &cursor, facts.index_spo, NULL, NULL);
i = 0;
while (p[i]) {
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + i);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + i);
i++;
}
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_pos, NULL, NULL);
i = 0;
while (p[i]) {
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + i);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + i);
i++;
}
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_osp, NULL, NULL);
i = 0;
while (p[i]) {
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + i);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + i);
i++;
}
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_spo, fact, fact);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), fact);
+ FACT_TEST_EQ(cursor_fact, fact);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_pos, fact, fact);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_osp, fact, fact);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_spo, fact + 1, fact + 1);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 1);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 1);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_pos, fact + 1, fact + 1);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 1);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 1);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_osp, fact + 1, fact + 1);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 1);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 1);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_spo, fact, fact + 6);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 1);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 2);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 3);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 4);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 5);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 6);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 1);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 2);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 3);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 4);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 5);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 6);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_pos, fact, fact + 6);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 1);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 2);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 3);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 4);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 5);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 6);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 1);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 2);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 3);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 4);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 5);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 6);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
facts_cursor_init(&facts, &cursor, facts.index_osp, fact, fact + 6);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 1);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 2);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 3);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 4);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 5);
- FACT_TEST_EQ(facts_cursor_next(&cursor), fact + 6);
- TEST_EQ(facts_cursor_next(&cursor), NULL);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 1);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 2);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 3);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 4);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 5);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ FACT_TEST_EQ(cursor_fact, fact + 6);
+ TEST_EQ(facts_cursor_next(&cursor, &cursor_fact), &cursor_fact);
+ TEST_EQ(cursor_fact, NULL);
facts_cursor_clean(&cursor);
i = 0;
while (p[i]) {
diff --git a/test/facts_test.c b/test/facts_test.c
index ebbf9b6..f73099c 100644
--- a/test/facts_test.c
+++ b/test/facts_test.c
@@ -77,7 +77,7 @@ TEST_CASE(facts_add)
"-0x10000000000000000",
NULL
};
- s_fact *pf;
+ const s_fact *pf;
s_fact fact[24];
s_facts facts;
facts_init(&facts);
@@ -155,6 +155,8 @@ TEST_CASE_END(facts_dump_file)
TEST_CASE(facts_find)
{
+ bool b;
+ const s_fact *f;
uw i = 0;
char *p[24] = {
"\"a\"",
@@ -184,23 +186,28 @@ TEST_CASE(facts_find)
};
s_fact fact[24];
s_facts facts;
- s_fact *pf;
+ const s_fact *pf;
facts_init(&facts);
while (p[i]) {
fact_test_init_1(fact + i, p[i]);
- TEST_EQ(facts_find_fact(&facts, fact + i), NULL);
- TEST_EQ(facts_find_fact(&facts, fact + i), NULL);
+ TEST_EQ(facts_find_fact(&facts, fact + i, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_find_fact(&facts, fact + i, &f), &f);
+ TEST_ASSERT(! f);
facts_add_fact(&facts, fact + i);
- TEST_ASSERT((pf = facts_find_fact(&facts, fact + i)));
+ TEST_EQ(facts_find_fact(&facts, fact + i, &pf), &pf);
+ TEST_ASSERT(pf);
TEST_EQ(compare_tag(fact[i].subject, pf->subject), 0);
TEST_EQ(compare_tag(fact[i].predicate, pf->predicate), 0);
TEST_EQ(compare_tag(fact[i].object, pf->object), 0);
i++;
}
while (i--) {
- facts_remove_fact(&facts, fact + i);
- TEST_EQ(facts_find_fact(&facts, fact + i), NULL);
- TEST_EQ(facts_find_fact(&facts, fact + i), NULL);
+ facts_remove_fact(&facts, fact + i, &b);
+ TEST_EQ(facts_find_fact(&facts, fact + i, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_find_fact(&facts, fact + i, &f), &f);
+ TEST_ASSERT(! f);
fact_test_clean_1(fact + i);
}
facts_clean(&facts);
@@ -225,6 +232,7 @@ TEST_CASE_END(facts_init_clean)
TEST_CASE(facts_load)
{
+ const s_fact *f;
uw i = 0;
char *p[24] = {
"\"a\"",
@@ -261,7 +269,8 @@ TEST_CASE(facts_load)
TEST_EQ(facts_count(&facts), 23);
while (p[i]) {
fact_test_init_1(&fact, p[i]);
- TEST_ASSERT(facts_find_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(f);
fact_test_clean_1(&fact);
i++;
}
@@ -322,6 +331,7 @@ TEST_CASE_END(facts_log_add)
TEST_CASE(facts_log_remove)
{
+ bool b;
uw i = 0;
char *p[24] = {
"\"a\"",
@@ -362,7 +372,7 @@ TEST_CASE(facts_log_remove)
i++;
}
while (i--) {
- facts_remove_fact(&facts, fact + i);
+ facts_remove_fact(&facts, fact + i, &b);
}
i = 0;
while (p[i]) {
@@ -391,6 +401,8 @@ TEST_CASE_END(facts_new_delete)
TEST_CASE(facts_open_file)
{
+ bool b;
+ const s_fact *f;
uw i = 0;
char *p[24] = {
"\"a\"",
@@ -460,15 +472,18 @@ TEST_CASE(facts_open_file)
i = 0;
while (p[i]) {
fact_test_init_1(&fact, p[i]);
- TEST_ASSERT(facts_find_fact(&facts, &fact));
- TEST_ASSERT(facts_remove_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(f);
+ TEST_EQ(facts_remove_fact(&facts, &fact, &b), &b);
+ TEST_ASSERT(b);
fact_test_clean_1(&fact);
i++;
}
i = 0;
while (q[i]) {
fact_test_init_1(&fact, q[i]);
- TEST_ASSERT(! facts_find_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(! f);
TEST_ASSERT(facts_add_fact(&facts, &fact));
fact_test_clean_1(&fact);
i++;
@@ -492,14 +507,16 @@ TEST_CASE(facts_open_file)
i = 0;
while (p[i]) {
fact_test_init_1(&fact, p[i]);
- TEST_ASSERT(facts_find_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(f);
fact_test_clean_1(&fact);
i++;
}
i = 0;
while (q[i]) {
fact_test_init_1(&fact, q[i]);
- TEST_ASSERT(facts_find_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(f);
fact_test_clean_1(&fact);
i++;
}
@@ -522,7 +539,8 @@ TEST_CASE(facts_open_file)
i = 0;
while (p[i]) {
fact_test_init_1(&fact, p[i]);
- TEST_ASSERT(! facts_find_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(! f);
TEST_ASSERT(facts_add_fact(&facts, &fact));
fact_test_clean_1(&fact);
i++;
@@ -530,7 +548,8 @@ TEST_CASE(facts_open_file)
i = 0;
while (q[i]) {
fact_test_init_1(&fact, q[i]);
- TEST_ASSERT(! facts_find_fact(&facts, &fact));
+ TEST_EQ(facts_find_fact(&facts, &fact, &f), &f);
+ TEST_ASSERT(! f);
TEST_ASSERT(facts_add_fact(&facts, &fact));
fact_test_clean_1(&fact);
i++;
@@ -546,6 +565,7 @@ TEST_CASE_END(facts_open_file)
TEST_CASE(facts_remove)
{
+ bool b;
uw i = 0;
char *p[24] = {
"\"a\"",
@@ -582,10 +602,12 @@ TEST_CASE(facts_remove)
i++;
}
while (i--) {
- TEST_EQ(facts_remove_fact(&facts, fact + i), true);
+ TEST_EQ(facts_remove_fact(&facts, fact + i, &b), &b);
+ TEST_EQ(b, true);
TEST_EQ(facts.tags.count, i);
TEST_EQ(facts.facts.count, i);
- TEST_EQ(facts_remove_fact(&facts, fact + i), false);
+ TEST_EQ(facts_remove_fact(&facts, fact + i, &b), &b);
+ TEST_EQ(b, false);
TEST_EQ(facts.tags.count, i);
TEST_EQ(facts.facts.count, i);
fact_test_clean_1(fact + i);
diff --git a/test/facts_with_test.c b/test/facts_with_test.c
index d150ec3..7d7c61c 100644
--- a/test/facts_with_test.c
+++ b/test/facts_with_test.c
@@ -31,6 +31,7 @@ void facts_with_test (void)
TEST_CASE(facts_with_)
{
s_facts_with_cursor cursor;
+ const s_fact *f;
s_fact fact;
s_facts facts;
sw i = 0;
@@ -51,87 +52,123 @@ TEST_CASE(facts_with_)
facts_add_tags(&facts, tag + 6, tag + 7, tag + 2);
i = 0;
facts_with(&facts, &cursor, (s_tag *[])
- { tag_init_var(&subject),
- tag_init_var(&predicate),
- tag_init_var(&object),
+ { tag_init_var(&subject, &g_sym_Tag),
+ tag_init_var(&predicate, &g_sym_Tag),
+ tag_init_var(&object, &g_sym_Tag),
NULL, NULL });
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(f);
fact_init(&fact, tag, tag + 1, tag + 3);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 4, tag + 3);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag + 5, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag + 6, tag + 7, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_with(&facts, &cursor, (s_tag *[]) { tag,
- tag_init_var(&predicate),
- tag_init_var(&object),
+ tag_init_var(&predicate,
+ &g_sym_Tag),
+ tag_init_var(&object,
+ &g_sym_Tag),
NULL, NULL });
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 1, tag + 3);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 4, tag + 3);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_with(&facts, &cursor, (s_tag *[]) { tag,
tag + 1,
- tag_init_var(&object),
+ tag_init_var(&object,
+ &g_sym_Tag),
NULL, NULL });
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 1, tag + 3);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_with(&facts, &cursor, (s_tag *[]) { tag, tag + 1, tag + 2,
NULL, NULL });
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_with(&facts, &cursor, (s_tag *[]) { tag + 5, tag + 1, tag + 2,
NULL, NULL });
fact_init(&fact, tag + 5, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
- facts_with(&facts, &cursor, (s_tag *[]) { tag_init_var(&subject),
- tag_init_var(&predicate),
- tag_init_var(&object),
+ facts_with(&facts, &cursor, (s_tag *[]) { tag_init_var(&subject,
+ &g_sym_Tag),
+ tag_init_var(&predicate,
+ &g_sym_Tag),
+ tag_init_var(&object,
+ &g_sym_Tag),
NULL,
&subject,
tag + 1,
&object,
NULL, NULL });
- TEST_ASSERT(facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(f);
TAG_TEST_EQ(&subject, tag);
TAG_TEST_EQ(&predicate, tag + 1);
TAG_TEST_EQ(&object, tag + 2);
- TEST_ASSERT(facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(f);
TAG_TEST_EQ(&subject, tag);
TAG_TEST_EQ(&predicate, tag + 1);
TAG_TEST_EQ(&object, tag + 3);
- TEST_ASSERT(facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(f);
TAG_TEST_EQ(&subject, tag);
TAG_TEST_EQ(&predicate, tag + 4);
TAG_TEST_EQ(&object, tag + 3);
- TEST_ASSERT(facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(f);
TAG_TEST_EQ(&subject, tag + 5);
TAG_TEST_EQ(&predicate, tag + 1);
TAG_TEST_EQ(&object, tag + 2);
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_with(&facts, &cursor, (s_tag *[]) { tag, tag + 1, tag + 2,
tag + 1, tag + 3,
@@ -139,41 +176,56 @@ TEST_CASE(facts_with_)
tag + 5, tag + 1, tag + 2,
NULL, NULL });
fact_init(&fact, tag + 5, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_with(&facts, &cursor, (s_tag *[]) { tag + 3, tag, tag + 1,
tag, tag + 2,
NULL,
tag + 4, tag + 1, tag + 2,
NULL, NULL });
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
- facts_with(&facts, &cursor, (s_tag *[]) { tag_init_var(&subject),
- tag_init_var(&predicate),
- tag_init_var(&object),
+ facts_with(&facts, &cursor, (s_tag *[]) { tag_init_var(&subject,
+ &g_sym_Tag),
+ tag_init_var(&predicate,
+ &g_sym_Tag),
+ tag_init_var(&object,
+ &g_sym_Tag),
NULL,
tag + 3, tag, tag + 1,
tag, tag + 2,
NULL,
tag + 4, tag + 1, tag + 2,
NULL, NULL });
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
- facts_with(&facts, &cursor, (s_tag *[]) { tag_init_var(&subject),
- tag_init_var(&predicate),
- tag_init_var(&object),
+ facts_with(&facts, &cursor, (s_tag *[]) { tag_init_var(&subject,
+ &g_sym_Tag),
+ tag_init_var(&predicate,
+ &g_sym_Tag),
+ tag_init_var(&object,
+ &g_sym_Tag),
NULL,
tag, tag + 1, tag + 2,
tag, tag + 2,
NULL,
tag + 4, tag + 1, tag + 2,
NULL, NULL });
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
- TEST_ASSERT(! facts_with_cursor_next(&cursor));
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_with_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_cursor_clean(&cursor);
facts_clean(&facts);
}
@@ -182,6 +234,7 @@ TEST_CASE_END(facts_with_)
TEST_CASE(facts_with_tags)
{
s_facts_cursor cursor;
+ const s_fact *f;
s_fact fact;
s_facts facts;
sw i = 0;
@@ -202,44 +255,61 @@ TEST_CASE(facts_with_tags)
facts_add_tags(&facts, tag + 6, tag + 7, tag + 2);
i = 0;
facts_with_tags(&facts, &cursor,
- tag_init_var(&subject),
- tag_init_var(&predicate),
- tag_init_var(&object));
+ tag_init_var(&subject, &g_sym_Tag),
+ tag_init_var(&predicate, &g_sym_Tag),
+ tag_init_var(&object, &g_sym_Tag));
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 1, tag + 3);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 4, tag + 3);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag + 5, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag + 6, tag + 7, tag + 2);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
- FACT_TEST_EQ(NULL, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_tags(&facts, &cursor,
tag,
- tag_init_var(&predicate),
- tag_init_var(&object));
+ tag_init_var(&predicate, &g_sym_Tag),
+ tag_init_var(&object, &g_sym_Tag));
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 1, tag + 3);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 4, tag + 3);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
- FACT_TEST_EQ(NULL, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_tags(&facts, &cursor,
tag,
tag + 1,
- tag_init_var(&object));
+ tag_init_var(&object, &g_sym_Tag));
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
fact_init(&fact, tag, tag + 1, tag + 3);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
- FACT_TEST_EQ(NULL, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_with_tags(&facts, &cursor, tag, tag + 1, tag + 2);
fact_init(&fact, tag, tag + 1, tag + 2);
- FACT_TEST_EQ(&fact, facts_cursor_next(&cursor));
- FACT_TEST_EQ(NULL, facts_cursor_next(&cursor));
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ FACT_TEST_EQ(&fact, f);
+ TEST_EQ(facts_cursor_next(&cursor, &f), &f);
+ TEST_ASSERT(! f);
facts_clean(&facts);
}
TEST_CASE_END(facts_with_tags)
diff --git a/test/ic3/defstruct.in b/test/ic3/defstruct.in
new file mode 100644
index 0000000..22bed8e
--- /dev/null
+++ b/test/ic3/defstruct.in
@@ -0,0 +1,4 @@
+quote defmodule Test do defstruct [a: 1, b: 2] end
+defmodule Test do defstruct [a: 1, b: 2] end
+quote %Test{}
+%Test{}
diff --git a/test/ic3/defstruct.out.expected b/test/ic3/defstruct.out.expected
new file mode 100644
index 0000000..16219c3
--- /dev/null
+++ b/test/ic3/defstruct.out.expected
@@ -0,0 +1,6 @@
+defmodule Test do
+ defstruct [a: 1, b: 2]
+end
+Test
+%Test{}
+%Test{a: 1, b: 2}
diff --git a/test/ic3/defstruct.ret.expected b/test/ic3/defstruct.ret.expected
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/ic3/defstruct.ret.expected
@@ -0,0 +1 @@
+0
diff --git a/test/ic3/struct.out.expected b/test/ic3/struct.out.expected
index ab04642..fac2d08 100644
--- a/test/ic3/struct.out.expected
+++ b/test/ic3/struct.out.expected
@@ -1,6 +1,6 @@
0.0
0.0
+%GL.Vec3{}
%GL.Vec3{x: 0.0f, y: 0.0f, z: 0.0f}
-%GL.Vec3{x: 0.0f, y: 0.0f, z: 0.0f}
-[position: %GL.Vec3{x: 0.0f, y: 0.0f, z: 0.0f}, normal: %GL.Vec3{x: 0.0f, y: 0.0f, z: 0.0f}, tex_coord: %GL.Vec2{x: 0.0f, y: 0.0f}]
+[position: %GL.Vec3{}, normal: %GL.Vec3{}, tex_coord: %GL.Vec2{}]
[position: %GL.Vec3{x: 0.0f, y: 0.0f, z: 0.0f}, normal: %GL.Vec3{x: 0.0f, y: 0.0f, z: 0.0f}, tex_coord: %GL.Vec2{x: 0.0f, y: 0.0f}]