/* * Nome: Leonardo Koosuke Azuma * SO: Arch Linux x86_64 * Compilador: gcc (GCC) 13.2.1 20230801 */ #ifndef _MYMAP_H #define _MYMAP_H #include #include #define A typedef struct Node{ char *key; char *value; struct Node *next; }node; typedef struct Map{ uint32_t size; node **head; }string_map; string_map init_map(uint32_t size); /* * 64-bit FNV-1 hash * https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function */ #define FNV_offset_basis 14695981039346656037UL #define FNV_prime 1099511628211UL uint32_t hash_function(char *key, uint32_t size); void insert_map(char *key, char *value, string_map map); node *create_node(char *key, char *value); char *get_value(char *key, string_map map); #endif