source: _old/app/src/tok.c/common_tok.cc @ 1e121f4

Last change on this file since 1e121f4 was 1e121f4, checked in by Adam Kędziora <s301614@…>, 14 years ago

Replacing old implementation with working implementation

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