Hash :
954aae90
Author :
Date :
2025-05-16T21:13:17
doc: Improve regexp documentation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
/**
* @file
*
* @brief Regular expressions
*
* A regular expression engine used for DTD and XML Schema
* validation.
*
* @copyright See Copyright for the status of this software.
*
* @author Daniel Veillard
*/
#ifndef __XML_REGEXP_H__
#define __XML_REGEXP_H__
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/xmlstring.h>
#ifdef LIBXML_REGEXP_ENABLED
#ifdef __cplusplus
extern "C" {
#endif
/**
* A libxml regular expression
*/
typedef struct _xmlRegexp xmlRegexp;
typedef xmlRegexp *xmlRegexpPtr;
/**
* A libxml progressive regular expression evaluation context
*/
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
/*
* The POSIX like API
*/
XMLPUBFUN xmlRegexp *
xmlRegexpCompile (const xmlChar *regexp);
XMLPUBFUN void xmlRegFreeRegexp(xmlRegexp *regexp);
XMLPUBFUN int
xmlRegexpExec (xmlRegexp *comp,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN void
xmlRegexpPrint (FILE *output,
xmlRegexp *regexp);
XMLPUBFUN int
xmlRegexpIsDeterminist(xmlRegexp *comp);
/**
* Callback function when doing a transition in the automata
*
* @param exec the regular expression context
* @param token the current token string
* @param transdata transition data
* @param inputdata input data
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxt *exec,
const xmlChar *token,
void *transdata,
void *inputdata);
/*
* The progressive API
*/
XML_DEPRECATED
XMLPUBFUN xmlRegExecCtxt *
xmlRegNewExecCtxt (xmlRegexp *comp,
xmlRegExecCallbacks callback,
void *data);
XML_DEPRECATED
XMLPUBFUN void
xmlRegFreeExecCtxt (xmlRegExecCtxt *exec);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecPushString(xmlRegExecCtxt *exec,
const xmlChar *value,
void *data);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecPushString2(xmlRegExecCtxt *exec,
const xmlChar *value,
const xmlChar *value2,
void *data);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecNextValues(xmlRegExecCtxt *exec,
int *nbval,
int *nbneg,
xmlChar **values,
int *terminal);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecErrInfo (xmlRegExecCtxt *exec,
const xmlChar **string,
int *nbval,
int *nbneg,
xmlChar **values,
int *terminal);
#ifdef __cplusplus
}
#endif
#endif /* LIBXML_REGEXP_ENABLED */
#endif /*__XML_REGEXP_H__ */