Commit 33beece8b5ea0db72906c114e06c7eb05f84783d

Thomas de Grivel 2023-08-16T19:46:56

e_bool -> bool

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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
diff --git a/libc3/buf_file.c b/libc3/buf_file.c
index 1ca1622..2bc3f53 100644
--- a/libc3/buf_file.c
+++ b/libc3/buf_file.c
@@ -36,7 +36,7 @@ void buf_file_close (s_buf *buf)
   buf->user_ptr = NULL;
 }
 
-e_bool buf_file_is_open (s_buf *buf)
+bool buf_file_is_open (s_buf *buf)
 {
   s_buf_file *buf_file;
   assert(buf);
diff --git a/libc3/buf_file.h b/libc3/buf_file.h
index 3f69b8d..dcc22db 100644
--- a/libc3/buf_file.h
+++ b/libc3/buf_file.h
@@ -21,7 +21,7 @@
 #include "types.h"
 
 /* observers */
-e_bool    buf_file_is_open (s_buf *buf);
+bool    buf_file_is_open (s_buf *buf);
 
 /* modifiers */
 s_buf * buf_file_open_r (s_buf *buf, FILE *fp);
diff --git a/libc3/character.c b/libc3/character.c
index b96645b..db06e08 100644
--- a/libc3/character.c
+++ b/libc3/character.c
@@ -25,20 +25,20 @@ character character_1 (const s8 *p)
   return c;
 }
 
-e_bool character_is_digit (character c)
+bool character_is_digit (character c)
 {
   return ('0' <= c && c <= '9');
 }
 
 
-e_bool character_is_lowercase (character c)
+bool character_is_lowercase (character c)
 {
   return (c >= 0 &&
           c < UCD_MAX &&
           g_ucd[c].flags & UCD_LETTER_LOWERCASE);
 }
 
-e_bool character_is_printable (character c)
+bool character_is_printable (character c)
 {
   const u64 ucd_printable = UCD_LETTER | UCD_MARK | UCD_NUMBER |
     UCD_PUNCTUATION | UCD_SYMBOL | UCD_SEPARATOR_SPACE;
@@ -47,14 +47,14 @@ e_bool character_is_printable (character c)
           g_ucd[c].flags & ucd_printable);
 }
 
-e_bool character_is_space (character c)
+bool character_is_space (character c)
 {
   return (c >= 0 &&
           c < UCD_MAX &&
           g_ucd[c].flags & (UCD_OTHER_CONTROL | UCD_SEPARATOR_SPACE));
 }
 
-e_bool character_is_uppercase (character c)
+bool character_is_uppercase (character c)
 {
   return (c >= 0 &&
           c < UCD_MAX &&
diff --git a/libc3/character.h b/libc3/character.h
index d5b9a2e..fc4b87a 100644
--- a/libc3/character.h
+++ b/libc3/character.h
@@ -18,11 +18,11 @@
 
 character character_1 (const s8 *p);
 void      character_hash_update (character c, t_hash *hash);
-e_bool    character_is_digit (character c);
-e_bool    character_is_lowercase (character c);
-e_bool    character_is_printable (character c);
-e_bool    character_is_space (character c);
-e_bool    character_is_uppercase (character c);
+bool      character_is_digit (character c);
+bool      character_is_lowercase (character c);
+bool      character_is_printable (character c);
+bool      character_is_space (character c);
+bool      character_is_uppercase (character c);
 sw        character_read (s_buf *buf, character *c);
 character character_switch_case (character c);
 character character_to_lower (character c);
diff --git a/libc3/facts.c b/libc3/facts.c
index 82bfb3e..7dcd487 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -498,7 +498,7 @@ s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag)
   return &item->data;
 }
 
-e_bool facts_remove_fact (s_facts *facts, const s_fact *fact)
+bool facts_remove_fact (s_facts *facts, const s_fact *fact)
 {
   s_fact f;
   s_fact *found;
@@ -556,7 +556,7 @@ sw facts_save_file (s_facts *facts, const s8 *path)
   return r;
 }
 
-e_bool facts_unref_tag (s_facts *facts, const s_tag *tag)
+bool facts_unref_tag (s_facts *facts, const s_tag *tag)
 {
   s_set_item__tag *item;
   assert(facts);
diff --git a/libc3/facts.h b/libc3/facts.h
index 8186081..53cf8d5 100644
--- a/libc3/facts.h
+++ b/libc3/facts.h
@@ -45,9 +45,9 @@ void     facts_lock_unlock_w (s_facts *facts);
 void     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);
-e_bool   facts_remove_fact (s_facts *facts, const s_fact *fact);
+bool     facts_remove_fact (s_facts *facts, const s_fact *fact);
 sw       facts_save_file (s_facts *facts, const s8 *path);
-e_bool   facts_unref_tag (s_facts *facts, const s_tag *tag);
+bool     facts_unref_tag (s_facts *facts, const s_tag *tag);
 
 /* Observers */
 sw       facts_dump (s_facts *facts, s_buf *buf);
diff --git a/libc3/hash.c b/libc3/hash.c
index f08d312..becfe77 100644
--- a/libc3/hash.c
+++ b/libc3/hash.c
@@ -88,7 +88,7 @@ void hash_update_array (t_hash *hash, const s_array *a)
   hash_update(hash, a->data, a->size);
 }
 
-void hash_update_bool (t_hash *hash, e_bool x)
+void hash_update_bool (t_hash *hash, bool x)
 {
   const s8 type[] = "bool";
   assert(hash);
diff --git a/libc3/hash.h b/libc3/hash.h
index c44a370..1ac5db4 100644
--- a/libc3/hash.h
+++ b/libc3/hash.h
@@ -25,7 +25,7 @@ u64  hash_to_u64 (t_hash *hash);
 void hash_update (t_hash *hash, const void *data, uw size);
 void hash_update_1 (t_hash *hash, const s8 *p);
 void hash_update_array (t_hash *hash, const s_array *a);
-void hash_update_bool (t_hash *hash, e_bool b);
+void hash_update_bool (t_hash *hash, bool b);
 void hash_update_call (t_hash *hash, const s_call *call);
 void hash_update_cfn (t_hash *hash, const s_cfn *cfn);
 HASH_UPDATE_PROTOTYPE(f32);
diff --git a/libc3/ident.c b/libc3/ident.c
index e2d655b..5b34869 100644
--- a/libc3/ident.c
+++ b/libc3/ident.c
@@ -17,7 +17,7 @@
 #include "str.h"
 #include "sym.h"
 
-e_bool ident_character_is_reserved (character c)
+bool ident_character_is_reserved (character c)
 {
   return (character_is_space(c) ||
           c == '#' ||
@@ -39,7 +39,7 @@ s_ident * ident_copy (const s_ident *src, s_ident *dest)
   return dest;
 }
 
-e_bool ident_first_character_is_reserved (character c)
+bool ident_first_character_is_reserved (character c)
 {
   return (character_is_digit(c) ||
           character_is_uppercase(c) ||
@@ -54,7 +54,7 @@ e_bool ident_first_character_is_reserved (character c)
           c == '}');
 }
 
-e_bool ident_has_reserved_characters (const s_ident *ident)
+bool ident_has_reserved_characters (const s_ident *ident)
 {
   character c;
   sw r;
diff --git a/libc3/ident.h b/libc3/ident.h
index 02d42db..e9cc243 100644
--- a/libc3/ident.h
+++ b/libc3/ident.h
@@ -28,15 +28,15 @@ s_ident * ident_resolve_module (s_ident *ident, const s_env *env);
 /* Observers */
 
 /* Returns true iff c is an ident reserved character. */
-e_bool ident_character_is_reserved (character c);
+bool ident_character_is_reserved (character c);
 
 s_ident * ident_copy (const s_ident *src, s_ident *dest);
 
 /* Returns true iff c is an ident reserved character as first. */
-e_bool ident_first_character_is_reserved (character c);
+bool ident_first_character_is_reserved (character c);
 
 /* Returns true iff ident contains reserved characters. */
-e_bool ident_has_reserved_characters (const s_ident *ident);
+bool ident_has_reserved_characters (const s_ident *ident);
 
 s_ident * ident_init (s_ident *ident, const s_sym *sym);
 
diff --git a/libc3/integer.c b/libc3/integer.c
index fed1adf..90d21f0 100644
--- a/libc3/integer.c
+++ b/libc3/integer.c
@@ -220,13 +220,13 @@ s_integer * integer_init_zero (s_integer *dest)
   return dest;
 }
 
-e_bool integer_is_negative (const s_integer *i)
+bool integer_is_negative (const s_integer *i)
 {
   assert(i);
   return i->mp_int.sign == MP_NEG;
 }
 
-e_bool integer_is_zero (const s_integer *i)
+bool integer_is_zero (const s_integer *i)
 {
   assert(i);
   return (i->mp_int.used == 0);
diff --git a/libc3/integer.h b/libc3/integer.h
index bcb2463..18a43a9 100644
--- a/libc3/integer.h
+++ b/libc3/integer.h
@@ -82,18 +82,18 @@ s_integer * integer_new ();
 s_integer * integer_new_copy (const s_integer *a);
 
 /* Observers */
-uw               integer_bits (const s_integer *i);
-uw               integer_bytes (const s_integer *i);
-e_bool           integer_is_negative (const s_integer *i);
-e_bool           integer_is_zero (const s_integer *i);
-f64              integer_to_f64 (const s_integer *i);
-s8               integer_to_s8 (const s_integer *i);
-s16              integer_to_s16 (const s_integer *i);
-s32              integer_to_s32 (const s_integer *i);
-s64              integer_to_s64 (const s_integer *i);
-u8               integer_to_u8 (const s_integer *i);
-u16              integer_to_u16 (const s_integer *i);
-u32              integer_to_u32 (const s_integer *i);
-u64              integer_to_u64 (const s_integer *i);
+uw   integer_bits (const s_integer *i);
+uw   integer_bytes (const s_integer *i);
+bool integer_is_negative (const s_integer *i);
+bool integer_is_zero (const s_integer *i);
+f64  integer_to_f64 (const s_integer *i);
+s8   integer_to_s8 (const s_integer *i);
+s16  integer_to_s16 (const s_integer *i);
+s32  integer_to_s32 (const s_integer *i);
+s64  integer_to_s64 (const s_integer *i);
+u8   integer_to_u8 (const s_integer *i);
+u16  integer_to_u16 (const s_integer *i);
+u32  integer_to_u32 (const s_integer *i);
+u64  integer_to_u64 (const s_integer *i);
 
 #endif /* INTEGER_H */
diff --git a/libc3/set.c.in b/libc3/set.c.in
index 8687da9..335767f 100644
--- a/libc3/set.c.in
+++ b/libc3/set.c.in
@@ -129,7 +129,7 @@ set_init___NAME$ (s_set___NAME$ *set, uw max)
   return set;
 }
 
-e_bool
+bool
 set_remove___NAME$ (s_set___NAME$ *set, const _TYPE$ *data)
 {
   s_set_item___NAME$ *item;
@@ -138,7 +138,7 @@ set_remove___NAME$ (s_set___NAME$ *set, const _TYPE$ *data)
   return false;
 }
 
-e_bool
+bool
 set_remove_item___NAME$ (s_set___NAME$ *set, s_set_item___NAME$ *item)
 {
   sw h;
diff --git a/libc3/set.h.in b/libc3/set.h.in
index d89d97c..92e8392 100644
--- a/libc3/set.h.in
+++ b/libc3/set.h.in
@@ -43,10 +43,10 @@ set_get_hash_next___NAME$ (const s_set_item___NAME$ *item);
 s_set___NAME$ *
 set_init___NAME$ (s_set___NAME$ *set, uw max);
 
-e_bool
+bool
 set_remove___NAME$ (s_set___NAME$ *set, const _TYPE$ *data);
 
-e_bool
+bool
 set_remove_item___NAME$ (s_set___NAME$ *set, s_set_item___NAME$ *item);
 
 s_set___NAME$ *
diff --git a/libc3/set__fact.c b/libc3/set__fact.c
index c68d918..20e6fc2 100644
--- a/libc3/set__fact.c
+++ b/libc3/set__fact.c
@@ -129,7 +129,7 @@ set_init__fact (s_set__fact *set, uw max)
   return set;
 }
 
-e_bool
+bool
 set_remove__fact (s_set__fact *set, const s_fact *data)
 {
   s_set_item__fact *item;
@@ -138,7 +138,7 @@ set_remove__fact (s_set__fact *set, const s_fact *data)
   return false;
 }
 
-e_bool
+bool
 set_remove_item__fact (s_set__fact *set, s_set_item__fact *item)
 {
   sw h;
diff --git a/libc3/set__fact.h b/libc3/set__fact.h
index 9f71540..cb7e4f7 100644
--- a/libc3/set__fact.h
+++ b/libc3/set__fact.h
@@ -43,10 +43,10 @@ set_get_hash_next__fact (const s_set_item__fact *item);
 s_set__fact *
 set_init__fact (s_set__fact *set, uw max);
 
-e_bool
+bool
 set_remove__fact (s_set__fact *set, const s_fact *data);
 
-e_bool
+bool
 set_remove_item__fact (s_set__fact *set, s_set_item__fact *item);
 
 s_set__fact *
diff --git a/libc3/set__tag.c b/libc3/set__tag.c
index 521be20..cc688df 100644
--- a/libc3/set__tag.c
+++ b/libc3/set__tag.c
@@ -129,7 +129,7 @@ set_init__tag (s_set__tag *set, uw max)
   return set;
 }
 
-e_bool
+bool
 set_remove__tag (s_set__tag *set, const s_tag *data)
 {
   s_set_item__tag *item;
@@ -138,7 +138,7 @@ set_remove__tag (s_set__tag *set, const s_tag *data)
   return false;
 }
 
-e_bool
+bool
 set_remove_item__tag (s_set__tag *set, s_set_item__tag *item)
 {
   sw h;
diff --git a/libc3/set__tag.h b/libc3/set__tag.h
index 4b7a820..ed0c4e2 100644
--- a/libc3/set__tag.h
+++ b/libc3/set__tag.h
@@ -43,10 +43,10 @@ set_get_hash_next__tag (const s_set_item__tag *item);
 s_set__tag *
 set_init__tag (s_set__tag *set, uw max);
 
-e_bool
+bool
 set_remove__tag (s_set__tag *set, const s_tag *data);
 
-e_bool
+bool
 set_remove_item__tag (s_set__tag *set, s_set_item__tag *item);
 
 s_set__tag *
diff --git a/libc3/skiplist.c.in b/libc3/skiplist.c.in
index 7cd210c..dd0ee0a 100644
--- a/libc3/skiplist.c.in
+++ b/libc3/skiplist.c.in
@@ -191,7 +191,7 @@ skiplist_random_height___NAME$ (s_skiplist___NAME$ *skiplist)
   return height;
 }
 
-e_bool
+bool
 skiplist_remove___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ _NAME$)
 {
   uw level;
diff --git a/libc3/skiplist.h.in b/libc3/skiplist.h.in
index f2f86b4..8c0e087 100644
--- a/libc3/skiplist.h.in
+++ b/libc3/skiplist.h.in
@@ -53,7 +53,7 @@ skiplist_pred___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ value);
 u8
 skiplist_random_height___NAME$ (s_skiplist___NAME$ *skiplist);
 
-e_bool
+bool
 skiplist_remove___NAME$ (s_skiplist___NAME$ *skiplist, _TYPE$ value);
 
 #endif /* SKIPLIST___NAME$_H */
diff --git a/libc3/skiplist__fact.c b/libc3/skiplist__fact.c
index 138579f..a39890f 100644
--- a/libc3/skiplist__fact.c
+++ b/libc3/skiplist__fact.c
@@ -191,7 +191,7 @@ skiplist_random_height__fact (s_skiplist__fact *skiplist)
   return height;
 }
 
-e_bool
+bool
 skiplist_remove__fact (s_skiplist__fact *skiplist, s_fact * fact)
 {
   uw level;
diff --git a/libc3/skiplist__fact.h b/libc3/skiplist__fact.h
index 3f5710c..8c6ca45 100644
--- a/libc3/skiplist__fact.h
+++ b/libc3/skiplist__fact.h
@@ -53,7 +53,7 @@ skiplist_pred__fact (s_skiplist__fact *skiplist, s_fact * value);
 u8
 skiplist_random_height__fact (s_skiplist__fact *skiplist);
 
-e_bool
+bool
 skiplist_remove__fact (s_skiplist__fact *skiplist, s_fact * value);
 
 #endif /* SKIPLIST__fact_H */
diff --git a/libc3/str.c b/libc3/str.c
index 3557713..cdf90c1 100644
--- a/libc3/str.c
+++ b/libc3/str.c
@@ -39,7 +39,7 @@ sw str_character (const s_str *str, uw position, character *dest)
   return r;
 }
 
-e_bool str_character_is_reserved (character c)
+bool str_character_is_reserved (character c)
 {
   return ! character_is_printable(c) ||
     c == '"' ||
@@ -84,7 +84,7 @@ void str_delete (s_str *str)
   free(str);
 }
 
-e_bool str_has_reserved_characters (const s_str *src)
+bool str_has_reserved_characters (const s_str *src)
 {
   character c;
   sw r;
diff --git a/libc3/str.h b/libc3/str.h
index 4a94d23..fd48e8b 100644
--- a/libc3/str.h
+++ b/libc3/str.h
@@ -55,10 +55,10 @@ void str_delete (s_str *str);
 sw            str_character (const s_str *str, uw position,
                              character *dest);
 character     str_character_escape (character c);
-e_bool        str_character_is_reserved (character c);
+bool          str_character_is_reserved (character c);
 sw            str_character_position (const s_str *str, character c);
 s_str *       str_copy (const s_str *src, s_str *dest);
-e_bool        str_has_reserved_characters (const s_str *str);
+bool          str_has_reserved_characters (const s_str *str);
 s_str *       str_inspect (const s_str *x, s_str *dest);
 sw            str_length_utf8 (const s_str *str);
 sw            str_peek_bool (const s_str *src, bool *p);
diff --git a/libc3/sym.c b/libc3/sym.c
index 9fb1bc2..d28b665 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -35,7 +35,7 @@ const s_sym * sym_1 (const s8 *p)
   return str_to_sym(&stra);
 }
 
-e_bool sym_character_is_reserved (character c)
+bool sym_character_is_reserved (character c)
 {
   return (character_is_space(c) ||
           c == '#' ||
@@ -83,7 +83,7 @@ const s_sym * sym_find (const s_str *str)
   return NULL;
 }
 
-e_bool sym_has_reserved_characters (const s_sym *sym)
+bool sym_has_reserved_characters (const s_sym *sym)
 {
   character c;
   sw r;
@@ -113,7 +113,7 @@ s_str * sym_inspect (const s_sym *sym, s_str *dest)
   return buf_to_str(&tmp, dest);
 }
 
-e_bool sym_is_module (const s_sym *sym)
+bool sym_is_module (const s_sym *sym)
 {
   character c;
   if (str_peek_character(&sym->str, &c) > 0)
diff --git a/libc3/sym.h b/libc3/sym.h
index 68920ef..7b849ca 100644
--- a/libc3/sym.h
+++ b/libc3/sym.h
@@ -31,7 +31,7 @@
  */
 const s_sym * sym_1 (const s8 *p);
 
-e_bool sym_character_is_reserved (character c);
+bool sym_character_is_reserved (character c);
 
 /** @brief Call when exiting program. */
 void sym_delete_all ();
@@ -39,12 +39,12 @@ void sym_delete_all ();
 /** @brief Find an existing symbol. */
 const s_sym * sym_find (const s_str *src);
 
-e_bool sym_has_reserved_characters (const s_sym *sym);
+bool sym_has_reserved_characters (const s_sym *sym);
 
 s_str * sym_inspect (const s_sym *sym, s_str *dest);
 
 /** @brief True iff sym is a module name (starts with a capital). */
-e_bool sym_is_module (const s_sym *sym);
+bool sym_is_module (const s_sym *sym);
 
 const s_sym * sym_new (const s_str *src);