sl@0: /* sl@0: * tclRegexp.h -- sl@0: * sl@0: * This file contains definitions used internally by Henry sl@0: * Spencer's regular expression code. sl@0: * sl@0: * Copyright (c) 1998 by Sun Microsystems, Inc. sl@0: * Copyright (c) 1998-1999 by Scriptics Corporation. sl@0: * sl@0: * See the file "license.terms" for information on usage and redistribution sl@0: * of this file, and for a DISCLAIMER OF ALL WARRANTIES. sl@0: * sl@0: * RCS: @(#) $Id: tclRegexp.h,v 1.11 1999/08/02 17:45:38 redman Exp $ sl@0: */ sl@0: sl@0: #ifndef _TCLREGEXP sl@0: #define _TCLREGEXP sl@0: sl@0: #include "regex.h" sl@0: sl@0: #ifdef BUILD_tcl sl@0: # undef TCL_STORAGE_CLASS sl@0: # define TCL_STORAGE_CLASS DLLEXPORT sl@0: #endif sl@0: sl@0: /* sl@0: * The TclRegexp structure encapsulates a compiled regex_t, sl@0: * the flags that were used to compile it, and an array of pointers sl@0: * that are used to indicate subexpressions after a call to Tcl_RegExpExec. sl@0: * Note that the string and objPtr are mutually exclusive. These values sl@0: * are needed by Tcl_RegExpRange in order to return pointers into the sl@0: * original string. sl@0: */ sl@0: sl@0: typedef struct TclRegexp { sl@0: int flags; /* Regexp compile flags. */ sl@0: regex_t re; /* Compiled re, includes number of sl@0: * subexpressions. */ sl@0: CONST char *string; /* Last string passed to Tcl_RegExpExec. */ sl@0: Tcl_Obj *objPtr; /* Last object passed to Tcl_RegExpExecObj. */ sl@0: regmatch_t *matches; /* Array of indices into the Tcl_UniChar sl@0: * representation of the last string matched sl@0: * with this regexp to indicate the location sl@0: * of subexpressions. */ sl@0: rm_detail_t details; /* Detailed information on match (currently sl@0: * used only for REG_EXPECT). */ sl@0: int refCount; /* Count of number of references to this sl@0: * compiled regexp. */ sl@0: } TclRegexp; sl@0: sl@0: #endif /* _TCLREGEXP */