28#define TABLE_INITIAL_CAPACITY 16
127 size_t key_len,
const char *value,
142 size_t key_len,
size_t *out_len);
struct snobol_table snobol_table_t
Associative table (opaque handle).
Portable function-attribute macros for SNOBOL4.
bool table_set_ex(snobol_table_t *table, const char *key, size_t key_len, const char *value, size_t value_len)
Insert or update a key-value pair (NUL-safe byte-exact variants).
const char * table_get_ex(const snobol_table_t *table, const char *key, size_t key_len, size_t *out_len)
Look up a value by key (NUL-safe).
bool table_set(snobol_table_t *table, const char *key, const char *value)
Insert or update a key-value pair.
const char * table_name(const snobol_table_t *table)
Get the table name (for debugging).
uint32_t table_hash_bytes(const char *str, size_t len)
Hash function for byte-exact strings (FNV-1a, NUL-safe).
struct table_entry table_entry_t
bool table_has_ex(const snobol_table_t *table, const char *key, size_t key_len)
Check if a key exists in the table (NUL-safe).
snobol_table_t * table_create(const char *name)
Create a new runtime table.
snobol_table_t * table_retain(snobol_table_t *table)
Increment table reference count.
bool table_delete_ex(snobol_table_t *table, const char *key, size_t key_len)
Delete a key from the table (NUL-safe).
bool table_delete(snobol_table_t *table, const char *key)
Delete a key from the table.
bool table_has(const snobol_table_t *table, const char *key)
Check if a key exists in the table.
void table_clear(snobol_table_t *table)
Clear all entries from the table.
void table_release(snobol_table_t *table)
Decrement table reference count and free if zero.
size_t table_size(const snobol_table_t *table)
Get the number of active entries.
uint32_t table_hash_string(const char *str)
Hash function for strings (FNV-1a).
const char * table_get(const snobol_table_t *table, const char *key)
Look up a value by key.