blob: b66d4d958038cd03d2213e6bf8053c2d8dbe0a39 [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
12#if defined(WIN32) && defined(_MSC_VER)
13#include <libxml/xmlwin32version.h>
14#else
15#include <libxml/xmlversion.h>
16#endif
17#ifdef LIBXML_REGEXP_ENABLED
18
Daniel Veillard4255d502002-04-16 15:50:10 +000019
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/**
25 * xmlRegexpPtr:
26 *
27 * A libxml regular expression, they can actually be far more complex
28 * thank the POSIX regex expressions.
29 */
30typedef struct _xmlRegexp xmlRegexp;
31typedef xmlRegexp *xmlRegexpPtr;
32
33/**
34 * xmlRegExecCtxtPtr:
35 *
36 * A libxml progressive regular expression evaluation context
37 */
38typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
39typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
40
Daniel Veillard84d70a42002-09-16 10:51:38 +000041#ifdef __cplusplus
42}
43#endif
44#include <libxml/tree.h>
45#ifdef __cplusplus
46extern "C" {
47#endif
48
Daniel Veillard4255d502002-04-16 15:50:10 +000049/*
50 * The POSIX like API
51 */
52xmlRegexpPtr xmlRegexpCompile(const xmlChar *regexp);
53void xmlRegFreeRegexp(xmlRegexpPtr regexp);
54int xmlRegexpExec (xmlRegexpPtr comp,
55 const xmlChar *value);
56void xmlRegexpPrint (FILE *output,
57 xmlRegexpPtr regexp);
58
59/*
60 * Callback function when doing a transition in the automata
61 */
62typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
63 const xmlChar *token,
64 void *transdata,
65 void *inputdata);
66
67/*
68 * The progressive API
69 */
70xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp,
71 xmlRegExecCallbacks callback,
72 void *data);
73void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
74int xmlRegExecPushString (xmlRegExecCtxtPtr exec,
75 const xmlChar *value,
76 void *data);
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif /* LIBXML_REGEXP_ENABLED */
83
84#endif /*__XML_REGEXP_H__ */