Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 1 | /* |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 2 | * Summary: API to build regexp automata |
| 3 | * Description: the API to build regexp automata |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 4 | * |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 5 | * Copy: See Copyright for the status of this software. |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 6 | * |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 7 | * Author: Daniel Veillard |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __XML_AUTOMATA_H__ |
| 11 | #define __XML_AUTOMATA_H__ |
| 12 | |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 13 | #include <libxml/xmlversion.h> |
Daniel Veillard | 84d70a4 | 2002-09-16 10:51:38 +0000 | [diff] [blame] | 14 | #include <libxml/tree.h> |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 15 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 16 | #ifdef LIBXML_REGEXP_ENABLED |
Daniel Veillard | 84d70a4 | 2002-09-16 10:51:38 +0000 | [diff] [blame] | 17 | #ifdef LIBXML_AUTOMATA_ENABLED |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 18 | #include <libxml/xmlregexp.h> |
| 19 | |
| 20 | #ifdef __cplusplus |
| 21 | extern "C" { |
| 22 | #endif |
| 23 | |
| 24 | /** |
| 25 | * xmlAutomataPtr: |
| 26 | * |
| 27 | * A libxml automata description, It can be compiled into a regexp |
| 28 | */ |
| 29 | typedef struct _xmlAutomata xmlAutomata; |
| 30 | typedef xmlAutomata *xmlAutomataPtr; |
| 31 | |
| 32 | /** |
| 33 | * xmlAutomataStatePtr: |
| 34 | * |
| 35 | * A state int the automata description, |
| 36 | */ |
| 37 | typedef struct _xmlAutomataState xmlAutomataState; |
| 38 | typedef xmlAutomataState *xmlAutomataStatePtr; |
| 39 | |
| 40 | /* |
| 41 | * Building API |
| 42 | */ |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 43 | XMLPUBFUN xmlAutomataPtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 44 | xmlNewAutomata (void); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 45 | XMLPUBFUN void XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 46 | xmlFreeAutomata (xmlAutomataPtr am); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 47 | |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 48 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 49 | xmlAutomataGetInitState (xmlAutomataPtr am); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 50 | XMLPUBFUN int XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 51 | xmlAutomataSetFinalState (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 52 | xmlAutomataStatePtr state); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 53 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 54 | xmlAutomataNewState (xmlAutomataPtr am); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 55 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 56 | xmlAutomataNewTransition (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 57 | xmlAutomataStatePtr from, |
| 58 | xmlAutomataStatePtr to, |
| 59 | const xmlChar *token, |
| 60 | void *data); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 61 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 62 | xmlAutomataNewTransition2 (xmlAutomataPtr am, |
Daniel Veillard | 52b48c7 | 2003-04-13 19:53:42 +0000 | [diff] [blame] | 63 | xmlAutomataStatePtr from, |
| 64 | xmlAutomataStatePtr to, |
| 65 | const xmlChar *token, |
| 66 | const xmlChar *token2, |
| 67 | void *data); |
Daniel Veillard | 9efc476 | 2005-07-19 14:33:55 +0000 | [diff] [blame] | 68 | XMLPUBFUN 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 Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 76 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 77 | xmlAutomataNewCountTrans (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 78 | xmlAutomataStatePtr from, |
| 79 | xmlAutomataStatePtr to, |
| 80 | const xmlChar *token, |
| 81 | int min, |
| 82 | int max, |
| 83 | void *data); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 84 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame] | 85 | 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 Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 93 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 94 | xmlAutomataNewOnceTrans (xmlAutomataPtr am, |
Daniel Veillard | 7646b18 | 2002-04-20 06:41:40 +0000 | [diff] [blame] | 95 | xmlAutomataStatePtr from, |
| 96 | xmlAutomataStatePtr to, |
| 97 | const xmlChar *token, |
| 98 | int min, |
| 99 | int max, |
| 100 | void *data); |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame] | 101 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 102 | xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame] | 103 | xmlAutomataStatePtr from, |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 104 | xmlAutomataStatePtr to, |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame] | 105 | const xmlChar *token, |
| 106 | const xmlChar *token2, |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 107 | int min, |
| 108 | int max, |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame] | 109 | void *data); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 110 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 111 | xmlAutomataNewAllTrans (xmlAutomataPtr am, |
Daniel Veillard | 7646b18 | 2002-04-20 06:41:40 +0000 | [diff] [blame] | 112 | xmlAutomataStatePtr from, |
Daniel Veillard | 441bc32 | 2002-04-20 17:38:48 +0000 | [diff] [blame] | 113 | xmlAutomataStatePtr to, |
| 114 | int lax); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 115 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 116 | xmlAutomataNewEpsilon (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 117 | xmlAutomataStatePtr from, |
| 118 | xmlAutomataStatePtr to); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 119 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 120 | xmlAutomataNewCountedTrans (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 121 | xmlAutomataStatePtr from, |
| 122 | xmlAutomataStatePtr to, |
| 123 | int counter); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 124 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 125 | xmlAutomataNewCounterTrans (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 126 | xmlAutomataStatePtr from, |
| 127 | xmlAutomataStatePtr to, |
| 128 | int counter); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 129 | XMLPUBFUN int XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 130 | xmlAutomataNewCounter (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 131 | int min, |
| 132 | int max); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 133 | |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 134 | XMLPUBFUN xmlRegexpPtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 135 | xmlAutomataCompile (xmlAutomataPtr am); |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 136 | XMLPUBFUN int XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 137 | xmlAutomataIsDeterminist (xmlAutomataPtr am); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 138 | |
| 139 | #ifdef __cplusplus |
| 140 | } |
Daniel Veillard | f8e3db0 | 2012-09-11 13:26:36 +0800 | [diff] [blame] | 141 | #endif |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 142 | |
| 143 | #endif /* LIBXML_AUTOMATA_ENABLED */ |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 144 | #endif /* LIBXML_REGEXP_ENABLED */ |
| 145 | |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 146 | #endif /* __XML_AUTOMATA_H__ */ |