亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tclregexp.c

?? tcl是工具命令語言
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*  * tclRegexp.c -- * *	This file contains the public interfaces to the Tcl regular *	expression mechanism. * * Copyright (c) 1998 by Sun Microsystems, Inc. * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tclRegexp.c,v 1.14 2002/01/17 03:03:12 dgp Exp $ */#include "tclInt.h"#include "tclPort.h"#include "tclRegexp.h"/* *---------------------------------------------------------------------- * The routines in this file use Henry Spencer's regular expression * package contained in the following additional source files: * *	regc_color.c	regc_cvec.c	regc_lex.c *	regc_nfa.c	regcomp.c	regcustom.h *	rege_dfa.c	regerror.c	regerrs.h *	regex.h		regexec.c	regfree.c *	regfronts.c	regguts.h * * Copyright (c) 1998 Henry Spencer.  All rights reserved. *  * Development of this software was funded, in part, by Cray Research Inc., * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics * Corporation, none of whom are responsible for the results.  The author * thanks all of them.  *  * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. *  * I'd appreciate being given credit for this package in the documentation * of software which uses it, but that is not a requirement. *  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * *** NOTE: this code has been altered slightly for use in Tcl: *** * *** 1. Names have been changed, e.g. from re_comp to		 *** * ***    TclRegComp, to avoid clashes with other 		 *** * ***    regexp implementations used by applications. 		 *** *//* * Thread local storage used to maintain a per-thread cache of compiled * regular expressions. */#define NUM_REGEXPS 30typedef struct ThreadSpecificData {    int initialized;		/* Set to 1 when the module is initialized. */    char *patterns[NUM_REGEXPS];/* Strings corresponding to compiled				 * regular expression patterns.	 NULL				 * means that this slot isn't used.				 * Malloc-ed. */    int patLengths[NUM_REGEXPS];/* Number of non-null characters in				 * corresponding entry in patterns.				 * -1 means entry isn't used. */    struct TclRegexp *regexps[NUM_REGEXPS];				/* Compiled forms of above strings.  Also				 * malloc-ed, or NULL if not in use yet. */} ThreadSpecificData;static Tcl_ThreadDataKey dataKey;/* * Declarations for functions used only in this file. */static TclRegexp *	CompileRegexp _ANSI_ARGS_((Tcl_Interp *interp,			    CONST char *pattern, int length, int flags));static void		DupRegexpInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,			    Tcl_Obj *copyPtr));static void		FinalizeRegexp _ANSI_ARGS_((ClientData clientData));static void		FreeRegexp _ANSI_ARGS_((TclRegexp *regexpPtr));static void		FreeRegexpInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));static int		RegExpExecUniChar _ANSI_ARGS_((Tcl_Interp *interp,			    Tcl_RegExp re, CONST Tcl_UniChar *uniString,			    int numChars, int nmatches, int flags));static int		SetRegexpFromAny _ANSI_ARGS_((Tcl_Interp *interp,			    Tcl_Obj *objPtr));/* * The regular expression Tcl object type.  This serves as a cache * of the compiled form of the regular expression. */Tcl_ObjType tclRegexpType = {    "regexp",				/* name */    FreeRegexpInternalRep,		/* freeIntRepProc */    DupRegexpInternalRep,		/* dupIntRepProc */    NULL,				/* updateStringProc */    SetRegexpFromAny			/* setFromAnyProc */};/* *---------------------------------------------------------------------- * * Tcl_RegExpCompile -- * *	Compile a regular expression into a form suitable for fast *	matching.  This procedure is DEPRECATED in favor of the *	object version of the command. * * Results: *	The return value is a pointer to the compiled form of string, *	suitable for passing to Tcl_RegExpExec.  This compiled form *	is only valid up until the next call to this procedure, so *	don't keep these around for a long time!  If an error occurred *	while compiling the pattern, then NULL is returned and an error *	message is left in the interp's result. * * Side effects: *	Updates the cache of compiled regexps. * *---------------------------------------------------------------------- */Tcl_RegExpTcl_RegExpCompile(interp, string)    Tcl_Interp *interp;		/* For use in error reporting and				 * to access the interp regexp cache. */    CONST char *string;		/* String for which to produce				 * compiled regular expression. */{    return (Tcl_RegExp) CompileRegexp(interp, string, (int) strlen(string),	    REG_ADVANCED);}/* *---------------------------------------------------------------------- * * Tcl_RegExpExec -- * *	Execute the regular expression matcher using a compiled form *	of a regular expression and save information about any match *	that is found. * * Results: *	If an error occurs during the matching operation then -1 *	is returned and the interp's result contains an error message. *	Otherwise the return value is 1 if a matching range is *	found and 0 if there is no matching range. * * Side effects: *	None. * *---------------------------------------------------------------------- */intTcl_RegExpExec(interp, re, string, start)    Tcl_Interp *interp;		/* Interpreter to use for error reporting. */    Tcl_RegExp re;		/* Compiled regular expression;  must have				 * been returned by previous call to				 * Tcl_GetRegExpFromObj. */    CONST char *string;		/* String against which to match re. */    CONST char *start;		/* If string is part of a larger string,				 * this identifies beginning of larger				 * string, so that "^" won't match. */{    int flags, result, numChars;    TclRegexp *regexp = (TclRegexp *)re;    Tcl_DString ds;    CONST Tcl_UniChar *ustr;    /*     * If the starting point is offset from the beginning of the buffer,     * then we need to tell the regexp engine not to match "^".     */    if (string > start) {	flags = REG_NOTBOL;    } else {	flags = 0;    }    /*     * Remember the string for use by Tcl_RegExpRange().     */    regexp->string = string;    regexp->objPtr = NULL;    /*     * Convert the string to Unicode and perform the match.     */    Tcl_DStringInit(&ds);    ustr = Tcl_UtfToUniCharDString(string, -1, &ds);    numChars = Tcl_DStringLength(&ds) / sizeof(Tcl_UniChar);    result = RegExpExecUniChar(interp, re, ustr, numChars,	    -1 /* nmatches */, flags);    Tcl_DStringFree(&ds);    return result;}/* *--------------------------------------------------------------------------- * * Tcl_RegExpRange -- * *	Returns pointers describing the range of a regular expression match, *	or one of the subranges within the match. * * Results: *	The variables at *startPtr and *endPtr are modified to hold the *	addresses of the endpoints of the range given by index.  If the *	specified range doesn't exist then NULLs are returned. * * Side effects: *	None. * *--------------------------------------------------------------------------- */voidTcl_RegExpRange(re, index, startPtr, endPtr)    Tcl_RegExp re;		/* Compiled regular expression that has				 * been passed to Tcl_RegExpExec. */    int index;			/* 0 means give the range of the entire				 * match, > 0 means give the range of				 * a matching subrange. */    CONST char **startPtr;	/* Store address of first character in				 * (sub-) range here. */    CONST char **endPtr;	/* Store address of character just after last				 * in (sub-) range here. */{    TclRegexp *regexpPtr = (TclRegexp *) re;    CONST char *string;    if ((size_t) index > regexpPtr->re.re_nsub) {	*startPtr = *endPtr = NULL;    } else if (regexpPtr->matches[index].rm_so < 0) {	*startPtr = *endPtr = NULL;    } else {	if (regexpPtr->objPtr) {	    string = Tcl_GetString(regexpPtr->objPtr);	} else {	    string = regexpPtr->string;	}	*startPtr = Tcl_UtfAtIndex(string, regexpPtr->matches[index].rm_so);	*endPtr = Tcl_UtfAtIndex(string, regexpPtr->matches[index].rm_eo);    }}/* *--------------------------------------------------------------------------- * * RegExpExecUniChar -- * *	Execute the regular expression matcher using a compiled form of a *	regular expression and save information about any match that is *	found. * * Results: *	If an error occurs during the matching operation then -1 is *	returned and an error message is left in interp's result. *	Otherwise the return value is 1 if a matching range was found or *	0 if there was no matching range. * * Side effects: *	None. * *---------------------------------------------------------------------- */static intRegExpExecUniChar(interp, re, wString, numChars, nmatches, flags)    Tcl_Interp *interp;		/* Interpreter to use for error reporting. */    Tcl_RegExp re;		/* Compiled regular expression; returned by				 * a previous call to Tcl_GetRegExpFromObj */    CONST Tcl_UniChar *wString;	/* String against which to match re. */    int numChars;		/* Length of Tcl_UniChar string (must				 * be >= 0). */    int nmatches;		/* How many subexpression matches (counting				 * the whole match as subexpression 0) are				 * of interest.  -1 means "don't know". */    int flags;			/* Regular expression flags. */{    int status;    TclRegexp *regexpPtr = (TclRegexp *) re;    size_t last = regexpPtr->re.re_nsub + 1;    size_t nm = last;    if (nmatches >= 0 && (size_t) nmatches < nm) {	nm = (size_t) nmatches;    }    status = TclReExec(&regexpPtr->re, wString, (size_t) numChars,	    &regexpPtr->details, nm, regexpPtr->matches, flags);    /*     * Check for errors.     */    if (status != REG_OKAY) {	if (status == REG_NOMATCH) {	    return 0;	}	if (interp != NULL) {	    TclRegError(interp, "error while matching regular expression: ",		    status);	}	return -1;    }    return 1;}/* *--------------------------------------------------------------------------- * * TclRegExpRangeUniChar -- * *	Returns pointers describing the range of a regular expression match, *	or one of the subranges within the match, or the hypothetical range *	represented by the rm_extend field of the rm_detail_t. * * Results: *	The variables at *startPtr and *endPtr are modified to hold the *	offsets of the endpoints of the range given by index.  If the *	specified range doesn't exist then -1s are supplied. * * Side effects: *	None. * *--------------------------------------------------------------------------- */voidTclRegExpRangeUniChar(re, index, startPtr, endPtr)    Tcl_RegExp re;		/* Compiled regular expression that has				 * been passed to Tcl_RegExpExec. */    int index;			/* 0 means give the range of the entire				 * match, > 0 means give the range of				 * a matching subrange, -1 means the				 * range of the rm_extend field. */    int *startPtr;		/* Store address of first character in				 * (sub-) range here. */    int *endPtr;		/* Store address of character just after last				 * in (sub-) range here. */{    TclRegexp *regexpPtr = (TclRegexp *) re;    if ((regexpPtr->flags&REG_EXPECT) && index == -1) {	*startPtr = regexpPtr->details.rm_extend.rm_so;	*endPtr = regexpPtr->details.rm_extend.rm_eo;    } else if ((size_t) index > regexpPtr->re.re_nsub) {	*startPtr = -1;	*endPtr = -1;    } else {	*startPtr = regexpPtr->matches[index].rm_so;	*endPtr = regexpPtr->matches[index].rm_eo;    }}/* *---------------------------------------------------------------------- * * Tcl_RegExpMatch -- * *	See if a string matches a regular expression. * * Results: *	If an error occurs during the matching operation then -1 *	is returned and the interp's result contains an error message. *	Otherwise the return value is 1 if "string" matches "pattern" *	and 0 otherwise. * * Side effects: *	None. * *---------------------------------------------------------------------- */intTcl_RegExpMatch(interp, string, pattern)    Tcl_Interp *interp;		/* Used for error reporting. May be NULL. */    CONST char *string;		/* String. */    CONST char *pattern;	/* Regular expression to match against				 * string. */{    Tcl_RegExp re;    re = Tcl_RegExpCompile(interp, pattern);    if (re == NULL) {	return -1;    }    return Tcl_RegExpExec(interp, re, string, string);}/* *---------------------------------------------------------------------- * * Tcl_RegExpExecObj -- * *	Execute a precompiled regexp against the given object. * * Results: *	If an error occurs during the matching operation then -1 *	is returned and the interp's result contains an error message. *	Otherwise the return value is 1 if "string" matches "pattern" *	and 0 otherwise. * * Side effects: *	Converts the object to a Unicode object. * *---------------------------------------------------------------------- */intTcl_RegExpExecObj(interp, re, objPtr, offset, nmatches, flags)    Tcl_Interp *interp;		/* Interpreter to use for error reporting. */    Tcl_RegExp re;		/* Compiled regular expression;  must have				 * been returned by previous call to				 * Tcl_GetRegExpFromObj. */    Tcl_Obj *objPtr;		/* String against which to match re. */    int offset;			/* Character index that marks where matching				 * should begin. */    int nmatches;		/* How many subexpression matches (counting				 * the whole match as subexpression 0) are				 * of interest.  -1 means all of them. */    int flags;			/* Regular expression execution flags. */{    TclRegexp *regexpPtr = (TclRegexp *) re;    Tcl_UniChar *udata;    int length;    /*     * Save the target object so we can extract strings from it later.     */    regexpPtr->string = NULL;    regexpPtr->objPtr = objPtr;    udata = Tcl_GetUnicodeFromObj(objPtr, &length);    if (offset > length) {	offset = length;    }    udata += offset;    length -= offset;        return RegExpExecUniChar(interp, re, udata, length, nmatches, flags);}/* *---------------------------------------------------------------------- * * Tcl_RegExpMatchObj -- * *	See if an object matches a regular expression. * * Results: *	If an error occurs during the matching operation then -1 *	is returned and the interp's result contains an error message. *	Otherwise the return value is 1 if "string" matches "pattern" *	and 0 otherwise. * * Side effects: *	Changes the internal rep of the pattern and string objects. * *---------------------------------------------------------------------- */intTcl_RegExpMatchObj(interp, stringObj, patternObj)    Tcl_Interp *interp;		/* Used for error reporting. May be NULL. */    Tcl_Obj *stringObj;		/* Object containing the String to search. */    Tcl_Obj *patternObj;	/* Regular expression to match against				 * string. */{    Tcl_RegExp re;    re = Tcl_GetRegExpFromObj(interp, patternObj,	    TCL_REG_ADVANCED | TCL_REG_NOSUB);    if (re == NULL) {	return -1;    }    return Tcl_RegExpExecObj(interp, re, stringObj, 0 /* offset */,	    0 /* nmatches */, 0 /* flags */);}/* *---------------------------------------------------------------------- * * Tcl_RegExpGetInfo -- * *	Retrieve information about the current match. * * Results: *	None. *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
毛片基地黄久久久久久天堂| 91精品国产美女浴室洗澡无遮挡| 国产91精品露脸国语对白| 美女网站在线免费欧美精品| 日本一区中文字幕| 蜜桃av噜噜一区| 视频一区在线播放| 日日噜噜夜夜狠狠视频欧美人 | 综合久久给合久久狠狠狠97色 | 视频一区二区不卡| 香蕉影视欧美成人| 青青草伊人久久| 久久99精品国产麻豆不卡| 国内精品国产三级国产a久久| 久久99精品国产91久久来源| 韩国欧美国产一区| 国产福利不卡视频| 成人av电影在线网| 91精品欧美综合在线观看最新| 欧美日韩精品三区| 日韩午夜在线播放| 久久午夜羞羞影院免费观看| 欧美高清一级片在线观看| 亚洲天堂久久久久久久| 亚洲高清免费视频| 美女视频免费一区| 成人免费不卡视频| 欧美日韩一区二区电影| 欧美va亚洲va在线观看蝴蝶网| 国产欧美日韩视频在线观看| 亚洲裸体xxx| 日韩精品一二三四| 国产精品一色哟哟哟| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 中文字幕一区二区日韩精品绯色| 自拍偷拍国产亚洲| 三级在线观看一区二区| 国产一区二区看久久| a4yy欧美一区二区三区| 欧美三级午夜理伦三级中视频| 欧美一级日韩免费不卡| 欧美激情在线免费观看| 亚洲摸摸操操av| 日本成人超碰在线观看| 成人福利视频网站| 欧美日韩一区二区三区免费看| 精品少妇一区二区三区| 亚洲精品视频在线看| 国产一区日韩二区欧美三区| 91免费观看视频在线| 日韩三级在线观看| 一区二区三区四区激情| 国产精品香蕉一区二区三区| 欧美撒尿777hd撒尿| 久久免费午夜影院| 亚洲国产精品久久艾草纯爱| 国内一区二区在线| 欧美羞羞免费网站| 久久新电视剧免费观看| 亚洲欧美二区三区| 国产一区二区电影| 欧美日韩亚洲另类| 国产精品久久看| 捆绑调教一区二区三区| 欧美亚洲动漫制服丝袜| 国产精品网友自拍| 久久国产精品72免费观看| 色又黄又爽网站www久久| 国产视频一区在线观看 | 在线视频亚洲一区| 国产午夜精品福利| 免费看日韩精品| 欧美在线观看一二区| 国产精品久久久久久久浪潮网站 | 日韩va欧美va亚洲va久久| 99久久夜色精品国产网站| 久久亚洲精品国产精品紫薇| 五月激情综合色| 91福利在线导航| 亚洲欧美色图小说| 丰满岳乱妇一区二区三区| 久久综合一区二区| 久久精品国产999大香线蕉| 欧美伊人精品成人久久综合97 | 日本成人在线视频网站| 欧美写真视频网站| 一区二区三区在线观看欧美| 北条麻妃一区二区三区| 国产日韩欧美亚洲| 黄色小说综合网站| 日韩一级大片在线| 日韩vs国产vs欧美| 91精品国产综合久久香蕉的特点| 亚洲一区电影777| 日本国产一区二区| 一二三四社区欧美黄| 在线视频一区二区三| 夜夜夜精品看看| 91福利国产成人精品照片| 亚洲色图视频网| 色婷婷综合久久久久中文一区二区 | 懂色中文一区二区在线播放| 精品国产a毛片| 久久99精品久久久久| 精品国产精品网麻豆系列| 国内精品伊人久久久久av影院 | 久久99日本精品| 精品国产青草久久久久福利| 日本不卡一区二区| 日韩视频不卡中文| 国产风韵犹存在线视精品| 国产日韩成人精品| a级精品国产片在线观看| 日韩一区欧美一区| 欧美在线三级电影| 日本不卡一二三区黄网| 精品国产污网站| 成人免费视频caoporn| 亚洲三级在线免费| 欧美视频精品在线观看| 日本欧美一区二区在线观看| 精品国偷自产国产一区| 国产成人一级电影| 国产精品久久久久久久裸模| 在线观看欧美黄色| 美女视频一区二区三区| 国产片一区二区| 欧美日韩免费一区二区三区视频| 午夜精品久久久久久久蜜桃app| 4438x亚洲最大成人网| 激情综合网激情| 国产精品情趣视频| 欧美亚一区二区| 精品中文字幕一区二区小辣椒| 国产喂奶挤奶一区二区三区| 一本久道久久综合中文字幕| 日本欧美在线观看| 国产精品伦一区二区三级视频| 欧美三区在线观看| 国产一区福利在线| 亚洲精品videosex极品| 欧美一区二区视频在线观看| 国产成人精品综合在线观看| 一区二区成人在线| 精品成人佐山爱一区二区| 99re热视频精品| 麻豆视频一区二区| 中文字幕亚洲视频| 日韩欧美一区二区久久婷婷| 成人小视频在线观看| 亚洲高清在线精品| 日本一区二区高清| 欧美精品一二三| 成人福利电影精品一区二区在线观看 | 婷婷成人综合网| 国产欧美日韩视频一区二区| 欧美裸体一区二区三区| 粉嫩高潮美女一区二区三区| 亚洲va天堂va国产va久| 国产日产欧美一区| 51精品国自产在线| 91麻豆免费看| 国产麻豆一精品一av一免费| 亚洲影视在线观看| 国产视频一区二区在线| 91精品午夜视频| 日本韩国一区二区三区视频| 国产美女娇喘av呻吟久久| 亚洲国产一区二区视频| 中文在线资源观看网站视频免费不卡 | 欧美中文字幕一区二区三区亚洲| 国产美女娇喘av呻吟久久| 天堂资源在线中文精品| 国产精品少妇自拍| 欧美变态tickle挠乳网站| 欧美三级在线播放| 一本大道久久a久久综合| 国产69精品久久久久777| 麻豆成人av在线| 亚洲第一av色| 一区二区在线看| 亚洲欧洲av另类| 欧美激情资源网| 国产亚洲va综合人人澡精品| 日韩午夜中文字幕| 91精品婷婷国产综合久久竹菊| 欧美伊人久久久久久久久影院 | 精品国产伦一区二区三区观看方式| 欧美三级视频在线播放| 91丝袜美女网| 国产电影一区二区三区| 韩国v欧美v日本v亚洲v| 精品亚洲免费视频| 蜜臀av在线播放一区二区三区| 日韩中文字幕亚洲一区二区va在线| 亚洲色欲色欲www| 亚洲视频精选在线| 亚洲色欲色欲www在线观看| 国产精品高潮久久久久无| 中文字幕精品一区二区精品绿巨人|