Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * regexp.h : describes the basic API for libxml regular expressions handling |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * Daniel Veillard <veillard@redhat.com> |
| 7 | */ |
| 8 | |
| 9 | #ifndef __XML_REGEXP_H__ |
| 10 | #define __XML_REGEXP_H__ |
| 11 | |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 12 | #include <libxml/xmlversion.h> |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 13 | |
Igor Zlatkovic | 7ae91bc | 2002-11-08 17:18:52 +0000 | [diff] [blame] | 14 | #ifdef LIBXML_REGEXP_ENABLED |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 15 | |
| 16 | #ifdef __cplusplus |
| 17 | extern "C" { |
| 18 | #endif |
| 19 | |
| 20 | /** |
| 21 | * xmlRegexpPtr: |
| 22 | * |
| 23 | * A libxml regular expression, they can actually be far more complex |
| 24 | * thank the POSIX regex expressions. |
| 25 | */ |
| 26 | typedef struct _xmlRegexp xmlRegexp; |
| 27 | typedef xmlRegexp *xmlRegexpPtr; |
| 28 | |
| 29 | /** |
| 30 | * xmlRegExecCtxtPtr: |
| 31 | * |
| 32 | * A libxml progressive regular expression evaluation context |
| 33 | */ |
| 34 | typedef struct _xmlRegExecCtxt xmlRegExecCtxt; |
| 35 | typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; |
| 36 | |
Daniel Veillard | 84d70a4 | 2002-09-16 10:51:38 +0000 | [diff] [blame] | 37 | #ifdef __cplusplus |
| 38 | } |
| 39 | #endif |
| 40 | #include <libxml/tree.h> |
| 41 | #ifdef __cplusplus |
| 42 | extern "C" { |
| 43 | #endif |
| 44 | |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 45 | /* |
| 46 | * The POSIX like API |
| 47 | */ |
| 48 | xmlRegexpPtr xmlRegexpCompile(const xmlChar *regexp); |
| 49 | void xmlRegFreeRegexp(xmlRegexpPtr regexp); |
| 50 | int xmlRegexpExec (xmlRegexpPtr comp, |
| 51 | const xmlChar *value); |
| 52 | void xmlRegexpPrint (FILE *output, |
| 53 | xmlRegexpPtr regexp); |
Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 54 | int xmlRegexpIsDeterminist(xmlRegexpPtr comp); |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 55 | |
| 56 | /* |
| 57 | * Callback function when doing a transition in the automata |
| 58 | */ |
| 59 | typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, |
| 60 | const xmlChar *token, |
| 61 | void *transdata, |
| 62 | void *inputdata); |
| 63 | |
| 64 | /* |
| 65 | * The progressive API |
| 66 | */ |
| 67 | xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp, |
| 68 | xmlRegExecCallbacks callback, |
| 69 | void *data); |
| 70 | void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); |
| 71 | int xmlRegExecPushString (xmlRegExecCtxtPtr exec, |
| 72 | const xmlChar *value, |
| 73 | void *data); |
| 74 | |
| 75 | #ifdef __cplusplus |
| 76 | } |
| 77 | #endif |
| 78 | |
| 79 | #endif /* LIBXML_REGEXP_ENABLED */ |
| 80 | |
| 81 | #endif /*__XML_REGEXP_H__ */ |