Rev | Line | |
---|
[25ae32e] | 1 | #include <stdlib.h> |
---|
| 2 | #include <string.h> |
---|
| 3 | #include "common_tok.h" |
---|
| 4 | |
---|
| 5 | char dictionary[255]; |
---|
| 6 | |
---|
| 7 | void process_tok_options(gengetopt_args_info args) |
---|
| 8 | { |
---|
| 9 | if(args.dictionary_given) |
---|
| 10 | strcpy(dictionary, args.dictionary_arg); |
---|
| 11 | else { |
---|
| 12 | char path[256]; |
---|
| 13 | sprintf(path, "/etc/utt/%s", DICT_FILE); |
---|
| 14 | if (file_accessible(path) == 0) |
---|
| 15 | strcpy(dictionary, path); |
---|
| 16 | else { |
---|
| 17 | sprintf(path, "%s/.utt/%s", getenv("HOME"), DICT_FILE); |
---|
| 18 | if (file_accessible(path) == 0) |
---|
| 19 | strcpy(dictionary, path); |
---|
| 20 | else { |
---|
| 21 | fprintf(stderr, "Cannot find dictionary!\n"); |
---|
| 22 | exit(1); |
---|
| 23 | } |
---|
| 24 | } |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.