2
* Copyright (c) 2002 by The XFree86 Project, Inc.
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
* and/or sell copies of the Software, and to permit persons to whom the
9
* Software is furnished to do so, subject to the following conditions:
11
* The above copyright notice and this permission notice shall be included in
12
* all copies or substantial portions of the Software.
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
* THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
* Except as contained in this notice, the name of the XFree86 Project shall
23
* not be used in advertising or otherwise to promote the sale, use or other
24
* dealings in this Software without prior written authorization from the
27
* Author: Paulo C�sar Pereira de Andrade
30
/* $XFree86: xc/programs/xedit/lisp/re/re.h,v 1.2 2002/09/23 01:25:41 paulo Exp $ */
43
/* Compile flags options */
44
#define REG_BASIC 0000 /* Not used */
45
#define REG_EXTENDED 0001 /* Not used, only extended supported */
49
#define RE_NEWLINE 0010
50
#define RE_NOSPEC 0020
56
/* Execute flag options */
60
#define RE_TRACE 00400 /* Not used/supported */
61
#define RE_LARGE 01000 /* Not used/supported */
62
#define RE_BACKR 02000 /* Not used/supported */
64
/* Value returned by reexec when match fails */
66
/* Compile error values */
82
#define RE_ATOI 255 /* Not used/supported */
83
#define RE_ITOA 0400 /* Not used/supported */
90
/* (re)gular expression (mat)ch result */
91
typedef struct _re_mat {
96
/* (re)gular expression (cod)e */
97
typedef struct _re_cod {
99
int re_nsub; /* Public member */
100
const char *re_endp; /* Support for RE_PEND */
107
/* compile the given pattern string
108
* returns 0 on success, error code otherwise */
109
int recomp(re_cod *preg, const char *pattern, int flags);
111
/* execute the compiled pattern on the string.
112
* returns 0 if matched, RE_NOMATCH if failed, error code otherwise */
113
int reexec(const re_cod *preg, const char *string,
114
int nmat, re_mat pmat[], int flags);
116
/* formats an error message for the given code in ebuffer */
117
int reerror(int ecode, const re_cod *preg, char *ebuffer, int ebuffer_size);
119
/* frees the given parameter */
120
void refree(re_cod *preg);