1 |
/*$Header$ */
|
2 |
/*
|
3 |
* tclRegexp.h --
|
4 |
*
|
5 |
* This file contains definitions used internally by Henry
|
6 |
* Spencer's regular expression code.
|
7 |
*
|
8 |
* Copyright (c) 1998 by Sun Microsystems, Inc.
|
9 |
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
10 |
*
|
11 |
* See the file "license.terms" for information on usage and redistribution
|
12 |
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
13 |
*
|
14 |
* RCS: @(#) $Id: tclregexp.h,v 1.1.1.1 2001/06/13 04:45:39 dtashley Exp $
|
15 |
*/
|
16 |
|
17 |
#ifndef _TCLREGEXP
|
18 |
#define _TCLREGEXP
|
19 |
|
20 |
#include "regex.h"
|
21 |
|
22 |
#ifdef BUILD_tcl
|
23 |
# undef TCL_STORAGE_CLASS
|
24 |
# define TCL_STORAGE_CLASS DLLEXPORT
|
25 |
#endif
|
26 |
|
27 |
/*
|
28 |
* The TclRegexp structure encapsulates a compiled regex_t,
|
29 |
* the flags that were used to compile it, and an array of pointers
|
30 |
* that are used to indicate subexpressions after a call to Tcl_RegExpExec.
|
31 |
* Note that the string and objPtr are mutually exclusive. These values
|
32 |
* are needed by Tcl_RegExpRange in order to return pointers into the
|
33 |
* original string.
|
34 |
*/
|
35 |
|
36 |
typedef struct TclRegexp {
|
37 |
int flags; /* Regexp compile flags. */
|
38 |
regex_t re; /* Compiled re, includes number of
|
39 |
* subexpressions. */
|
40 |
CONST char *string; /* Last string passed to Tcl_RegExpExec. */
|
41 |
Tcl_Obj *objPtr; /* Last object passed to Tcl_RegExpExecObj. */
|
42 |
regmatch_t *matches; /* Array of indices into the Tcl_UniChar
|
43 |
* representation of the last string matched
|
44 |
* with this regexp to indicate the location
|
45 |
* of subexpressions. */
|
46 |
rm_detail_t details; /* Detailed information on match (currently
|
47 |
* used only for REG_EXPECT). */
|
48 |
int refCount; /* Count of number of references to this
|
49 |
* compiled regexp. */
|
50 |
} TclRegexp;
|
51 |
|
52 |
#endif /* _TCLREGEXP */
|
53 |
|
54 |
/* End of tclregexp.h */
|