1 /* $Id: dfap.h,v 1.11 2005-01-15 19:38:18 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
35 struct Tnode *root; /* root of regular syntax tree */
36 int position; /* no of positions so far */
37 int rule; /* no of rules so far */
38 BSetHandle *charset; /* character set type */
39 BSet anyset; /* character recognized by `.' */
40 int use_Tnode; /* used Tnodes */
41 int max_Tnode; /* allocated Tnodes */
42 struct Tblock *start; /* start block of Tnodes */
43 struct Tblock *end; /* end block of Tnodes */
53 const unsigned char *expr_ptr;
60 const char **(*cmap)(void *vp, const char **from, int len);
63 typedef struct DFA_stateb_ {
64 struct DFA_stateb_ *next;
65 struct DFA_state *state_block;
69 struct DFA_state *freelist; /* chain of unused (but allocated) states */
70 struct DFA_state *unmarked; /* chain of unmarked DFA states */
71 struct DFA_state *marked; /* chain of marked DFA states */
72 DFA_stateb *statemem; /* state memory */
73 int no; /* no of states (unmarked+marked) */
74 SetType st; /* Position set type */
75 int hash; /* no hash entries in hasharray */
76 struct DFA_state **hasharray; /* hash pointers */
77 struct DFA_state **sortarray; /* sorted DFA states */
78 struct DFA_trans *transmem; /* transition memory */
81 int init_DFA_states (struct DFA_states **dfasp, SetType st, int hash);
82 int rm_DFA_states (struct DFA_states **dfasp);
83 int add_DFA_state (struct DFA_states *dfas, Set *s,
84 struct DFA_state **sp);
85 struct DFA_state *get_DFA_state (struct DFA_states *dfas);
86 void sort_DFA_states (struct DFA_states *dfas);
87 void add_DFA_tran (struct DFA_states *, struct DFA_state *,