hashmap
========

.. |br| raw:: html

    <br/>

This module has 5 functions
and 2 macro functions
that are defined as follows:

``GENERATE_HASHMAP_DECLARATION(TYPE_OF_KEY, TYPE_OF_DATA)``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This macro function acts as a
monomorphized generic and generates prototypes
of all of the functions of this module such
that they work with the type passed as `TYPE_OF_DATA`.

|br|

``GENERATE_HASHMAP_DEFINITION(TYPE_OF_KEY, TYPE_OF_DATA)``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This macro function acts as a
monomorphized generic and generates definitions/bodies
of all of the functions of this module such
that they work with the type passed as `TYPE_OF_DATA`.
It is the source file counterpart to
``GENERATE_HASHMAP_DECLARATION()`.

|br|

``void hashmap_init(struct hashmap* hashmap, uint32_t (*hash_function)(TYPE_OF_KEY));``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This function is generated by
the two aforementioned macro functions.
It initializes an existing `hashmap` instance
passed by pointer by the user. `hash_function`
must be a function capable of hashing instances
of `TYPE_OF_KEY` into `uint32_t`'s. This is how
the keys are determined for data values.
This function does not heap allocate using `kmalloc`.

Note: `hashmap_init` and `hashmap` are both name
mangled in a non API stable way (the mangling may
change at any time). If you need their true mangled
names, use the name getter macro functions.

|br|

``TYPE_OF_DATA* find(struct hashmap* hashmap, TYPE_OF_KEY key);``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

|br|

``TYPE_OF_DATA remove(struct hashmap* hashmap, TYPE_OF_KEY key);``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

|br|

``void add(struct hashmap* hashmap, TYPE_OF_KEY key, TYPE_OF_DATA data);``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

|br|

``void hashmap_destroy(struct hashmap* hashmap);``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This function is generated by
the two aforementioned macro functions.
It zeroes out the `hashmap` instance
passed by pointer by the user
and frees all resources allocated by it.

Note: `hashmap_destroy` and `hashmap` are both name
mangled in a non API stable way (the mangling may
change at any time). If you need their true mangled
names, use the name getter macro functions.

|br|

..
    TODO: Insert the macros to get the mangled names later




