1 --- misc/hunspell-1.2.8/intl/localename.c 2007-04-06 10:05:34.000000000 +0200
2 +++ misc/build/hunspell-1.2.8/intl/localename.c 2008-11-01 16:30:49.000000000 +0100
5 # define LANG_SINDHI 0x59
8 +# define LANG_SORBIAN 0x2e
11 # define LANG_SLOVAK 0x1b
13 --- misc/hunspell-1.2.8/src/hunspell/affixmgr.cxx 2008-11-01 08:00:41.000000000 +0100
14 +++ misc/build/hunspell-1.2.8/src/hunspell/affixmgr.cxx 2008-11-01 16:30:49.000000000 +0100
23 AffixMgr::AffixMgr(const char * affpath, HashMgr** ptr, int * md, const char * key)
25 // register hash manager and load affix data from aff file
27 while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
28 !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
29 (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) ||
30 - (numdefcpd && defcpd_check(&words, wnum + 1, rv, NULL,1))))) {
31 + (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))))) {
32 rv = rv->next_homonym;
35 --- misc/hunspell-1.2.8/src/hunspell/affixmgr.hxx 2008-10-30 21:28:59.000000000 +0100
36 +++ misc/build/hunspell-1.2.8/src/hunspell/affixmgr.hxx 2008-11-01 16:30:49.000000000 +0100
38 #define _AFFIXMGR_HXX_
41 -#ifdef __SUNPRO_CC // for SunONE Studio compiler
47 --- misc/hunspell-1.2.8/src/hunspell/atypes.hxx 2008-10-29 15:30:51.000000000 +0100
48 +++ misc/build/hunspell-1.2.8/src/hunspell/atypes.hxx 2008-11-01 16:30:49.000000000 +0100
55 #ifndef HUNSPELL_WARNING
56 #ifdef HUNSPELL_WARNING_ON
57 #define HUNSPELL_WARNING fprintf
58 --- misc/hunspell-1.2.8/src/hunspell/csutil.cxx Wed Oct 22 12:15:28 2008
59 +++ misc/build/hunspell-1.2.8/src/hunspell/csutil.cxx Thu Feb 19 18:13:34 2009
61 #include "langnum.hxx"
64 -# include <unicode/uchar.h>
65 +#include <unicode/uchar.h>
67 -# ifndef MOZILLA_CLIENT
68 -# include "utf_info.cxx"
69 -# define UTF_LST_LEN (sizeof(utf_lst) / (sizeof(unicode_info)))
71 +#ifndef MOZILLA_CLIENT
72 +#include "utf_info.cxx"
73 +#define UTF_LST_LEN (sizeof(utf_lst) / (sizeof(unicode_info)))
79 --- misc/hunspell-1.2.8/src/hunspell/filemgr.cxx Sat Nov 1 15:09:41 2008
80 +++ misc/build/hunspell-1.2.8/src/hunspell/filemgr.cxx Thu Feb 19 17:28:35 2009
86 #include "filemgr.hxx"
88 int FileMgr::fail(const char * err, const char * par) {
89 --- misc/hunspell-1.2.8/src/hunspell/filemgr.hxx Mon Aug 11 11:32:02 2008
90 +++ misc/build/hunspell-1.2.8/src/hunspell/filemgr.hxx Thu Feb 19 13:58:01 2009
98 char in[BUFSIZE + 50]; // input buffer
99 int fail(const char * err, const char * par);
100 --- misc/hunspell-1.2.8/src/hunspell/hashmgr.cxx Thu Aug 14 16:49:33 2008
101 +++ misc/build/hunspell-1.2.8/src/hunspell/hashmgr.cxx Thu Feb 19 17:25:33 2009
106 +//#ifdef __SUNPRO_CC // for SunONE Studio compiler
107 +//using namespace std;
116 -#include "hashmgr.hxx"
117 -#include "csutil.hxx"
118 -#include "atypes.hxx"
120 #ifdef MOZILLA_CLIENT
121 #ifdef __SUNPRO_CC // for SunONE Studio compiler
127 +#include "hashmgr.hxx"
128 +#include "csutil.hxx"
129 +#include "atypes.hxx"
131 // build a hash table from a munched word list
133 HashMgr::HashMgr(const char * tpath, const char * apath, const char * key)
137 al = decode_flags(&flags, ap + 1, dict);
139 + HUNSPELL_WARNING(stderr, "Can't allocate memory.\n");
142 flag_qsort(flags, 0, al);
147 int HashMgr::decode_flags(unsigned short ** result, char * flags, FileMgr * af) {
149 + if (*flags == '\0') {
150 + HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n", af->getlinenum());
155 case FLAG_LONG: { // two-character flags (1x2yZz -> 1x 2y Zz)
157 --- misc/hunspell-1.2.8/src/hunspell/hashmgr.hxx 2008-08-12 12:22:54.000000000 +0200
158 +++ misc/build/hunspell-1.2.8/src/hunspell/hashmgr.hxx 2009-02-19 12:57:11.780108100 +0100
161 #ifndef MOZILLA_CLIENT
163 +/* using namespace std; */
167 --- misc/hunspell-1.2.8/src/hunspell/hunspell.cxx Thu Oct 30 20:15:53 2008
168 +++ misc/build/hunspell-1.2.8/src/hunspell/hunspell.cxx Thu Feb 19 18:13:35 2009
171 +#pragma setlocale("C")
174 #include "license.hunspell"
175 #include "license.myspell"
181 -#include "hunspell.hxx"
182 -#include "hunspell.h"
184 -#include "csutil.hxx"
186 #ifndef MOZILLA_CLIENT
193 +#include "hunspell.hxx"
194 +#include "csutil.hxx"
196 Hunspell::Hunspell(const char * affpath, const char * dpath, const char * key)
200 char wspace[MAXWORDUTF8LEN];
201 w_char unicw[MAXWORDLEN];
202 // Hunspell supports XML input of the simplified API (see manual)
203 - if (strcmp(word, SPELL_XML) == 0) return 1;
204 + if (strncmp(word, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
205 + if (strcmp(word, SPELL_XML) == 0) return 1; // query XML interface support
209 int nc = strlen(word);
212 @@ -1854,89 +1860,3 @@
215 #endif // END OF HUNSPELL_EXPERIMENTAL CODE
217 -Hunhandle *Hunspell_create(const char * affpath, const char * dpath)
219 - return (Hunhandle*)(new Hunspell(affpath, dpath));
222 -Hunhandle *Hunspell_create_key(const char * affpath, const char * dpath,
225 - return (Hunhandle*)(new Hunspell(affpath, dpath, key));
228 -void Hunspell_destroy(Hunhandle *pHunspell)
230 - delete (Hunspell*)(pHunspell);
233 -int Hunspell_spell(Hunhandle *pHunspell, const char *word)
235 - return ((Hunspell*)pHunspell)->spell(word);
238 -char *Hunspell_get_dic_encoding(Hunhandle *pHunspell)
240 - return ((Hunspell*)pHunspell)->get_dic_encoding();
243 -int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word)
245 - return ((Hunspell*)pHunspell)->suggest(slst, word);
248 -int Hunspell_analyze(Hunhandle *pHunspell, char*** slst, const char * word)
250 - return ((Hunspell*)pHunspell)->analyze(slst, word);
253 -int Hunspell_stem(Hunhandle *pHunspell, char*** slst, const char * word)
255 - return ((Hunspell*)pHunspell)->stem(slst, word);
258 -int Hunspell_stem(Hunhandle *pHunspell, char*** slst, char** desc, int n)
260 - return ((Hunspell*)pHunspell)->stem(slst, desc, n);
263 -int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word,
264 - const char * word2)
266 - return ((Hunspell*)pHunspell)->generate(slst, word, word2);
269 -int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word,
270 - char** desc, int n)
272 - return ((Hunspell*)pHunspell)->generate(slst, word, desc, n);
275 - /* functions for run-time modification of the dictionary */
277 - /* add word to the run-time dictionary */
279 -int Hunspell_add(Hunhandle *pHunspell, const char * word) {
280 - return ((Hunspell*)pHunspell)->add(word);
283 - /* add word to the run-time dictionary with affix flags of
284 - * the example (a dictionary word): Hunspell will recognize
285 - * affixed forms of the new word, too.
288 -int Hunspell_add_with_affix(Hunhandle *pHunspell, const char * word,
289 - const char * example) {
290 - return ((Hunspell*)pHunspell)->add_with_affix(word, example);
293 - /* remove word from the run-time dictionary */
295 -int Hunspell_remove(Hunhandle *pHunspell, const char * word) {
296 - return ((Hunspell*)pHunspell)->remove(word);
299 -void Hunspell_free_list(Hunhandle *pHunspell, char *** slst, int n) {
302 --- misc/hunspell-1.2.8/src/hunspell/hunspell.hxx 2008-07-09 16:14:39.000000000 +0200
303 +++ misc/build/hunspell-1.2.8/src/hunspell/hunspell.hxx 2008-11-26 18:32:58.765625000 +0100
309 -class DLLEXPORT Hunspell
315 HashMgr* pHMgr[MAXDIC];
316 --- misc/hunspell-1.2.8/src/hunspell/hunzip.cxx Tue Jun 17 10:57:55 2008
317 +++ misc/build/hunspell-1.2.8/src/hunspell/hunzip.cxx Thu Feb 19 17:29:19 2009
322 +using namespace std;
323 #include "hunzip.hxx"
325 #define CODELEN 65536
326 --- misc/hunspell-1.2.8/src/hunspell/hunzip.hxx Thu Feb 19 15:59:42 2009
327 +++ misc/build/hunspell-1.2.8/src/hunspell/hunzip.hxx Thu Feb 19 18:13:35 2009
329 #define MSG_MEMORY "error: %s: missing memory\n"
330 #define MSG_KEY "error: %s: missing or bad password\n"
337 --- misc/hunspell-1.2.8/src/hunspell/license.hunspell 2008-06-17 10:57:55.000000000 +0200
338 +++ misc/build/hunspell-1.2.8/src/hunspell/license.hunspell 2008-11-01 16:30:49.000000000 +0100
341 * ***** END LICENSE BLOCK ***** */
344 --- misc/hunspell-1.2.8/src/hunspell/makefile.mk Tue Jun 17 10:57:55 2008
345 +++ misc/build/hunspell-1.2.8/src/hunspell/makefile.mk Thu Feb 19 18:13:52 2009
348 #*************************************************************************
351 +PRJ = ../../../../../..
357 +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
359 #----- Settings ---------------------------------------------------------
362 # --- Files --------------------------------------------------------
364 # all_target: ALLTAR DICTIONARY
368 ##CXXFLAGS += -I..$/..$/lingutil
369 ##CFLAGSCXX += -I..$/..$/lingutil
371 $(SLO)$/utf_info.obj \
372 $(SLO)$/hashmgr.obj \
373 $(SLO)$/suggestmgr.obj \
374 + $(SLO)$/phonet.obj \
375 + $(SLO)$/hunzip.obj \
376 + $(SLO)$/filemgr.obj \
377 + $(SLO)$/replist.obj \
380 LIB1TARGET= $(SLB)$/lib$(TARGET).lib
381 --- misc/hunspell-1.2.8/src/hunspell/phonet.cxx 2008-08-13 15:29:08.000000000 +0200
382 +++ misc/build/hunspell-1.2.8/src/hunspell/phonet.cxx 2008-11-01 16:30:49.000000000 +0100
387 +using namespace std;
391 --- misc/hunspell-1.2.8/src/hunspell/replist.cxx Sat Nov 1 15:09:51 2008
392 +++ misc/build/hunspell-1.2.8/src/hunspell/replist.cxx Thu Feb 19 14:02:51 2009
395 #include "replist.hxx"
396 #include "csutil.hxx"
397 +using namespace std;
399 RepList::RepList(int n) {
400 dat = (replentry **) malloc(sizeof(replentry *) * n);
401 --- misc/hunspell-1.2.8/src/tools/analyze.cxx Tue Jun 17 13:44:50 2008
402 +++ misc/build/hunspell-1.2.8/src/tools/analyze.cxx Thu Feb 19 18:13:35 2009
407 -#include "hunspell.hxx"
413 +#include "hunspell.hxx"
417 int main(int argc, char **argv)
419 --- misc/hunspell-1.2.8/src/tools/chmorph.cxx Tue Jun 17 12:15:34 2008
420 +++ misc/build/hunspell-1.2.8/src/tools/chmorph.cxx Thu Feb 19 17:36:46 2009
425 -#include "hunspell.hxx"
426 -#include "textparser.hxx"
432 +#include "hunspell.hxx"
433 +#include "textparser.hxx"
436 main(int argc, char** argv)
438 --- misc/hunspell-1.2.8/src/tools/example.cxx Tue Jun 17 13:07:24 2008
439 +++ misc/build/hunspell-1.2.8/src/tools/example.cxx Thu Feb 19 17:38:12 2009
444 +using namespace std;
446 #include "hunspell.hxx"
448 extern char * mystrdup(const char * s);
450 -using namespace std;
453 main(int argc, char** argv)
455 --- misc/hunspell-1.2.8/src/tools/hunspell.cxx 2008-09-04 15:44:19.000000000 +0200
456 +++ misc/build/hunspell-1.2.8/src/tools/hunspell.cxx 2008-11-01 16:31:24.000000000 +0100
463 +using namespace std;
469 #include "hunspell.hxx"
470 #include "csutil.hxx"
472 +// switch off iconv support for tests (fixing Solaris problems)
475 #ifndef HUNSPELL_EXTRA
476 #define suggest_auto suggest
482 +#ifdef HAVE_LANGINFO_CODESET
483 #include <langinfo.h>
487 #ifdef HAVE_LIBINTL_H
489 @@ -1385,9 +1397,11 @@
491 ui_lang = setlocale(LC_ALL, "");
492 textdomain("hunspell");
493 +#ifdef HAVE_LANGINFO_CODESET
494 ui_enc = nl_langinfo(CODESET);
500 rl_set_key("
\e\e", rl_escape, rl_get_keymap());
501 --- misc/hunspell-1.2.8/src/tools/hunzip.cxx Tue Jan 15 11:10:04 2008
502 +++ misc/build/hunspell-1.2.8/src/tools/hunzip.cxx Thu Feb 19 17:38:12 2009
507 +using namespace std;
509 #include "hunzip.hxx"
511 #define DESC "hunzip - decompress a hzip file to the standard output\n" \
512 --- misc/hunspell-1.2.8/src/tools/hzip.c Fri Apr 4 15:20:10 2008
513 +++ misc/build/hunspell-1.2.8/src/tools/hzip.c Thu Feb 19 18:13:35 2009
515 if (tree->type != code_NODE) {
518 - if (tree->type == code_TERM) i = CODELEN; // terminal code
519 + if (tree->type == code_TERM) i = CODELEN;
520 table[i] = malloc((deep + 1) * sizeof(char));
521 strcpy(table[i], code);
527 -// return length of the freq array
529 int get_freqdata(struct item *** dest, FILE * f, unsigned short * termword) {
533 (*dest)[n]->word = i;
536 - // terminal sequence (also contains the last odd byte of the file)
538 (*dest)[n] = newitem(1, NULL, NULL, code_TERM);
539 *termword = *((unsigned short *) c);
541 @@ -134,20 +134,20 @@
545 - // header and codes
546 - fprintf(f2, "%s", (key ? MAGIC_ENCRYPTED : MAGIC)); // 3-byte HEADER
548 + fprintf(f2, "%s", (key ? MAGIC_ENCRYPTED : MAGIC));
549 cl = (unsigned char) (n & 0x00ff);
550 ch = (unsigned char) (n >> 8);
553 for (cs = 0; *enc; enc++) cs ^= *enc;
554 - fprintf(f2, "%c", cs); // 1-byte check sum
555 + fprintf(f2, "%c", cs);
558 if ((*(++enc)) == '\0') enc = key;
561 - fprintf(f2, "%c%c", ch, cl); // upper and lower byte of record count
562 + fprintf(f2, "%c%c", ch, cl);
563 for (i = 0; i < BUFSIZE; i++) bitbuf[i] = '\0';
564 for (i = 0; i < CODELEN + 1; i++) if (table[i]) {
565 unsigned short * d = (unsigned short *) &c;
567 if (*(++enc) == '\0') enc = key;
570 - fprintf(f2, "%c%c", c[0], c[1]); // 2-character code id
571 + fprintf(f2, "%c%c", c[0], c[1]);
573 write_bits(f2, bitbuf, &bits, table[i]);
575 @@ -169,11 +169,11 @@
576 if (*(++enc) == '\0') enc = key;
579 - } else fprintf(f2, "%c", (unsigned char) bits); // 1-byte code length
580 - fwrite(bitbuf, sizeof(char), bits/8 + 1, f2); // x-byte code
581 + } else fprintf(f2, "%c", (unsigned char) bits);
582 + fwrite(bitbuf, sizeof(char), bits/8 + 1, f2);
588 while((cx[0] = getc(f)) != -1 && (cx[1] = getc(f)) != -1) {
592 write_bits(f2, bitbuf, &bits, table[*((unsigned short *) c)]);
594 - // terminal suffixes
596 write_bits(f2, bitbuf, &bits, table[CODELEN]);
597 if (bits > 0) fwrite(bitbuf, sizeof(char), bits/8 + 1, f2);
599 @@ -201,11 +201,11 @@
602 if (i > 0 && buf[i - 1] == '\n') {
603 - if (j == i) j--; // line duplicate
607 if (c == '\t') c = 30;
610 for (; buf[i - m - 2] == prev[prevlen - m - 2] &&
611 m < i - j - 1 && m < 15; m++);
617 - *p = m + 31; // 33-46
621 if (i > 0 && buf[i - 1] == '\n') {