fix possible crash on user deletion
[srvx.git] / rx / rxspencer.h
1 /* classes: h_files */
2
3 #ifndef RXSPENCERH
4 #define RXSPENCERH
5 /*      Copyright (C) 1995, 1996 Tom Lord
6  * 
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Library General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  * 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Library General Public License for more details.
16  * 
17  * You should have received a copy of the GNU Library General Public License
18  * along with this software; see the file COPYING.  If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330, 
20  * Boston, MA 02111-1307, USA. 
21  */
22
23 \f
24
25 #include "rxproto.h"
26 #include "rxnode.h"
27 #include "rxunfa.h"
28 #include "rxanal.h"
29 #include "inst-rxposix.h"
30
31 \f
32
33 #define RX_MANY_CASES 30
34
35
36 typedef enum rx_answers (*rx_vmfn)
37      P((void * closure,
38         unsigned const char ** burst, int * len, int * offset,
39         int start, int end, int need));
40
41 typedef enum rx_answers (*rx_contextfn)
42      P((void * closure,
43         struct rexp_node * node,
44         int start, int end,
45         struct rx_registers * regs));
46
47
48 struct rx_solutions
49 {
50   int step;
51
52   int cset_size;
53   struct rexp_node * exp;
54   struct rexp_node ** subexps;
55   struct rx_registers * regs;
56
57   int start;
58   int end;
59
60   rx_vmfn vmfn;
61   rx_contextfn contextfn;
62   void * closure;
63
64   struct rx_unfaniverse * verse;
65   struct rx_unfa * dfa;
66   struct rx_classical_system match_engine;
67   struct rx_unfa * left_dfa;
68   struct rx_classical_system left_match_engine;
69
70   int split_guess;
71   struct rx_solutions * left;
72   struct rx_solutions * right;
73
74   int interval_x;
75
76   int saved_rm_so;
77   int saved_rm_eo;
78
79   int final_tag;
80 };
81
82 extern struct rx_solutions rx_no_solutions;
83
84 \f
85 #ifdef __STDC__
86 extern struct rx_solutions * rx_make_solutions (struct rx_registers * regs, struct rx_unfaniverse * verse, struct rexp_node * expression, struct rexp_node ** subexps, int cset_size, int start, int end, rx_vmfn vmfn, rx_contextfn contextfn, void * closure);
87 extern void rx_free_solutions (struct rx_solutions * solns);
88 extern int rx_best_end_guess (struct rx_solutions * solns, struct rexp_node *  exp, int bound);
89 extern enum rx_answers rx_next_solution (struct rx_solutions * solns);
90
91 #else /* STDC */
92 extern struct rx_solutions * rx_make_solutions ();
93 extern void rx_free_solutions ();
94 extern int rx_best_end_guess ();
95 extern enum rx_answers rx_next_solution ();
96
97 #endif /* STDC */
98
99 #endif  /* RXSPENCERH */