tclRegexp.hGo to the documentation of this file.00001 /* 00002 * tclRegexp.h -- 00003 * 00004 * This file contains definitions used internally by Henry 00005 * Spencer's regular expression code. 00006 * 00007 * Copyright (c) 1998 by Sun Microsystems, Inc. 00008 * Copyright (c) 1998-1999 by Scriptics Corporation. 00009 * 00010 * See the file "license.terms" for information on usage and redistribution 00011 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 00012 * 00013 * RCS: @(#) $Id: tclRegexp.h,v 1.1 2001/08/18 00:48:55 fmk Exp $ 00014 */ 00015 00016 #ifndef _TCLREGEXP 00017 #define _TCLREGEXP 00018 00019 #include "regex.h" 00020 00021 #ifdef BUILD_tcl 00022 # undef TCL_STORAGE_CLASS 00023 # define TCL_STORAGE_CLASS DLLEXPORT 00024 #endif 00025 00026 /* 00027 * The TclRegexp structure encapsulates a compiled regex_t, 00028 * the flags that were used to compile it, and an array of pointers 00029 * that are used to indicate subexpressions after a call to Tcl_RegExpExec. 00030 * Note that the string and objPtr are mutually exclusive. These values 00031 * are needed by Tcl_RegExpRange in order to return pointers into the 00032 * original string. 00033 */ 00034 00035 typedef struct TclRegexp { 00036 int flags; /* Regexp compile flags. */ 00037 regex_t re; /* Compiled re, includes number of 00038 * subexpressions. */ 00039 CONST char *string; /* Last string passed to Tcl_RegExpExec. */ 00040 Tcl_Obj *objPtr; /* Last object passed to Tcl_RegExpExecObj. */ 00041 regmatch_t *matches; /* Array of indices into the Tcl_UniChar 00042 * representation of the last string matched 00043 * with this regexp to indicate the location 00044 * of subexpressions. */ 00045 rm_detail_t details; /* Detailed information on match (currently 00046 * used only for REG_EXPECT). */ 00047 int refCount; /* Count of number of references to this 00048 * compiled regexp. */ 00049 } TclRegexp; 00050 00051 #endif /* _TCLREGEXP */ |