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 | |
| 12 | #if defined(WIN32) && defined(_MSC_VER) |
| 13 | #include <libxml/xmlwin32version.h> |
| 14 | #else |
| 15 | #include <libxml/xmlversion.h> |
| 16 | #endif |
| 17 | #ifdef LIBXML_REGEXP_ENABLED |
| 18 | |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 19 | |
| 20 | #ifdef __cplusplus |
| 21 | extern "C" { |
| 22 | #endif |
| 23 | |
| 24 | /** |
| 25 | * xmlRegexpPtr: |
| 26 | * |
| 27 | * A libxml regular expression, they can actually be far more complex |
| 28 | * thank the POSIX regex expressions. |
| 29 | */ |
| 30 | typedef struct _xmlRegexp xmlRegexp; |
| 31 | typedef xmlRegexp *xmlRegexpPtr; |
| 32 | |
| 33 | /** |
| 34 | * xmlRegExecCtxtPtr: |
| 35 | * |
| 36 | * A libxml progressive regular expression evaluation context |
| 37 | */ |
| 38 | typedef struct _xmlRegExecCtxt xmlRegExecCtxt; |
| 39 | typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; |
| 40 | |
Daniel Veillard | 84d70a4 | 2002-09-16 10:51:38 +0000 | [diff] [blame^] | 41 | #ifdef __cplusplus |
| 42 | } |
| 43 | #endif |
| 44 | #include <libxml/tree.h> |
| 45 | #ifdef __cplusplus |
| 46 | extern "C" { |
| 47 | #endif |
| 48 | |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 49 | /* |
| 50 | * The POSIX like API |
| 51 | */ |
| 52 | xmlRegexpPtr xmlRegexpCompile(const xmlChar *regexp); |
| 53 | void xmlRegFreeRegexp(xmlRegexpPtr regexp); |
| 54 | int xmlRegexpExec (xmlRegexpPtr comp, |
| 55 | const xmlChar *value); |
| 56 | void xmlRegexpPrint (FILE *output, |
| 57 | xmlRegexpPtr regexp); |
| 58 | |
| 59 | /* |
| 60 | * Callback function when doing a transition in the automata |
| 61 | */ |
| 62 | typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, |
| 63 | const xmlChar *token, |
| 64 | void *transdata, |
| 65 | void *inputdata); |
| 66 | |
| 67 | /* |
| 68 | * The progressive API |
| 69 | */ |
| 70 | xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp, |
| 71 | xmlRegExecCallbacks callback, |
| 72 | void *data); |
| 73 | void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); |
| 74 | int xmlRegExecPushString (xmlRegExecCtxtPtr exec, |
| 75 | const xmlChar *value, |
| 76 | void *data); |
| 77 | |
| 78 | #ifdef __cplusplus |
| 79 | } |
| 80 | #endif |
| 81 | |
| 82 | #endif /* LIBXML_REGEXP_ENABLED */ |
| 83 | |
| 84 | #endif /*__XML_REGEXP_H__ */ |