chore: fix repo compilation after rebase with main

c-web-server
Jef Roosens 2023-05-29 18:40:36 +02:00
parent acbe8dc314
commit 7913201f89
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
15 changed files with 15 additions and 26 deletions

View File

@ -79,7 +79,7 @@ $(TARGETS_MEM_TEST): test-mem-%: %
.PHONY: build-test
build-test: $(BINS_TEST)
$(BINS_TEST): %: %.c.o $(BIN)
$(BINS_TEST): %: %.c.o
$(CC) \
$^ -o $@

View File

@ -50,14 +50,14 @@ int main() {
info("Initializing trie");
Trie *trie = trie_init();
int count = trie_populate(trie, "lander.data");
Trie *trie;
TrieExitCode res = trie_init(&trie, "lander.data");
if (count < 0) {
if (res != Ok) {
critical(1, "An error occured while populating the trie.");
}
info("Trie initialized and populated with %i entries", count);
info("Trie initialized and populated with %i entries", trie_size(trie));
http_loop_gctx *gctx = http_loop_gctx_init();
gctx->trie = trie;

View File

@ -5,8 +5,8 @@
#include <string.h>
#include "trie.h"
#include "trie_entry.c"
#include "trie_node.c"
#include "trie_entry.h"
#include "trie_node.h"
typedef struct ttrie {
TrieNode *root;

View File

@ -1,4 +1,4 @@
#include "trie.h"
#include "trie_entry.h"
#include <stdlib.h>
EntryType entry_type_from_char(char c) {

View File

@ -0,0 +1,7 @@
#include "trie.h"
EntryType entry_type_from_char(char c);
char entry_type_to_char(EntryType et);
Entry *entry_new(EntryType type, const char *string);

View File

@ -1,8 +0,0 @@
include_directories(include)
if(CMAKE_BUILD_TYPE MATCHES "^Test")
enable_testing()
add_subdirectory(test)
endif()
add_library(trie STATIC include/trie.h src/trie.c)

View File

@ -1,4 +0,0 @@
# Trie design
This trie is a modified version of the custom trie I had to implement for my
Algorithms & Datastructures 3 course.

View File

@ -1,6 +0,0 @@
add_compile_options(-Wno-incompatible-pointer-types)
add_executable(test_trie test_trie.c ../src/trie.c)
add_test(NAME test_trie COMMAND test_trie)
add_executable(test_trie_fuzzy test_trie_fuzzy.c ../src/trie.c)
add_test(NAME test_trie_fuzzy COMMAND test_trie_fuzzy)