diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-30 14:39:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-30 14:39:30 -0400 |
| commit | 1a6ce0047bbc5125c386f65ae348688f98a9bb3f (patch) | |
| tree | ee56e2b3535ddcbc36fab5240d804d95f7744b5f /stdlib/tables.h | |
| parent | 2ba07c2cf53a765d4decb2cb09dbf5e1e99f1966 (diff) | |
Rename TypeInfo -> TypeInfo_t and fix up some typeinfo code
Diffstat (limited to 'stdlib/tables.h')
| -rw-r--r-- | stdlib/tables.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/stdlib/tables.h b/stdlib/tables.h index 53e0c583..14b50ef8 100644 --- a/stdlib/tables.h +++ b/stdlib/tables.h @@ -29,8 +29,8 @@ }, Set$info(item_info)); \ set; }) -Table_t Table$from_entries(Array_t entries, const TypeInfo *type); -void *Table$get(Table_t t, const void *key, const TypeInfo *type); +Table_t Table$from_entries(Array_t entries, const TypeInfo_t *type); +void *Table$get(Table_t t, const void *key, const TypeInfo_t *type); #define Table$get_optional(table_expr, key_t, val_t, key_expr, nonnull_var, nonnull_expr, null_expr, info_expr) ({ \ const Table_t t = table_expr; const key_t k = key_expr; \ val_t *nonnull_var = Table$get(t, &k, info_expr); \ @@ -38,10 +38,10 @@ void *Table$get(Table_t t, const void *key, const TypeInfo *type); #define Table$has_value(table_expr, key_expr, info_expr) ({ \ const Table_t t = table_expr; __typeof(key_expr) k = key_expr; \ (Table$get(t, &k, info_expr) != NULL); }) -PUREFUNC void *Table$get_raw(Table_t t, const void *key, const TypeInfo *type); +PUREFUNC void *Table$get_raw(Table_t t, const void *key, const TypeInfo_t *type); CONSTFUNC void *Table$entry(Table_t t, int64_t n); -void *Table$reserve(Table_t *t, const void *key, const void *value, const TypeInfo *type); -void Table$set(Table_t *t, const void *key, const void *value, const TypeInfo *type); +void *Table$reserve(Table_t *t, const void *key, const void *value, const TypeInfo_t *type); +void Table$set(Table_t *t, const void *key, const void *value, const TypeInfo_t *type); #define Table$set_value(t, key_expr, value_expr, type) ({ __typeof(key_expr) k = key_expr; __typeof(value_expr) v = value_expr; \ Table$set(t, &k, &v, type); }) #define Table$reserve_value(t, key_expr, type) ({ __typeof(key_expr) k = key_expr; Table$reserve(t, &k, NULL, type); }) @@ -51,24 +51,24 @@ void Table$set(Table_t *t, const void *key, const void *value, const TypeInfo *t if (val) *val += amount_expr; \ else { __typeof(amount_expr) init = amount_expr; Table$set(t, &key, &init, type); } (void)0; }) -void Table$remove(Table_t *t, const void *key, const TypeInfo *type); +void Table$remove(Table_t *t, const void *key, const TypeInfo_t *type); #define Table$remove_value(t, key_expr, type) ({ __typeof(key_expr) k = key_expr; Table$remove(t, &k, type); }) -Table_t Table$overlap(Table_t a, Table_t b, const TypeInfo *type); -Table_t Table$with(Table_t a, Table_t b, const TypeInfo *type); -Table_t Table$without(Table_t a, Table_t b, const TypeInfo *type); -PUREFUNC bool Table$is_subset_of(Table_t a, Table_t b, bool strict, const TypeInfo *type); -PUREFUNC bool Table$is_superset_of(Table_t a, Table_t b, bool strict, const TypeInfo *type); +Table_t Table$overlap(Table_t a, Table_t b, const TypeInfo_t *type); +Table_t Table$with(Table_t a, Table_t b, const TypeInfo_t *type); +Table_t Table$without(Table_t a, Table_t b, const TypeInfo_t *type); +PUREFUNC bool Table$is_subset_of(Table_t a, Table_t b, bool strict, const TypeInfo_t *type); +PUREFUNC bool Table$is_superset_of(Table_t a, Table_t b, bool strict, const TypeInfo_t *type); void Table$clear(Table_t *t); -Table_t Table$sorted(Table_t t, const TypeInfo *type); +Table_t Table$sorted(Table_t t, const TypeInfo_t *type); void Table$mark_copy_on_write(Table_t *t); #define TABLE_INCREF(t) ({ ARRAY_INCREF((t).entries); if ((t).bucket_info) (t).bucket_info->data_refcount += ((t).bucket_info->data_refcount < TABLE_MAX_DATA_REFCOUNT); }) #define TABLE_COPY(t) ({ TABLE_INCREF(t); t; }) -PUREFUNC int32_t Table$compare(const Table_t *x, const Table_t *y, const TypeInfo *type); -PUREFUNC bool Table$equal(const Table_t *x, const Table_t *y, const TypeInfo *type); -PUREFUNC uint64_t Table$hash(const Table_t *t, const TypeInfo *type); -Text_t Table$as_text(const Table_t *t, bool colorize, const TypeInfo *type); +PUREFUNC int32_t Table$compare(const Table_t *x, const Table_t *y, const TypeInfo_t *type); +PUREFUNC bool Table$equal(const Table_t *x, const Table_t *y, const TypeInfo_t *type); +PUREFUNC uint64_t Table$hash(const Table_t *t, const TypeInfo_t *type); +Text_t Table$as_text(const Table_t *t, bool colorize, const TypeInfo_t *type); CONSTFUNC void *Table$str_entry(Table_t t, int64_t n); PUREFUNC void *Table$str_get(Table_t t, const char *key); @@ -79,6 +79,6 @@ void Table$str_remove(Table_t *t, const char *key); #define Table$length(t) ((t).entries.length) -extern const TypeInfo CStrToVoidStarTable; +extern const TypeInfo_t CStrToVoidStarTable; // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1 |
