1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * Copyright (C) 2002-2017 Németh László
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
18 * Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
19 * Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,
20 * Goldman Eleonóra, Sarlós Tamás, Bencsáth Boldizsár, Halácsy Péter,
21 * Dvornik László, Gefferth András, Nagy Viktor, Varga Dániel, Chris Halls,
22 * Rene Engelhard, Bram Moolenaar, Dafydd Jones, Harri Pitkänen
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
41 #ifndef HUNSPELL_WARNING
43 #ifdef HUNSPELL_WARNING_ON
44 #define HUNSPELL_WARNING fprintf
46 // empty inline function to switch off warnings (instead of the C99 standard
48 static inline void HUNSPELL_WARNING(FILE*, const char*, ...) {}
61 #define CONTSIZE 65536
64 #define aeXPRODUCT (1 << 0)
65 #define aeUTF8 (1 << 1)
66 #define aeALIASF (1 << 2)
67 #define aeALIASM (1 << 3)
68 #define aeLONGCOND (1 << 4)
72 #define IN_CPD_BEGIN 1
74 #define IN_CPD_OTHER 3
77 #define SPELL_COMPOUND (1 << 0)
78 #define SPELL_FORBIDDEN (1 << 1)
79 #define SPELL_ALLCAP (1 << 2)
80 #define SPELL_NOCAP (1 << 3)
81 #define SPELL_INITCAP (1 << 4)
82 #define SPELL_ORIGCAP (1 << 5)
83 #define SPELL_WARN (1 << 6)
86 #define MAXCOMPOUND 10
88 #define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
92 #define FLAG unsigned short
93 #define FLAG_NULL 0x00
94 #define FREE_FLAG(a) a = 0
96 #define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
98 // timelimit: max. ~1/4 sec (process time on Linux) for
99 // for a suggestion, including max. ~/10 sec for a case
100 // sensitive plain or compound word suggestion, within
101 // ~1/20 sec long time consuming suggestion functions
102 #define TIMELIMIT_GLOBAL (CLOCKS_PER_SEC / 4)
103 #define TIMELIMIT_SUGGESTION (CLOCKS_PER_SEC / 10)
104 #define TIMELIMIT (CLOCKS_PER_SEC / 20)
106 #define MAXPLUSTIMER 100
114 typedef std::vector<std::string> mapentry;
115 typedef std::vector<FLAG> flagentry;
119 std::string pattern2;
120 std::string pattern3;