Commit 6b9d1659d177e619eae4b2ed1995f59ca942da9f

Thomas de Grivel 2023-11-26T16:03:18

wip toasters

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
diff --git a/libc3/file.c b/libc3/file.c
index 69abecb..1f53266 100644
--- a/libc3/file.c
+++ b/libc3/file.c
@@ -132,6 +132,7 @@ s_str * file_search (const s_str *suffix, const s_sym *mode,
           (r = buf_write_str(&buf, suffix)) < 0)
         return NULL;
       buf_read_to_str(&buf, &tmp);
+      io_inspect_str(&tmp);
       file_access(&tmp, mode, &access);
       if (access) {
         *dest = tmp;
diff --git a/libc3/list.c b/libc3/list.c
index 913a27c..cb0fe71 100644
--- a/libc3/list.c
+++ b/libc3/list.c
@@ -21,20 +21,6 @@
 #include "tag.h"
 #include "tuple.h"
 
-s_list * list_1 (const char *p)
-{
-  s_buf buf;
-  s_list *list;
-  buf_init_1(&buf, p);
-  if (buf_parse_list(&buf, &list) != (sw) strlen(p)) {
-    assert(! "invalid list");
-    buf_clean(&buf);
-    return NULL;
-  }
-  buf_clean(&buf);
-  return list;
-}
-
 void list_clean (s_list **list)
 {
   s_list *l;
@@ -172,6 +158,20 @@ s_list * list_new (s_list *next)
   return list_init(dest, next);
 }
 
+s_list * list_new_1 (const char *p)
+{
+  s_buf buf;
+  s_list *list;
+  buf_init_1(&buf, p);
+  if (buf_parse_list(&buf, &list) != (sw) strlen(p)) {
+    assert(! "invalid list");
+    buf_clean(&buf);
+    return NULL;
+  }
+  buf_clean(&buf);
+  return list;
+}
+
 s_list * list_new_copy (const s_tag *x, s_list *next)
 {
   s_list *dest;
@@ -253,3 +253,24 @@ s_array * list_to_array (s_list *list, const s_sym *type,
   }
   return dest;
 }
+
+s_list ** list_remove_void (s_list **list)
+{
+  s_list *tmp;
+  s_list **l;
+  assert(list);
+  tmp = *list;
+  l = &tmp;
+  while (l && *l) {
+    if ((*l)->tag.type == TAG_VOID)
+      *l = list_delete(*l);
+    else {
+      if ((*l)->next.type == TAG_LIST)
+        l = &(*l)->next.data.list;
+      else
+        l = NULL;
+    }
+  }
+  *list = tmp;
+  return list;
+}
diff --git a/libc3/list.h b/libc3/list.h
index 8b7bb6b..4fd5a65 100644
--- a/libc3/list.h
+++ b/libc3/list.h
@@ -24,24 +24,22 @@
 #include "hash.h"
 #include "types.h"
 
-/* Stack allocation compatible functions, do not use */
+/* Stack-allocation functions, call list_clean after use. */
 void      list_clean (s_list **list);
 s_list  * list_init (s_list *list, s_list *next);
 s_list ** list_init_copy (s_list **list, const s_list **src);
 s_list  * list_init_copy_tag (s_list *list, const s_tag *tag, s_list *next);
 
-/* Constructors, call list_delete after use */
-s_list * list_1 (const s8 *p);
+/* Heap-allocation functions, call list_delete after use */
+s_list * list_delete (s_list *list);
+void     list_delete_all (s_list *list);
 s_list * list_new (s_list *next);
+s_list * list_new_1 (const s8 *p);
 s_list * list_new_f64 (f64 x, s_list *next);
 s_list * list_new_copy (const s_tag *tag, s_list *next);
 s_list * list_new_list (s_list *list, s_list *next);
 s_list * list_new_str_1 (s8 *free, const s8 *p, s_list *next);
 
-/* Destructor */
-s_list * list_delete (s_list *list);
-void     list_delete_all (s_list *list);
-
 /* Observers */
 s_list ** list_cast (const s_tag *tag, s_list **list);
 sw        list_length (const s_list *list);
@@ -52,4 +50,7 @@ s_tuple * list_to_tuple_reverse (const s_list *list, s_tuple *dest);
 /* Call str_delete after use. */
 s_str   * list_inspect (const s_list *list, s_str *dest);
 
+/* Operators */
+s_list ** list_remove_void (s_list **list);
+
 #endif /* LIBC3_LIST_H */
diff --git a/libc3/window/cairo/demo/toasters.c b/libc3/window/cairo/demo/toasters.c
index f7f908b..a5cf129 100644
--- a/libc3/window/cairo/demo/toasters.c
+++ b/libc3/window/cairo/demo/toasters.c
@@ -36,6 +36,7 @@ static s_tag * toaster_init (s_tag *toaster, f64 y)
 static void toaster_render (s_tag *toaster, s_window_cairo *window,
                             cairo_t *cr, s_sequence *seq)
 {
+  cairo_matrix_t matrix;
   f64 *size;
   f64 *speed;
   f64 *x;
@@ -46,7 +47,7 @@ static void toaster_render (s_tag *toaster, s_window_cairo *window,
     x     = &toaster->data.map.values[2].data.f64;
     y     = &toaster->data.map.values[3].data.f64;
     *speed += seq->dt;
-    *size += *speed * 10.0;
+    *size += *speed * 0.01;
     *x += *speed * g_speed_x;
     *y += *speed * g_speed_y;
     if (*x > window->w || *y < 0.0) {
@@ -54,9 +55,13 @@ static void toaster_render (s_tag *toaster, s_window_cairo *window,
       toaster->type = TAG_VOID;
       return;
     }
+    cairo_get_matrix(cr, &matrix);
+    cairo_translate(cr, *x, *y);
+    cairo_scale(cr, *size, *size);
     cairo_sprite_blit(&g_toaster_sprite,
                       ((uw) seq->t) % g_toaster_sprite.frame_count,
-                      cr, *x, *y);
+                      cr, 0, 0);
+    cairo_set_matrix(cr, &matrix);
   }
 }
 
@@ -86,7 +91,7 @@ bool toasters_render (s_sequence *seq, s_window_cairo *window,
   cairo_set_source_rgb(cr, 0.7, 0.95, 1.0);
   cairo_rectangle(cr, 0, 0, window->w, window->h);
   cairo_fill(cr);
-  io_inspect(&seq->tag);
+  /*io_inspect(&seq->tag);*/
   if (seq->tag.type == TAG_LIST) {
     i = seq->tag.data.list;
     while (i) {
@@ -103,6 +108,7 @@ bool toasters_render (s_sequence *seq, s_window_cairo *window,
           first = j->next.data.list = list_new(j->next.data.list);
           toaster_init(&first->tag, y);
         }
+        list_remove_void(&j->next.data.list);
         j = list_next(j);
         while (j) {
           toaster_render(&j->tag, window, cr, seq);
diff --git a/libc3/window/cairo/xcb/demo/sources.mk b/libc3/window/cairo/xcb/demo/sources.mk
index 7b3cf49..b8429c5 100644
--- a/libc3/window/cairo/xcb/demo/sources.mk
+++ b/libc3/window/cairo/xcb/demo/sources.mk
@@ -3,6 +3,5 @@ HEADERS = \
 	 \
 
 SOURCES = \
-	window.c \
 	window_cairo_xcb_demo.c \
 
diff --git a/libc3/window/cairo/xcb/demo/sources.sh b/libc3/window/cairo/xcb/demo/sources.sh
index 2a5d8d4..4fbe5a1 100644
--- a/libc3/window/cairo/xcb/demo/sources.sh
+++ b/libc3/window/cairo/xcb/demo/sources.sh
@@ -1,3 +1,3 @@
 # sources.sh generated by update_sources
 HEADERS=' '
-SOURCES='window.c window_cairo_xcb_demo.c '
+SOURCES='window_cairo_xcb_demo.c '
diff --git a/libc3/window/cairo/xcb/demo/window.c b/libc3/window/cairo/xcb/demo/window.c
deleted file mode 100644
index 2a00f81..0000000
--- a/libc3/window/cairo/xcb/demo/window.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* c3
- * Copyright 2022,2023 kmx.io <contact@kmx.io>
- *
- * Permission is hereby granted to use this software granted the above
- * copyright notice and this permission paragraph are included in all
- * copies and substantial portions of this software.
- *
- * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
- * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
- * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
- * THIS SOFTWARE.
- */
-#include "../../../window.c"
diff --git a/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c b/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c
index 90d1a10..d38c4d1 100644
--- a/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c
+++ b/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c
@@ -13,13 +13,17 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <libc3/c3.h>
-#include "../../../window.h"
+#include "../../window_cairo.h"
 #include "../../demo/window_cairo_demo.h"
 #include "../window_cairo_xcb.h"
 
-int main (void)
+int main (int argc, char **argv)
 {
   s_window_cairo window;
+  if (! c3_init(NULL, argc, argv)) {
+    err_puts("c3_init");
+    return 1;
+  }
   window_cairo_init(&window, 0, 0, 800, 600,
                     "C3.Window.Cairo.XCB demo",
                     WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
@@ -28,7 +32,11 @@ int main (void)
   window.load   = window_cairo_demo_load;
   window.render = window_cairo_demo_render;
   window.resize = window_cairo_demo_resize;
-  if (! window_cairo_xcb_run(&window))
+  if (! window_cairo_xcb_run(&window)) {
+    err_puts("window_cairo_xcb_run -> false");
+    c3_clean(NULL);
     return g_c3_exit_code;
+  }
+  c3_clean(NULL);
   return 0;
 }
diff --git a/sources.mk b/sources.mk
index a828bcc..14f4c50 100644
--- a/sources.mk
+++ b/sources.mk
@@ -60,8 +60,8 @@ C3_C_SOURCES = \
 	ic3/buf_linenoise.h \
 	ic3/linenoise.c \
 	libc3/abs.c \
-	libc3/buf_inspect_s8.c \
 	libc3/buf.c \
+	libc3/buf_inspect_s8.c \
 	libc3/buf_inspect_s8.h \
 	libc3/buf_inspect_s8_binary.c \
 	libc3/buf_inspect_s8_binary.h \
@@ -69,8 +69,8 @@ C3_C_SOURCES = \
 	libc3/buf_inspect_s8_octal.h \
 	libc3/buf_inspect_s8_decimal.c \
 	libc3/buf_inspect_s8_decimal.h \
-	libc3/buf_inspect_s8_hexadecimal.c \
 	libc3/array.h \
+	libc3/buf_inspect_s8_hexadecimal.c \
 	libc3/buf_inspect_s16.c \
 	libc3/call.c \
 	libc3/arg.c \
@@ -89,6 +89,7 @@ C3_C_SOURCES = \
 	libc3/buf_inspect_s16_hexadecimal.h \
 	libc3/buf_inspect_s32.c \
 	libc3/buf_inspect_s32.h \
+	libc3/s8.c \
 	libc3/env.c \
 	libc3/bool.c \
 	libc3/bool.h \
@@ -207,7 +208,7 @@ C3_C_SOURCES = \
 	libc3/buf_parse_s16.h \
 	libc3/buf_parse_s32.c \
 	libc3/buf_parse_s32.h \
-	libc3/s8.c \
+	libc3/s8.h \
 	libc3/list.c \
 	libc3/facts_cursor.h \
 	libc3/facts_spec.c \
@@ -246,18 +247,17 @@ C3_C_SOURCES = \
 	libc3/skiplist__fact.h \
 	libc3/skiplist_node__fact.c \
 	libc3/skiplist_node__fact.h \
-	libc3/s8.h \
 	libc3/s16.c \
 	libc3/s16.h \
 	libc3/s32.c \
 	libc3/s32.h \
+	libc3/s64.c \
 	libc3/facts_with_cursor.h \
 	libc3/float.h \
 	libc3/frame.c \
 	libc3/frame.h \
-	libc3/s64.c \
-	libc3/s64.h \
 	libc3/types.h \
+	libc3/s64.h \
 	libc3/sw.c \
 	libc3/sw.h \
 	libc3/u8.c \
@@ -335,7 +335,6 @@ C3_C_SOURCES = \
 	libc3/buf_inspect_u_base.h.in \
 	libc3/window/cairo/xcb/config.h \
 	libc3/window/cairo/xcb/window_cairo_xcb.c \
-	libc3/window/cairo/xcb/demo/window.c \
 	libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c \
 	libc3/window/cairo/xcb/window_cairo_xcb.h \
 	libc3/window/cairo/types.h \
diff --git a/sources.sh b/sources.sh
index 23821fa..d7e3799 100644
--- a/sources.sh
+++ b/sources.sh
@@ -1,4 +1,4 @@
 # sources.sh generated by update_sources
 C3_CONFIGURES='c3c/configure c3s/configure c3s/update_sources ic3/configure ic3/update_sources libc3/configure libc3/update_sources libc3/window/cairo/xcb/configure libc3/window/cairo/xcb/update_sources libc3/window/cairo/xcb/demo/update_sources libc3/window/cairo/xcb/demo/configure libc3/window/cairo/configure libc3/window/cairo/quartz/configure libc3/window/cairo/quartz/update_sources libc3/window/cairo/quartz/demo/configure libc3/window/cairo/quartz/demo/update_sources libc3/window/cairo/demo/configure libc3/window/cairo/demo/update_sources libc3/window/cairo/update_sources libc3/window/cairo/win32/configure libc3/window/cairo/win32/demo/configure libc3/window/cairo/win32/demo/update_sources libc3/window/cairo/win32/update_sources libc3/window/configure libc3/window/update_sources libtommath/update_sources libtommath/configure test/configure test/update_sources ucd2c/configure '
 C3_MAKEFILES='c3c/Makefile c3s/Makefile ic3/Makefile libc3/gen.mk libc3/Makefile libc3/window/cairo/xcb/Makefile libc3/window/cairo/xcb/demo/Makefile libc3/window/cairo/Makefile libc3/window/cairo/quartz/Makefile libc3/window/cairo/quartz/demo/Makefile libc3/window/cairo/demo/Makefile libc3/window/cairo/win32/Makefile libc3/window/cairo/win32/demo/Makefile libc3/window/Makefile libtommath/Makefile test/Makefile ucd2c/Makefile '
-C3_C_SOURCES='c3c/c3c.c c3s/buf_readline.c c3s/c3s.c c3s/buf_readline.h ic3/ic3.c ic3/buf_linenoise.c ic3/buf_linenoise.h ic3/linenoise.c libc3/abs.c libc3/buf_inspect_s8.c libc3/buf.c libc3/buf_inspect_s8.h libc3/buf_inspect_s8_binary.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_s8_octal.c libc3/buf_inspect_s8_octal.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect_s8_decimal.h libc3/buf_inspect_s8_hexadecimal.c libc3/array.h libc3/buf_inspect_s16.c libc3/call.c libc3/arg.c libc3/array.c libc3/binding.c libc3/c3.c libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_s16.h libc3/buf_inspect_s16_binary.c libc3/buf_inspect_s16_binary.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s16_octal.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_s32.c libc3/buf_inspect_s32.h libc3/env.c libc3/bool.c libc3/bool.h libc3/buf_file.c libc3/buf_inspect_s32_binary.c libc3/buf_inspect_s32_binary.h libc3/buf_inspect_s32_octal.c libc3/buf_inspect_s32_octal.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_s64.c libc3/buf_inspect_s64.h libc3/buf_inspect_s64_binary.c libc3/buf_inspect_s64_binary.h libc3/buf_inspect_sw.c libc3/buf_parse.h libc3/buf.h libc3/buf_save.c libc3/facts_spec_cursor.c libc3/buf_inspect_s64_octal.c libc3/buf_inspect_s64_octal.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_sw.h libc3/buf_inspect_sw_binary.c libc3/buf_inspect_sw_binary.h libc3/buf_inspect_sw_octal.c libc3/buf_inspect_sw_octal.h libc3/buf_inspect_sw_decimal.c libc3/buf_file.h libc3/buf_save.h libc3/call.h libc3/buf_inspect_sw_decimal.h libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_sw_hexadecimal.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_octal.c libc3/buf_inspect_u8_octal.h libc3/buf_inspect_u8_decimal.c libc3/buf_inspect_u8_decimal.h libc3/buf_inspect_u16.c libc3/binding.h libc3/sequence.c libc3/io.c libc3/ceiling.c libc3/ceiling.h libc3/cfn.c libc3/cfn.h libc3/character.c libc3/character.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u8_hexadecimal.h libc3/buf_inspect_u16.h libc3/buf_inspect_u16_binary.c libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u16_octal.c libc3/buf_inspect_u16_octal.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/compare.c libc3/buf_inspect.c libc3/compare.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_octal.c libc3/buf_inspect_u32_octal.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_u64.c libc3/error.c libc3/error.h libc3/error_handler.c libc3/eval.h libc3/eval.c libc3/facts.h libc3/buf_inspect_u64.h libc3/buf_inspect_u64_binary.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u64_octal.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_uw.c libc3/buf_inspect_uw.h libc3/set__fact.c libc3/file.h libc3/fact.c libc3/fact.h libc3/facts_cursor.c libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_binary.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_uw_octal.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_parse_s8.c libc3/buf_parse_s8.h libc3/buf_parse_s16.c libc3/buf_parse_s16.h libc3/buf_parse_s32.c libc3/buf_parse_s32.h libc3/s8.c libc3/list.c libc3/facts_cursor.h libc3/facts_spec.c libc3/facts_spec.h libc3/facts_spec_cursor.h libc3/buf_parse_s64.c libc3/buf_parse_s64.h libc3/buf_parse_sw.c libc3/buf_parse_sw.h libc3/buf_parse_u8.c libc3/buf_parse_u8.h 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_uw.c libc3/buf_parse_uw.h libc3/set__fact.h libc3/set__tag.c libc3/buf_parse_u.h.in libc3/facts_with.c libc3/facts_with.h libc3/facts_with_cursor.c libc3/set__tag.h libc3/set_cursor__fact.c libc3/set_cursor__fact.h libc3/set_cursor__tag.c libc3/set_cursor__tag.h libc3/set_item__fact.c libc3/set_item__fact.h libc3/set_item__tag.c libc3/set_item__tag.h libc3/skiplist__fact.c libc3/skiplist__fact.h libc3/skiplist_node__fact.c libc3/skiplist_node__fact.h libc3/s8.h libc3/s16.c libc3/s16.h libc3/s32.c libc3/s32.h libc3/facts_with_cursor.h libc3/float.h libc3/frame.c libc3/frame.h libc3/s64.c libc3/s64.h libc3/types.h libc3/sw.c libc3/sw.h libc3/u8.c libc3/u8.h libc3/u16.c libc3/f64.h libc3/u16.h libc3/u32.c libc3/f32.c libc3/f64.c libc3/u32.h libc3/u64.c libc3/u64.h libc3/uw.c libc3/uw.h libc3/hash.h libc3/ident.h libc3/integer.c libc3/integer.h libc3/io.h libc3/list.h libc3/log.c libc3/log.h libc3/buf_inspect_s.h.in libc3/module.c libc3/buf_inspect.h libc3/c3_main.h libc3/map.c libc3/abs.h libc3/str.c libc3/module.h libc3/buf_parse_u.c.in libc3/quote.c libc3/quote.h libc3/set.c.in libc3/set.h.in libc3/buf_inspect_s_base.h.in libc3/sequence.h libc3/set_cursor.c.in libc3/set_cursor.h.in libc3/f32.h libc3/facts.c libc3/set_item.c.in libc3/set_item.h.in libc3/s.h.in libc3/sign.c libc3/sign.h libc3/skiplist.c.in libc3/skiplist.h.in libc3/type.h libc3/tag.c libc3/skiplist_node.c.in libc3/skiplist_node.h.in libc3/str.h libc3/tag.h libc3/ucd.c libc3/sym.h libc3/tuple.c libc3/tuple.h libc3/type.c libc3/ucd.h libc3/buf_parse_s.c.in libc3/buf_parse_s.h.in libc3/buf_inspect_s.c.in libc3/error_handler.h libc3/ident.c libc3/tag_bor.c libc3/tag_bxor.c libc3/buf_inspect_s_base.c.in libc3/buf_inspect_u.c.in libc3/buf_inspect_u.h.in libc3/env.h libc3/arg.h libc3/buf_inspect_u_base.c.in libc3/buf_inspect_u_base.h.in libc3/window/cairo/xcb/config.h libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/xcb/demo/window.c libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/cairo/types.h libc3/window/cairo/window_cairo.h libc3/window/cairo/window_cairo.c libc3/window/cairo/quartz/window_cairo_quartz.h libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.h libc3/window/cairo/quartz/xkbquartz.h libc3/window/cairo/quartz/window_cairo_quartz_view.h libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h libc3/window/cairo/quartz/quartz_to_xkbcommon.c libc3/window/cairo/quartz/quartz_to_xkbcommon.h libc3/window/cairo/demo/bg_rect.c libc3/window/cairo/demo/bg_rect.h libc3/window/cairo/demo/lightspeed.c libc3/window/cairo/demo/lightspeed.h libc3/window/cairo/demo/window_cairo_demo.c libc3/window/cairo/demo/window_cairo_demo.h libc3/window/cairo/demo/toasters.c libc3/window/cairo/demo/toasters.h libc3/window/cairo/cairo_png.c 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/cairo_png.h libc3/window/cairo/cairo_sprite.c libc3/window/cairo/cairo_sprite.h libc3/window/types.h libc3/window/window.c libc3/window/window.h libc3/buf_parse.c libc3/u.c.in libc3/fn.c libc3/u.h.in libc3/sha1.h libc3/c3.h libc3/fn.h libc3/map.h libc3/file.c libc3/license.c libc3/operator.c libc3/ptag.h libc3/tag_add.c libc3/tag_band.c libc3/fn_clause.h libc3/s.c.in libc3/operator.h libc3/sym.c libc3/fn_clause.c libc3/ptag.c libc3/var.h libc3/var.c libc3/time.c libc3/time.h libc3/hash.c test/buf_inspect_test.c test/bool_test.c test/buf_parse_test.c test/facts_test.c test/buf_file_test.c test/list_test.c test/test.c test/test.h test/buf_parse_test_u8.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_test.c test/buf_parse_test_u64.c test/call_test.c test/facts_cursor_test.c test/cfn_test.c test/character_test.c test/env_test.c test/fact_test.c test/fact_test.h test/libc3_test.c test/str_test.c test/facts_with_test.c test/hash_test.c test/compare_test.c test/compare_test.h test/ident_test.c test/set__fact_test.c test/set__tag_test.c test/skiplist__fact_test.c test/sym_test.c test/tag_test.c test/tag_test.h test/array_test.c test/fn_test.c 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/c3s.c c3s/buf_readline.h ic3/ic3.c ic3/buf_linenoise.c ic3/buf_linenoise.h ic3/linenoise.c libc3/abs.c libc3/buf.c 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_octal.c libc3/buf_inspect_s8_octal.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect_s8_decimal.h libc3/array.h libc3/buf_inspect_s8_hexadecimal.c libc3/buf_inspect_s16.c libc3/call.c libc3/arg.c libc3/array.c libc3/binding.c libc3/c3.c libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_s16.h libc3/buf_inspect_s16_binary.c libc3/buf_inspect_s16_binary.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s16_octal.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_s32.c libc3/buf_inspect_s32.h libc3/s8.c libc3/env.c libc3/bool.c libc3/bool.h libc3/buf_file.c libc3/buf_inspect_s32_binary.c libc3/buf_inspect_s32_binary.h libc3/buf_inspect_s32_octal.c libc3/buf_inspect_s32_octal.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_s64.c libc3/buf_inspect_s64.h libc3/buf_inspect_s64_binary.c libc3/buf_inspect_s64_binary.h libc3/buf_inspect_sw.c libc3/buf_parse.h libc3/buf.h libc3/buf_save.c libc3/facts_spec_cursor.c libc3/buf_inspect_s64_octal.c libc3/buf_inspect_s64_octal.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_sw.h libc3/buf_inspect_sw_binary.c libc3/buf_inspect_sw_binary.h libc3/buf_inspect_sw_octal.c libc3/buf_inspect_sw_octal.h libc3/buf_inspect_sw_decimal.c libc3/buf_file.h libc3/buf_save.h libc3/call.h libc3/buf_inspect_sw_decimal.h libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_sw_hexadecimal.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_octal.c libc3/buf_inspect_u8_octal.h libc3/buf_inspect_u8_decimal.c libc3/buf_inspect_u8_decimal.h libc3/buf_inspect_u16.c libc3/binding.h libc3/sequence.c libc3/io.c libc3/ceiling.c libc3/ceiling.h libc3/cfn.c libc3/cfn.h libc3/character.c libc3/character.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u8_hexadecimal.h libc3/buf_inspect_u16.h libc3/buf_inspect_u16_binary.c libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u16_octal.c libc3/buf_inspect_u16_octal.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/compare.c libc3/buf_inspect.c libc3/compare.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_octal.c libc3/buf_inspect_u32_octal.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_u64.c libc3/error.c libc3/error.h libc3/error_handler.c libc3/eval.h libc3/eval.c libc3/facts.h libc3/buf_inspect_u64.h libc3/buf_inspect_u64_binary.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u64_octal.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_uw.c libc3/buf_inspect_uw.h libc3/set__fact.c libc3/file.h libc3/fact.c libc3/fact.h libc3/facts_cursor.c libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_binary.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_uw_octal.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_parse_s8.c libc3/buf_parse_s8.h libc3/buf_parse_s16.c libc3/buf_parse_s16.h libc3/buf_parse_s32.c libc3/buf_parse_s32.h libc3/s8.h libc3/list.c libc3/facts_cursor.h libc3/facts_spec.c libc3/facts_spec.h libc3/facts_spec_cursor.h libc3/buf_parse_s64.c libc3/buf_parse_s64.h libc3/buf_parse_sw.c libc3/buf_parse_sw.h libc3/buf_parse_u8.c libc3/buf_parse_u8.h 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_uw.c libc3/buf_parse_uw.h libc3/set__fact.h libc3/set__tag.c libc3/buf_parse_u.h.in libc3/facts_with.c libc3/facts_with.h libc3/facts_with_cursor.c libc3/set__tag.h libc3/set_cursor__fact.c libc3/set_cursor__fact.h libc3/set_cursor__tag.c libc3/set_cursor__tag.h libc3/set_item__fact.c libc3/set_item__fact.h libc3/set_item__tag.c libc3/set_item__tag.h libc3/skiplist__fact.c libc3/skiplist__fact.h libc3/skiplist_node__fact.c libc3/skiplist_node__fact.h libc3/s16.c libc3/s16.h libc3/s32.c libc3/s32.h libc3/s64.c libc3/facts_with_cursor.h libc3/float.h libc3/frame.c libc3/frame.h libc3/types.h libc3/s64.h libc3/sw.c libc3/sw.h libc3/u8.c libc3/u8.h libc3/u16.c libc3/f64.h libc3/u16.h libc3/u32.c libc3/f32.c libc3/f64.c libc3/u32.h libc3/u64.c libc3/u64.h libc3/uw.c libc3/uw.h libc3/hash.h libc3/ident.h libc3/integer.c libc3/integer.h libc3/io.h libc3/list.h libc3/log.c libc3/log.h libc3/buf_inspect_s.h.in libc3/module.c libc3/buf_inspect.h libc3/c3_main.h libc3/map.c libc3/abs.h libc3/str.c libc3/module.h libc3/buf_parse_u.c.in libc3/quote.c libc3/quote.h libc3/set.c.in libc3/set.h.in libc3/buf_inspect_s_base.h.in libc3/sequence.h libc3/set_cursor.c.in libc3/set_cursor.h.in libc3/f32.h libc3/facts.c libc3/set_item.c.in libc3/set_item.h.in libc3/s.h.in libc3/sign.c libc3/sign.h libc3/skiplist.c.in libc3/skiplist.h.in libc3/type.h libc3/tag.c libc3/skiplist_node.c.in libc3/skiplist_node.h.in libc3/str.h libc3/tag.h libc3/ucd.c libc3/sym.h libc3/tuple.c libc3/tuple.h libc3/type.c libc3/ucd.h libc3/buf_parse_s.c.in libc3/buf_parse_s.h.in libc3/buf_inspect_s.c.in libc3/error_handler.h libc3/ident.c libc3/tag_bor.c libc3/tag_bxor.c libc3/buf_inspect_s_base.c.in libc3/buf_inspect_u.c.in libc3/buf_inspect_u.h.in libc3/env.h libc3/arg.h libc3/buf_inspect_u_base.c.in libc3/buf_inspect_u_base.h.in libc3/window/cairo/xcb/config.h libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/cairo/types.h libc3/window/cairo/window_cairo.h libc3/window/cairo/window_cairo.c libc3/window/cairo/quartz/window_cairo_quartz.h libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.h libc3/window/cairo/quartz/xkbquartz.h libc3/window/cairo/quartz/window_cairo_quartz_view.h libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h libc3/window/cairo/quartz/quartz_to_xkbcommon.c libc3/window/cairo/quartz/quartz_to_xkbcommon.h libc3/window/cairo/demo/bg_rect.c libc3/window/cairo/demo/bg_rect.h libc3/window/cairo/demo/lightspeed.c libc3/window/cairo/demo/lightspeed.h libc3/window/cairo/demo/window_cairo_demo.c libc3/window/cairo/demo/window_cairo_demo.h libc3/window/cairo/demo/toasters.c libc3/window/cairo/demo/toasters.h libc3/window/cairo/cairo_png.c 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/cairo_png.h libc3/window/cairo/cairo_sprite.c libc3/window/cairo/cairo_sprite.h libc3/window/types.h libc3/window/window.c libc3/window/window.h libc3/buf_parse.c libc3/u.c.in libc3/fn.c libc3/u.h.in libc3/sha1.h libc3/c3.h libc3/fn.h libc3/map.h libc3/file.c libc3/license.c libc3/operator.c libc3/ptag.h libc3/tag_add.c libc3/tag_band.c libc3/fn_clause.h libc3/s.c.in libc3/operator.h libc3/sym.c libc3/fn_clause.c libc3/ptag.c libc3/var.h libc3/var.c libc3/time.c libc3/time.h libc3/hash.c test/buf_inspect_test.c test/bool_test.c test/buf_parse_test.c test/facts_test.c test/buf_file_test.c test/list_test.c test/test.c test/test.h test/buf_parse_test_u8.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_test.c test/buf_parse_test_u64.c test/call_test.c test/facts_cursor_test.c test/cfn_test.c test/character_test.c test/env_test.c test/fact_test.c test/fact_test.h test/libc3_test.c test/str_test.c test/facts_with_test.c test/hash_test.c test/compare_test.c test/compare_test.h test/ident_test.c test/set__fact_test.c test/set__tag_test.c test/skiplist__fact_test.c test/sym_test.c test/tag_test.c test/tag_test.h test/array_test.c test/fn_test.c test/tuple_test.c test/types_test.c ucd2c/ucd.h ucd2c/ucd2c.c '
diff --git a/test/cfn_test.c b/test/cfn_test.c
index dc9445d..35b4bde 100644
--- a/test/cfn_test.c
+++ b/test/cfn_test.c
@@ -50,7 +50,7 @@ TEST_CASE(cfn_apply)
   s_tag result;
   s_cfn a;
   cfn_init(&a, sym_1("cfn_test_not"),
-           list_1("(:bool)"),
+           list_new_1("(:bool)"),
            sym_1("bool"));
   cfn_link(&a);
   cfn_prep_cif(&a);
@@ -71,7 +71,7 @@ TEST_CASE(cfn_init_copy)
   s_cfn b;
   s_list *b_arg_types;
   cfn_init(&a, sym_1("cfn_test_not"),
-           list_1("(:bool)"),
+           list_new_1("(:bool)"),
            sym_1("bool"));
   TEST_EQ(cfn_init_copy(&b, &a), &b);
   TEST_EQ(a.name, b.name);
@@ -104,7 +104,7 @@ TEST_CASE(cfn_init_clean)
 {
   s_cfn a;
   TEST_EQ(cfn_init(&a, sym_1("cfn_test_not"),
-                   list_1("(:bool)"),
+                   list_new_1("(:bool)"),
                    sym_1("bool")), &a);
   TEST_EQ(a.name, sym_1("cfn_test_not"));
   TEST_EQ(a.ptr.f, 0);
@@ -132,7 +132,7 @@ TEST_CASE(cfn_link)
   s_cfn a;
   s_cfn b;
   cfn_init(&a, sym_1("cfn_test_not"),
-           list_1("(:bool)"),
+           list_new_1("(:bool)"),
            sym_1("bool"));
   b = a;
   TEST_EQ(cfn_link(&a), &a);
@@ -157,7 +157,7 @@ TEST_CASE(cfn_prep_cif)
   s_cfn a;
   s_cfn b;
   cfn_init(&a, sym_1("cfn_test_not"),
-           list_1("(:bool)"),
+           list_new_1("(:bool)"),
            sym_1("bool"));
   b = a;
   TEST_EQ(cfn_prep_cif(&a), &a);
diff --git a/test/compare_test.c b/test/compare_test.c
index 9caf0ff..c2174ae 100644
--- a/test/compare_test.c
+++ b/test/compare_test.c
@@ -150,8 +150,8 @@ TEST_CASE_END(compare_f64)
 TEST_CASE(compare_list)
 {
   COMPARE_TEST_LIST(NULL, NULL, 0);
-  COMPARE_TEST_LIST(list_1("[A, B]"), list_1("[A, C]"), -1);
-  COMPARE_TEST_LIST(list_1("[A, C]"), list_1("[A, B]"), 1);
+  COMPARE_TEST_LIST(list_new_1("[A, B]"), list_new_1("[A, C]"), -1);
+  COMPARE_TEST_LIST(list_new_1("[A, C]"), list_new_1("[A, B]"), 1);
 }
 TEST_CASE_END(compare_list)
 
diff --git a/test/env_test.c b/test/env_test.c
index 7ea8485..c84b949 100644
--- a/test/env_test.c
+++ b/test/env_test.c
@@ -44,7 +44,7 @@ TEST_CASE(env_eval_call)
   call_init(&call);
   call.ident.module = sym_1("C3");
   call.ident.sym = sym_1("operator08");
-  call.arguments = list_1("[1, 2]");
+  call.arguments = list_new_1("[1, 2]");
   tag_init_u8(&expected, 3);
   TEST_ASSERT(env_eval_call(&env, &call, &result));
   TEST_EQ(compare_tag(&result, &expected), 0);
diff --git a/test/list_test.c b/test/list_test.c
index 614df80..3bd74d1 100644
--- a/test/list_test.c
+++ b/test/list_test.c
@@ -17,12 +17,12 @@
 #include "../libc3/str.h"
 #include "test.h"
 
-#define LIST_TEST_1(test)                                              \
+#define LIST_TEST_NEW_1(test)                                          \
   do {                                                                 \
     s_list *list_test;                                                 \
-    test_context("list_1(" # test ")");                                \
-    TEST_ASSERT((list_test = list_1(test)));                           \
-    list_delete_all(list_test);                                            \
+    test_context("list_new_1(" # test ")");                            \
+    TEST_ASSERT((list_test = list_new_1(test)));                       \
+    list_delete_all(list_test);                                        \
     test_context(NULL);                                                \
   } while (0)
 
@@ -31,38 +31,38 @@
     s_list *list_test;                                                 \
     s_str str_result;                                                  \
     test_context("list_inspect(" # test ") -> " # expected);           \
-    list_test = list_1(test);                                          \
+    list_test = list_new_1(test);                                      \
     TEST_EQ(list_inspect(list_test, &str_result), &str_result);        \
     TEST_STRNCMP(str_result.ptr.p, (expected), str_result.size);       \
     str_clean(&str_result);                                            \
-    list_delete_all(list_test);                                            \
+    list_delete_all(list_test);                                        \
     test_context(NULL);                                                \
   } while (0)
 
 void list_test (void);
-TEST_CASE_PROTOTYPE(list_1);
+TEST_CASE_PROTOTYPE(list_new_1);
 TEST_CASE_PROTOTYPE(list_inspect);
 
 void list_test (void)
 {
-  TEST_CASE_RUN(list_1);
+  TEST_CASE_RUN(list_new_1);
   TEST_CASE_RUN(list_inspect);
 }
 
-TEST_CASE(list_1)
+TEST_CASE(list_new_1)
 {
-  TEST_ASSERT(! list_1("[]"));
-  LIST_TEST_1("[[] | []]");
-  LIST_TEST_1("[[], [] | []]");
-  LIST_TEST_1("[[], [], [] | []]");
-  LIST_TEST_1("[A]");
-  LIST_TEST_1("[A | B]");
-  LIST_TEST_1("[A, B]");
-  LIST_TEST_1("[A, B | C]");
-  LIST_TEST_1("[A, B, C]");
-  LIST_TEST_1("[A, B, C | D]");
+  TEST_ASSERT(! list_new_1("[]"));
+  LIST_TEST_NEW_1("[[] | []]");
+  LIST_TEST_NEW_1("[[], [] | []]");
+  LIST_TEST_NEW_1("[[], [], [] | []]");
+  LIST_TEST_NEW_1("[A]");
+  LIST_TEST_NEW_1("[A | B]");
+  LIST_TEST_NEW_1("[A, B]");
+  LIST_TEST_NEW_1("[A, B | C]");
+  LIST_TEST_NEW_1("[A, B, C]");
+  LIST_TEST_NEW_1("[A, B, C | D]");
 }
-TEST_CASE_END(list_1)
+TEST_CASE_END(list_new_1)
 
 TEST_CASE(list_inspect)
 {