chore: fix repo compilation after rebase with main
parent
acbe8dc314
commit
7913201f89
2
Makefile
2
Makefile
|
@ -79,7 +79,7 @@ $(TARGETS_MEM_TEST): test-mem-%: %
|
||||||
.PHONY: build-test
|
.PHONY: build-test
|
||||||
build-test: $(BINS_TEST)
|
build-test: $(BINS_TEST)
|
||||||
|
|
||||||
$(BINS_TEST): %: %.c.o $(BIN)
|
$(BINS_TEST): %: %.c.o
|
||||||
$(CC) \
|
$(CC) \
|
||||||
$^ -o $@
|
$^ -o $@
|
||||||
|
|
||||||
|
|
|
@ -50,14 +50,14 @@ int main() {
|
||||||
|
|
||||||
info("Initializing trie");
|
info("Initializing trie");
|
||||||
|
|
||||||
Trie *trie = trie_init();
|
Trie *trie;
|
||||||
int count = trie_populate(trie, "lander.data");
|
TrieExitCode res = trie_init(&trie, "lander.data");
|
||||||
|
|
||||||
if (count < 0) {
|
if (res != Ok) {
|
||||||
critical(1, "An error occured while populating the trie.");
|
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();
|
http_loop_gctx *gctx = http_loop_gctx_init();
|
||||||
gctx->trie = trie;
|
gctx->trie = trie;
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "trie.h"
|
#include "trie.h"
|
||||||
#include "trie_entry.c"
|
#include "trie_entry.h"
|
||||||
#include "trie_node.c"
|
#include "trie_node.h"
|
||||||
|
|
||||||
typedef struct ttrie {
|
typedef struct ttrie {
|
||||||
TrieNode *root;
|
TrieNode *root;
|
|
@ -1,4 +1,4 @@
|
||||||
#include "trie.h"
|
#include "trie_entry.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
EntryType entry_type_from_char(char c) {
|
EntryType entry_type_from_char(char c) {
|
|
@ -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);
|
|
@ -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)
|
|
|
@ -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.
|
|
|
@ -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)
|
|
Loading…
Reference in New Issue