ReactOS 0.4.16-dev-2208-g6350669
xmlregexp.h
Go to the documentation of this file.
1/*
2 * Summary: regular expressions handling
3 * Description: basic API for libxml regular expressions handling used
4 * for XML Schemas and validation.
5 *
6 * Copy: See Copyright for the status of this software.
7 *
8 * Author: Daniel Veillard
9 */
10
11#ifndef __XML_REGEXP_H__
12#define __XML_REGEXP_H__
13
14#include <stdio.h>
15#include <libxml/xmlversion.h>
16#include <libxml/xmlstring.h>
17
18#ifdef LIBXML_REGEXP_ENABLED
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
30typedef struct _xmlRegexp xmlRegexp;
31typedef xmlRegexp *xmlRegexpPtr;
32
38typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
39typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
40
41/*
42 * The POSIX like API
43 */
44XMLPUBFUN xmlRegexpPtr
45 xmlRegexpCompile (const xmlChar *regexp);
46XMLPUBFUN void xmlRegFreeRegexp(xmlRegexpPtr regexp);
47XMLPUBFUN int
48 xmlRegexpExec (xmlRegexpPtr comp,
49 const xmlChar *value);
50XMLPUBFUN void
51 xmlRegexpPrint (FILE *output,
52 xmlRegexpPtr regexp);
53XMLPUBFUN int
54 xmlRegexpIsDeterminist(xmlRegexpPtr comp);
55
65typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
66 const xmlChar *token,
67 void *transdata,
68 void *inputdata);
69
70/*
71 * The progressive API
72 */
73XMLPUBFUN xmlRegExecCtxtPtr
74 xmlRegNewExecCtxt (xmlRegexpPtr comp,
75 xmlRegExecCallbacks callback,
76 void *data);
77XMLPUBFUN void
78 xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
79XMLPUBFUN int
80 xmlRegExecPushString(xmlRegExecCtxtPtr exec,
81 const xmlChar *value,
82 void *data);
83XMLPUBFUN int
84 xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
85 const xmlChar *value,
86 const xmlChar *value2,
87 void *data);
88
89XMLPUBFUN int
90 xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
91 int *nbval,
92 int *nbneg,
94 int *terminal);
95XMLPUBFUN int
96 xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
97 const xmlChar **string,
98 int *nbval,
99 int *nbneg,
100 xmlChar **values,
101 int *terminal);
102#ifdef LIBXML_EXPR_ENABLED
103/*
104 * Formal regular expression handling
105 * Its goal is to do some formal work on content models
106 */
107
108/* expressions are used within a context */
109typedef struct _xmlExpCtxt xmlExpCtxt;
110typedef xmlExpCtxt *xmlExpCtxtPtr;
111
112XMLPUBFUN void
113 xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
114XMLPUBFUN xmlExpCtxtPtr
115 xmlExpNewCtxt (int maxNodes,
116 xmlDictPtr dict);
117
118XMLPUBFUN int
119 xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
120XMLPUBFUN int
121 xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
122
123/* Expressions are trees but the tree is opaque */
124typedef struct _xmlExpNode xmlExpNode;
125typedef xmlExpNode *xmlExpNodePtr;
126
127typedef enum {
128 XML_EXP_EMPTY = 0,
129 XML_EXP_FORBID = 1,
130 XML_EXP_ATOM = 2,
131 XML_EXP_SEQ = 3,
132 XML_EXP_OR = 4,
133 XML_EXP_COUNT = 5
134} xmlExpNodeType;
135
136/*
137 * 2 core expressions shared by all for the empty language set
138 * and for the set with just the empty token
139 */
140XMLPUBVAR xmlExpNodePtr forbiddenExp;
141XMLPUBVAR xmlExpNodePtr emptyExp;
142
143/*
144 * Expressions are reference counted internally
145 */
146XMLPUBFUN void
147 xmlExpFree (xmlExpCtxtPtr ctxt,
148 xmlExpNodePtr expr);
149XMLPUBFUN void
150 xmlExpRef (xmlExpNodePtr expr);
151
152/*
153 * constructors can be either manual or from a string
154 */
155XMLPUBFUN xmlExpNodePtr
156 xmlExpParse (xmlExpCtxtPtr ctxt,
157 const char *expr);
158XMLPUBFUN xmlExpNodePtr
159 xmlExpNewAtom (xmlExpCtxtPtr ctxt,
160 const xmlChar *name,
161 int len);
162XMLPUBFUN xmlExpNodePtr
163 xmlExpNewOr (xmlExpCtxtPtr ctxt,
164 xmlExpNodePtr left,
165 xmlExpNodePtr right);
166XMLPUBFUN xmlExpNodePtr
167 xmlExpNewSeq (xmlExpCtxtPtr ctxt,
168 xmlExpNodePtr left,
169 xmlExpNodePtr right);
170XMLPUBFUN xmlExpNodePtr
171 xmlExpNewRange (xmlExpCtxtPtr ctxt,
172 xmlExpNodePtr subset,
173 int min,
174 int max);
175/*
176 * The really interesting APIs
177 */
178XMLPUBFUN int
179 xmlExpIsNillable(xmlExpNodePtr expr);
180XMLPUBFUN int
181 xmlExpMaxToken (xmlExpNodePtr expr);
182XMLPUBFUN int
183 xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
184 xmlExpNodePtr expr,
185 const xmlChar**langList,
186 int len);
187XMLPUBFUN int
188 xmlExpGetStart (xmlExpCtxtPtr ctxt,
189 xmlExpNodePtr expr,
190 const xmlChar**tokList,
191 int len);
192XMLPUBFUN xmlExpNodePtr
193 xmlExpStringDerive(xmlExpCtxtPtr ctxt,
194 xmlExpNodePtr expr,
195 const xmlChar *str,
196 int len);
197XMLPUBFUN xmlExpNodePtr
198 xmlExpExpDerive (xmlExpCtxtPtr ctxt,
199 xmlExpNodePtr expr,
200 xmlExpNodePtr sub);
201XMLPUBFUN int
202 xmlExpSubsume (xmlExpCtxtPtr ctxt,
203 xmlExpNodePtr expr,
204 xmlExpNodePtr sub);
205XMLPUBFUN void
206 xmlExpDump (xmlBufferPtr buf,
207 xmlExpNodePtr expr);
208#endif /* LIBXML_EXPR_ENABLED */
209#ifdef __cplusplus
210}
211#endif
212
213#endif /* LIBXML_REGEXP_ENABLED */
214
215#endif /*__XML_REGEXP_H__ */
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble right
Definition: glext.h:10859
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLint left
Definition: glext.h:7726
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
static IPrintDialogCallback callback
Definition: printdlg.c:326
#define min(a, b)
Definition: monoChain.cc:55
const WCHAR * str
Definition: dict.c:59
Definition: query.h:86
Definition: name.c:39
#define max(a, b)
Definition: svc.c:63
Definition: pdh_main.c:96
#define XMLPUBFUN
Definition: xmlexports.h:30
#define XMLPUBVAR
Definition: xmlexports.h:37
unsigned char xmlChar
Definition: xmlstring.h:28