diff options
author | stanton <stanton> | 1999-06-17 19:32:14 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-06-17 19:32:14 (GMT) |
commit | 132b0b161f32aebd943a596184fdda97aa960c7d (patch) | |
tree | 356c44709bbda344154f1a4fe7811fabda634581 /generic/tclRegexp.h | |
parent | 0db76eb23cf35b0d912eb915711eecbe51c65ac1 (diff) | |
download | tcl-132b0b161f32aebd943a596184fdda97aa960c7d.zip tcl-132b0b161f32aebd943a596184fdda97aa960c7d.tar.gz tcl-132b0b161f32aebd943a596184fdda97aa960c7d.tar.bz2 |
* generic/tclTest.c:
* generic/tclRegexp.h:
* generic/tclRegexp.c:
* generic/tcl.h:
* generic/tcl.decls: Renamed Tcl_RegExpMatchObj to
Tcl_RegExpExecObj and added a new Tcl_RegExpMatchObj that is
equivalent to Tcl_RegExpMatch. Added public macros for the regexp
compile/execute flags. Changed to store either an object pointer
or a string pointer in the TclRegexp structure. Changed to avoid
adding a reference to the object or copying the string.
Diffstat (limited to 'generic/tclRegexp.h')
-rw-r--r-- | generic/tclRegexp.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/generic/tclRegexp.h b/generic/tclRegexp.h index 5cee78e..04d381d 100644 --- a/generic/tclRegexp.h +++ b/generic/tclRegexp.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclRegexp.h,v 1.9 1999/06/10 04:28:51 stanton Exp $ + * RCS: @(#) $Id: tclRegexp.h,v 1.10 1999/06/17 19:32:15 stanton Exp $ */ #ifndef _TCLREGEXP @@ -27,16 +27,17 @@ * The TclRegexp structure encapsulates a compiled regex_t, * the flags that were used to compile it, and an array of pointers * that are used to indicate subexpressions after a call to Tcl_RegExpExec. + * Note that the string and objPtr are mutually exclusive. These values + * are needed by Tcl_RegExpRange in order to return pointers into the + * original string. */ typedef struct TclRegexp { int flags; /* Regexp compile flags. */ regex_t re; /* Compiled re, includes number of * subexpressions. */ - Tcl_Obj *objPtr; /* Last object match with this regexp, so - * Tcl_RegExpRange() can convert the matches - * from character indices to UTF-8 byte - * offsets. */ + CONST char *string; /* Last string passed to Tcl_RegExpExec. */ + Tcl_Obj *objPtr; /* Last object passed to Tcl_RegExpExecObj. */ regmatch_t *matches; /* Array of indices into the Tcl_UniChar * representation of the last string matched * with this regexp to indicate the location @@ -53,9 +54,6 @@ typedef struct TclRegexp { EXTERN int TclRegAbout _ANSI_ARGS_((Tcl_Interp *interp, Tcl_RegExp re)); -EXTERN int TclRegExpExecUniChar _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_RegExp re, CONST Tcl_UniChar *uniString, - int numChars, int nmatches, int flags)); EXTERN int TclRegExpMatchObj _ANSI_ARGS_((Tcl_Interp *interp, char *string, Tcl_Obj *patObj)); EXTERN void TclRegExpRangeUniChar _ANSI_ARGS_((Tcl_RegExp re, |