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 |
| 76 | xmlAutomataNewOnceTrans (xmlAutomataPtr am, |
Daniel Veillard | 7646b18 | 2002-04-20 06:41:40 +0000 | [diff] [blame] | 77 | xmlAutomataStatePtr from, |
| 78 | xmlAutomataStatePtr to, |
| 79 | const xmlChar *token, |
| 80 | int min, |
| 81 | int max, |
| 82 | void *data); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 83 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 84 | xmlAutomataNewAllTrans (xmlAutomataPtr am, |
Daniel Veillard | 7646b18 | 2002-04-20 06:41:40 +0000 | [diff] [blame] | 85 | xmlAutomataStatePtr from, |
Daniel Veillard | 441bc32 | 2002-04-20 17:38:48 +0000 | [diff] [blame] | 86 | xmlAutomataStatePtr to, |
| 87 | int lax); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 88 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 89 | xmlAutomataNewEpsilon (xmlAutomataPtr am, |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 90 | xmlAutomataStatePtr from, |
| 91 | xmlAutomataStatePtr to); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 92 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 93 | xmlAutomataNewCountedTrans (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 94 | xmlAutomataStatePtr from, |
| 95 | xmlAutomataStatePtr to, |
| 96 | int counter); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 97 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
| 98 | xmlAutomataNewCounterTrans (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 99 | xmlAutomataStatePtr from, |
| 100 | xmlAutomataStatePtr to, |
| 101 | int counter); |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 102 | XMLPUBFUN int XMLCALL |
| 103 | xmlAutomataNewCounter (xmlAutomataPtr am, |
Daniel Veillard | b509f15 | 2002-04-17 16:28:10 +0000 | [diff] [blame] | 104 | int min, |
| 105 | int max); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 106 | |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 107 | XMLPUBFUN xmlRegexpPtr XMLCALL |
| 108 | xmlAutomataCompile (xmlAutomataPtr am); |
| 109 | XMLPUBFUN int XMLCALL |
| 110 | xmlAutomataIsDeterminist (xmlAutomataPtr am); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 111 | |
| 112 | #ifdef __cplusplus |
| 113 | } |
| 114 | #endif |
| 115 | |
| 116 | #endif /* LIBXML_AUTOMATA_ENABLED */ |
| 117 | #endif /* __XML_AUTOMATA_H__ */ |