![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
Defines a hashmap type that maps void pointers to integers. More...
#include "hashmap.h"Go to the source code of this file.
Macros | |
| #define | HASH_OF(key) |
| #define | HASHMAP(token) |
| #define | K void* |
| #define | V int |
Defines a hashmap type that maps void pointers to integers.
To use this:
To create a new hashmap:
where CAPACITY is the maximum capacity of the hashmap and NOTHING is a pointer key that is guaranteed to be never used (e.g., NULL). To put an entry into the hashmap:
where POINTER is a pointer not equal to NOTHING and VALUE is an integer. This will segfault if the hashmap is already at capacity.
To retrieve a value from the hashmap:
This will segfault if the entry is not in the hashmap.
See hashmap.h for documentation on how to declare other hashmap types.
| #define HASH_OF | ( | key | ) |
| #define K void* |
| #define V int |