root/staslova.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /* 
   2  *   Compound Text word statistics and search report
   3  *
   4  *   staslova.h : define & declaration
   5  *   $Id: staslova.h,v 1.3 2007/09/09 09:51:12 isao Exp $
   6  *                                       Copyright (c) isao yasuda,1998 
   7  */
   8 
   9 #include <stdio.h>
  10 #include <ctype.h>
  11 
  12 #ifndef STASLOVA
  13 #define STASLOVA 
  14                                   /* constant                             */
  15 #define ESC      '\x1B'           /* Escape character                     */
  16 #define ESCKANJI "\x1B\x24\x28"   /* JIS                                  */
  17 #define ESCASCII "\x1B\x28\x42"   /* ISO-646                              */
  18 #define ESC88591 "\x1B\x2D\x41"   /* ISO-8859-1 Latin No.1                */
  19 #define ESC88592 "\x1B\x2D\x42"   /* ISO-8859-2 Latin No.2                */
  20 #define ESC88595 "\x1B\x2D\x4C"   /* ISO-8859-5 Cyrillic                  */
  21 #define EXP      '0'              /* token is expression (not operator)   */
  22 #define STAT     0040             /* task mode statistics    00100000 x20 */
  23 #define MTCT     0100             /* task mode matching test 01000000 x40 */
  24 #define ASCII    0002             /* 00000010 x02                         */
  25 #define LATIN1   0004             /* 00000100 x04                         */
  26 #define LATIN2   0010             /* 00001000 x08                         */
  27 #define CYRIL    0020             /* 00010000 x10                         */
  28 #define JIS      0100             /* 01000000 x40                         */
  29 #define OTHER    0001             /* 00000001 x01                         */
  30 #define BASE     0040             /* 00100000 x20                         */
  31 #define CURRENT  1                /* current address parameter            */
  32 #define CONTEXT  2                /* newly alloc material address         */
  33 #define UNMATCH  0                /* symbol unmatch or false in matcing   */
  34 #define MATCH    1                /* symbol match or true in matcing      */
  35 #define NEXT     2                /* symbol next judge in matching        */
  36 #define NORMAL   0                /* error code normal                    */
  37 #define NOWORDS  1                /* error code no significant words      */
  38 #define IOEVENT  2                /* error code i/o processing EOF, etc   */
  39 #define MEMERR   3                /* error code memory allocation error   */
  40 #define IN       0                /* ESC sequence insert mode             */
  41 #define OUT      1                /* ESC sequence insert mode             */
  42 #define SEP      0                /* Separator check result code : yes    */
  43 #define NOSEP    1                /* Separator check result code : no     */
  44                                   /* definition max value                 */
  45 #define MAXLINE   102400          /* text line size limit                 */
  46 #define MAXTOKEN  4096            /* expression length max size           */
  47 #define MAXSELINE 1024            /* max se command line number           */
  48 #define MAXCOND   1024            /* max condition number                 */
  49 #define MAXNEST   128             /* max nesting numbers of set ( )       */ 
  50 #define MAXSTACK  256             /* numbers of operator in a nest        */
  51 #define MAXKS     256             /* numbers of separators max            */
  52 #define MAXKC     256             /* numbers of separators max            */
  53 #define MAXKP     256             /* numbers of separators max            */
  54 #define MAXJS     512             /* numbers of kanji separators max      */
  55 #define MAXJC     256             /* numbers of kanji separators max      */
  56 #define MAXJP     256             /* numbers of kanji separators max      */
  57 #define MAXWORD   512             /* numbers of word length               */
  58 #define MAXWDPTC  12800           /* max counts of word positions         */
  59 #endif
  60 
  61 struct mtent {
  62         int ln;
  63         unsigned char *txt;
  64         struct mtent *next;
  65 };
  66 
  67 struct ptent {
  68         int wdpt;
  69         struct ptent *next;
  70 };
  71 
  72 struct wdent {
  73         int wdc;
  74         unsigned char langinfo;
  75         unsigned char *mlwd;
  76         struct ptent *wdptl;
  77         struct mtent *mthead;
  78         struct mtent *mtlast;
  79         struct wdent *left_we;
  80         struct wdent *right_we;
  81 };
  82 
  83 struct cdent {
  84   unsigned char *cdparm;
  85   unsigned char **cdpolish;
  86   int tcount;
  87   struct wdent *mwdroot;
  88 };
  89 
  90 void print_usage(unsigned char *);
  91 int extender(int, char **);
  92 unsigned char **getwdarray(unsigned char *);
  93 unsigned char **getcdarray(unsigned char **);
  94 int sepextend(unsigned char *);
  95 int condextend(unsigned char *);
  96 struct cdent *getcdentry(unsigned char **, unsigned char *);
  97 unsigned char **polishbuild(unsigned char **);
  98 unsigned char divideword(unsigned char **, int);
  99 void mlesccpy(void);
 100 int mlsepcheck(unsigned char **,unsigned char);
 101 void mlescinsert(int);
 102 unsigned char *wordgen(unsigned char *);
 103 unsigned char **wordptgen(unsigned char **, int);
 104 unsigned char *fetchword(void);
 105 struct wdent *wdentalloc(void);
 106 unsigned char *getmaterial(int);
 107 unsigned char *materialalloc(unsigned char *,unsigned char *,unsigned char *);
 108 int matchword(unsigned char *, struct cdent *);
 109 int unarymatch(unsigned char *, unsigned char *);
 110 void statisticsctrl(unsigned char *);
 111 void matchingctrl(unsigned char *);
 112 struct wdent *addwdtree(struct wdent *, unsigned char *, int);
 113 struct ptent *addwdpt(struct ptent *, int);
 114 void printwdptlist(struct ptent *);
 115 void printwdtree(struct wdent *, int);
 116 struct mtent *addmtlist(struct mtent *);
 117 struct mtent *mtentalloc(void);
 118 void printmtlist(struct mtent *);
 119 void printcdtable(struct cdent *);
 120 unsigned char mlmdset(unsigned char **, unsigned char *, unsigned char *);
 121 unsigned char *mlstrchr(unsigned char *,\
 122                         unsigned char *, unsigned char *,\
 123                         unsigned char *,\
 124                         unsigned char *, unsigned char *);
 125 int mlchrcmp(unsigned char *, unsigned char *, unsigned char *,\
 126              unsigned char *, unsigned char *, unsigned char *);
 127 unsigned char mlchrinc(unsigned char **, unsigned char *, unsigned char *);
 128 unsigned char *mlchrlower(unsigned char *);
 129 int mlstrcmp(unsigned char *, unsigned char *);
 130 unsigned char mlesccheck(unsigned char *);
 131 unsigned char mlchrtype(unsigned char **, unsigned char *, unsigned char *);
 132 
 133 
 134 
 135 

/* [previous][next][first][last][top][bottom][index][help] */