aboutsummaryrefslogtreecommitdiff
path: root/builtins/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'builtins/table.h')
-rw-r--r--builtins/table.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/builtins/table.h b/builtins/table.h
index 91e87bc5..8e6e5de1 100644
--- a/builtins/table.h
+++ b/builtins/table.h
@@ -44,8 +44,8 @@ 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); })
-void *Table$get_raw(Table_t t, const void *key, const TypeInfo *type);
-void *Table$entry(Table_t t, int64_t n);
+PUREFUNC void *Table$get_raw(Table_t t, const void *key, const TypeInfo *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);
#define Table$set_value(t, key_expr, value_expr, type) ({ __typeof(key_expr) k = key_expr; __typeof(value_expr) v = value_expr; \
@@ -63,22 +63,22 @@ void Table$remove(Table_t *t, const void *key, const TypeInfo *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);
-bool Table$is_subset_of(Table_t a, Table_t b, bool strict, const TypeInfo *type);
-bool Table$is_superset_of(Table_t a, Table_t b, bool strict, 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);
void Table$clear(Table_t *t);
Table_t Table$sorted(Table_t t, const TypeInfo *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; })
-int32_t Table$compare(const Table_t *x, const Table_t *y, const TypeInfo *type);
-bool Table$equal(const Table_t *x, const Table_t *y, const TypeInfo *type);
-uint64_t Table$hash(const Table_t *t, const TypeInfo *type);
+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);
-void *Table$str_entry(Table_t t, int64_t n);
-void *Table$str_get(Table_t t, const char *key);
-void *Table$str_get_raw(Table_t t, const char *key);
+CONSTFUNC void *Table$str_entry(Table_t t, int64_t n);
+PUREFUNC void *Table$str_get(Table_t t, const char *key);
+PUREFUNC void *Table$str_get_raw(Table_t t, const char *key);
void Table$str_set(Table_t *t, const char *key, const void *value);
void *Table$str_reserve(Table_t *t, const char *key, const void *value);
void Table$str_remove(Table_t *t, const char *key);