~ubuntu-branches/ubuntu/intrepid/ydpdict/intrepid

« back to all changes in this revision

Viewing changes to src/ydpconfig.c

  • Committer: Bazaar Package Importer
  • Author(s): Marcin Owsiany
  • Date: 2005-12-03 16:34:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051203163410-1wpo4yusify3g8cj
Tags: 0.65-1
* New upstream version
  - adds support for pl/de de/pl dictionary files
  - some fixes, including those for amd64 Closes: #341594, #338720, #338731
  - adds support for .ogg files
* debian/control:
  - adjusted description to de support
  - added upstream homepage URL to the description
* debian/rules: fixed (unused --libexecdir path to configure)
* debian/ydpdict.conf.example: removed
* debain/ydpdict.examples: use ydpdict.conf.example
* ydpdict.conf.example: changed mnt to media

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  ydpdict
3
 
 *  (c) 1998-2004 wojtek kaniewski <wojtekka@irc.pl>
 
3
 *  (C) Copyright 1998-2004 Wojtek Kaniewski <wojtekka@toxygen.net>
4
4
 *
5
5
 *  This program is free software; you can redistribute it and/or modify
6
6
 *  it under the terms of the GNU General Public License as published by
40
40
        { "version", no_argument, 0, 'v' },
41
41
        { "pol", no_argument, 0, 'p' },
42
42
        { "ang", no_argument, 0, 'a' },
 
43
        { "pol-niem", no_argument, 0, 'P' },
 
44
        { "niem-pol", no_argument, 0, 'D' },
43
45
        { "path", required_argument, 0, 't' },
44
46
        { "cdpath", required_argument, 0, 'c' },
45
47
        { "nopl", no_argument, 0, 'n' },
58
60
U�ycie: %s [OPCJE]\n\
59
61
  -a, --ang             uruchamia s�ownik angielsko-polski (domy�lne)\n\
60
62
  -p, --pol             uruchamia s�ownik polsko-angielski\n\
 
63
  -d, --niem-pol        uruchamia s�ownik niemiecko-polski\n\
 
64
  -o, --pol-niem        uruchamia s�ownik polsko-niemiecki\n\
61
65
  -n, --nopl            wy��cza wy�wietlanie polskich liter\n\
62
66
  -i, --iso             wy�wietla polskie literki w standardzie ISO-8859-2\n\
63
67
  -u, --unicode         wy�wietla polskie literki u�ywaj�c unikodu\n\
73
77
 
74
78
/* jakie�tam zmienne */
75
79
char *e_labels[] = E_LABELS;
76
 
int *e_vals[] = E_VALS;
 
80
void *e_vals[] = E_VALS;
77
81
char *color_defs[] = COLOR_DEFS;
78
82
int color_vals[] = COLOR_VALS;
79
83
 
88
92
        filespath = "./";
89
93
        use_color = 1;
90
94
        charset = 1;
91
 
        dict_ap = 1;
 
95
        dict = 1;
92
96
        config_text = COLOR_WHITE;
93
97
        config_cf1 = COLOR_CYAN | A_BOLD;
94
98
        config_cf2 = COLOR_GREEN | A_BOLD;
131
135
                                case 'c':
132
136
                                        for (y = 0; color_defs[y]; y++) {
133
137
                                                if (!strcasecmp(par, color_defs[y]))
134
 
                                                        *e_vals[x] = color_vals[y];
 
138
                                                        *(int*)(e_vals[x]) = color_vals[y];
135
139
                                        }
136
140
                                        break;
137
141
                                        
138
142
                                /* warto�� bool'owska: on lub off */
139
143
                                case 'b':
140
144
                                        if (!strncasecmp(par, "On", 2))
141
 
                                                *e_vals[x] = TRUE;
 
145
                                                *(int*)(e_vals[x]) = TRUE;
142
146
                                        if (!strncasecmp(par, "Of", 2))
143
 
                                                *e_vals[x] = FALSE;
 
147
                                                *(int*)(e_vals[x]) = FALSE;
144
148
                                        break;
145
149
                                        
146
150
                                /* warto�� ci�gu */
148
152
                                        *(char**)e_vals[x] = xstrdup(par);
149
153
                                        break;
150
154
 
 
155
                                /* liczba */
 
156
                                case 'i':
 
157
                                        *(int*)(e_vals[x]) = atoi(par);
 
158
                                        break;
 
159
 
151
160
                                /* zestaw znak�w */
152
161
                                case 'h':
153
162
                                        if (!strncasecmp(par, "No", 2))
173
182
        fclose(f);
174
183
  
175
184
#ifdef HAVE_GETOPT_LONG
176
 
        while ((optc = getopt_long(argc, argv, "hvVpaf:c:niuUw:", longopts, (int*) 0)) != -1) {
 
185
        while ((optc = getopt_long(argc, argv, "hvVpaodf:c:niuUw:", longopts, (int*) 0)) != -1) {
177
186
#else
178
 
        while ((optc = getopt(argc, argv, "hvVpaf:c:niuUw:")) != -1) {
 
187
        while ((optc = getopt(argc, argv, "hvVpaodf:c:niuUw:")) != -1) {
179
188
#endif
180
189
                switch(optc) {
181
190
                        case 'h':
186
195
                                printf("ydpdict-" VERSION "\n");
187
196
                                exit(0);
188
197
                        case 'p':
189
 
                                dict_ap = 0;
 
198
                                dict = 0;
190
199
                                break;
191
200
                        case 'a':
192
 
                                dict_ap = 1;
 
201
                                dict = 1;
 
202
                                break;
 
203
                        case 'o':
 
204
                                dict = 2;
 
205
                                break;
 
206
                        case 'd':
 
207
                                dict = 3;
193
208
                                break;
194
209
                        case 'n':
195
210
                                charset = 0;