update stuff
This commit is contained in:
parent
5973022688
commit
544ed8b045
194 changed files with 2060 additions and 1464 deletions
|
|
@ -10,9 +10,9 @@
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/char/isalpha.h"
|
||||
#include "me/char/char.h"
|
||||
#include "me/convert/str_to_numbers.h"
|
||||
#include "me/string/str_len.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/types.h"
|
||||
|
||||
#define OP_ADD 0b0001
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@
|
|||
/* ************************************************************************** */
|
||||
|
||||
|
||||
#include "me/char/isalpha.h"
|
||||
#include "me/char/char.h"
|
||||
#include "me/convert/str_to_numbers.h"
|
||||
#include "me/string/str_len.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/types.h"
|
||||
#include "me/printf/printf.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -14,19 +14,19 @@
|
|||
#include "me/hash/sip.h"
|
||||
#include "me/hashmap/hashmap_C__PREFIX__.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem_copy.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/types.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
t_hashmap_C__PREFIX__ *new_hashmap_C__PREFIX__(t_hash_C__PREFIX___fn hfunc,
|
||||
t_hashmap_C__PREFIX__ *hmap_new_C__PREFIX__(t_hash_C__PREFIX___fn hfunc,
|
||||
t_eq_C__PREFIX___fn cfunc,
|
||||
t_drop_C__PREFIX___fn drop)
|
||||
{
|
||||
return (new_hashmap_with_buckets_C__PREFIX__(hfunc, cfunc, drop,
|
||||
return (hmap_new_with_buckets_C__PREFIX__(hfunc, cfunc, drop,
|
||||
DEFAULT_BUCKETS));
|
||||
}
|
||||
|
||||
t_hashmap_C__PREFIX__ *new_hashmap_with_buckets_C__PREFIX__(
|
||||
t_hashmap_C__PREFIX__ *hmap_new_with_buckets_C__PREFIX__(
|
||||
t_hash_C__PREFIX___fn hfunc, t_eq_C__PREFIX___fn cfunc,
|
||||
t_drop_C__PREFIX___fn drop, t_usize buckets)
|
||||
{
|
||||
|
|
@ -46,7 +46,7 @@ t_hashmap_C__PREFIX__ *new_hashmap_with_buckets_C__PREFIX__(
|
|||
return (hmap);
|
||||
}
|
||||
|
||||
void drop_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap)
|
||||
void hmap_free_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap)
|
||||
{
|
||||
t_usize index;
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ void drop_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap)
|
|||
mem_free(hmap);
|
||||
}
|
||||
|
||||
t_entry_C__PREFIX__ *hashmap_get_entry_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap,
|
||||
t_entry_C__PREFIX__ *hmap_get_entry_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap,
|
||||
t_usize hashed_key,
|
||||
C__KEYTYPE__ *key,
|
||||
t_entry_C__PREFIX__ **prev)
|
||||
|
|
@ -88,7 +88,7 @@ t_entry_C__PREFIX__ *hashmap_get_entry_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap,
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
void insert_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap, C__KEYTYPE__ key,
|
||||
void hmap_insert_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap, C__KEYTYPE__ key,
|
||||
C__VALTYPE__ value)
|
||||
{
|
||||
t_usize hashed_key;
|
||||
|
|
@ -98,7 +98,7 @@ void insert_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap, C__KEYTYPE__ key,
|
|||
hmap->hfunc(&hmap->hasher, &key);
|
||||
hashed_key = hasher_reset_and_finish(&hmap->hasher);
|
||||
prev = NULL;
|
||||
entry = hashmap_get_entry_C__PREFIX__(hmap, hashed_key, &key, &prev);
|
||||
entry = hmap_get_entry_C__PREFIX__(hmap, hashed_key, &key, &prev);
|
||||
if (entry == NULL)
|
||||
{
|
||||
entry = mem_alloc(sizeof(t_entry_C__PREFIX__));
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "me/hashmap/hashmap_C__PREFIX__.h"
|
||||
|
||||
t_error hashmap_C__PREFIX___iter(t_hashmap_C__PREFIX__ *self,
|
||||
t_error hmap_C__PREFIX___iter(t_hashmap_C__PREFIX__ *self,
|
||||
t_error (*func)(t_usize idx,
|
||||
const C__KEYTYPE__ *key,
|
||||
C__VALTYPE__ *val, void *ctx),
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
#include "me/hash/sip.h"
|
||||
#include "me/hashmap/hashmap_C__PREFIX__.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem_copy.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/types.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
C__VALTYPE__ *get_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap,
|
||||
C__VALTYPE__ *hmap_get_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap,
|
||||
C__KEYTYPE__ *key)
|
||||
{
|
||||
t_usize hashed_key;
|
||||
|
|
@ -26,13 +26,13 @@ C__VALTYPE__ *get_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap,
|
|||
|
||||
hmap->hfunc(&hmap->hasher, key);
|
||||
hashed_key = hasher_reset_and_finish(&hmap->hasher);
|
||||
entry = hashmap_get_entry_C__PREFIX__(hmap, hashed_key, key, &prev);
|
||||
entry = hmap_get_entry_C__PREFIX__(hmap, hashed_key, key, &prev);
|
||||
if (entry == NULL)
|
||||
return (NULL);
|
||||
return (&entry->kv.val);
|
||||
}
|
||||
|
||||
void remove_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap, C__KEYTYPE__ *key)
|
||||
void hmap_remove_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap, C__KEYTYPE__ *key)
|
||||
{
|
||||
t_usize hashed_key;
|
||||
t_entry_C__PREFIX__ *prev;
|
||||
|
|
@ -42,7 +42,7 @@ void remove_hashmap_C__PREFIX__(t_hashmap_C__PREFIX__ *hmap, C__KEYTYPE__ *key)
|
|||
hashed_key = hasher_reset_and_finish(&hmap->hasher);
|
||||
hmap->hasher = hasher_sip13_new();
|
||||
prev = NULL;
|
||||
entry = hashmap_get_entry_C__PREFIX__(hmap, hashed_key, key, &prev);
|
||||
entry = hmap_get_entry_C__PREFIX__(hmap, hashed_key, key, &prev);
|
||||
if (entry == NULL)
|
||||
return;
|
||||
if (prev == NULL)
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/mem/mem_alloc_array.h"
|
||||
#include "me/mem/mem_copy.h"
|
||||
#include "me/mem/mem_set_zero.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/types.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/vec/vec_C__PREFIX__.h"
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/mem/mem_alloc_array.h"
|
||||
#include "me/mem/mem_copy.h"
|
||||
#include "me/mem/mem_set_zero.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/types.h"
|
||||
#include "me/vec/vec_C__PREFIX__.h"
|
||||
#include <stdlib.h>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/mem/mem_alloc_array.h"
|
||||
#include "me/mem/mem_copy.h"
|
||||
#include "me/mem/mem_set_zero.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/types.h"
|
||||
#include "me/vec/vec_C__PREFIX__.h"
|
||||
#include <stdlib.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue