source: src/tok.c/common_tok.cc

Last change on this file was 5f4d9c3, checked in by Maciej Prill <mprill@…>, 13 years ago

Rewritten the build system, added lem UTF-8 version.

  • Property mode set to 100644
File size: 583 bytes
Line 
1#include <cstdlib>
2#include <cstring>
3#include "common_tok.h"
4
5char dictionary[255];
6
7void 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.