/app/libxml2-2.4.28/include/libxml2/libxml/xmlregexp.h


    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 #include <libxml/xmlversion.h>
   13 
   14 #ifdef LIBXML_REGEXP_ENABLED
   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 
   37 #ifdef __cplusplus
   38 }
   39 #endif 
   40 #include <libxml/tree.h>
   41 #ifdef __cplusplus
   42 extern "C" {
   43 #endif
   44 
   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);
   54 int			xmlRegexpIsDeterminist(xmlRegexpPtr comp);
   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__ */