![]() | Fun 0.41.5 The programming language that makes You have fun |
Simple string-keyed map implementation backing VAL_MAP Values. More...


Go to the source code of this file.
Data Structures | |
| struct | Map |
Typedefs | |
| typedef struct Map | Map |
Functions | |
| Value | make_map_empty (void) |
| Construct a new empty map Value. | |
| int | map_set (Value *vm, const char *key, Value v) |
| Insert or replace a key in the map. | |
| int | map_get_copy (const Value *vm, const char *key, Value *out) |
| Look up a key and copy the stored value into out. | |
| int | map_has (const Value *vm, const char *key) |
| Check whether the map contains the specified key. | |
| Value | map_keys_array (const Value *vm) |
| Return all map keys as an array of strings. | |
| Value | map_values_array (const Value *vm) |
| Return all map values as an array (deep-copied). | |
Simple string-keyed map implementation backing VAL_MAP Values.
Definition in file map.c.
| typedef struct Map Map |
| Value make_map_empty | ( | void | ) |
Look up a key and copy the stored value into out.
The returned value is a deep copy; caller owns it and must free it.
| vm | Source map Value (VAL_MAP). |
| key | Key to search for. |
| out | Output pointer to receive a copy; may be NULL to only test presence. |
Definition at line 112 of file map.c.

| int map_has | ( | const Value * | vm, |
| const char * | key ) |
Insert or replace a key in the map.
On success, ownership of v transfers into the map. On failure, v is freed.
| vm | Target Value of type VAL_MAP. |
| key | NUL-terminated key string (copied into the map). |
| v | Value to store; consumed on success. |
Definition at line 79 of file map.c.

