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