__lseek => lseek, __{f,}truncate => {f,}truncate
[unix-history] / usr / src / include / regex.h
CommitLineData
2827e0f4
KB
1/*-
2 * Copyright (c) 1992 Henry Spencer.
3 * Copyright (c) 1992 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Henry Spencer of the University of Toronto.
8 *
9 * %sccs.include.redist.c%
10 *
5b882fd2 11 * @(#)regex.h 5.3 (Berkeley) %G%
2827e0f4
KB
12 */
13
14#ifndef _REGEX_H_
15#define _REGEX_H_
16
17/* types */
18typedef off_t regoff_t;
19
20typedef struct {
21 int re_magic;
22 size_t re_nsub; /* number of parenthesized subexpressions */
5b882fd2 23 const char *re_endp; /* end pointer for REG_PEND */
2827e0f4
KB
24 struct re_guts *re_g; /* none of your business :-) */
25} regex_t;
26
27typedef struct {
28 regoff_t rm_so; /* start of match */
29 regoff_t rm_eo; /* end of match */
30} regmatch_t;
31
2827e0f4 32/* regcomp() flags */
5b882fd2
KB
33#define REG_BASIC 0000
34#define REG_EXTENDED 0001
35#define REG_ICASE 0002
36#define REG_NOSUB 0004
37#define REG_NEWLINE 0010
38#define REG_NOSPEC 0020
39#define REG_PEND 0040
40#define REG_DUMP 0200
41
42/* regerror() flags */
43#define REG_NOMATCH 1
44#define REG_BADPAT 2
45#define REG_ECOLLATE 3
46#define REG_ECTYPE 4
47#define REG_EESCAPE 5
48#define REG_ESUBREG 6
49#define REG_EBRACK 7
50#define REG_EPAREN 8
51#define REG_EBRACE 9
52#define REG_BADBR 10
53#define REG_ERANGE 11
54#define REG_ESPACE 12
55#define REG_BADRPT 13
56#define REG_EMPTY 14
57#define REG_ASSERT 15
58#define REG_INVARG 16
59#define REG_ATOI 255 /* convert name to number (!) */
60#define REG_ITOA 0400 /* convert number to name (!) */
2827e0f4
KB
61
62/* regexec() flags */
63#define REG_NOTBOL 00001
64#define REG_NOTEOL 00002
65#define REG_STARTEND 00004
5b882fd2
KB
66#define REG_TRACE 00400 /* tracing of execution */
67#define REG_LARGE 01000 /* force large representation */
68#define REG_BACKR 02000 /* force use of backref code */
2827e0f4 69
7147ea66
KB
70#include <sys/cdefs.h>
71
72__BEGIN_DECLS
73int regcomp __P((regex_t *, const char *, int));
74size_t regerror __P((int, const regex_t *, char *, size_t));
75int regexec __P((const regex_t *,
76 const char *, size_t, regmatch_t [], int));
77void regfree __P((regex_t *));
78__END_DECLS
79
2827e0f4 80#endif /* !_REGEX_H_ */