00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __XML_REGEXP_H__
00012 #define __XML_REGEXP_H__
00013
00014 #include <libxml/xmlversion.h>
00015
00016 #ifdef LIBXML_REGEXP_ENABLED
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00028 typedef struct _xmlRegexp xmlRegexp;
00029 typedef xmlRegexp *xmlRegexpPtr;
00030
00036 typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
00037 typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
00038
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 #include <libxml/tree.h>
00043 #include <libxml/dict.h>
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048
00049
00050
00051 XMLPUBFUN xmlRegexpPtr XMLCALL
00052 xmlRegexpCompile (const xmlChar *regexp);
00053 XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
00054 XMLPUBFUN int XMLCALL
00055 xmlRegexpExec (xmlRegexpPtr comp,
00056 const xmlChar *value);
00057 XMLPUBFUN void XMLCALL
00058 xmlRegexpPrint (FILE *output,
00059 xmlRegexpPtr regexp);
00060 XMLPUBFUN int XMLCALL
00061 xmlRegexpIsDeterminist(xmlRegexpPtr comp);
00062
00063
00064
00065
00066 typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
00067 const xmlChar *token,
00068 void *transdata,
00069 void *inputdata);
00070
00071
00072
00073
00074 XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
00075 xmlRegNewExecCtxt (xmlRegexpPtr comp,
00076 xmlRegExecCallbacks callback,
00077 void *data);
00078 XMLPUBFUN void XMLCALL
00079 xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
00080 XMLPUBFUN int XMLCALL
00081 xmlRegExecPushString(xmlRegExecCtxtPtr exec,
00082 const xmlChar *value,
00083 void *data);
00084 XMLPUBFUN int XMLCALL
00085 xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
00086 const xmlChar *value,
00087 const xmlChar *value2,
00088 void *data);
00089
00090 XMLPUBFUN int XMLCALL
00091 xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
00092 int *nbval,
00093 int *nbneg,
00094 xmlChar **values,
00095 int *terminal);
00096 XMLPUBFUN int XMLCALL
00097 xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
00098 const xmlChar **string,
00099 int *nbval,
00100 int *nbneg,
00101 xmlChar **values,
00102 int *terminal);
00103 #ifdef LIBXML_EXPR_ENABLED
00104
00105
00106
00107
00108
00109
00110 typedef struct _xmlExpCtxt xmlExpCtxt;
00111 typedef xmlExpCtxt *xmlExpCtxtPtr;
00112
00113 XMLPUBFUN void XMLCALL
00114 xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
00115 XMLPUBFUN xmlExpCtxtPtr XMLCALL
00116 xmlExpNewCtxt (int maxNodes,
00117 xmlDictPtr dict);
00118
00119 XMLPUBFUN int XMLCALL
00120 xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
00121 XMLPUBFUN int XMLCALL
00122 xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
00123
00124
00125 typedef struct _xmlExpNode xmlExpNode;
00126 typedef xmlExpNode *xmlExpNodePtr;
00127
00128 typedef enum {
00129 XML_EXP_EMPTY = 0,
00130 XML_EXP_FORBID = 1,
00131 XML_EXP_ATOM = 2,
00132 XML_EXP_SEQ = 3,
00133 XML_EXP_OR = 4,
00134 XML_EXP_COUNT = 5
00135 } xmlExpNodeType;
00136
00137
00138
00139
00140
00141 XMLPUBVAR xmlExpNodePtr forbiddenExp;
00142 XMLPUBVAR xmlExpNodePtr emptyExp;
00143
00144
00145
00146
00147 XMLPUBFUN void XMLCALL
00148 xmlExpFree (xmlExpCtxtPtr ctxt,
00149 xmlExpNodePtr expr);
00150 XMLPUBFUN void XMLCALL
00151 xmlExpRef (xmlExpNodePtr expr);
00152
00153
00154
00155
00156 XMLPUBFUN xmlExpNodePtr XMLCALL
00157 xmlExpParse (xmlExpCtxtPtr ctxt,
00158 const char *expr);
00159 XMLPUBFUN xmlExpNodePtr XMLCALL
00160 xmlExpNewAtom (xmlExpCtxtPtr ctxt,
00161 const xmlChar *name,
00162 int len);
00163 XMLPUBFUN xmlExpNodePtr XMLCALL
00164 xmlExpNewOr (xmlExpCtxtPtr ctxt,
00165 xmlExpNodePtr left,
00166 xmlExpNodePtr right);
00167 XMLPUBFUN xmlExpNodePtr XMLCALL
00168 xmlExpNewSeq (xmlExpCtxtPtr ctxt,
00169 xmlExpNodePtr left,
00170 xmlExpNodePtr right);
00171 XMLPUBFUN xmlExpNodePtr XMLCALL
00172 xmlExpNewRange (xmlExpCtxtPtr ctxt,
00173 xmlExpNodePtr subset,
00174 int min,
00175 int max);
00176
00177
00178
00179 XMLPUBFUN int XMLCALL
00180 xmlExpIsNillable(xmlExpNodePtr expr);
00181 XMLPUBFUN int XMLCALL
00182 xmlExpMaxToken (xmlExpNodePtr expr);
00183 XMLPUBFUN int XMLCALL
00184 xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
00185 xmlExpNodePtr expr,
00186 const xmlChar**langList,
00187 int len);
00188 XMLPUBFUN int XMLCALL
00189 xmlExpGetStart (xmlExpCtxtPtr ctxt,
00190 xmlExpNodePtr expr,
00191 const xmlChar**tokList,
00192 int len);
00193 XMLPUBFUN xmlExpNodePtr XMLCALL
00194 xmlExpStringDerive(xmlExpCtxtPtr ctxt,
00195 xmlExpNodePtr expr,
00196 const xmlChar *str,
00197 int len);
00198 XMLPUBFUN xmlExpNodePtr XMLCALL
00199 xmlExpExpDerive (xmlExpCtxtPtr ctxt,
00200 xmlExpNodePtr expr,
00201 xmlExpNodePtr sub);
00202 XMLPUBFUN int XMLCALL
00203 xmlExpSubsume (xmlExpCtxtPtr ctxt,
00204 xmlExpNodePtr expr,
00205 xmlExpNodePtr sub);
00206 XMLPUBFUN void XMLCALL
00207 xmlExpDump (xmlBufferPtr buf,
00208 xmlExpNodePtr expr);
00209 #endif
00210 #ifdef __cplusplus
00211 }
00212 #endif
00213
00214 #endif
00215
00216 #endif