aboutsummaryrefslogtreecommitdiff
path: root/libxml2-2.9.10/os400/libxmlrpg/xmlregexp.rpgle
blob: 01d411a73a439630560223258bdf8d0cb10a9bcb (plain)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
      * Summary: regular expressions handling
      * Description: basic API for libxml regular expressions handling used
      *              for XML Schemas and validation.
      *
      * Copy: See Copyright for the status of this software.
      *
      * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.

      /if not defined(XML_REGEXP_H__)
      /define XML_REGEXP_H__

      /include "libxmlrpg/xmlversion"

      /if defined(LIBXML_REGEXP_ENABLED)

      /include "libxmlrpg/xmlTypesC"

      * xmlRegexpPtr:
      *
      * A libxml regular expression, they can actually be far more complex
      * thank the POSIX regex expressions.

     d xmlRegexpPtr    s               *   based(######typedef######)

      * xmlRegExecCtxtPtr:
      *
      * A libxml progressive regular expression evaluation context

     d xmlRegExecCtxtPtr...
     d                 s               *   based(######typedef######)

      /include "libxmlrpg/tree"
      /include "libxmlrpg/dict"

      * The POSIX like API

     d xmlRegexpCompile...
     d                 pr                  extproc('xmlRegexpCompile')
     d                                     like(xmlRegexpPtr)
     d  regexp                         *   value options(*string)               const xmlChar *

     d xmlRegFreeRegexp...
     d                 pr                  extproc('xmlRegFreeRegexp')
     d  regexp                             value like(xmlRegexpPtr)

     d xmlRegexpExec   pr                  extproc('xmlRegexpExec')
     d                                     like(xmlCint)
     d  comp                               value like(xmlRegexpPtr)
     d  value                          *   value options(*string)               const xmlChar *

     d xmlRegexpPrint  pr                  extproc('xmlRegexpPrint')
     d  output                         *   value                                FILE *
     d  regexp                             value like(xmlRegexpPtr)

     d xmlRegexpIsDeterminist...
     d                 pr                  extproc('xmlRegexpIsDeterminist')
     d                                     like(xmlCint)
     d  comp                               value like(xmlRegexpPtr)

      * xmlRegExecCallbacks:
      * @exec: the regular expression context
      * @token: the current token string
      * @transdata: transition data
      * @inputdata: input data
      *
      * Callback function when doing a transition in the automata

     d xmlRegExecCallbacks...
     d                 s               *   based(######typedef######)
     d                                     procptr

      * The progressive API

     d xmlRegNewExecCtxt...
     d                 pr                  extproc('xmlRegNewExecCtxt')
     d                                     like(xmlRegExecCtxtPtr)
     d  comp                               value like(xmlRegexpPtr)
     d  callback                           value like(xmlRegExecCallbacks)
     d  data                           *   value                                void *

     d xmlRegFreeExecCtxt...
     d                 pr                  extproc('xmlRegFreeExecCtxt')
     d  exec                               value like(xmlRegExecCtxtPtr)

     d xmlRegExecPushString...
     d                 pr                  extproc('xmlRegExecPushString')
     d                                     like(xmlCint)
     d  exec                               value like(xmlRegExecCtxtPtr)
     d  value                          *   value options(*string)               const xmlChar *
     d  data                           *   value                                void *

     d xmlRegExecPushString2...
     d                 pr                  extproc('xmlRegExecPushString2')
     d                                     like(xmlCint)
     d  exec                               value like(xmlRegExecCtxtPtr)
     d  value                          *   value options(*string)               const xmlChar *
     d  value2                         *   value options(*string)               const xmlChar *
     d  data                           *   value                                void *

     d xmlRegExecNextValues...
     d                 pr                  extproc('xmlRegExecNextValues')
     d                                     like(xmlCint)
     d  exec                               value like(xmlRegExecCtxtPtr)
     d  nbval                              like(xmlCint)
     d  nbneg                              like(xmlCint)
     d  values                         *                                        xmlChar * (*)
     d  terminal                           like(xmlCint)

     d xmlRegExecErrInfo...
     d                 pr                  extproc('xmlRegExecErrInfo')
     d                                     like(xmlCint)
     d  exec                               value like(xmlRegExecCtxtPtr)
     d  string                         *                                        const xmlChar * (*)
     d  nbval                              like(xmlCint)
     d  nbneg                              like(xmlCint)
     d  values                         *                                        xmlChar * (*)
     d  terminal                           like(xmlCint)

      /if defined(LIBXML_EXPR_ENABLED)

      * Formal regular expression handling
      * Its goal is to do some formal work on content models

      * expressions are used within a context

     d xmlExpCtxtPtr   s               *   based(######typedef######)

     d xmlExpFreeCtxt  pr                  extproc('xmlExpFreeCtxt')
     d  ctxt                               value like(xmlExpCtxtPtr)

     d xmlExpNewCtxt   pr                  extproc('xmlExpNewCtxt')
     d                                     like(xmlExpCtxtPtr)
     d  maxNodes                           value like(xmlCint)
     d  dict                               value like(xmlDictPtr)

     d xmlExpCtxtNbNodes...
     d                 pr                  extproc('xmlExpCtxtNbNodes')
     d                                     like(xmlCint)
     d  ctxt                               value like(xmlExpCtxtPtr)

     d xmlExpCtxtNbCons...
     d                 pr                  extproc('xmlExpCtxtNbCons')
     d                                     like(xmlCint)
     d  ctxt                               value like(xmlExpCtxtPtr)

      * Expressions are trees but the tree is opaque

     d xmlExpNodePtr   s               *   based(######typedef######)

     d xmlExpNodeType  s                   based(######typedef######)
     d                                     like(xmlCenum)
     d  XML_EXP_EMPTY  c                   0
     d  XML_EXP_FORBID...
     d                 c                   1
     d  XML_EXP_ATOM   c                   2
     d  XML_EXP_SEQ    c                   3
     d  XML_EXP_OR     c                   4
     d  XML_EXP_COUNT  c                   5

      * 2 core expressions shared by all for the empty language set
      * and for the set with just the empty token

     d forbiddenExp    s                   import('forbiddenExp')
     d                                     like(xmlExpNodePtr)

     d emptyExp        s                   import('emptyExp')
     d                                     like(xmlExpNodePtr)


      * Expressions are reference counted internally

     d xmlExpFree      pr                  extproc('xmlExpFree')
     d  expr                               value like(xmlExpNodePtr)

     d xmlExpRef       pr                  extproc('xmlExpRef')
     d  expr                               value like(xmlExpNodePtr)

      * constructors can be either manual or from a string

     d xmlExpParse     pr                  extproc('xmlExpParse')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  expr                           *   value options(*string)               const char *

     d xmlExpNewAtom   pr                  extproc('xmlExpNewAtom')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  name                           *   value options(*string)               const xmlChar *
     d  len                                value like(xmlCint)

     d xmlExpNewOr     pr                  extproc('xmlExpNewOr')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  left                               value like(xmlExpNodePtr)
     d  right                              value like(xmlExpNodePtr)

     d xmlExpNewSeq    pr                  extproc('xmlExpNewSeq')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  left                               value like(xmlExpNodePtr)
     d  right                              value like(xmlExpNodePtr)

     d xmlExpNewRange  pr                  extproc('xmlExpNewRange')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  subset                             value like(xmlExpNodePtr)
     d  min                                value like(xmlCint)
     d  max                                value like(xmlCint)

      * The really interesting APIs

     d xmlExpIsNillable...
     d                 pr                  extproc('xmlExpIsNillable')
     d                                     like(xmlCint)
     d  expr                               value like(xmlExpNodePtr)

     d xmlExpMaxToken  pr                  extproc('xmlExpMaxToken')
     d                                     like(xmlCint)
     d  expr                               value like(xmlExpNodePtr)

     d xmlExpGetLanguage...
     d                 pr                  extproc('xmlExpGetLanguage')
     d                                     like(xmlCint)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  expr                               value like(xmlExpNodePtr)
     d  langList                       *                                        const xmlChar *(*)
     d  len                                value like(xmlCint)

     d xmlExpGetStart  pr                  extproc('xmlExpGetStart')
     d                                     like(xmlCint)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  expr                               value like(xmlExpNodePtr)
     d  tokList                        *                                        const xmlChar *(*)
     d  len                                value like(xmlCint)

     d xmlExpStringDerive...
     d                 pr                  extproc('xmlExpStringDerive')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  expr                               value like(xmlExpNodePtr)
     d  str                            *   value options(*string)               const xmlChar *
     d  len                                value like(xmlCint)

     d xmlExpExpDerive...
     d                 pr                  extproc('xmlExpExpDerive')
     d                                     like(xmlExpNodePtr)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  expr                               value like(xmlExpNodePtr)
     d  sub                                value like(xmlExpNodePtr)

     d xmlExpSubsume   pr                  extproc('xmlExpSubsume')
     d                                     like(xmlCint)
     d  ctxt                               value like(xmlExpCtxtPtr)
     d  expr                               value like(xmlExpNodePtr)
     d  sub                                value like(xmlExpNodePtr)

     d xmlExpDump      pr                  extproc('xmlExpDump')
     d  buf                                value like(xmlBufferPtr)
     d  expr                               value like(xmlExpNodePtr)
      /endif                                                                    LIBXML_EXPR_ENABLED
      /endif                                                                    LIBXML_REGEXP_ENABLD
      /endif                                                                    XML_REGEXP_H__