-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (delete): Added a hashmap delete function
- Loading branch information
Showing
17 changed files
with
249 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
push: | ||
|
||
jobs: | ||
tests: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,4 +53,5 @@ dkms.conf | |
|
||
build | ||
.direnv | ||
result | ||
result | ||
/debug.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <string.h> | ||
|
||
#include "key.h" | ||
#include "hash.h" | ||
|
||
th_key_t th_key_new(th_any_t data, size_t size) | ||
{ | ||
return (th_key_t) { | ||
.hash = th_hash(data, size), | ||
.size = size, | ||
.data = data, | ||
}; | ||
} | ||
|
||
bool th_key_is_equal(th_key_t *first, th_key_t *second) | ||
{ | ||
if (first->size != second->size) return false; | ||
|
||
return memcmp(first->data, second->data, first->size) == 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __TINYHASH_KEY_H__ | ||
#define __TINYHASH_KEY_H__ | ||
|
||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <stdbool.h> | ||
|
||
#include "types.h" | ||
|
||
typedef struct { | ||
uint32_t hash; | ||
int size; | ||
th_any_t data; | ||
} th_key_t; | ||
|
||
th_key_t th_key_new(th_any_t data, size_t size); | ||
|
||
bool th_key_is_equal(th_key_t *first, th_key_t *second); | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.