File: regexp.h

package info (click to toggle)
less 668-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,988 kB
  • sloc: ansic: 24,976; perl: 884; sh: 399; makefile: 123; python: 33
file content (34 lines) | stat: -rw-r--r-- 1,127 bytes parent folder | download
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
/*
 * Definitions etc. for regexp(3) routines.
 *
 * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
 * not the System V one.
 */

#ifndef _REGEXP
#define _REGEXP 1

#define NSUBEXP  10
typedef struct regexp {
        constant char *startp[NSUBEXP];
        constant char *endp[NSUBEXP];
        char regstart;          /* Internal use only. */
        char reganch;           /* Internal use only. */
        char *regmust;          /* Internal use only. */
        int regmlen;            /* Internal use only. */
        char program[1];        /* Unwarranted chumminess with compiler. */
} regexp;

#if defined(__STDC__) || defined(__cplusplus)
#   define _ANSI_ARGS_(x)       x
#else
#   define _ANSI_ARGS_(x)       ()
#endif

extern regexp *regcomp _ANSI_ARGS_((constant char *exp));
extern int regexec _ANSI_ARGS_((regexp *prog, constant char *string));
extern int regexec2 _ANSI_ARGS_((regexp *prog, constant char *string, int notbol));
extern void regsub _ANSI_ARGS_((regexp *prog, constant char *source, char *dest));
extern void regerror _ANSI_ARGS_((constant char *msg));

#endif /* REGEXP */