Back to index

wims  3.65+svn20090927
symtext.h
Go to the documentation of this file.
00001 /*    Copyright (C) 2002-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis
00002  *
00003  *  This program is free software; you can redistribute it and/or modify
00004  *  it under the terms of the GNU General Public License as published by
00005  *  the Free Software Foundation; either version 2 of the License, or
00006  *  (at your option) any later version.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00016  */
00017 
00018 #ifndef SYMTEXT_H
00019 #define SYMTEXT_H 1
00020 
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <stdarg.h>
00024 #include <ctype.h>
00025 #include <unistd.h>
00026 #include <math.h>
00027 #include <string.h>
00028 #include <sys/stat.h>
00029 #include <sys/types.h>
00030 #include <fcntl.h>
00031 #include <errno.h>
00032 #include <signal.h>
00033 #include <time.h>
00034 
00035 #include "lines.h"
00036 
00037        /* Maximum of string length. */
00038 #define MAX_LINELEN (40*1024-1)
00039        /* Maximum of blocks. Limited to sizeof(short). */
00040 #define MAX_BLOCKS   8192
00041        /* Maximum of pools. Limited to sizeof(short). */
00042 #define MAX_POOLS    10240
00043        /* Maximum of variable names. */
00044 #define MAX_NAMELEN  63
00045        /* Maximum of (complete) file names. */
00046 #define MAX_FNAME    199
00047        /* Maximum of dictionaries, including reserved ones. */
00048 #define MAX_DICS     15
00049        /* Maximum of lists in permdata. Very limited. */
00050 #define MAX_PERMLIST 4
00051        /* Size of list buffer */
00052 #define MAX_LISTS    65536
00053        /* Limit of the length of builtin command names */
00054 #define MAX_BINAME   10
00055        /* Limit to nesting levels */
00056 #define MAX_LEVELS   16384
00057        /* How many picks at most */
00058 #define MAX_PICKS    64
00059        /* limit of entries in a dictionary */
00060 #define MAX_DICENTRIES 512*1024
00061        /* limit of any single dictionary size */
00062 #define MAX_DICSIZE  10240*1024
00063 
00064        /* int or short */
00065 #define listtype     short int
00066        /* default dictionary directory */
00067 #define defaultdir   "scripts"
00068 
00069 #define char_punct   ".,;:?!\""
00070 #define char_math    "+-*/=|%<>()_"
00071 #define char_parenth "()[]{}"
00072 #define char_cs             "_&$#`\\@~"
00073 #define char_quote   "`'\""
00074 
00075 typedef struct block {
00076     char *string;           /* string for compare */
00077     int (*fn) (struct block *blk, char *start, int level);
00078     listtype nextblock, sublock;   /* subblocks are always consecutive */
00079     listtype len, lcnt, lind1, lind2, lstart, pool, mpool, mend;
00080     listtype *listlen;
00081     listtype *lists[MAX_PERMLIST]; /* permutation lists */
00082 } block;
00083 
00084 typedef struct poolstruct {
00085     listtype block, lastpool, ind1, ind2, dirty, len;
00086     char *string;
00087     listtype *tag;          /* level tags for recursion */
00088 } poolstruct;
00089 
00090 #endif
00091