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 * RCS: @(#) $Id: tclRegexp.h,v 1.15 2007/12/13 15:23:20 dgp Exp $ 14 */ 15 16#ifndef _TCLREGEXP 17#define _TCLREGEXP 18 19#include "regex.h" 20 21/* 22 * The TclRegexp structure encapsulates a compiled regex_t, the flags that 23 * were used to compile it, and an array of pointers that are used to indicate 24 * subexpressions after a call to Tcl_RegExpExec. Note that the string and 25 * objPtr are mutually exclusive. These values are needed by Tcl_RegExpRange 26 * in order to return pointers into the original string. 27 */ 28 29typedef struct TclRegexp { 30 int flags; /* Regexp compile flags. */ 31 regex_t re; /* Compiled re, includes number of 32 * subexpressions. */ 33 CONST char *string; /* Last string passed to Tcl_RegExpExec. */ 34 Tcl_Obj *objPtr; /* Last object passed to Tcl_RegExpExecObj. */ 35 Tcl_Obj *globObjPtr; /* Glob pattern rep of RE or NULL if none. */ 36 regmatch_t *matches; /* Array of indices into the Tcl_UniChar 37 * representation of the last string matched 38 * with this regexp to indicate the location 39 * of subexpressions. */ 40 rm_detail_t details; /* Detailed information on match (currently 41 * used only for REG_EXPECT). */ 42 int refCount; /* Count of number of references to this 43 * compiled regexp. */ 44} TclRegexp; 45 46#endif /* _TCLREGEXP */ 47 48/* 49 * Local Variables: 50 * mode: c 51 * c-basic-offset: 4 52 * fill-column: 78 53 * End: 54 */ 55