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 | |
Daniel Veillard | 84d70a4 | 2002-09-16 10:51:38 +0000 | [diff] [blame] | 16 | #ifdef LIBXML_AUTOMATA_ENABLED |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 17 | #include <libxml/xmlregexp.h> |
| 18 | |
| 19 | #ifdef __cplusplus |
| 20 | extern "C" { |
| 21 | #endif |
| 22 | |
| 23 | /** |
| 24 | * xmlAutomataPtr: |
| 25 | * |
| 26 | * A libxml automata description, It can be compiled into a regexp |
| 27 | */ |
| 28 | typedef struct _xmlAutomata xmlAutomata; |
| 29 | typedef xmlAutomata *xmlAutomataPtr; |
| 30 | |
| 31 | /** |
| 32 | * xmlAutomataStatePtr: |
| 33 | * |
| 34 | * A state int the automata description, |
| 35 | */ |
| 36 | typedef struct _xmlAutomataState xmlAutomataState; |
| 37 | typedef xmlAutomataState *xmlAutomataStatePtr; |
| 38 | |
| 39 | /* |
| 40 | * Building API |
| 41 | */ |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 42 | XMLPUBFUN xmlAutomataPtr XMLCALL |
| 43 | xmlNewAutomata (void); |
| 44 | XMLPUBFUN void XMLCALL |
| 45 | xmlFreeAutomata (xmlAutomataPtr am); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 46 | |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 47 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 48 | xmlAutomataGetInitState (xmlAutomataPtr am); |
| 49 | XMLPUBFUN int XMLCALL |
| 50 | xmlAutomataSetFinalState (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 51 | xmlAutomataStatePtr state); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 52 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 53 | xmlAutomataNewState (xmlAutomataPtr am); |
| 54 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 55 | xmlAutomataNewTransition (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 56 | xmlAutomataStatePtr from, |
| 57 | xmlAutomataStatePtr to, |
| 58 | const xmlChar *token, |
| 59 | void *data); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 60 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 61 | xmlAutomataNewTransition2 (xmlAutomataPtr am, |
Daniel Veillard | 52b48c7 | 2003-04-13 19:53:42 +0000 | [diff] [blame] | 62 | xmlAutomataStatePtr from, |
| 63 | xmlAutomataStatePtr to, |
| 64 | const xmlChar *token, |
| 65 | const xmlChar *token2, |
| 66 | void *data); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 67 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 68 | xmlAutomataNewCountTrans (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 69 | xmlAutomataStatePtr from, |
| 70 | xmlAutomataStatePtr to, |
| 71 | const xmlChar *token, |
| 72 | int min, |
| 73 | int max, |
| 74 | void *data); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 75 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame^] | 76 | xmlAutomataNewCountTrans2 (xmlAutomataPtr am, |
| 77 | xmlAutomataStatePtr from, |
| 78 | xmlAutomataStatePtr to, |
| 79 | const xmlChar *token, |
| 80 | const xmlChar *token2, |
| 81 | int min, |
| 82 | int max, |
| 83 | void *data); |
| 84 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 85 | xmlAutomataNewOnceTrans (xmlAutomataPtr am, |
Daniel Veillard | 7646b18 | 2002-04-20 06:41:40 +0000 | [diff] [blame] | 86 | xmlAutomataStatePtr from, |
| 87 | xmlAutomataStatePtr to, |
| 88 | const xmlChar *token, |
| 89 | int min, |
| 90 | int max, |
| 91 | void *data); |
Kasimier T. Buchcik | 8787640 | 2004-09-29 13:29:03 +0000 | [diff] [blame^] | 92 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 93 | xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, |
| 94 | xmlAutomataStatePtr from, |
| 95 | xmlAutomataStatePtr to, |
| 96 | const xmlChar *token, |
| 97 | const xmlChar *token2, |
| 98 | int min, |
| 99 | int max, |
| 100 | void *data); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 101 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 102 | xmlAutomataNewAllTrans (xmlAutomataPtr am, |
Daniel Veillard | 7646b18 | 2002-04-20 06:41:40 +0000 | [diff] [blame] | 103 | xmlAutomataStatePtr from, |
Daniel Veillard | 441bc32 | 2002-04-20 17:38:48 +0000 | [diff] [blame] | 104 | xmlAutomataStatePtr to, |
| 105 | int lax); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 106 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 107 | xmlAutomataNewEpsilon (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 108 | xmlAutomataStatePtr from, |
| 109 | xmlAutomataStatePtr to); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 110 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 111 | xmlAutomataNewCountedTrans (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 112 | xmlAutomataStatePtr from, |
| 113 | xmlAutomataStatePtr to, |
| 114 | int counter); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 115 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 116 | xmlAutomataNewCounterTrans (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 117 | xmlAutomataStatePtr from, |
| 118 | xmlAutomataStatePtr to, |
| 119 | int counter); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 120 | XMLPUBFUN int XMLCALL |
| 121 | xmlAutomataNewCounter (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 122 | int min, |
| 123 | int max); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 124 | |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 125 | XMLPUBFUN xmlRegexpPtr XMLCALL |
| 126 | xmlAutomataCompile (xmlAutomataPtr am); |
| 127 | XMLPUBFUN int XMLCALL |
| 128 | xmlAutomataIsDeterminist (xmlAutomataPtr am); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 129 | |
| 130 | #ifdef __cplusplus |
| 131 | } |
| 132 | #endif |
| 133 | |
| 134 | #endif /* LIBXML_AUTOMATA_ENABLED */ |
| 135 | #endif /* __XML_AUTOMATA_H__ */ |