| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Summary: regular expressions handling | 2 * Summary: regular expressions handling |
| 3 * Description: basic API for libxml regular expressions handling used | 3 * Description: basic API for libxml regular expressions handling used |
| 4 * for XML Schemas and validation. | 4 * for XML Schemas and validation. |
| 5 * | 5 * |
| 6 * Copy: See Copyright for the status of this software. | 6 * Copy: See Copyright for the status of this software. |
| 7 * | 7 * |
| 8 * Author: Daniel Veillard | 8 * Author: Daniel Veillard |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 /** | 31 /** |
| 32 * xmlRegExecCtxtPtr: | 32 * xmlRegExecCtxtPtr: |
| 33 * | 33 * |
| 34 * A libxml progressive regular expression evaluation context | 34 * A libxml progressive regular expression evaluation context |
| 35 */ | 35 */ |
| 36 typedef struct _xmlRegExecCtxt xmlRegExecCtxt; | 36 typedef struct _xmlRegExecCtxt xmlRegExecCtxt; |
| 37 typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; | 37 typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; |
| 38 | 38 |
| 39 #ifdef __cplusplus | 39 #ifdef __cplusplus |
| 40 } | 40 } |
| 41 #endif | 41 #endif |
| 42 #include <libxml/tree.h> | 42 #include <libxml/tree.h> |
| 43 #include <libxml/dict.h> | 43 #include <libxml/dict.h> |
| 44 #ifdef __cplusplus | 44 #ifdef __cplusplus |
| 45 extern "C" { | 45 extern "C" { |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 /* | 48 /* |
| 49 * The POSIX like API | 49 * The POSIX like API |
| 50 */ | 50 */ |
| 51 XMLPUBFUN xmlRegexpPtr XMLCALL | 51 XMLPUBFUN xmlRegexpPtr XMLCALL |
| 52 xmlRegexpCompile (const xmlChar *regexp); | 52 xmlRegexpCompile (const xmlChar *regexp); |
| 53 XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); | 53 XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); |
| 54 XMLPUBFUN int XMLCALL» » » | 54 XMLPUBFUN int XMLCALL |
| 55 xmlRegexpExec (xmlRegexpPtr comp, | 55 xmlRegexpExec (xmlRegexpPtr comp, |
| 56 const xmlChar *value); | 56 const xmlChar *value); |
| 57 XMLPUBFUN void XMLCALL» » » | 57 XMLPUBFUN void XMLCALL |
| 58 » » xmlRegexpPrint» (FILE *output, | 58 » » xmlRegexpPrint» (FILE *output, |
| 59 xmlRegexpPtr regexp); | 59 xmlRegexpPtr regexp); |
| 60 XMLPUBFUN int XMLCALL» » » | 60 XMLPUBFUN int XMLCALL |
| 61 xmlRegexpIsDeterminist(xmlRegexpPtr comp); | 61 xmlRegexpIsDeterminist(xmlRegexpPtr comp); |
| 62 | 62 |
| 63 /* | 63 /** |
| 64 * xmlRegExecCallbacks: |
| 65 * @exec: the regular expression context |
| 66 * @token: the current token string |
| 67 * @transdata: transition data |
| 68 * @inputdata: input data |
| 69 * |
| 64 * Callback function when doing a transition in the automata | 70 * Callback function when doing a transition in the automata |
| 65 */ | 71 */ |
| 66 typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, | 72 typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, |
| 67 const xmlChar *token, | 73 const xmlChar *token, |
| 68 void *transdata, | 74 void *transdata, |
| 69 void *inputdata); | 75 void *inputdata); |
| 70 | 76 |
| 71 /* | 77 /* |
| 72 * The progressive API | 78 * The progressive API |
| 73 */ | 79 */ |
| 74 XMLPUBFUN xmlRegExecCtxtPtr XMLCALL» | 80 XMLPUBFUN xmlRegExecCtxtPtr XMLCALL |
| 75 » » xmlRegNewExecCtxt» (xmlRegexpPtr comp, | 81 » » xmlRegNewExecCtxt» (xmlRegexpPtr comp, |
| 76 xmlRegExecCallbacks callback, | 82 xmlRegExecCallbacks callback, |
| 77 void *data); | 83 void *data); |
| 78 XMLPUBFUN void XMLCALL» » » | 84 XMLPUBFUN void XMLCALL |
| 79 xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); | 85 xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); |
| 80 XMLPUBFUN int XMLCALL» » » | 86 XMLPUBFUN int XMLCALL |
| 81 » » xmlRegExecPushString(xmlRegExecCtxtPtr exec, | 87 » » xmlRegExecPushString(xmlRegExecCtxtPtr exec, |
| 82 const xmlChar *value, | 88 const xmlChar *value, |
| 83 void *data); | 89 void *data); |
| 84 XMLPUBFUN int XMLCALL» » » | 90 XMLPUBFUN int XMLCALL |
| 85 xmlRegExecPushString2(xmlRegExecCtxtPtr exec, | 91 xmlRegExecPushString2(xmlRegExecCtxtPtr exec, |
| 86 const xmlChar *value, | 92 const xmlChar *value, |
| 87 const xmlChar *value2, | 93 const xmlChar *value2, |
| 88 void *data); | 94 void *data); |
| 89 | 95 |
| 90 XMLPUBFUN int XMLCALL | 96 XMLPUBFUN int XMLCALL |
| 91 xmlRegExecNextValues(xmlRegExecCtxtPtr exec, | 97 xmlRegExecNextValues(xmlRegExecCtxtPtr exec, |
| 92 » » » » » int *nbval, | 98 » » » » » int *nbval, |
| 93 » » » » » int *nbneg, | 99 » » » » » int *nbneg, |
| 94 xmlChar **values, | 100 xmlChar **values, |
| 95 int *terminal); | 101 int *terminal); |
| 96 XMLPUBFUN int XMLCALL | 102 XMLPUBFUN int XMLCALL |
| 97 xmlRegExecErrInfo (xmlRegExecCtxtPtr exec, | 103 xmlRegExecErrInfo (xmlRegExecCtxtPtr exec, |
| 98 » » » » » const xmlChar **string, | 104 » » » » » const xmlChar **string, |
| 99 int *nbval, | 105 int *nbval, |
| 100 » » » » » int *nbneg, | 106 » » » » » int *nbneg, |
| 101 xmlChar **values, | 107 xmlChar **values, |
| 102 int *terminal); | 108 int *terminal); |
| 103 #ifdef LIBXML_EXPR_ENABLED | 109 #ifdef LIBXML_EXPR_ENABLED |
| 104 /* | 110 /* |
| 105 * Formal regular expression handling | 111 * Formal regular expression handling |
| 106 * Its goal is to do some formal work on content models | 112 * Its goal is to do some formal work on content models |
| 107 */ | 113 */ |
| 108 | 114 |
| 109 /* expressions are used within a context */ | 115 /* expressions are used within a context */ |
| 110 typedef struct _xmlExpCtxt xmlExpCtxt; | 116 typedef struct _xmlExpCtxt xmlExpCtxt; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 128 typedef enum { | 134 typedef enum { |
| 129 XML_EXP_EMPTY = 0, | 135 XML_EXP_EMPTY = 0, |
| 130 XML_EXP_FORBID = 1, | 136 XML_EXP_FORBID = 1, |
| 131 XML_EXP_ATOM = 2, | 137 XML_EXP_ATOM = 2, |
| 132 XML_EXP_SEQ = 3, | 138 XML_EXP_SEQ = 3, |
| 133 XML_EXP_OR = 4, | 139 XML_EXP_OR = 4, |
| 134 XML_EXP_COUNT = 5 | 140 XML_EXP_COUNT = 5 |
| 135 } xmlExpNodeType; | 141 } xmlExpNodeType; |
| 136 | 142 |
| 137 /* | 143 /* |
| 138 * 2 core expressions shared by all for the empty language set | 144 * 2 core expressions shared by all for the empty language set |
| 139 * and for the set with just the empty token | 145 * and for the set with just the empty token |
| 140 */ | 146 */ |
| 141 XMLPUBVAR xmlExpNodePtr forbiddenExp; | 147 XMLPUBVAR xmlExpNodePtr forbiddenExp; |
| 142 XMLPUBVAR xmlExpNodePtr emptyExp; | 148 XMLPUBVAR xmlExpNodePtr emptyExp; |
| 143 | 149 |
| 144 /* | 150 /* |
| 145 * Expressions are reference counted internally | 151 * Expressions are reference counted internally |
| 146 */ | 152 */ |
| 147 XMLPUBFUN void XMLCALL | 153 XMLPUBFUN void XMLCALL |
| 148 xmlExpFree (xmlExpCtxtPtr ctxt, | 154 xmlExpFree (xmlExpCtxtPtr ctxt, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 XMLPUBFUN int XMLCALL | 208 XMLPUBFUN int XMLCALL |
| 203 xmlExpSubsume (xmlExpCtxtPtr ctxt, | 209 xmlExpSubsume (xmlExpCtxtPtr ctxt, |
| 204 xmlExpNodePtr expr, | 210 xmlExpNodePtr expr, |
| 205 xmlExpNodePtr sub); | 211 xmlExpNodePtr sub); |
| 206 XMLPUBFUN void XMLCALL | 212 XMLPUBFUN void XMLCALL |
| 207 xmlExpDump (xmlBufferPtr buf, | 213 xmlExpDump (xmlBufferPtr buf, |
| 208 xmlExpNodePtr expr); | 214 xmlExpNodePtr expr); |
| 209 #endif /* LIBXML_EXPR_ENABLED */ | 215 #endif /* LIBXML_EXPR_ENABLED */ |
| 210 #ifdef __cplusplus | 216 #ifdef __cplusplus |
| 211 } | 217 } |
| 212 #endif | 218 #endif |
| 213 | 219 |
| 214 #endif /* LIBXML_REGEXP_ENABLED */ | 220 #endif /* LIBXML_REGEXP_ENABLED */ |
| 215 | 221 |
| 216 #endif /*__XML_REGEXP_H__ */ | 222 #endif /*__XML_REGEXP_H__ */ |
| OLD | NEW |