source: app/src/tok.c/common_tok.cc @ 25ae32e

help
Last change on this file since 25ae32e was 25ae32e, checked in by obrebski <obrebski@…>, 16 years ago

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@4 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

  • Property mode set to 100644
File size: 585 bytes
Line 
1#include <stdlib.h>
2#include <string.h>
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.