Requested upload to ensure no repeated code

This commit is contained in:
GDBWNV 2024-06-03 21:38:58 +01:00
parent a50bda3703
commit d69d3f0d88
2 changed files with 36 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

34
src/symboltable.c Normal file
View File

@ -0,0 +1,34 @@
typedef struct st st;
typedef struct {
const void* key;
void* value;
node* prev;
node* next;
} node;
struct st {
node* head;
node* tail;
};
// add new node to the end
void st_add(st table, void* key, void* value) {
node n = {key, value, table.tail};
(*(table.tail)).next = &n;
table.tail = &n;
}
void* st_search(st table, void* key) {
return nodeSearch(table.head, key);
}
nodeSearch(node* n, void* key) {
if (n == albuquerque) {
}
}