~ubuntu-branches/ubuntu/precise/cuneiform/precise

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rling/sources/c/speldici.c

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk
  • Date: 2010-09-14 15:53:54 UTC
  • mto: (5.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100914155354-i3uu2woc5aucphax
Tags: upstream-1.0.0+dfsg
ImportĀ upstreamĀ versionĀ 1.0.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
Copyright (c) 1993-2008, Cognitive Technologies
3
 
All rights reserved.
4
 
 
5
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½,
6
 
ļæ½ļæ½ļæ½ ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½:
7
 
 
8
 
      * ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
9
 
        ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
10
 
        ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
11
 
      * ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½
12
 
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
13
 
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½
14
 
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
15
 
      * ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ Cognitive Technologies, ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½
16
 
        ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
17
 
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
18
 
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
19
 
 
20
 
ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ "ļæ½ļæ½ļæ½
21
 
ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½" ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½-ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
22
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ ļæ½ļæ½
23
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½. ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
24
 
ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½
25
 
ļæ½ļæ½ŃØļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½
26
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
27
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ (ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
28
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½-ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
29
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
30
 
ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½), ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½
31
 
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
32
 
 
33
 
Redistribution and use in source and binary forms, with or without modification,
34
 
are permitted provided that the following conditions are met:
35
 
 
36
 
    * Redistributions of source code must retain the above copyright notice,
37
 
      this list of conditions and the following disclaimer.
38
 
    * Redistributions in binary form must reproduce the above copyright notice,
39
 
      this list of conditions and the following disclaimer in the documentation
40
 
      and/or other materials provided with the distribution.
41
 
    * Neither the name of the Cognitive Technologies nor the names of its
42
 
      contributors may be used to endorse or promote products derived from this
43
 
      software without specific prior written permission.
44
 
 
45
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46
 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47
 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48
 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
49
 
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50
 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51
 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
52
 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53
 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
 
*/
 
2
 Copyright (c) 1993-2008, Cognitive Technologies
 
3
 All rights reserved.
 
4
 
 
5
 Š Š°Š·Ń€ŠµŃˆŠ°ŠµŃ‚ся ŠæŠ¾Š²Ń‚Š¾Ń€Š½Š¾Šµ Ń€Š°ŃŠæрŠ¾ŃŃ‚Ń€Š°Š½ŠµŠ½ŠøŠµ Šø ŠøсŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Š½ŠøŠµ ŠŗŠ°Šŗ Š² Š²ŠøŠ“Šµ ŠøсхŠ¾Š“Š½Š¾Š³Š¾ ŠŗŠ¾Š“Š°,
 
6
 Ń‚Š°Šŗ Šø Š² Š“Š²Š¾ŠøчŠ½Š¾Š¹ Ń„Š¾Ń€Š¼Šµ, Ń ŠøŠ·Š¼ŠµŠ½ŠµŠ½ŠøяŠ¼Šø ŠøŠ»Šø Š±ŠµŠ·, ŠæрŠø ŃŠ¾Š±Š»ŃŽŠ“ŠµŠ½ŠøŠø ŃŠ»ŠµŠ“ующŠøх ŃƒŃŠ»Š¾Š²ŠøŠ¹:
 
7
 
 
8
 * ŠŸŃ€Šø ŠæŠ¾Š²Ń‚Š¾Ń€Š½Š¾Š¼ Ń€Š°ŃŠæрŠ¾ŃŃ‚Ń€Š°Š½ŠµŠ½ŠøŠø ŠøсхŠ¾Š“Š½Š¾Š³Š¾ ŠŗŠ¾Š“Š° Š“Š¾Š»Š¶Š½Ń‹ Š¾ŃŃ‚Š°Š²Š°Ń‚ŃŒŃŃ ŃƒŠŗŠ°Š·Š°Š½Š½Š¾Šµ
 
9
 Š²Ń‹ŃˆŠµ ŃƒŠ²ŠµŠ“Š¾Š¼Š»ŠµŠ½ŠøŠµ Š¾Š± Š°Š²Ń‚Š¾Ń€ŃŠŗŠ¾Š¼ ŠæрŠ°Š²Šµ, ŃŃ‚Š¾Ń‚ ŃŠæŠøсŠ¾Šŗ ŃƒŃŠ»Š¾Š²ŠøŠ¹ Šø ŠæŠ¾ŃŠ»ŠµŠ“ующŠøŠ¹
 
10
 Š¾Ń‚ŠŗŠ°Š· Š¾Ń‚ Š³Š°Ń€Š°Š½Ń‚ŠøŠ¹.
 
11
 * ŠŸŃ€Šø ŠæŠ¾Š²Ń‚Š¾Ń€Š½Š¾Š¼ Ń€Š°ŃŠæрŠ¾ŃŃ‚Ń€Š°Š½ŠµŠ½ŠøŠø Š“Š²Š¾ŠøчŠ½Š¾Š³Š¾ ŠŗŠ¾Š“Š° Š² Š“Š¾ŠŗуŠ¼ŠµŠ½Ń‚Š°Ń†ŠøŠø Šø/ŠøŠ»Šø Š²
 
12
 Š“руŠ³Šøх Š¼Š°Ń‚ŠµŃ€ŠøŠ°Š»Š°Ń…, ŠæŠ¾ŃŃ‚Š°Š²Š»ŃŠµŠ¼Ń‹Ń… ŠæрŠø Ń€Š°ŃŠæрŠ¾ŃŃ‚Ń€Š°Š½ŠµŠ½ŠøŠø, Š“Š¾Š»Š¶Š½Ń‹ ŃŠ¾Ń…Ń€Š°Š½ŃŃ‚ŃŒŃŃ
 
13
 ŃƒŠŗŠ°Š·Š°Š½Š½Š°Ń Š²Ń‹ŃˆŠµ ŠøŠ½Ń„Š¾Ń€Š¼Š°Ń†Šøя Š¾Š± Š°Š²Ń‚Š¾Ń€ŃŠŗŠ¾Š¼ ŠæрŠ°Š²Šµ, ŃŃ‚Š¾Ń‚ ŃŠæŠøсŠ¾Šŗ ŃƒŃŠ»Š¾Š²ŠøŠ¹ Šø
 
14
 ŠæŠ¾ŃŠ»ŠµŠ“ующŠøŠ¹ Š¾Ń‚ŠŗŠ°Š· Š¾Ń‚ Š³Š°Ń€Š°Š½Ń‚ŠøŠ¹.
 
15
 * ŠŠø Š½Š°Š·Š²Š°Š½ŠøŠµ Cognitive Technologies, Š½Šø ŠøŠ¼ŠµŠ½Š° ŠµŠµ ŃŠ¾Ń‚Ń€ŃƒŠ“Š½ŠøŠŗŠ¾Š² Š½Šµ Š¼Š¾Š³ŃƒŃ‚
 
16
 Š±Ń‹Ń‚ŃŒ ŠøсŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Š½Ń‹ Š² ŠŗŠ°Ń‡ŠµŃŃ‚Š²Šµ ŃŃ€ŠµŠ“стŠ²Š° ŠæŠ¾Š“Š“ŠµŃ€Š¶ŠŗŠø Šø/ŠøŠ»Šø ŠæрŠ¾Š“Š²ŠøŠ¶ŠµŠ½Šøя
 
17
 ŠæрŠ¾Š“уŠŗтŠ¾Š², Š¾ŃŠ½Š¾Š²Š°Š½Š½Ń‹Ń… Š½Š° ŃŃ‚Š¾Š¼ ŠŸŠž, Š±ŠµŠ· ŠæрŠµŠ“Š²Š°Ń€ŠøтŠµŠ»ŃŒŠ½Š¾Š³Š¾ ŠæŠøсьŠ¼ŠµŠ½Š½Š¾Š³Š¾
 
18
 Ń€Š°Š·Ń€ŠµŃˆŠµŠ½Šøя.
 
19
 
 
20
 Š­Š¢Š ŠŸŠ ŠžŠ“Š ŠŠœŠœŠ ŠŸŠ Š•Š”ŠžŠ”Š¢ŠŠ’Š›Š•ŠŠ Š’Š›ŠŠ”Š•Š›Š¬Š¦ŠŠœŠ˜ ŠŠ’Š¢ŠžŠ Š”ŠšŠ˜Š„ ŠŸŠ ŠŠ’ Š˜/Š˜Š›Š˜ Š”Š Š£Š“Š˜ŠœŠ˜ Š›Š˜Š¦ŠŠœŠ˜ "ŠšŠŠš
 
21
 ŠžŠŠ Š•Š”Š¢Š¬" Š‘Š•Š— ŠšŠŠšŠžŠ“Šž-Š›Š˜Š‘Šž Š’Š˜Š”Š Š“ŠŠ ŠŠŠ¢Š˜Š™, Š’Š«Š ŠŠ–Š•ŠŠŠ«Š„ ŠÆŠ’ŠŠž Š˜Š›Š˜ ŠŸŠžŠ”Š ŠŠ—Š£ŠœŠ•Š’ŠŠ•ŠœŠ«Š„,
 
22
 Š’ŠšŠ›Š®Š§ŠŠÆ Š“ŠŠ ŠŠŠ¢Š˜Š˜ ŠšŠžŠœŠœŠ•Š Š§Š•Š”ŠšŠžŠ™ Š¦Š•ŠŠŠžŠ”Š¢Š˜ Š˜ ŠŸŠ Š˜Š“ŠžŠ”ŠŠžŠ”Š¢Š˜ Š”Š›ŠÆ ŠšŠžŠŠšŠ Š•Š¢ŠŠžŠ™ Š¦Š•Š›Š˜, ŠŠž ŠŠ•
 
23
 ŠžŠ“Š ŠŠŠ˜Š§Š˜Š’ŠŠÆŠ”Š¬ Š˜ŠœŠ˜. ŠŠ˜ Š’Š›ŠŠ”Š•Š›Š•Š¦ ŠŠ’Š¢ŠžŠ Š”ŠšŠ˜Š„ ŠŸŠ ŠŠ’ Š˜ ŠŠ˜ ŠžŠ”ŠŠž Š”Š Š£Š“ŠžŠ• Š›Š˜Š¦Šž, ŠšŠžŠ¢ŠžŠ ŠžŠ•
 
24
 ŠœŠžŠ–Š•Š¢ Š˜Š—ŠœŠ•ŠŠÆŠ¢Š¬ Š˜/Š˜Š›Š˜ ŠŸŠžŠ’Š¢ŠžŠ ŠŠž Š ŠŠ”ŠŸŠ ŠžŠ”Š¢Š ŠŠŠÆŠ¢Š¬ ŠŸŠ ŠžŠ“Š ŠŠœŠœŠ£, ŠŠ˜ Š’ ŠšŠžŠ•Šœ Š”Š›Š£Š§ŠŠ• ŠŠ•
 
25
 ŠŠ•Š”ŠŠ¢ ŠžŠ¢Š’Š•Š¢Š”Š¢Š’Š•ŠŠŠžŠ”Š¢Š˜, Š’ŠšŠ›Š®Š§ŠŠÆ Š›Š®Š‘Š«Š• ŠžŠ‘Š©Š˜Š•, Š”Š›Š£Š§ŠŠ™ŠŠ«Š•, Š”ŠŸŠ•Š¦Š˜ŠŠ›Š¬ŠŠ«Š• Š˜Š›Š˜
 
26
 ŠŸŠžŠ”Š›Š•Š”ŠžŠ’ŠŠ’ŠØŠ˜Š• Š£Š‘Š«Š¢ŠšŠ˜, Š”Š’ŠÆŠ—ŠŠŠŠ«Š• Š” Š˜Š”ŠŸŠžŠ›Š¬Š—ŠžŠ’ŠŠŠ˜Š•Šœ Š˜Š›Š˜ ŠŸŠžŠŠ•Š”Š•ŠŠŠ«Š• Š’Š”Š›Š•Š”Š”Š¢Š’Š˜Š•
 
27
 ŠŠ•Š’ŠžŠ—ŠœŠžŠ–ŠŠžŠ”Š¢Š˜ Š˜Š”ŠŸŠžŠ›Š¬Š—ŠžŠ’ŠŠŠ˜ŠÆ ŠŸŠ ŠžŠ“Š ŠŠœŠœŠ« (Š’ŠšŠ›Š®Š§ŠŠÆ ŠŸŠžŠ¢Š•Š Š˜ Š”ŠŠŠŠ«Š„, Š˜Š›Š˜ Š”ŠŠŠŠ«Š•,
 
28
 Š”Š¢ŠŠ’ŠØŠ˜Š• ŠŠ•Š“ŠžŠ”ŠŠ«ŠœŠ˜, Š˜Š›Š˜ Š£Š‘Š«Š¢ŠšŠ˜ Š˜/Š˜Š›Š˜ ŠŸŠžŠ¢Š•Š Š˜ Š”ŠžŠ„ŠžŠ”ŠžŠ’, ŠŸŠžŠŠ•Š”Š•ŠŠŠ«Š• Š˜Š—-Š—Š Š”Š•Š™Š”Š¢Š’Š˜Š™
 
29
 Š¢Š Š•Š¢Š¬Š˜Š„ Š›Š˜Š¦ Š˜/Š˜Š›Š˜ ŠžŠ¢ŠšŠŠ—Š ŠŸŠ ŠžŠ“Š ŠŠœŠœŠ« Š ŠŠ‘ŠžŠ¢ŠŠ¢Š¬ Š”ŠžŠ’ŠœŠ•Š”Š¢ŠŠž Š” Š”Š Š£Š“Š˜ŠœŠ˜ ŠŸŠ ŠžŠ“Š ŠŠœŠœŠŠœŠ˜,
 
30
 ŠŠž ŠŠ• ŠžŠ“Š ŠŠŠ˜Š§Š˜Š’ŠŠÆŠ”Š¬ Š­Š¢Š˜ŠœŠ˜ Š”Š›Š£Š§ŠŠÆŠœŠ˜), ŠŠž ŠŠ• ŠžŠ“Š ŠŠŠ˜Š§Š˜Š’ŠŠÆŠ”Š¬ Š˜ŠœŠ˜, Š”ŠŠ–Š• Š•Š”Š›Š˜ Š¢ŠŠšŠžŠ™
 
31
 Š’Š›ŠŠ”Š•Š›Š•Š¦ Š˜Š›Š˜ Š”Š Š£Š“ŠžŠ• Š›Š˜Š¦Šž Š‘Š«Š›Š˜ Š˜Š—Š’Š•Š©Š•ŠŠ« Šž Š’ŠžŠ—ŠœŠžŠ–ŠŠžŠ”Š¢Š˜ Š¢ŠŠšŠ˜Š„ Š£Š‘Š«Š¢ŠšŠžŠ’ Š˜ ŠŸŠžŠ¢Š•Š Š¬.
 
32
 
 
33
 Redistribution and use in source and binary forms, with or without modification,
 
34
 are permitted provided that the following conditions are met:
 
35
 
 
36
 * Redistributions of source code must retain the above copyright notice,
 
37
 this list of conditions and the following disclaimer.
 
38
 * Redistributions in binary form must reproduce the above copyright notice,
 
39
 this list of conditions and the following disclaimer in the documentation
 
40
 and/or other materials provided with the distribution.
 
41
 * Neither the name of the Cognitive Technologies nor the names of its
 
42
 contributors may be used to endorse or promote products derived from this
 
43
 software without specific prior written permission.
 
44
 
 
45
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 
46
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
47
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
48
 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 
49
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
50
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
51
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
52
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
53
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
54
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
55
 */
56
56
 
57
57
/**************************************************************************/
58
58
/*                         -- Updation history. --                        */
66
66
//            28-June-93 ). Release has been received from Joe by FEDERAL
67
67
//            mail.
68
68
//
69
 
// 1. Function < BYTE * load_stat_dict ( CHAR  *point ) > has
 
69
// 1. Function < uchar * load_stat_dict ( char  *point ) > has
70
70
//    been rewritten to use new strems technology.
71
71
//    Parameter CountryCode in the load_stat_dict has been removed.
72
 
//    The global variable BYTE language is used now to check current
 
72
//    The global variable uchar language is used now to check current
73
73
//    language settings. All IO operations have been changed to use
74
74
//    data streams from IOLIB.H.
75
75
// 2. Functions < void user_voc_init (void) > and < static void
76
76
//    unload_user_dicts(void) > have been added after Joe.
77
 
// 3. Function < void load_user_dicts ( PSTR list_name, CHAR  *
 
77
// 3. Function < void load_user_dicts ( char * list_name, char  *
78
78
//    point) > has been rewritten after Joe.
79
 
// 4. Function < LONG read_all_voc( INT seqn, CHAR *name, CHAR  *p ) >
 
79
// 4. Function < int32_t read_all_voc( int16_t seqn, char *name, char  *p ) >
80
80
//    has been removed with new streams technology.
81
81
//
82
82
// 08-14-93 06:01pm, Mike
83
83
//
84
 
// 5. Function < BYTE * load_stat_dict ( CHAR  *point ) > has
 
84
// 5. Function < uchar * load_stat_dict ( char  *point ) > has
85
85
//    been changed to load ALL tables at once. Speller's standalone module
86
86
//    MAIN.C need to be changed !!!
87
87
//
96
96
#include <string.h>
97
97
#include <stdio.h>
98
98
 
99
 
  #include "spelmode.h"
100
 
  #include "nt_types.h"
101
 
  #include "recdefs.h"
102
 
  #include "lang.h"
103
 
 
104
 
  #include "speldefs.h"
105
 
  #include "spelfunc.h"
106
 
  #include "udicfunc.h"
107
 
  #include "tigeremulate.h"
108
 
 
109
 
  #ifndef MAXPATH
110
 
    #define MAXPATH 128
111
 
  #endif
 
99
#include "spelmode.h"
 
100
 
 
101
#include "recdefs.h"
 
102
#include "lang.h"
 
103
 
 
104
#include "speldefs.h"
 
105
#include "spelfunc.h"
 
106
#include "udicfunc.h"
 
107
#include "tigeremulate.h"
 
108
 
 
109
#ifndef MAXPATH
 
110
#define MAXPATH 128
 
111
#endif
112
112
 
113
113
/**************************************************************************/
114
114
/***********      Export section.       ***********************************/
119
119
// Parameter CountryCode has been removed.
120
120
// 12-09-93 ATAL
121
121
// This function have tu return proper pointer, never NULL !
122
 
void * (*my_alloc)(Word32 len);
123
 
void   (*my_free)(void * );
124
 
void    ErrorExit(int Code);
125
 
//DWORD  LoadUserDict( CHAR*, CHAR*, DWORD, voc_state*);
126
 
 
127
 
  BYTE  * load_stat_dict ( CHAR  *point );
128
 
    /*---------- Updated : 04-01-93 09:46pm, Mike ------
129
 
     Function loads static dictionary file into far memory location
130
 
     <point> The side effect is initialization of decoder table
131
 
     by call of function dectable_init(). New static dictionary
132
 
     format is used : all tables in the one file.
133
 
     Returns far pointer to the next available memory block.
134
 
     --------------------------------------------------*/
135
 
 
136
 
  void init_stat_dict ( struct dict_state * dict );
137
 
    /*-----------------17-02-93 03:21pm-----------------
138
 
     Function copies static dictionary control structure from far memory
139
 
     <load_dict> into NEAR control structure <dict>.
140
 
     --------------------------------------------------*/
 
122
void * (*my_alloc)(uint32_t len);
 
123
void (*my_free)(void *);
 
124
void ErrorExit(int Code);
 
125
//uint32_t  LoadUserDict( char*, char*, uint32_t, voc_state*);
 
126
 
 
127
uchar * load_stat_dict(char *point);
 
128
/*---------- Updated : 04-01-93 09:46pm, Mike ------
 
129
 Function loads static dictionary file into far memory location
 
130
 <point> The side effect is initialization of decoder table
 
131
 by call of function dectable_init(). New static dictionary
 
132
 format is used : all tables in the one file.
 
133
 Returns far pointer to the next available memory block.
 
134
 --------------------------------------------------*/
 
135
 
 
136
void init_stat_dict(struct dict_state * dict);
 
137
/*-----------------17-02-93 03:21pm-----------------
 
138
 Function copies static dictionary control structure from far memory
 
139
 <load_dict> into NEAR control structure <dict>.
 
140
 --------------------------------------------------*/
141
141
 
142
142
// 08-13-93 08:55pm, Mike
143
 
// Return type has been changed from <BYTE  *> to <void>
144
 
  void load_user_dicts ( PSTR list_name, CHAR  * point );
145
 
    /*-----------------17-02-93 03:30pm-----------------
146
 
     Function loads user's dictionaries into memory by
147
 
     list of vocs.
148
 
     --------------------------------------------------*/
 
143
// Return type has been changed from <uchar  *> to <void>
 
144
void load_user_dicts(char * list_name, char * point);
 
145
/*-----------------17-02-93 03:30pm-----------------
 
146
 Function loads user's dictionaries into memory by
 
147
 list of vocs.
 
148
 --------------------------------------------------*/
149
149
void unload_user_dicts(void);
150
150
 
151
151
// 08-13-93 06:35pm, Mike after Joe...
152
 
  extern LONG read_all_vtab (INT seqn, CHAR  *p);
 
152
extern int32_t read_all_vtab(int16_t seqn, char *p);
153
153
 
154
154
/* -- Data -- */
155
155
 
156
 
  struct dict_state  * load_dict = NULL;    //Allex 09.07.98
157
 
    /*-----------------17-02-93 02:49pm-----------------
158
 
     Global work pointer to static dictionary control structure.
159
 
     --------------------------------------------------*/
 
156
struct dict_state * load_dict = NULL; //Allex 09.07.98
 
157
/*-----------------17-02-93 02:49pm-----------------
 
158
 Global work pointer to static dictionary control structure.
 
159
 --------------------------------------------------*/
160
160
 
161
161
user_voc voc_array[MAX_VOC_NUMBER];
162
 
INT real_voc_no =0;
 
162
int16_t real_voc_no = 0;
163
163
 
164
164
// 08-13-93 06:35pm, Mike after Joe...
165
 
extern INT vocs_NOK;
 
165
extern int16_t vocs_NOK;
166
166
 
167
167
/**************************************************************************/
168
168
/***********      Import section.       ***********************************/
169
169
/**************************************************************************/
170
170
/* -- Code -- */
171
171
 
172
 
  INT    cond_open ( INT seqn, PBYTE name, WORD b1, WORD b2 );
173
 
  PBYTE  seq_nam   ( INT seqn );
174
 
  PCHAR  full_name ( PBYTE w, PBYTE n );
175
 
 
 
172
int16_t cond_open(int16_t seqn, puchar name, uint16_t b1, uint16_t b2);
 
173
puchar seq_nam(int16_t seqn);
 
174
pchar full_name(puchar w, puchar n);
176
175
 
177
176
/* -- Data -- */
178
177
 
179
 
  extern BYTE alphabet[][ABCSIZE];
 
178
extern uchar alphabet[][ABCSIZE];
180
179
 
181
 
  extern CHAR tiger_dir[40];
 
180
extern char tiger_dir[40];
182
181
 
183
182
/**************************************************************************/
184
183
/***********      Locals section.     *************************************/
186
185
/* -- Code -- */
187
186
 
188
187
// 08-13-93 06:32pm, Mike
189
 
//  LONG  read_all_voc(INT seqn, CHAR *name, CHAR  *p);
 
188
//  int32_t  read_all_voc(int16_t seqn, char *name, char  *p);
190
189
//    /*-----------------17-02-93 02:27pm-----------------
191
190
//     Function reads an dictionary file with name <name>
192
191
//     or with number <seqn> into far memory location <p>.
193
192
//     --------------------------------------------------*/
194
193
 
195
 
  static  INT   parce_voc_list_record ( PSTR w, PSTR  nm, INT *type );
196
 
 
 
194
static int16_t parce_voc_list_record(char * w, char * nm, int16_t *type);
197
195
 
198
196
/**************************************************************************/
199
197
/***********      Code section.      **************************************/
200
198
/**************************************************************************/
201
199
 
202
 
BYTE * load_stat_dict ( CHAR  *point )
203
 
    /*---------- Updated : 04-01-93 09:46pm, Mike ------
204
 
     Function loads static dictionary file into far memory location
205
 
     <point> The side effect is initialization of decoder table
206
 
     by call of function dectable_init(). New static dictionary
207
 
     format is used : all tables in the one file.
208
 
     Returns far pointer to the next available memory block.
209
 
     --------------------------------------------------*/
 
200
uchar * load_stat_dict(char *point)
 
201
/*---------- Updated : 04-01-93 09:46pm, Mike ------
 
202
 Function loads static dictionary file into far memory location
 
203
 <point> The side effect is initialization of decoder table
 
204
 by call of function dectable_init(). New static dictionary
 
205
 format is used : all tables in the one file.
 
206
 Returns far pointer to the next available memory block.
 
207
 --------------------------------------------------*/
210
208
{
211
 
  LONG              size;
212
 
  PTDictState       dict;
213
 
  PTDictHeaderMask  dictHdr;
214
 
  CHAR              nearBuf[65];
215
 
  DWORD             treeLength, tailsLength;
216
 
  DWORD             rulesLength, hushLength;
217
 
 
218
 
  if ( !InitializeAlphabet( language ))
219
 
  {
220
 
          ErrorExit(RLING_ERROR_CANT_OPEN_TABLE);
221
 
  }
222
 
 
 
209
        int32_t size;
 
210
        PTDictState dict;
 
211
        PTDictHeaderMask dictHdr;
 
212
        char nearBuf[65];
 
213
        uint32_t treeLength, tailsLength;
 
214
        uint32_t rulesLength, hushLength;
 
215
 
 
216
        if (!InitializeAlphabet(language)) {
 
217
                ErrorExit(RLING_ERROR_CANT_OPEN_TABLE);
 
218
        }
223
219
 
224
220
        /* -- Initialize control pointers. -- */
225
 
  load_dict = dict = (PTDictState) point;
226
 
  point += sizeof (TDictState);
227
 
 
228
 
    /* -- Read whole static dictionary file. -- */
229
 
  size = read_all_vtab( 7, point );
230
 
  if ( size == -1 )
231
 
  {
232
 
    #ifdef SYSPR_ERROR
233
 
      PRINTF("Unable to open TREE.VOC \n");
234
 
    #endif
235
 
          ErrorExit(RLING_ERROR_CANT_OPEN_TABLE);
236
 
      //return (BYTE  *)dict;
237
 
  }
238
 
  else
239
 
  {
240
 
    dict->size = size;
241
 
    dictHdr    = (PTDictHeaderMask)point;
242
 
  }
243
 
 
244
 
 
245
 
    /* -- Check correctness of file header. -- */
246
 
  memcpy( nearBuf, dictHdr->sign, sizeof(dictHdr->sign) );
247
 
  if ( memcmp( nearBuf, STAT_DICT_SIGN, sizeof(STAT_DICT_SIGN) ) ) {
248
 
    return (BYTE  *)dict;
249
 
  }
250
 
 
251
 
    /* -- Check CPU type for current data. -- */
 
221
        load_dict = dict = (PTDictState) point;
 
222
        point += sizeof(TDictState);
 
223
 
 
224
        /* -- Read whole static dictionary file. -- */
 
225
        size = read_all_vtab(7, point);
 
226
        if (size == -1) {
 
227
#ifdef SYSPR_ERROR
 
228
                PRINTF("Unable to open TREE.VOC \n");
 
229
#endif
 
230
                ErrorExit(RLING_ERROR_CANT_OPEN_TABLE);
 
231
                //return (uchar  *)dict;
 
232
        } else {
 
233
                dict->size = size;
 
234
                dictHdr = (PTDictHeaderMask) point;
 
235
        }
 
236
 
 
237
        /* -- Check correctness of file header. -- */
 
238
        memcpy(nearBuf, dictHdr->sign, sizeof(dictHdr->sign));
 
239
        if (memcmp(nearBuf, STAT_DICT_SIGN, sizeof(STAT_DICT_SIGN))) {
 
240
                return (uchar *) dict;
 
241
        }
 
242
 
 
243
        /* -- Check CPU type for current data. -- */
252
244
#ifdef PC_TYPE
253
 
  if ( dictHdr->cpuType[0] != 'I' ) {
254
 
    return (BYTE  *)dict;
255
 
  }
 
245
        if ( dictHdr->cpuType[0] != 'I' ) {
 
246
                return (uchar *)dict;
 
247
        }
256
248
#endif
257
249
#ifdef __MAC__
258
 
  if ( dictHdr->cpuType[0] != 'M' ) {
259
 
    return (BYTE  *)dict;
260
 
  }
261
 
#endif
262
 
 
263
 
 
264
 
    /* -- Get data section sizes. -- */
265
 
  treeLength = strtoul(dictHdr->treeLength, NULL, 10);
266
 
  tailsLength = strtoul(dictHdr->tailsLength, NULL, 10);
267
 
  rulesLength = strtoul(dictHdr->rulesLength, NULL, 10);
268
 
  hushLength = strtoul(dictHdr->hushLength, NULL, 10);
269
 
 
270
 
    /* -- Get alphabet size. -- */
271
 
  size = strtoul(dictHdr->abcSize, NULL, 10);
272
 
  if ( size > 64 ) {
273
 
    return (BYTE  *)dict;
274
 
  }
275
 
  else {
276
 
    dict->abcSize = (WORD)size;
277
 
  }
278
 
 
279
 
/*  -- Load decode tables. -- NEED TO THINK ABOUT !!!
280
 
--
281
 
--
282
 
*/
283
 
 
284
 
    /* -- Initialize decoder tables. */
285
 
  dectable_init();
286
 
 
287
 
    /* -- Set pointers for access procedure. -- */
288
 
  dict->root         = (BYTE  *)dictHdr + sizeof(TDictHeaderMask);
289
 
  dict->tailset_root = (BYTE  *)dict->root + treeLength;
290
 
  dict->vartable
291
 
      = (PTTailVar)((BYTE  *)dict->tailset_root + tailsLength);
292
 
  dict->table
293
 
      = (PTShiftType)((BYTE  *)dict->vartable + rulesLength);
294
 
 
295
 
    /* -- Check size corectness. -- */
296
 
  size = treeLength + tailsLength + rulesLength
297
 
                          + hushLength + sizeof(TDictHeaderMask);
298
 
 
299
 
 
300
 
  if ( (LONG)dict->size != size ) {
301
 
    return (BYTE  *)dict;
302
 
  }
303
 
 
304
 
// 08-14-93 05:50pm, Mike
305
 
//  Bolvano ( after Lepik )!!!!
306
 
//  If you want to use .ART and so on you need to load these files!!!!!
307
 
 
308
 
//  else {
309
 
//    return dict->root + dict->size;
310
 
//  }
311
 
 
312
 
// Here is the new version of dictionary loading.
313
 
 
314
 
  point = dict->root + dict->size;  // temp: for return value counting.
315
 
 
316
 
  if ( ( point = load_specABC( point, language) ) == NULL ) {
317
 
      #ifdef SYSPR
318
 
        PRINTF( "\n SPELLER: Unable to open Special voc...\n");
319
 
      #endif
320
 
    return (BYTE  *)dict;
321
 
  }
322
 
 
323
 
  if ( !loadArtBase( language )) {
324
 
      #ifdef SYSPR
325
 
        PRINTF( "\n SPELLER: Problems to load special"
326
 
                " replacement table...\n"
327
 
              );
328
 
      #endif
329
 
    return (BYTE  *)dict;
330
 
  }
331
 
 
332
 
  return point;
 
250
        if ( dictHdr->cpuType[0] != 'M' ) {
 
251
                return (uchar *)dict;
 
252
        }
 
253
#endif
 
254
 
 
255
        /* -- Get data section sizes. -- */
 
256
        treeLength = strtoul(dictHdr->treeLength, NULL, 10);
 
257
        tailsLength = strtoul(dictHdr->tailsLength, NULL, 10);
 
258
        rulesLength = strtoul(dictHdr->rulesLength, NULL, 10);
 
259
        hushLength = strtoul(dictHdr->hushLength, NULL, 10);
 
260
 
 
261
        /* -- Get alphabet size. -- */
 
262
        size = strtoul(dictHdr->abcSize, NULL, 10);
 
263
        if (size > 64) {
 
264
                return (uchar *) dict;
 
265
        } else {
 
266
                dict->abcSize = (uint16_t) size;
 
267
        }
 
268
 
 
269
        /*  -- Load decode tables. -- NEED TO THINK ABOUT !!!
 
270
         --
 
271
         --  memcpy( nearBuf, dictHdr->abcUpper, sizeof(dictHdr->abcUpper));
 
272
         --  memcpy( alphabet[0], nearBuf, sizeof(dictHdr->abcUpper) );
 
273
         --  memcpy( nearBuf, dictHdr->abcLower, sizeof(dictHdr->abcLower));
 
274
         --  memcpy( alphabet[1], nearBuf, sizeof(dictHdr->abcLower) );
 
275
         --
 
276
         */
 
277
 
 
278
        /* -- Initialize decoder tables. */
 
279
        dectable_init();
 
280
 
 
281
        /* -- Set pointers for access procedure. -- */
 
282
        dict->root = (uchar *) dictHdr + sizeof(TDictHeaderMask);
 
283
        dict->tailset_root = (uchar *) dict->root + treeLength;
 
284
        dict->vartable = (PTTailVar)((uchar *) dict->tailset_root + tailsLength);
 
285
        dict->table = (PTShiftType)((uchar *) dict->vartable + rulesLength);
 
286
 
 
287
        /* -- Check size corectness. -- */
 
288
        size = treeLength + tailsLength + rulesLength + hushLength
 
289
                        + sizeof(TDictHeaderMask);
 
290
 
 
291
        if ((int32_t) dict->size != size) {
 
292
                return (uchar *) dict;
 
293
        }
 
294
 
 
295
        // 08-14-93 05:50pm, Mike
 
296
        //  Bolvano ( after Lepik )!!!!
 
297
        //  If you want to use .ART and so on you need to load these files!!!!!
 
298
 
 
299
        //  else {
 
300
        //    return dict->root + dict->size;
 
301
        //  }
 
302
 
 
303
        // Here is the new version of dictionary loading.
 
304
 
 
305
        point = dict->root + dict->size; // temp: for return value counting.
 
306
 
 
307
        if ((point = load_specABC(point, language)) == NULL) {
 
308
#ifdef SYSPR
 
309
                PRINTF( "\n SPELLER: Unable to open Special voc...\n");
 
310
#endif
 
311
                return (uchar *) dict;
 
312
        }
 
313
 
 
314
        if (!loadArtBase(language)) {
 
315
#ifdef SYSPR
 
316
                PRINTF( "\n SPELLER: Problems to load special"
 
317
                                " replacement table...\n"
 
318
                );
 
319
#endif
 
320
                return (uchar *) dict;
 
321
        }
 
322
 
 
323
        return point;
333
324
}
334
325
 
335
326
/* ------------------------------------------------------------------ */
336
327
// 08-13-93 05:37pm, Mike
337
328
// Not needed with IOLIB.H
338
329
//
339
 
//LONG read_all_voc( INT seqn, CHAR *name, CHAR  *p )
 
330
//int32_t read_all_voc( int16_t seqn, char *name, char  *p )
340
331
//    /*-----------------17-02-93 02:27pm-----------------
341
332
//     Function reads an dictionary file with name <name>
342
333
//     or with number <seqn> into far memory location <p>.
343
334
//     --------------------------------------------------*/
344
335
//{
345
 
//  LONG l;
346
 
//  BYTE w[MAXPATH];
 
336
//  int32_t l;
 
337
//  uchar w[MAXPATH];
347
338
//
348
 
//  full_name( w, (PBYTE)name );
349
 
//  l = read_all_file( (PSTR)w, p );
 
339
//  full_name( w, (puchar)name );
 
340
//  l = read_all_file( (char *)w, p );
350
341
//  if ( l <= 0 ) {
351
 
//    full_name( w, (PBYTE)seq_nam( seqn ));
352
 
//    l =  read_all_file( (PSTR)w, p );
 
342
//    full_name( w, (puchar)seq_nam( seqn ));
 
343
//    l =  read_all_file( (char *)w, p );
353
344
//  }
354
345
//
355
346
//  return l;
361
348
//
362
349
/* ------------------------------------------------------------------ */
363
350
 
364
 
void init_stat_dict ( struct dict_state * dict )
365
 
    /*-----------------17-02-93 03:21pm-----------------
366
 
     Function copies static dictionary control structure from far memory
367
 
     <load_dict> into NEAR control structure <dict>.
368
 
     --------------------------------------------------*/
369
 
{
370
 
  memcpy ( dict, load_dict, sizeof(struct dict_state) );
371
 
}
372
 
 
373
 
/* ------------------------------------------------------------------ */
374
 
// 08-13-93 05:54pm, Mike
375
 
// From Joe...
376
 
 
377
 
void user_voc_init (void)
378
 
{
379
 
  real_voc_no = 0;
380
 
}
381
 
 
382
 
/* ------------------------------------------------------------------ */
383
 
// 08-13-93 05:54pm, Mike
384
 
// From Joe...
385
 
 
386
 
void unload_user_dicts(void)
387
 
{
388
 
  int i;
389
 
  for ( i=0; i < real_voc_no; i++) {
390
 
    my_free (voc_array[i].voc.vocseg/*,0*/);
391
 
  }
392
 
  real_voc_no = 0;
 
351
void init_stat_dict(struct dict_state * dict)
 
352
/*-----------------17-02-93 03:21pm-----------------
 
353
 Function copies static dictionary control structure from far memory
 
354
 <load_dict> into NEAR control structure <dict>.
 
355
 --------------------------------------------------*/
 
356
{
 
357
        memcpy(dict, load_dict, sizeof(struct dict_state));
 
358
}
 
359
 
 
360
/* ------------------------------------------------------------------ */
 
361
// 08-13-93 05:54pm, Mike
 
362
// From Joe...
 
363
 
 
364
void user_voc_init(void) {
 
365
        real_voc_no = 0;
 
366
}
 
367
 
 
368
/* ------------------------------------------------------------------ */
 
369
// 08-13-93 05:54pm, Mike
 
370
// From Joe...
 
371
 
 
372
void unload_user_dicts(void) {
 
373
        int i;
 
374
        for (i = 0; i < real_voc_no; i++) {
 
375
                my_free(voc_array[i].voc.vocseg/*,0*/);
 
376
        }
 
377
        real_voc_no = 0;
393
378
}
394
379
 
395
380
/* ------------------------------------------------------------------ */
397
382
#define VOCMEMSIZE 0x10000L     /* 64K */
398
383
// old version : read list of vocs from disk file USER.LST
399
384
 
400
 
void load_user_dicts_kzl ( PSTR list_name, CHAR  * point)
401
 
    /*-----------------17-02-93 03:30pm-----------------
402
 
     Function loads user's dictionaries into memory by
403
 
     list of vocs.
404
 
     --------------------------------------------------*/
 
385
void load_user_dicts_kzl(char * list_name, char * point)
 
386
/*-----------------17-02-93 03:30pm-----------------
 
387
 Function loads user's dictionaries into memory by
 
388
 list of vocs.
 
389
 --------------------------------------------------*/
405
390
{
406
 
  CHAR  w[MAXPATH], nm[MAXPATH];
407
 
  FILE *   lst;
408
 
  INT   type;
409
 
  INT   errorNo = 0;
410
 
 
411
 
  unload_user_dicts();
412
 
 
413
 
  lst = fopen ( list_name, "rt");
414
 
  if ( lst < 0 ) {
415
 
    return;
416
 
  }
417
 
 
418
 
  while ( fgets( w, MAXPATH, lst ) != NULL) {
419
 
 
420
 
    if (real_voc_no == MAX_VOC_NUMBER) {
421
 
      errorNo = VOC_TOOLARGELIST; break;
422
 
    }
423
 
 
424
 
    if ( ! parce_voc_list_record (w, nm, &type)) {
425
 
      continue;
426
 
    }
427
 
 
428
 
    if ( (point = my_alloc (VOCMEMSIZE)) == NULL) {
429
 
      errorNo = VOC_NOTLOADED;  break;
430
 
    }
431
 
 
432
 
    if ( LoadUserDict (nm, point, VOCMEMSIZE,
433
 
                &(voc_array[real_voc_no].voc)) == 0L )
434
 
    {
435
 
      my_free( point/*, 0*/ );
436
 
      errorNo = VOC_NOTLOADED;  break;
437
 
    }
438
 
 
439
 
    real_voc_no++;
440
 
  }
441
 
 
442
 
  fclose( lst );
443
 
  if ( errorNo != 0 )
444
 
  {
445
 
    ErrorExit ( /*ERR_voc,*/ errorNo );
446
 
  }
447
 
 
448
 
  return;
 
391
        char w[MAXPATH], nm[MAXPATH];
 
392
        FILE * lst;
 
393
        int16_t type;
 
394
        int16_t errorNo = 0;
 
395
 
 
396
        unload_user_dicts();
 
397
 
 
398
        lst = fopen(list_name, "rt");
 
399
        if (lst < 0) {
 
400
                return;
 
401
        }
 
402
 
 
403
        while (fgets(w, MAXPATH, lst) != NULL) {
 
404
 
 
405
                if (real_voc_no == MAX_VOC_NUMBER) {
 
406
                        errorNo = VOC_TOOLARGELIST;
 
407
                        break;
 
408
                }
 
409
 
 
410
                if (!parce_voc_list_record(w, nm, &type)) {
 
411
                        continue;
 
412
                }
 
413
 
 
414
                if ((point = my_alloc(VOCMEMSIZE)) == NULL) {
 
415
                        errorNo = VOC_NOTLOADED;
 
416
                        break;
 
417
                }
 
418
 
 
419
                if (LoadUserDict(nm, point, VOCMEMSIZE, &(voc_array[real_voc_no].voc))
 
420
                                == 0L) {
 
421
                        my_free(point/*, 0*/);
 
422
                        errorNo = VOC_NOTLOADED;
 
423
                        break;
 
424
                }
 
425
 
 
426
                real_voc_no++;
 
427
        }
 
428
 
 
429
        fclose(lst);
 
430
        if (errorNo != 0) {
 
431
                ErrorExit( /*ERR_voc,*/errorNo);
 
432
        }
 
433
 
 
434
        return;
449
435
}
450
436
//////////////////////////////////////////////////////////////////////////////
451
437
// list_of_name if concat many vocs name, cutting '\0', last limit is "\0\0"
453
439
 Function loads user's dictionaries into memory using
454
440
 list of names of vocabularies(in list_of_names).
455
441
 --------------------------------------------------*/
456
 
void load_user_dicts ( PSTR list_of_names, CHAR  * point)
457
 
{
458
 
        INT   type;
459
 
        INT   errorNo = 0;
460
 
        CHAR  nm[MAXPATH];
 
442
void load_user_dicts(char * list_of_names, char * point) {
 
443
        int16_t type;
 
444
        int16_t errorNo = 0;
 
445
        char nm[MAXPATH];
461
446
 
462
447
        unload_user_dicts();
463
448
 
464
 
        while ( (*list_of_names) != 0)
465
 
        {
466
 
                if (real_voc_no == MAX_VOC_NUMBER)
467
 
                {
 
449
        while ((*list_of_names) != 0) {
 
450
                if (real_voc_no == MAX_VOC_NUMBER) {
468
451
                        errorNo = RLING_ERROR_TOO_MANY_USER_DICTONARY;
469
452
                        break;
470
453
                }
471
454
 
472
 
                if ( ! parce_voc_list_record (list_of_names, nm, &type))
473
 
                {
 
455
                if (!parce_voc_list_record(list_of_names, nm, &type)) {
474
456
                        continue;
475
457
                }
476
458
 
477
 
                if ( (point = my_alloc (VOCMEMSIZE)) == NULL)
478
 
                {
479
 
                        errorNo = RLING_ERROR_CANT_OPEN_USER_DICTONARY;
480
 
                        break;
481
 
                }
482
 
 
483
 
                if ( LoadUserDict (nm, point, VOCMEMSIZE,
484
 
                        &(voc_array[real_voc_no].voc)) == 0L )
485
 
                {
486
 
                        my_free( point /*,0*/);
487
 
                        errorNo = RLING_ERROR_CANT_OPEN_USER_DICTONARY;
488
 
                        break;
489
 
                }
490
 
 
491
 
                list_of_names +=(strlen(list_of_names)+1);
 
459
                if ((point = my_alloc(VOCMEMSIZE)) == NULL) {
 
460
                        errorNo = RLING_ERROR_CANT_OPEN_USER_DICTONARY;
 
461
                        break;
 
462
                }
 
463
 
 
464
                if (LoadUserDict(nm, point, VOCMEMSIZE, &(voc_array[real_voc_no].voc))
 
465
                                == 0L) {
 
466
                        my_free(point /*,0*/);
 
467
                        errorNo = RLING_ERROR_CANT_OPEN_USER_DICTONARY;
 
468
                        break;
 
469
                }
 
470
 
 
471
                list_of_names += (strlen(list_of_names) + 1);
492
472
                real_voc_no++;
493
473
        }
494
474
 
495
 
        if ( errorNo != 0 )
496
 
        {
 
475
        if (errorNo != 0) {
497
476
                unload_user_dicts();
498
 
                ErrorExit ( errorNo );
 
477
                ErrorExit(errorNo);
499
478
        }
500
479
 
501
480
        return;
502
481
}
503
482
/* ------------------------------------------------------------------ */
504
483
 
505
 
INT parce_voc_list_record ( PSTR w, PSTR  nm, INT *type )
506
 
{
507
 
  *type = 0;
508
 
  while( (*w) && (*w == ' ') )w++;
509
 
  if ( (!*w)||(*w == '\n'))                return 0;
510
 
  while ( (*w != ' ') &&(*w!= 0) && ( *w != '\n') )
511
 
    *(nm++) = *(w++);
512
 
  *nm = 0;
513
 
  return 1;
 
484
int16_t parce_voc_list_record(char * w, char * nm, int16_t *type) {
 
485
        *type = 0;
 
486
        while ((*w) && (*w == ' '))
 
487
                w++;
 
488
        if ((!*w) || (*w == '\n'))
 
489
                return 0;
 
490
        while ((*w != ' ') && (*w != 0) && (*w != '\n'))
 
491
                *(nm++) = *(w++);
 
492
        *nm = 0;
 
493
        return 1;
514
494
}
515
495
 
516
496
/* ------------------------------------------------------------------ */