diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index e5ccd09..459efd6 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -19,7 +19,7 @@
sw buf_parse_cfn_arg_types (s_buf *buf, s_list **dest);
-sw buf_parse_array (s_buf *buf, s_array *a)
+sw buf_parse_array (s_buf *buf, s_array *dest)
{
uw *address;
uw i = 0;
@@ -29,6 +29,7 @@ sw buf_parse_array (s_buf *buf, s_array *a)
sw r;
sw result = 0;
s_buf_save save;
+ s_tag tag;
s_array tmp;
const s_sym *type;
assert(buf);
@@ -45,11 +46,7 @@ sw buf_parse_array (s_buf *buf, s_array *a)
result += r;
tmp.type = sym_to_e_tag_type(type);
item_size = tag_type_size(tmp.type);
- if (! (item = calloc(1, item_size))) {
- buf_save_clean(buf, &save);
- err(1, "buf_parse_array");
- return -1;
- }
+ item = tag_to_pointer(&tag, type);
if ((r = buf_ignore_spaces(buf)) < 0)
goto clean;
result += r;
@@ -75,91 +72,47 @@ sw buf_parse_array (s_buf *buf, s_array *a)
err(1, "buf_parse_array");
if (! (tmp.sizes = calloc(tmp.dimension, sizeof(uw))))
err(1, "buf_parse_array");
- switch (tmp.type) {
- case TAG_VOID:
- buf_save_clean(buf, &save);
- errx(1, "void array element type");
- return -1;
- case TAG_ARRAY:
- parse = (f_buf_parse) buf_parse_array;
- break;
- case TAG_BOOL:
- parse = (f_buf_parse) buf_parse_bool;
- break;
- case TAG_CALL:
- case TAG_CALL_FN:
- case TAG_CALL_MACRO:
- parse = (f_buf_parse) buf_parse_call;
- break;
- case TAG_CFN:
- parse = (f_buf_parse) buf_parse_cfn;
- break;
- case TAG_CHARACTER:
- parse = (f_buf_parse) buf_parse_character;
- break;
- case TAG_F32:
- parse = (f_buf_parse) buf_parse_f32;
- break;
- case TAG_F64:
- parse = (f_buf_parse) buf_parse_f64;
- break;
- case TAG_FN:
- parse = (f_buf_parse) buf_parse_fn;
- break;
- case TAG_IDENT:
- parse = (f_buf_parse) buf_parse_ident;
- break;
- case TAG_INTEGER:
- parse = (f_buf_parse) buf_parse_integer;
- break;
- case TAG_S64:
- parse = (f_buf_parse) buf_parse_s64;
- break;
- case TAG_S32:
- parse = (f_buf_parse) buf_parse_s32;
- break;
- case TAG_S16:
- parse = (f_buf_parse) buf_parse_s16;
- break;
- case TAG_S8:
- parse = (f_buf_parse) buf_parse_s8;
- break;
- case TAG_U8:
- parse = (f_buf_parse) buf_parse_u8;
- break;
- case TAG_U16:
- parse = (f_buf_parse) buf_parse_u16;
- break;
- case TAG_U32:
- parse = (f_buf_parse) buf_parse_32;
- break;
- case TAG_U64:
- parse = (f_buf_parse) buf_parse_u64;
- break;
- case TAG_LIST:
- parse = (f_buf_parse) buf_parse_list;
- break;
- case TAG_PTAG:
- parse = (f_buf_parse) buf_parse_ptag;
- break;
- case TAG_QUOTE:
- parse = (f_buf_parse) buf_parse_quote;
- break;
- case TAG_STR:
- parse = (f_buf_parse) buf_parse_str;
- break;
- case TAG_SYM:
- parse = (f_buf_parse) buf_parse_sym;
- break;
- case TAG_TUPLE:
- parse = (f_buf_parse) buf_parse_tuple;
- break;
- case TAG_VAR:
- parse = (f_buf_parse) buf_parse_var;
- break;
+ parse = tag_type_to_buf_parse(tmp.type);
while (i < tmp.dimension) {
if (i == tmp.dimension - 1) {
- if ((r = parse(buf,
+ if ((r = parse(buf, item)) <= 0)
+ goto restore;
+ result += r;
+ address[i]++;
+ while ((r = buf_read_1(buf, "]")) > 0) {
+ result += r;
+ if (! tmp.sizes[i])
+ tmp.sizes[i] = address[i];
+ else
+ if (tmp.sizes[i] != address[i]) {
+ assert(! "dimension size mismatch");
+ errx(1, "dimension size mismatch");
+ return -1;
+ }
+ if (! i) {
+ dest = tmp;
+ r = result;
+ goto clean;
+ }
+ i--;
+ }
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_read_1(buf, ",")) <= 0)
+ goto restore;
+ result += r;
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ while (i < (tmp.dimension - 1) && (r = buf_read_1(buf, "[")) > 0) {
+ result += r;
+ i++;
+ }
+ if (r < 0)
+ goto restore;
+ }
+
i++;
}
restore:
@@ -664,6 +617,27 @@ sw buf_parse_digit_hex (s_buf *buf, u8 *dest)
return r;
}
+sw buf_parse_digit (s_buf *buf, s_str *bases, uw bases_count)
+{
+ character c;
+ sw digit;
+ uw i = 0;
+ uw j;
+ sw r;
+ assert(buf);
+ assert(bases);
+ assert(bases_count);
+ if ((r = buf_peek_character_utf8(buf, &c)) <= 0)
+ return r;
+ while (i < bases_count &&
+ (digit = str_character_position(bases[i], c)) < 0)
+ i++;
+ if (digit >= 0)
+ if ((r = buf_parse_character_utf8(buf, &c)) <= 0)
+ return r;
+ return digit;
+}
+
sw buf_parse_digit_oct (s_buf *buf, u8 *dest)
{
character c;
@@ -1495,8 +1469,8 @@ sw buf_parse_s (s_buf *buf, void *s, u8 size)
return r;
}
-sw buf_parse_s_bases (s_buf *buf, void *s, u8 size, const s_str *bases,
- uw bases_count, bool negative)
+sw buf_parse_s_bases (s_buf *buf, void *dest, u8 size,
+ const s_str *bases, uw bases_count, bool negative)
{
character c;
sw i;
@@ -1530,25 +1504,9 @@ sw buf_parse_s_bases (s_buf *buf, void *s, u8 size, const s_str *bases,
return r;
}
-sw buf_parse_digit (s_buf *buf, s_str *bases, uw bases_count)
+sw buf_parse_s8 (s_buf *buf, s8 *dest)
{
- character c;
- sw digit;
- uw i = 0;
- uw j;
- sw r;
- assert(buf);
- assert(bases);
- assert(bases_count);
- if ((r = buf_peek_character_utf8(buf, &c)) <= 0)
- return r;
- while (i < bases_count &&
- (digit = str_character_position(bases[i], c)) < 0)
- i++;
- if (digit >= 0)
- if ((r = buf_parse_character_utf8(buf, &c)) <= 0)
- return r;
- return digit;
+ return buf_parse_s(buf, dest, 1);
}
sw buf_parse_u_base (s_buf *buf, void *s, u8 size, const s_str *base)
diff --git a/libc3/buf_parse.h b/libc3/buf_parse.h
index 97e7165..7df9269 100644
--- a/libc3/buf_parse.h
+++ b/libc3/buf_parse.h
@@ -63,6 +63,15 @@ sw buf_parse_integer (s_buf *buf, s_integer *dest);
sw buf_parse_list (s_buf *buf, s_list **dest);
sw buf_parse_module_name (s_buf *buf, const s_sym **dest);
sw buf_parse_new_tag (s_buf *buf, s_tag **dest);
+sw buf_parse_quote (s_buf *buf, s_quote *dest);
+sw buf_parse_s (s_buf *buf, void *dest, u8 size);
+sw buf_parse_s_bases (s_buf *buf, void *dest, u8 size,
+ const s_str *bases, uw bases_count,
+ bool negative);
+sw buf_parse_s8 (s_buf *buf, s8 *dest);
+sw buf_parse_s16 (s_buf *buf, s16 *dest);
+sw buf_parse_s32 (s_buf *buf, s32 *dest);
+sw buf_parse_s64 (s_buf *buf, s64 *dest);
sw buf_parse_str (s_buf *buf, s_str *dest);
sw buf_parse_str_character (s_buf *buf, character *dest);
sw buf_parse_str_character_unicode (s_buf *buf, character *dest);
@@ -86,6 +95,13 @@ sw buf_parse_tag_str_u8 (s_buf *buf, s_tag *dest);
sw buf_parse_tag_sym (s_buf *buf, s_tag *dest);
sw buf_parse_tag_tuple (s_buf *buf, s_tag *dest);
sw buf_parse_tuple (s_buf *buf, s_tuple *dest);
+sw buf_parse_u (s_buf *buf, void *dest, u8 size);
+sw buf_parse_u_bases (s_buf *buf, void *dest, u8 size,
+ const s_str *bases, uw bases_count);
+sw buf_parse_u8 (s_buf *buf, u8 *dest);
+sw buf_parse_u16 (s_buf *buf, u16 *dest);
+sw buf_parse_u32 (s_buf *buf, u32 *dest);
+sw buf_parse_u64 (s_buf *buf, u64 *dest);
sw buf_parse_u64_hex (s_buf *buf, u64 *dest);
#endif /* BUF_PARSE_H */
diff --git a/libc3/cfn.c b/libc3/cfn.c
index 10c4acf..b0492f7 100644
--- a/libc3/cfn.c
+++ b/libc3/cfn.c
@@ -337,135 +337,3 @@ const s_sym * cfn_tag_type_to_sym (e_tag_type tag_type)
errx(1, "cfn_tag_type_to_sym: invalid tag type");
return NULL;
}
-
-void * cfn_tag_to_ffi_value (s_tag *tag, const s_sym *type)
-{
- if (type == sym_1("tag"))
- return tag;
- switch (tag->type.type) {
- case TAG_VOID:
- if (type == sym_1("void"))
- return NULL;
- goto invalid_type;
- case TAG_ARRAY:
- if (type == sym_1("array"))
- return tag->data.array.data;
- goto invalid_type;
- case TAG_BOOL:
- if (type == sym_1("bool"))
- return &tag->data.bool;
- goto invalid_type;
- case TAG_CALL:
- if (type == sym_1("call"))
- return &tag->data.call;
- goto invalid_type;
- case TAG_CALL_FN:
- if (type == sym_1("call_fn"))
- return &tag->data.call;
- goto invalid_type;
- case TAG_CALL_MACRO:
- if (type == sym_1("call_macro"))
- return &tag->data.call;
- goto invalid_type;
- case TAG_CFN:
- if (type == sym_1("cfn"))
- return &tag->data.cfn;
- goto invalid_type;
- case TAG_CHARACTER:
- if (type == sym_1("character"))
- return &tag->data.character;
- goto invalid_type;
- case TAG_F32:
- if (type == sym_1("f32"))
- return &tag->data.f32;
- goto invalid_type;
- case TAG_F64:
- if (type == sym_1("f64"))
- return &tag->data.f64;
- goto invalid_type;
- case TAG_FN:
- if (type == sym_1("fn"))
- return tag->data.fn;
- goto invalid_type;
- case TAG_IDENT:
- if (type == sym_1("ident"))
- return &tag->data.ident;
- goto invalid_type;
- case TAG_INTEGER:
- if (type == sym_1("integer"))
- return &tag->data.integer;
- goto invalid_type;
- case TAG_S64:
- if (type == sym_1("s64"))
- return &tag->data.s64;
- goto invalid_type;
- case TAG_S32:
- if (type == sym_1("s32"))
- return &tag->data.s32;
- goto invalid_type;
- case TAG_S16:
- if (type == sym_1("s16"))
- return &tag->data.s16;
- goto invalid_type;
- case TAG_S8:
- if (type == sym_1("s8"))
- return &tag->data.s8;
- goto invalid_type;
- case TAG_U8:
- if (type == sym_1("u8"))
- return &tag->data.u8;
- goto invalid_type;
- case TAG_U16:
- if (type == sym_1("u16"))
- return &tag->data.u16;
- goto invalid_type;
- case TAG_U32:
- if (type == sym_1("u32"))
- return &tag->data.u32;
- goto invalid_type;
- case TAG_U64:
- if (type == sym_1("u64"))
- return &tag->data.u64;
- goto invalid_type;
- case TAG_LIST:
- if (type == sym_1("list"))
- return tag->data.list;
- goto invalid_type;
- case TAG_PTAG:
- if (type == sym_1("ptag"))
- return (void *) tag->data.ptag;
- goto invalid_type;
- case TAG_QUOTE:
- if (type == sym_1("quote"))
- return &tag->data.quote;
- goto invalid_type;
- case TAG_STR:
- if (type == sym_1("str"))
- return &tag->data.str;
- if (type == sym_1("char*"))
- return (void *) tag->data.str.ptr.ps8;
- goto invalid_type;
- case TAG_SYM:
- if (type == sym_1("sym"))
- return (void *) tag->data.sym;
- if (type == sym_1("str"))
- return (void *) &tag->data.sym->str;
- if (type == sym_1("char*"))
- return (void *) tag->data.sym->str.ptr.ps8;
- goto invalid_type;
- case TAG_TUPLE:
- if (type == sym_1("tuple"))
- return &tag->data.tuple;
- goto invalid_type;
- case TAG_VAR:
- goto invalid_type;
- }
- assert(! "cfn_tag_to_ffi_value: invalid tag type");
- errx(1, "cfn_tag_to_ffi_value: invalid tag type");
- return NULL;
- invalid_type:
- warnx("cfn_tag_to_ffi_value: cannot cast %s to %s",
- cfn_tag_type_to_sym(tag->type.type)->str.ptr.ps8,
- type->str.ptr.ps8);
- return NULL;
-}
diff --git a/libc3/tag.c b/libc3/tag.c
index 1eea36e..a0bb9b6 100644
--- a/libc3/tag.c
+++ b/libc3/tag.c
@@ -1849,6 +1849,228 @@ ffi_type tag_to_ffi_type(const s_tag *tag)
return ffi_type_void;
}
+void * tag_to_pointer (s_tag *tag, const s_sym *type)
+{
+ if (type == sym_1("tag"))
+ return tag;
+ switch (tag->type.type) {
+ case TAG_VOID:
+ if (type == sym_1("void"))
+ return NULL;
+ goto invalid_type;
+ case TAG_ARRAY:
+ if (type == sym_1("array"))
+ return tag->data.array.data;
+ goto invalid_type;
+ case TAG_BOOL:
+ if (type == sym_1("bool"))
+ return &tag->data.bool;
+ goto invalid_type;
+ case TAG_CALL:
+ if (type == sym_1("call"))
+ return &tag->data.call;
+ goto invalid_type;
+ case TAG_CALL_FN:
+ if (type == sym_1("call_fn"))
+ return &tag->data.call;
+ goto invalid_type;
+ case TAG_CALL_MACRO:
+ if (type == sym_1("call_macro"))
+ return &tag->data.call;
+ goto invalid_type;
+ case TAG_CFN:
+ if (type == sym_1("cfn"))
+ return &tag->data.cfn;
+ goto invalid_type;
+ case TAG_CHARACTER:
+ if (type == sym_1("character"))
+ return &tag->data.character;
+ goto invalid_type;
+ case TAG_F32:
+ if (type == sym_1("f32"))
+ return &tag->data.f32;
+ goto invalid_type;
+ case TAG_F64:
+ if (type == sym_1("f64"))
+ return &tag->data.f64;
+ goto invalid_type;
+ case TAG_FN:
+ if (type == sym_1("fn"))
+ return tag->data.fn;
+ goto invalid_type;
+ case TAG_IDENT:
+ if (type == sym_1("ident"))
+ return &tag->data.ident;
+ goto invalid_type;
+ case TAG_INTEGER:
+ if (type == sym_1("integer"))
+ return &tag->data.integer;
+ goto invalid_type;
+ case TAG_S64:
+ if (type == sym_1("s64"))
+ return &tag->data.s64;
+ goto invalid_type;
+ case TAG_S32:
+ if (type == sym_1("s32"))
+ return &tag->data.s32;
+ goto invalid_type;
+ case TAG_S16:
+ if (type == sym_1("s16"))
+ return &tag->data.s16;
+ goto invalid_type;
+ case TAG_S8:
+ if (type == sym_1("s8"))
+ return &tag->data.s8;
+ goto invalid_type;
+ case TAG_U8:
+ if (type == sym_1("u8"))
+ return &tag->data.u8;
+ goto invalid_type;
+ case TAG_U16:
+ if (type == sym_1("u16"))
+ return &tag->data.u16;
+ goto invalid_type;
+ case TAG_U32:
+ if (type == sym_1("u32"))
+ return &tag->data.u32;
+ goto invalid_type;
+ case TAG_U64:
+ if (type == sym_1("u64"))
+ return &tag->data.u64;
+ goto invalid_type;
+ case TAG_LIST:
+ if (type == sym_1("list"))
+ return tag->data.list;
+ goto invalid_type;
+ case TAG_PTAG:
+ if (type == sym_1("ptag"))
+ return (void *) tag->data.ptag;
+ goto invalid_type;
+ case TAG_QUOTE:
+ if (type == sym_1("quote"))
+ return &tag->data.quote;
+ goto invalid_type;
+ case TAG_STR:
+ if (type == sym_1("str"))
+ return &tag->data.str;
+ if (type == sym_1("char*"))
+ return (void *) tag->data.str.ptr.ps8;
+ goto invalid_type;
+ case TAG_SYM:
+ if (type == sym_1("sym"))
+ return (void *) tag->data.sym;
+ if (type == sym_1("str"))
+ return (void *) &tag->data.sym->str;
+ if (type == sym_1("char*"))
+ return (void *) tag->data.sym->str.ptr.ps8;
+ goto invalid_type;
+ case TAG_TUPLE:
+ if (type == sym_1("tuple"))
+ return &tag->data.tuple;
+ goto invalid_type;
+ case TAG_VAR:
+ goto invalid_type;
+ }
+ assert(! "cfn_tag_to_ffi_value: invalid tag type");
+ errx(1, "cfn_tag_to_ffi_value: invalid tag type");
+ return NULL;
+ invalid_type:
+ warnx("cfn_tag_to_ffi_value: cannot cast %s to %s",
+ cfn_tag_type_to_sym(tag->type.type)->str.ptr.ps8,
+ type->str.ptr.ps8);
+ return NULL;
+}
+
+f_buf_parse tag_type_to_buf_parse (e_tag_type type)
+{
+ switch (type) {
+ case TAG_VOID:
+ buf_save_clean(buf, &save);
+ errx(1, "void array element type");
+ return -1;
+ case TAG_ARRAY:
+ parse = (f_buf_parse) buf_parse_array;
+ break;
+ case TAG_BOOL:
+ parse = (f_buf_parse) buf_parse_bool;
+ break;
+ case TAG_CALL:
+ case TAG_CALL_FN:
+ case TAG_CALL_MACRO:
+ parse = (f_buf_parse) buf_parse_call;
+ break;
+ case TAG_CFN:
+ parse = (f_buf_parse) buf_parse_cfn;
+ break;
+ case TAG_CHARACTER:
+ parse = (f_buf_parse) buf_parse_character;
+ break;
+ case TAG_F32:
+ parse = (f_buf_parse) buf_parse_f32;
+ break;
+ case TAG_F64:
+ parse = (f_buf_parse) buf_parse_f64;
+ break;
+ case TAG_FN:
+ parse = (f_buf_parse) buf_parse_fn;
+ break;
+ case TAG_IDENT:
+ parse = (f_buf_parse) buf_parse_ident;
+ break;
+ case TAG_INTEGER:
+ parse = (f_buf_parse) buf_parse_integer;
+ break;
+ case TAG_S64:
+ parse = (f_buf_parse) buf_parse_s64;
+ break;
+ case TAG_S32:
+ parse = (f_buf_parse) buf_parse_s32;
+ break;
+ case TAG_S16:
+ parse = (f_buf_parse) buf_parse_s16;
+ break;
+ case TAG_S8:
+ parse = (f_buf_parse) buf_parse_s8;
+ break;
+ case TAG_U8:
+ parse = (f_buf_parse) buf_parse_u8;
+ break;
+ case TAG_U16:
+ parse = (f_buf_parse) buf_parse_u16;
+ break;
+ case TAG_U32:
+ parse = (f_buf_parse) buf_parse_u32;
+ break;
+ case TAG_U64:
+ parse = (f_buf_parse) buf_parse_u64;
+ break;
+ case TAG_LIST:
+ parse = (f_buf_parse) buf_parse_list;
+ break;
+ case TAG_PTAG:
+ parse = (f_buf_parse) buf_parse_ptag;
+ break;
+ case TAG_QUOTE:
+ parse = (f_buf_parse) buf_parse_quote;
+ break;
+ case TAG_STR:
+ parse = (f_buf_parse) buf_parse_str;
+ break;
+ case TAG_SYM:
+ parse = (f_buf_parse) buf_parse_sym;
+ break;
+ case TAG_TUPLE:
+ parse = (f_buf_parse) buf_parse_tuple;
+ break;
+ case TAG_VAR:
+ parse = (f_buf_parse) buf_parse_var;
+ break;
+ }
+ assert(! "tag_type_to_buf_parse: invalid tag type");
+ err(1, "tag_type_to_buf_parse: invalid tag type");
+ return NULL;
+}
+
s8 * tag_type_to_string (e_tag_type type)
{
switch (type) {
diff --git a/libc3/tag.h b/libc3/tag.h
index ca2b3ce..2a7f959 100644
--- a/libc3/tag.h
+++ b/libc3/tag.h
@@ -89,54 +89,56 @@ s_tag * tag_new_var ();
void tag_delete (s_tag *tag);
/* Observers */
-u64 tag_hash_u64 (const s_tag *tag);
-uw tag_hash_uw (const s_tag *tag);
-s_str * tag_inspect (const s_tag *tag, s_str *dest);
-e_bool tag_is_bound_var (const s_tag *tag);
-e_bool tag_is_number (const s_tag *tag);
-e_bool tag_is_unbound_var (const s_tag *tag);
-s8 tag_number_compare (const s_tag *a, const s_tag *b);
-sw tag_size (const s_tag *tag);
-sw tag_type_size (e_tag_type type);
-s8 * tag_type_to_string (e_tag_type type);
+u64 tag_hash_u64 (const s_tag *tag);
+uw tag_hash_uw (const s_tag *tag);
+s_str * tag_inspect (const s_tag *tag, s_str *dest);
+e_bool tag_is_bound_var (const s_tag *tag);
+e_bool tag_is_number (const s_tag *tag);
+e_bool tag_is_unbound_var (const s_tag *tag);
+s8 tag_number_compare (const s_tag *a, const s_tag *b);
+sw tag_size (const s_tag *tag);
+sw tag_type_size (e_tag_type type);
+f_buf_parse tag_type_to_buf_parse (e_tag_type type);
+s8 * tag_type_to_string (e_tag_type type);
/* Modifiers */
-s_tag * tag_1 (s_tag *tag, const s8 *p);
-s_tag * tag_array (s_tag *tag, const s_array *a);
-s_tag * tag_bool (s_tag *tag, bool p);
-s_tag * tag_cast_integer_to_s16 (s_tag *tag);
-s_tag * tag_cast_integer_to_s32 (s_tag *tag);
-s_tag * tag_cast_integer_to_s64 (s_tag *tag);
-s_tag * tag_cast_integer_to_s8 (s_tag *tag);
-s_tag * tag_cast_integer_to_u16 (s_tag *tag);
-s_tag * tag_cast_integer_to_u32 (s_tag *tag);
-s_tag * tag_cast_integer_to_u64 (s_tag *tag);
-s_tag * tag_cast_integer_to_u8 (s_tag *tag);
-s_tag * tag_character (s_tag *tag, character c);
-s_tag * tag_copy (const s_tag *src, s_tag *dest);
-s_tag * tag_f32 (s_tag *tag, f32 f);
-s_tag * tag_f64 (s_tag *tag, f64 f);
-s_tag * tag_ident (s_tag *tag, const s_ident *ident);
-s_tag * tag_ident_1 (s_tag *tag, const s8 *p);
-s_tag * tag_integer (s_tag *tag, const s_integer *x);
-s_tag * tag_integer_1 (s_tag *tag, const s8 *p);
-s_tag * tag_integer_reduce (s_tag *tag);
-s_tag * tag_list (s_tag *tag, s_list *list);
-s_tag * tag_list_1 (s_tag *tag, const s8 *p);
-s_tag * tag_s16 (s_tag *tag, s16 i);
-s_tag * tag_s32 (s_tag *tag, s32 i);
-s_tag * tag_s64 (s_tag *tag, s64 i);
-s_tag * tag_s8 (s_tag *tag, s8 i);
-s_tag * tag_str (s_tag *tag, s8 *free, uw size, const s8 *p);
-s_tag * tag_str_1 (s_tag *tag, s8 *free, const s8 *p);
-s_tag * tag_sym (s_tag *tag, const s_sym *p);
-s_tag * tag_sym_1 (s_tag *tag, const s8 *p);
-s_tag * tag_u16 (s_tag *tag, u16 i);
-s_tag * tag_u32 (s_tag *tag, u32 i);
-s_tag * tag_u64 (s_tag *tag, u64 i);
-s_tag * tag_u8 (s_tag *tag, u8 i);
-s_tag * tag_var (s_tag *tag);
-s_tag * tag_void (s_tag *tag);
+s_tag * tag_1 (s_tag *tag, const s8 *p);
+s_tag * tag_array (s_tag *tag, const s_array *a);
+s_tag * tag_bool (s_tag *tag, bool p);
+s_tag * tag_cast_integer_to_s16 (s_tag *tag);
+s_tag * tag_cast_integer_to_s32 (s_tag *tag);
+s_tag * tag_cast_integer_to_s64 (s_tag *tag);
+s_tag * tag_cast_integer_to_s8 (s_tag *tag);
+s_tag * tag_cast_integer_to_u16 (s_tag *tag);
+s_tag * tag_cast_integer_to_u32 (s_tag *tag);
+s_tag * tag_cast_integer_to_u64 (s_tag *tag);
+s_tag * tag_cast_integer_to_u8 (s_tag *tag);
+s_tag * tag_character (s_tag *tag, character c);
+s_tag * tag_copy (const s_tag *src, s_tag *dest);
+s_tag * tag_f32 (s_tag *tag, f32 f);
+s_tag * tag_f64 (s_tag *tag, f64 f);
+s_tag * tag_ident (s_tag *tag, const s_ident *ident);
+s_tag * tag_ident_1 (s_tag *tag, const s8 *p);
+s_tag * tag_integer (s_tag *tag, const s_integer *x);
+s_tag * tag_integer_1 (s_tag *tag, const s8 *p);
+s_tag * tag_integer_reduce (s_tag *tag);
+s_tag * tag_list (s_tag *tag, s_list *list);
+s_tag * tag_list_1 (s_tag *tag, const s8 *p);
+s_tag * tag_s16 (s_tag *tag, s16 i);
+s_tag * tag_s32 (s_tag *tag, s32 i);
+s_tag * tag_s64 (s_tag *tag, s64 i);
+s_tag * tag_s8 (s_tag *tag, s8 i);
+s_tag * tag_str (s_tag *tag, s8 *free, uw size, const s8 *p);
+s_tag * tag_str_1 (s_tag *tag, s8 *free, const s8 *p);
+s_tag * tag_sym (s_tag *tag, const s_sym *p);
+s_tag * tag_sym_1 (s_tag *tag, const s8 *p);
+s_tag * tag_u16 (s_tag *tag, u16 i);
+s_tag * tag_u32 (s_tag *tag, u32 i);
+s_tag * tag_u64 (s_tag *tag, u64 i);
+s_tag * tag_u8 (s_tag *tag, u8 i);
+s_tag * tag_var (s_tag *tag);
+s_tag * tag_void (s_tag *tag);
+void * tag_to_pointer (s_tag *tag, const s_sym *type);
ffi_type tag_to_ffi_type(const s_tag *tag);
/* operators */