OLD | NEW |
| (Empty) |
1 Index: hyphen.c | |
2 =================================================================== | |
3 RCS file: /cvsroot/hunspell/hyphen/hyphen.c,v | |
4 retrieving revision 1.8 | |
5 diff -u -r1.8 hyphen.c | |
6 --- hyphen.c 13 Sep 2012 07:50:49 -0000 1.8 | |
7 +++ hyphen.c 6 Feb 2013 17:31:51 -0000 | |
8 @@ -374,19 +374,28 @@ | |
9 HyphenDict * | |
10 hnj_hyphen_load (const char *fn) | |
11 { | |
12 + HyphenDict *result; | |
13 + FILE *f; | |
14 + f = fopen (fn, "r"); | |
15 + if (f == NULL) | |
16 + return NULL; | |
17 + | |
18 + result = hnj_hyphen_load_file(f); | |
19 + | |
20 + fclose(f); | |
21 + return result; | |
22 +} | |
23 + | |
24 +HyphenDict * | |
25 +hnj_hyphen_load_file (FILE *f) | |
26 +{ | |
27 HyphenDict *dict[2]; | |
28 HashTab *hashtab; | |
29 - FILE *f; | |
30 char buf[MAX_CHARS]; | |
31 int nextlevel = 0; | |
32 int i, j, k; | |
33 HashEntry *e; | |
34 int state_num = 0; | |
35 - | |
36 - f = fopen (fn, "r"); | |
37 - if (f == NULL) | |
38 - return NULL; | |
39 - | |
40 // loading one or two dictionaries (separated by NEXTLEVEL keyword) | |
41 for (k = 0; k < 2; k++) { | |
42 hashtab = hnj_hash_new (); | |
43 @@ -497,7 +506,6 @@ | |
44 #endif | |
45 state_num = 0; | |
46 } | |
47 - fclose(f); | |
48 if (nextlevel) dict[0]->nextlevel = dict[1]; | |
49 else { | |
50 dict[1] -> nextlevel = dict[0]; | |
51 Index: hyphen.h | |
52 =================================================================== | |
53 RCS file: /cvsroot/hunspell/hyphen/hyphen.h,v | |
54 retrieving revision 1.2 | |
55 diff -u -r1.2 hyphen.h | |
56 --- hyphen.h 27 Nov 2010 02:20:33 -0000 1.2 | |
57 +++ hyphen.h 6 Feb 2013 17:31:51 -0000 | |
58 @@ -90,7 +90,11 @@ | |
59 int new_state; | |
60 }; | |
61 | |
62 +#if 0 | |
63 +/* DO NOT USE, there are known problems with Unicode on Windows. */ | |
64 HyphenDict *hnj_hyphen_load (const char *fn); | |
65 +#endif | |
66 +HyphenDict *hnj_hyphen_load_file (FILE *f); | |
67 void hnj_hyphen_free (HyphenDict *dict); | |
68 | |
69 /* obsolete, use hnj_hyphen_hyphenate2() or *hyphenate3() functions) */ | |
OLD | NEW |