summaryrefslogtreecommitdiff
path: root/word.h
diff options
context:
space:
mode:
Diffstat (limited to 'word.h')
-rw-r--r--word.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/word.h b/word.h
index 691059b..fd31cb9 100644
--- a/word.h
+++ b/word.h
@@ -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*/