Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2011 13:27:02 +0000 (UTC)
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r224881 - user/gabor/tre-integration/contrib/tre/lib
Message-ID:  <201108151327.p7FDR23B011820@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <limits.h>
 
-#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 <assert.h>
 #include <string.h>
 
-#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 <wctype.h>
 #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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108151327.p7FDR23B011820>