Debian Codegraph @

Tests/FindASPELL/Test/main.c

raw
1 #include <aspell.h>
2 #include <assert.h>
3 #include <stdio.h>
4 #include <string.h>
5
6 int main(void)
7 {
8 AspellConfig* config = new_aspell_config();
9 assert(config && "Failed creating AspellConfig");
10
11 AspellCanHaveError* result = new_aspell_speller(config);
12 delete_aspell_config(config);
13 AspellSpeller* speller = to_aspell_speller(result);
14 assert(aspell_error_number(result) == 0 && "Failed creating AspellSpeller");
15
16 char const* word = "conjunction";
17
18 if (aspell_speller_check(speller, word, (int)strlen(word))) {
19 printf("Word \"%s\" is spelled correctly\n", word);
20 } else {
21 printf("Word \"%s\" is misspelled\n", word);
22 }
23
24 delete_aspell_speller(speller);
25
26 return 0;
27 }