blob: bf1b131c653427eff6989dfd8e57698411787da6 [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
William M. Brack21e4ef22005-01-02 09:53:13 +000016#ifdef LIBXML_REGEXP_ENABLED
Daniel Veillard84d70a42002-09-16 10:51:38 +000017#ifdef LIBXML_AUTOMATA_ENABLED
Daniel Veillard4255d502002-04-16 15:50:10 +000018#include <libxml/xmlregexp.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/**
25 * xmlAutomataPtr:
26 *
27 * A libxml automata description, It can be compiled into a regexp
28 */
29typedef struct _xmlAutomata xmlAutomata;
30typedef xmlAutomata *xmlAutomataPtr;
31
32/**
33 * xmlAutomataStatePtr:
34 *
35 * A state int the automata description,
36 */
37typedef struct _xmlAutomataState xmlAutomataState;
38typedef xmlAutomataState *xmlAutomataStatePtr;
39
40/*
41 * Building API
42 */
Daniel Veillardf8e3db02012-09-11 13:26:36 +080043XMLPUBFUN xmlAutomataPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000044 xmlNewAutomata (void);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080045XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000046 xmlFreeAutomata (xmlAutomataPtr am);
Daniel Veillard4255d502002-04-16 15:50:10 +000047
Daniel Veillardf8e3db02012-09-11 13:26:36 +080048XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000049 xmlAutomataGetInitState (xmlAutomataPtr am);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080050XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000051 xmlAutomataSetFinalState (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000052 xmlAutomataStatePtr state);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080053XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000054 xmlAutomataNewState (xmlAutomataPtr am);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080055XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000056 xmlAutomataNewTransition (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000057 xmlAutomataStatePtr from,
58 xmlAutomataStatePtr to,
59 const xmlChar *token,
60 void *data);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080061XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000062 xmlAutomataNewTransition2 (xmlAutomataPtr am,
Daniel Veillard52b48c72003-04-13 19:53:42 +000063 xmlAutomataStatePtr from,
64 xmlAutomataStatePtr to,
65 const xmlChar *token,
66 const xmlChar *token2,
67 void *data);
Daniel Veillard9efc4762005-07-19 14:33:55 +000068XMLPUBFUN xmlAutomataStatePtr XMLCALL
69 xmlAutomataNewNegTrans (xmlAutomataPtr am,
70 xmlAutomataStatePtr from,
71 xmlAutomataStatePtr to,
72 const xmlChar *token,
73 const xmlChar *token2,
74 void *data);
75
Daniel Veillardf8e3db02012-09-11 13:26:36 +080076XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000077 xmlAutomataNewCountTrans (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +000078 xmlAutomataStatePtr from,
79 xmlAutomataStatePtr to,
80 const xmlChar *token,
81 int min,
82 int max,
83 void *data);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080084XMLPUBFUN xmlAutomataStatePtr XMLCALL
Kasimier T. Buchcik87876402004-09-29 13:29:03 +000085 xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
86 xmlAutomataStatePtr from,
87 xmlAutomataStatePtr to,
88 const xmlChar *token,
89 const xmlChar *token2,
90 int min,
91 int max,
92 void *data);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080093XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000094 xmlAutomataNewOnceTrans (xmlAutomataPtr am,
Daniel Veillard7646b182002-04-20 06:41:40 +000095 xmlAutomataStatePtr from,
96 xmlAutomataStatePtr to,
97 const xmlChar *token,
98 int min,
99 int max,
100 void *data);
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000101XMLPUBFUN xmlAutomataStatePtr XMLCALL
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800102 xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000103 xmlAutomataStatePtr from,
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800104 xmlAutomataStatePtr to,
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000105 const xmlChar *token,
106 const xmlChar *token2,
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800107 int min,
108 int max,
Kasimier T. Buchcik87876402004-09-29 13:29:03 +0000109 void *data);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800110XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000111 xmlAutomataNewAllTrans (xmlAutomataPtr am,
Daniel Veillard7646b182002-04-20 06:41:40 +0000112 xmlAutomataStatePtr from,
Daniel Veillard441bc322002-04-20 17:38:48 +0000113 xmlAutomataStatePtr to,
114 int lax);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800115XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000116 xmlAutomataNewEpsilon (xmlAutomataPtr am,
Daniel Veillard4255d502002-04-16 15:50:10 +0000117 xmlAutomataStatePtr from,
118 xmlAutomataStatePtr to);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800119XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000120 xmlAutomataNewCountedTrans (xmlAutomataPtr am,
Daniel Veillardb509f152002-04-17 16:28:10 +0000121 xmlAutomataStatePtr from,
122 xmlAutomataStatePtr to,
123 int counter);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800124XMLPUBFUN xmlAutomataStatePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000125 xmlAutomataNewCounterTrans (xmlAutomataPtr am,
Daniel Veillardb509f152002-04-17 16:28:10 +0000126 xmlAutomataStatePtr from,
127 xmlAutomataStatePtr to,
128 int counter);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800129XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000130 xmlAutomataNewCounter (xmlAutomataPtr am,
Daniel Veillardb509f152002-04-17 16:28:10 +0000131 int min,
132 int max);
Daniel Veillard4255d502002-04-16 15:50:10 +0000133
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800134XMLPUBFUN xmlRegexpPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000135 xmlAutomataCompile (xmlAutomataPtr am);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800136XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000137 xmlAutomataIsDeterminist (xmlAutomataPtr am);
Daniel Veillard4255d502002-04-16 15:50:10 +0000138
139#ifdef __cplusplus
140}
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800141#endif
Daniel Veillard4255d502002-04-16 15:50:10 +0000142
143#endif /* LIBXML_AUTOMATA_ENABLED */
William M. Brack21e4ef22005-01-02 09:53:13 +0000144#endif /* LIBXML_REGEXP_ENABLED */
145
Daniel Veillard4255d502002-04-16 15:50:10 +0000146#endif /* __XML_AUTOMATA_H__ */