Subversion Repositories wimsdev

Rev

Rev 8161 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 reyssat 1
/*    Copyright (C) 2002-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis
2
 *
3
 *  This program is free software; you can redistribute it and/or modify
4
 *  it under the terms of the GNU General Public License as published by
5
 *  the Free Software Foundation; either version 2 of the License, or
6
 *  (at your option) any later version.
7
 *
8
 *  This program is distributed in the hope that it will be useful,
9
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 *  GNU General Public License for more details.
12
 *
13
 *  You should have received a copy of the GNU General Public License
14
 *  along with this program; if not, write to the Free Software
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
 */
17
 
18
#ifndef SYMTEXT_H
19
#define SYMTEXT_H 1
20
 
21
#include <stdio.h>
22
#include <stdlib.h>
23
#include <stdarg.h>
24
#include <ctype.h>
25
#include <unistd.h>
26
#include <math.h>
27
#include <string.h>
28
#include <sys/stat.h>
29
#include <sys/types.h>
30
#include <fcntl.h>
31
#include <errno.h>
32
#include <signal.h>
33
#include <time.h>
34
 
35
#include "lines.h"
36
 
37
        /* Maximum of string length. */
38
#define MAX_LINELEN (40*1024-1)
39
        /* Maximum of blocks. Limited to sizeof(short). */
40
#define MAX_BLOCKS      8192
41
        /* Maximum of pools. Limited to sizeof(short). */
42
#define MAX_POOLS       10240
43
        /* Maximum of variable names. */
44
#define MAX_NAMELEN     63
45
        /* Maximum of (complete) file names. */
46
#define MAX_FNAME       199
47
        /* Maximum of dictionaries, including reserved ones. */
48
#define MAX_DICS        15
49
        /* Maximum of lists in permdata. Very limited. */
50
#define MAX_PERMLIST    4
51
        /* Size of list buffer */
52
#define MAX_LISTS       65536
53
        /* Limit of the length of builtin command names */
54
#define MAX_BINAME      10
55
        /* Limit to nesting levels */
56
#define MAX_LEVELS      16384
57
        /* How many picks at most */
58
#define MAX_PICKS       64
59
        /* limit of entries in a dictionary */
60
#define MAX_DICENTRIES 512*1024
61
        /* limit of any single dictionary size */
62
#define MAX_DICSIZE     10240*1024
63
 
64
        /* int or short */
65
#define listtype        short int
66
        /* default dictionary directory */
67
#define defaultdir      "scripts"
68
 
69
#define char_punct      ".,;:?!\""
70
#define char_math       "+-*/=|%<>()_"
71
#define char_parenth    "()[]{}"
72
#define char_cs         "_&$#`\\@~"
73
#define char_quote      "`'\""
74
 
75
typedef struct block {
76
    char *string;               /* string for compare */
77
    int (*fn) (struct block *blk, char *start, int level);
78
    listtype nextblock, sublock;        /* subblocks are always consecutive */
79
    listtype len, lcnt, lind1, lind2, lstart, pool, mpool, mend;
80
    listtype *listlen;
81
    listtype *lists[MAX_PERMLIST];      /* permutation lists */
82
} block;
83
 
84
typedef struct poolstruct {
85
    listtype block, lastpool, ind1, ind2, dirty, len;
86
    char *string;
87
    listtype *tag;              /* level tags for recursion */
88
} poolstruct;
89
 
90
#endif
91