blob: 16a1467ee0aa5749ffd30ac47c104f0916673036 [file] [log] [blame]
Daniel Veillard4255d502002-04-16 15:50:10 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: API to build regexp automata
3 * Description: the API to build regexp automata
Daniel Veillard4255d502002-04-16 15:50:10 +00004 *
Daniel Veillardbe586972003-11-18 20:56:51 +00005 * Copy: See Copyright for the status of this software.
Daniel Veillard4255d502002-04-16 15:50:10 +00006 *
Daniel Veillardbe586972003-11-18 20:56:51 +00007 * Author: Daniel Veillard
Daniel Veillard4255d502002-04-16 15:50:10 +00008 */
9
10#ifndef __XML_AUTOMATA_H__
11#define __XML_AUTOMATA_H__
12
Daniel Veillard4255d502002-04-16 15:50:10 +000013#include <libxml/xmlversion.h>
Daniel Veillard84d70a42002-09-16 10:51:38 +000014#include <libxml/tree.h>
Daniel Veillard4255d502002-04-16 15:50:10 +000015
Daniel Veillard84d70a42002-09-16 10:51:38 +000016#ifdef LIBXML_AUTOMATA_ENABLED
Daniel Veillard4255d502002-04-16 15:50:10 +000017#include <libxml/xmlregexp.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/**
24 * xmlAutomataPtr:
25 *
26 * A libxml automata description, It can be compiled into a regexp
27 */
28typedef struct _xmlAutomata xmlAutomata;
29typedef xmlAutomata *xmlAutomataPtr;
30
31/**
32 * xmlAutomataStatePtr:
33 *
34 * A state int the automata description,
35 */
36typedef struct _xmlAutomataState xmlAutomataState;
37typedef xmlAutomataState *xmlAutomataStatePtr;
38
39/*
40 * Building API
41 */
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000042XMLPUBFUN xmlAutomataPtr XMLCALL
43 xmlNewAutomata (void);
44XMLPUBFUN void XMLCALL
45 xmlFreeAutomata (xmlAutomataPtr am);
Daniel Veillard4255d502002-04-16 15:50:10 +000046
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000047XMLPUBFUN xmlAutomataStatePtr XMLCALL
48 xmlAutomataGetInitState (xmlAutomataPtr am);
49XMLPUBFUN int XMLCALL
50 xmlAutomataSetFinalState (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000051 xmlAutomataStatePtr state);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000052XMLPUBFUN xmlAutomataStatePtr XMLCALL
53 xmlAutomataNewState (xmlAutomataPtr am);
54XMLPUBFUN xmlAutomataStatePtr XMLCALL
55 xmlAutomataNewTransition (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000056 xmlAutomataStatePtr from,
57 xmlAutomataStatePtr to,
58 const xmlChar *token,
59 void *data);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000060XMLPUBFUN xmlAutomataStatePtr XMLCALL
61 xmlAutomataNewTransition2 (xmlAutomataPtr am,
Daniel Veillard52b48c72003-04-13 19:53:42 +000062 xmlAutomataStatePtr from,
63 xmlAutomataStatePtr to,
64 const xmlChar *token,
65 const xmlChar *token2,
66 void *data);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000067XMLPUBFUN xmlAutomataStatePtr XMLCALL
68 xmlAutomataNewCountTrans (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000069 xmlAutomataStatePtr from,
70 xmlAutomataStatePtr to,
71 const xmlChar *token,
72 int min,
73 int max,
74 void *data);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000075XMLPUBFUN xmlAutomataStatePtr XMLCALL
76 xmlAutomataNewOnceTrans (xmlAutomataPtr am,
Daniel Veillard7646b182002-04-20 06:41:40 +000077 xmlAutomataStatePtr from,
78 xmlAutomataStatePtr to,
79 const xmlChar *token,
80 int min,
81 int max,
82 void *data);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000083XMLPUBFUN xmlAutomataStatePtr XMLCALL
84 xmlAutomataNewAllTrans (xmlAutomataPtr am,
Daniel Veillard7646b182002-04-20 06:41:40 +000085 xmlAutomataStatePtr from,
Daniel Veillard441bc322002-04-20 17:38:48 +000086 xmlAutomataStatePtr to,
87 int lax);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000088XMLPUBFUN xmlAutomataStatePtr XMLCALL
89 xmlAutomataNewEpsilon (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000090 xmlAutomataStatePtr from,
91 xmlAutomataStatePtr to);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000092XMLPUBFUN xmlAutomataStatePtr XMLCALL
93 xmlAutomataNewCountedTrans (xmlAutomataPtr am,
Daniel Veillardb509f152002-04-17 16:28:10 +000094 xmlAutomataStatePtr from,
95 xmlAutomataStatePtr to,
96 int counter);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000097XMLPUBFUN xmlAutomataStatePtr XMLCALL
98 xmlAutomataNewCounterTrans (xmlAutomataPtr am,
Daniel Veillardb509f152002-04-17 16:28:10 +000099 xmlAutomataStatePtr from,
100 xmlAutomataStatePtr to,
101 int counter);
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000102XMLPUBFUN int XMLCALL
103 xmlAutomataNewCounter (xmlAutomataPtr am,
Daniel Veillardb509f152002-04-17 16:28:10 +0000104 int min,
105 int max);
Daniel Veillard4255d502002-04-16 15:50:10 +0000106
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000107XMLPUBFUN xmlRegexpPtr XMLCALL
108 xmlAutomataCompile (xmlAutomataPtr am);
109XMLPUBFUN int XMLCALL
110 xmlAutomataIsDeterminist (xmlAutomataPtr am);
Daniel Veillard4255d502002-04-16 15:50:10 +0000111
112#ifdef __cplusplus
113}
114#endif
115
116#endif /* LIBXML_AUTOMATA_ENABLED */
117#endif /* __XML_AUTOMATA_H__ */