X-Git-Url: https://git.cworth.org/git?p=wordgame;a=blobdiff_plain;f=dict.c;h=a3f088f0e084277416ce6ba3bd754cdee5abfacb;hp=98c9476ce08ba09c99043d1c770249e8a3b929ac;hb=17755d5a91f1470057bf2308984a25e7432bcd8a;hpb=2eb18813b84ae8ad4faeb92b1d8570599135d537 diff --git a/dict.c b/dict.c index 98c9476..a3f088f 100644 --- a/dict.c +++ b/dict.c @@ -227,8 +227,14 @@ trie_print_unseen (trie_t *trie, string_t *word) } void -dict_init (dict_t *dict, - const char *filename) +dict_init (dict_t *dict) +{ + dict->trie = trie_create (); +} + +void +dict_add_words_from_file (dict_t *dict, + const char *filename) { FILE *file; char *line = NULL; @@ -242,8 +248,6 @@ dict_init (dict_t *dict, exit (1); } - dict->trie = trie_create (); - while (1) { bytes_read = getline (&line, &line_size, file); if (bytes_read == -1)