xref: /aosp_15_r20/external/libxml2/include/libxml/xmlautomata.h (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1*7c568831SAndroid Build Coastguard Worker /*
2*7c568831SAndroid Build Coastguard Worker  * Summary: API to build regexp automata
3*7c568831SAndroid Build Coastguard Worker  * Description: the API to build regexp automata
4*7c568831SAndroid Build Coastguard Worker  *
5*7c568831SAndroid Build Coastguard Worker  * Copy: See Copyright for the status of this software.
6*7c568831SAndroid Build Coastguard Worker  *
7*7c568831SAndroid Build Coastguard Worker  * Author: Daniel Veillard
8*7c568831SAndroid Build Coastguard Worker  */
9*7c568831SAndroid Build Coastguard Worker 
10*7c568831SAndroid Build Coastguard Worker #ifndef __XML_AUTOMATA_H__
11*7c568831SAndroid Build Coastguard Worker #define __XML_AUTOMATA_H__
12*7c568831SAndroid Build Coastguard Worker 
13*7c568831SAndroid Build Coastguard Worker #include <libxml/xmlversion.h>
14*7c568831SAndroid Build Coastguard Worker 
15*7c568831SAndroid Build Coastguard Worker #ifdef LIBXML_REGEXP_ENABLED
16*7c568831SAndroid Build Coastguard Worker 
17*7c568831SAndroid Build Coastguard Worker #include <libxml/xmlstring.h>
18*7c568831SAndroid Build Coastguard Worker 
19*7c568831SAndroid Build Coastguard Worker #ifdef __cplusplus
20*7c568831SAndroid Build Coastguard Worker extern "C" {
21*7c568831SAndroid Build Coastguard Worker #endif
22*7c568831SAndroid Build Coastguard Worker 
23*7c568831SAndroid Build Coastguard Worker /**
24*7c568831SAndroid Build Coastguard Worker  * xmlAutomataPtr:
25*7c568831SAndroid Build Coastguard Worker  *
26*7c568831SAndroid Build Coastguard Worker  * A libxml automata description, It can be compiled into a regexp
27*7c568831SAndroid Build Coastguard Worker  */
28*7c568831SAndroid Build Coastguard Worker typedef struct _xmlAutomata xmlAutomata;
29*7c568831SAndroid Build Coastguard Worker typedef xmlAutomata *xmlAutomataPtr;
30*7c568831SAndroid Build Coastguard Worker 
31*7c568831SAndroid Build Coastguard Worker /**
32*7c568831SAndroid Build Coastguard Worker  * xmlAutomataStatePtr:
33*7c568831SAndroid Build Coastguard Worker  *
34*7c568831SAndroid Build Coastguard Worker  * A state int the automata description,
35*7c568831SAndroid Build Coastguard Worker  */
36*7c568831SAndroid Build Coastguard Worker typedef struct _xmlAutomataState xmlAutomataState;
37*7c568831SAndroid Build Coastguard Worker typedef xmlAutomataState *xmlAutomataStatePtr;
38*7c568831SAndroid Build Coastguard Worker 
39*7c568831SAndroid Build Coastguard Worker /*
40*7c568831SAndroid Build Coastguard Worker  * Building API
41*7c568831SAndroid Build Coastguard Worker  */
42*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataPtr
43*7c568831SAndroid Build Coastguard Worker 		    xmlNewAutomata		(void);
44*7c568831SAndroid Build Coastguard Worker XMLPUBFUN void
45*7c568831SAndroid Build Coastguard Worker 		    xmlFreeAutomata		(xmlAutomataPtr am);
46*7c568831SAndroid Build Coastguard Worker 
47*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
48*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataGetInitState	(xmlAutomataPtr am);
49*7c568831SAndroid Build Coastguard Worker XMLPUBFUN int
50*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataSetFinalState	(xmlAutomataPtr am,
51*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr state);
52*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
53*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewState		(xmlAutomataPtr am);
54*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
55*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewTransition	(xmlAutomataPtr am,
56*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
57*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
58*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
59*7c568831SAndroid Build Coastguard Worker 						 void *data);
60*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
61*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewTransition2	(xmlAutomataPtr am,
62*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
63*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
64*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
65*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token2,
66*7c568831SAndroid Build Coastguard Worker 						 void *data);
67*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
68*7c568831SAndroid Build Coastguard Worker                     xmlAutomataNewNegTrans	(xmlAutomataPtr am,
69*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
70*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
71*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
72*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token2,
73*7c568831SAndroid Build Coastguard Worker 						 void *data);
74*7c568831SAndroid Build Coastguard Worker 
75*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
76*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewCountTrans	(xmlAutomataPtr am,
77*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
78*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
79*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
80*7c568831SAndroid Build Coastguard Worker 						 int min,
81*7c568831SAndroid Build Coastguard Worker 						 int max,
82*7c568831SAndroid Build Coastguard Worker 						 void *data);
83*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
84*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewCountTrans2	(xmlAutomataPtr am,
85*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
86*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
87*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
88*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token2,
89*7c568831SAndroid Build Coastguard Worker 						 int min,
90*7c568831SAndroid Build Coastguard Worker 						 int max,
91*7c568831SAndroid Build Coastguard Worker 						 void *data);
92*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
93*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewOnceTrans	(xmlAutomataPtr am,
94*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
95*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
96*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
97*7c568831SAndroid Build Coastguard Worker 						 int min,
98*7c568831SAndroid Build Coastguard Worker 						 int max,
99*7c568831SAndroid Build Coastguard Worker 						 void *data);
100*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
101*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewOnceTrans2	(xmlAutomataPtr am,
102*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
103*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
104*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token,
105*7c568831SAndroid Build Coastguard Worker 						 const xmlChar *token2,
106*7c568831SAndroid Build Coastguard Worker 						 int min,
107*7c568831SAndroid Build Coastguard Worker 						 int max,
108*7c568831SAndroid Build Coastguard Worker 						 void *data);
109*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
110*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewAllTrans	(xmlAutomataPtr am,
111*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
112*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
113*7c568831SAndroid Build Coastguard Worker 						 int lax);
114*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
115*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewEpsilon	(xmlAutomataPtr am,
116*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
117*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to);
118*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
119*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewCountedTrans	(xmlAutomataPtr am,
120*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
121*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
122*7c568831SAndroid Build Coastguard Worker 						 int counter);
123*7c568831SAndroid Build Coastguard Worker XMLPUBFUN xmlAutomataStatePtr
124*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewCounterTrans	(xmlAutomataPtr am,
125*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr from,
126*7c568831SAndroid Build Coastguard Worker 						 xmlAutomataStatePtr to,
127*7c568831SAndroid Build Coastguard Worker 						 int counter);
128*7c568831SAndroid Build Coastguard Worker XMLPUBFUN int
129*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataNewCounter	(xmlAutomataPtr am,
130*7c568831SAndroid Build Coastguard Worker 						 int min,
131*7c568831SAndroid Build Coastguard Worker 						 int max);
132*7c568831SAndroid Build Coastguard Worker 
133*7c568831SAndroid Build Coastguard Worker XMLPUBFUN struct _xmlRegexp *
134*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataCompile		(xmlAutomataPtr am);
135*7c568831SAndroid Build Coastguard Worker XMLPUBFUN int
136*7c568831SAndroid Build Coastguard Worker 		    xmlAutomataIsDeterminist	(xmlAutomataPtr am);
137*7c568831SAndroid Build Coastguard Worker 
138*7c568831SAndroid Build Coastguard Worker #ifdef __cplusplus
139*7c568831SAndroid Build Coastguard Worker }
140*7c568831SAndroid Build Coastguard Worker #endif
141*7c568831SAndroid Build Coastguard Worker 
142*7c568831SAndroid Build Coastguard Worker #endif /* LIBXML_REGEXP_ENABLED */
143*7c568831SAndroid Build Coastguard Worker 
144*7c568831SAndroid Build Coastguard Worker #endif /* __XML_AUTOMATA_H__ */
145