diff options
author | JSDurand <mmemmew@gmail.com> | 2022-01-12 20:26:08 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2022-01-12 20:26:08 +0800 |
commit | 5730d6c04258e192195bfbbbed76d68fd78ed458 (patch) | |
tree | 92e64bd9576155000cf462ed1db3624e3bed3f8d /src/Makefile.am | |
parent | 91016bd3855375796fd1eabd501ebc12491f2655 (diff) |
Implement a simple hash table.
It is a very basic and simple hash table. It is so simple that I
hesitate to call it a hash table. Anyways, I think it suffices for my
purposes here.
* Makefile.am: Add necessary files.
* grammar.c (new_tnt_string): Formatting.
* ht.c (new_ht): Constructor
(destroy_ht): Destructor
(ht_expand): Rehash
(ht_insert, ht_delete, ht_find): Main functions.
* list.c (add_to_list, list_assure_size): Modify the use of realloc.
* test/check_ht.c: Ensure this is working correctly.
* util.c (read_entire_file): Modify the use of realloc.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r-- | src/Makefile.am | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index f43fbee..a708ba4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,9 +2,9 @@ AM_CFLAGS = -Wall -Wextra noinst_LIBRARIES = libeps.a libeps_a_SOURCES = grammar.c list.c util.c reader.c \ -str.c utf8.c dfa.c \ +str.c utf8.c dfa.c ht.c \ grammar.h list.h util.h reader.h \ -str_partial.h str.h utf8.h dfa.h +str_partial.h str.h utf8.h dfa.h ht.h libeps_a_CFLAGS = $(AM_CFLAGS) --pedantic @@ -21,7 +21,8 @@ CLEANFILES = TAGS # tests -check_PROGRAMS = check_list check_grammar check_reader check_dfa +check_PROGRAMS = check_list check_grammar check_reader check_dfa \ +check_ht check_list_SOURCES = test/check_list.c list.c @@ -33,6 +34,8 @@ str.c utf8.c util.c check_dfa_SOURCES = test/check_dfa.c dfa.c list.c str.c utf8.c +check_ht_SOURCES = test/check_ht.c ht.c + TESTS = $(check_PROGRAMS) AM_COLOR_TESTS = always |