1 /*  an - Anagram generator
2     Copyright (C) 2012  Paul Martin <pm@debian.org>
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License along
15     with this program; if not, write to the Free Software Foundation, Inc.,
16     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #ifndef WORDS_H
20 #define WORDS_H
21 
22 #include "bitfield.h"
23 
24 #define LONGEST_WORD 128
25 
26 struct word {
27     char *utf8_form;
28     int length;
29     struct bitfield *bits;
30 };
31 
32 struct wordlist {
33     struct word *word;
34     struct wordlist *next;
35 };
36 
37 void free_word(struct word *word);
38 
39 void add_word(struct wordlist **words, UChar *alphabet,
40               struct bitfield *masterbits, int maxlen, int minlen,
41               const char *word);
42 
43 void load_words(struct wordlist **words, UChar *alphabet,
44                 struct bitfield *masterbits, int maxlen, int minlen,
45                 const char *filename);
46 
47 struct wordlist *push_wordstack(struct wordlist *stack, struct word* word);
48 
49 struct wordlist *pop_wordstack(struct wordlist *stack);
50 
51 void print_wordstack(struct wordlist *stack);
52 
53 #endif /* WORDS_H */
54