]> git.cworth.org Git - wordgame/blobdiff - dict.c
Hide implementation details of dict in dict-impl.h. Add automatic dependency computat...
[wordgame] / dict.c
diff --git a/dict.c b/dict.c
index 98c9476ce08ba09c99043d1c770249e8a3b929ac..a3f088f0e084277416ce6ba3bd754cdee5abfacb 100644 (file)
--- 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)