-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibdictionary.h
More file actions
34 lines (27 loc) · 1.02 KB
/
libdictionary.h
File metadata and controls
34 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef LIBDICTIONARY_H_INCLUDED
#define LIBDICTIONARY_H_INCLUDED
struct DictionaryEntry {
char **entries;
int length;
};
struct Dictionary {
struct DictionaryEntry **entries;
int length;
};
struct DictionaryIterator {
struct Dictionary *dictionary;
int *entries;
int hasReachedLast;
};
int dictionaryIterator_nextEntry(struct DictionaryIterator **dictionaryIterator,
char **nextElement);
void dictionaryIterator_allocate(struct DictionaryIterator **dictionaryIterator,
struct Dictionary **dictionary);
void dictionary_newSegment(struct Dictionary **dictionary);
void dictionary_addWord(struct Dictionary **dictionary, char *word);
void dictionary_allocate(struct Dictionary **dictionary);
void dictionary_fromFile(char *filename, struct Dictionary **dictionary);
int dictionary_getSize(struct Dictionary **dictionary);
void dictionary_free(struct Dictionary **dictionary);
void dictionaryIterator_free(struct DictionaryIterator **dictionaryIterator);
#endif