blob: 434b7a2bd9c11e8259919e19ab813ca76c74c471 [file] [log] [blame]
Daniel Veillard4255d502002-04-16 15:50:10 +00001/*
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
Daniel Veillard4255d502002-04-16 15:50:10 +000012#include <libxml/xmlversion.h>
Daniel Veillard4255d502002-04-16 15:50:10 +000013
Igor Zlatkovic7ae91bc2002-11-08 17:18:52 +000014#ifdef LIBXML_REGEXP_ENABLED
Daniel Veillard4255d502002-04-16 15:50:10 +000015
16#ifdef __cplusplus
17extern "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 */
26typedef struct _xmlRegexp xmlRegexp;
27typedef xmlRegexp *xmlRegexpPtr;
28
29/**
30 * xmlRegExecCtxtPtr:
31 *
32 * A libxml progressive regular expression evaluation context
33 */
34typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
35typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
36
Daniel Veillard84d70a42002-09-16 10:51:38 +000037#ifdef __cplusplus
38}
39#endif
40#include <libxml/tree.h>
41#ifdef __cplusplus
42extern "C" {
43#endif
44
Daniel Veillard4255d502002-04-16 15:50:10 +000045/*
46 * The POSIX like API
47 */
48xmlRegexpPtr xmlRegexpCompile(const xmlChar *regexp);
49void xmlRegFreeRegexp(xmlRegexpPtr regexp);
50int xmlRegexpExec (xmlRegexpPtr comp,
51 const xmlChar *value);
52void xmlRegexpPrint (FILE *output,
53 xmlRegexpPtr regexp);
Daniel Veillard23e73572002-09-19 19:56:43 +000054int xmlRegexpIsDeterminist(xmlRegexpPtr comp);
Daniel Veillard4255d502002-04-16 15:50:10 +000055
56/*
57 * Callback function when doing a transition in the automata
58 */
59typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
60 const xmlChar *token,
61 void *transdata,
62 void *inputdata);
63
64/*
65 * The progressive API
66 */
67xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp,
68 xmlRegExecCallbacks callback,
69 void *data);
70void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
71int 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__ */