MapForeachValuePtrForKey
Description
Iterate over all values stored for a specific key with pointers.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Map to iterate over. |
lookup_key |
in | Key value to match against (compared via the map’s key_compare callback). |
value_ptr |
in | Name of pointer variable bound to each matching in-slot value. |
Success
The loop body runs once for each value stored under lookup_key, with value_ptr bound to the in-slot value address. Use this form when the body mutates the stored value in place. The body is skipped when m is empty or when the key is not present.
Failure
The macro itself does not fail. LOG_FATAL via ValidateMap(m) when m is uninitialised or corrupted.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.Foreach.c:63:
}
MapForeachValuePtrForKey(&map, 2, value_ptr) {
*value_ptr += 100;
}
Last updated on