diff options
Diffstat (limited to 'word.h')
-rw-r--r-- | word.h | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -10,11 +10,11 @@ * * WordExtract is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with WordExtract. If not, see <http://www.gnu.org/licenses/>. + * along with WordExtract. If not, see <http://www.gnu.org/licenses/>. */ #ifndef WORD_H @@ -25,19 +25,29 @@ */ #define WORDLENGTH 25 -struct word { +#include "main.h" + +struct words { char *word; - struct word *lsibl; - struct word *rsibl; + struct words *lsibl; + struct words *rsibl; }; -typedef struct word Word; +typedef struct words Word; +typedef struct { + unsigned int count; + char **by_az; +} SortedWords; +/*binary tree of words from parsed file*/ extern Word *words; +/*sorted array of words*/ +extern SortedWords user_words; -int to_list(char *); -Word *add_word_record(Word *, char *); +Word *add_word(Word *, char *); +void del_word(Word **, char *); unsigned int get_words_count(const Word *); void free_words(Word *); -char **get_sorted(Word *); +SortedWords get_sorted(Word *); +void save_words(FILE *, SortedWords, SaveOpt); #endif /*WORD_H*/ |