From owner-svn-src-user@FreeBSD.ORG Mon Aug 15 13:27:02 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D7D1065675; Mon, 15 Aug 2011 13:27:02 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B83708FC2C; Mon, 15 Aug 2011 13:27:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7FDR2Qh011825; Mon, 15 Aug 2011 13:27:02 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7FDR23B011820; Mon, 15 Aug 2011 13:27:02 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201108151327.p7FDR23B011820@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 15 Aug 2011 13:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224881 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2011 13:27:02 -0000 Author: gabor Date: Mon Aug 15 13:27:02 2011 New Revision: 224881 URL: http://svn.freebsd.org/changeset/base/224881 Log: - Use internal names for fast matching that match better TRE's internal names. The POSIX-like names will be used to provide an alternative interface for the fast matching code. Added: user/gabor/tre-integration/contrib/tre/lib/tre-fastmatch.c - copied, changed from r224873, user/gabor/tre-integration/contrib/tre/lib/fastmatch.c user/gabor/tre-integration/contrib/tre/lib/tre-fastmatch.h - copied, changed from r224871, user/gabor/tre-integration/contrib/tre/lib/fastmatch.h Deleted: user/gabor/tre-integration/contrib/tre/lib/fastmatch.c user/gabor/tre-integration/contrib/tre/lib/fastmatch.h Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c user/gabor/tre-integration/contrib/tre/lib/tre-compile.c Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/regexec.c Mon Aug 15 13:25:55 2011 (r224880) +++ user/gabor/tre-integration/contrib/tre/lib/regexec.c Mon Aug 15 13:27:02 2011 (r224881) @@ -44,7 +44,7 @@ char *alloca (); #endif /* HAVE_MALLOC_H */ #include -#include "fastmatch.h" +#include "tre-fastmatch.h" #include "tre-internal.h" #include "tre.h" #include "xmalloc.h" @@ -158,7 +158,7 @@ tre_match(const tre_tnfa_t *tnfa, const /* Check if we can cheat with a faster algorithm */ if (shortcut != NULL) - return tre_fastexec(shortcut, string, len, type, nmatch, pmatch, eflags); + return tre_match_fast(shortcut, string, len, type, nmatch, pmatch, eflags); if (tnfa->num_tags > 0 && nmatch > 0) { Modified: user/gabor/tre-integration/contrib/tre/lib/tre-compile.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/tre-compile.c Mon Aug 15 13:25:55 2011 (r224880) +++ user/gabor/tre-integration/contrib/tre/lib/tre-compile.c Mon Aug 15 13:27:02 2011 (r224881) @@ -20,7 +20,7 @@ #include #include -#include "fastmatch.h" +#include "tre-fastmatch.h" #include "tre-internal.h" #include "tre-mem.h" #include "tre-stack.h" @@ -1876,8 +1876,8 @@ tre_compile(regex_t *preg, const tre_cha if (!shortcut) return REG_ESPACE; ret = (cflags & REG_LITERAL) - ? tre_fastcomp_literal(shortcut, regex, n, cflags) - : tre_fastcomp(shortcut, regex, n, cflags); + ? tre_compile_literal(shortcut, regex, n, cflags) + : tre_compile_fast(shortcut, regex, n, cflags); if (ret == REG_OK) { preg->shortcut = shortcut; Copied and modified: user/gabor/tre-integration/contrib/tre/lib/tre-fastmatch.c (from r224873, user/gabor/tre-integration/contrib/tre/lib/fastmatch.c) ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Mon Aug 15 00:38:14 2011 (r224873, copy source) +++ user/gabor/tre-integration/contrib/tre/lib/tre-fastmatch.c Mon Aug 15 13:27:02 2011 (r224881) @@ -37,9 +37,9 @@ #include #endif -#include "fastmatch.h" #include "hashtable.h" #include "tre.h" +#include "tre-fastmatch.h" #include "tre-internal.h" #include "xmalloc.h" @@ -357,8 +357,8 @@ static int fastcmp(const void *, const v * Returns: REG_OK on success, error code otherwise */ int -tre_fastcomp_literal(fastmatch_t *fg, const tre_char_t *pat, size_t n, - int cflags) +tre_compile_literal(fastmatch_t *fg, const tre_char_t *pat, size_t n, + int cflags) { INIT_COMP; @@ -387,8 +387,8 @@ tre_fastcomp_literal(fastmatch_t *fg, co * Returns: REG_OK on success, error code otherwise */ int -tre_fastcomp(fastmatch_t *fg, const tre_char_t *pat, size_t n, - int cflags) +tre_compile_fast(fastmatch_t *fg, const tre_char_t *pat, size_t n, + int cflags) { INIT_COMP; @@ -525,7 +525,7 @@ tre_fastcomp(fastmatch_t *fg, const tre_ * Returns REG_OK or REG_NOMATCH depending on if we find a match or not. */ int -tre_fastexec(const fastmatch_t *fg, const void *data, size_t len, +tre_match_fast(const fastmatch_t *fg, const void *data, size_t len, tre_str_type_t type, int nmatch, regmatch_t pmatch[], int eflags) { unsigned int j = 0; @@ -629,7 +629,7 @@ tre_fastexec(const fastmatch_t *fg, cons * Frees the resources that were allocated when the pattern was compiled. */ void -tre_fastfree(fastmatch_t *fg) +tre_free_fast(fastmatch_t *fg) { #ifdef TRE_WCHAR Copied and modified: user/gabor/tre-integration/contrib/tre/lib/tre-fastmatch.h (from r224871, user/gabor/tre-integration/contrib/tre/lib/fastmatch.h) ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/fastmatch.h Sun Aug 14 22:53:02 2011 (r224871, copy source) +++ user/gabor/tre-integration/contrib/tre/lib/tre-fastmatch.h Mon Aug 15 13:27:02 2011 (r224881) @@ -58,11 +58,11 @@ typedef struct { bool newline; } fastmatch_t; -int tre_fastcomp_literal(fastmatch_t *preg, const tre_char_t *regex, +int tre_compile_literal(fastmatch_t *preg, const tre_char_t *regex, size_t, int); -int tre_fastcomp(fastmatch_t *preg, const tre_char_t *regex, size_t, int); -int tre_fastexec(const fastmatch_t *fg, const void *data, size_t len, +int tre_compile_fast(fastmatch_t *preg, const tre_char_t *regex, size_t, int); +int tre_match_fast(const fastmatch_t *fg, const void *data, size_t len, tre_str_type_t type, int nmatch, regmatch_t pmatch[], int eflags); -void tre_fastfree(fastmatch_t *preg); +void tre_free_fast(fastmatch_t *preg); #endif /* FASTMATCH_H */