commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r807655 - in /commons/sandbox/runtime/trunk/src/main/native: ./ include/arch/darwin/ include/arch/hpux/ include/arch/linux/ include/arch/solaris/ include/arch/unix/ include/arch/windows/ os/unix/ os/win32/ port/ shared/ srclib/regex/
Date Tue, 25 Aug 2009 14:44:11 GMT
Author: mturk
Date: Tue Aug 25 14:44:10 2009
New Revision: 807655

URL: http://svn.apache.org/viewvc?rev=807655&view=rev
Log:
Add fnmatch to the port layer

Added:
    commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c   (with props)
Modified:
    commons/sandbox/runtime/trunk/src/main/native/Makefile.in
    commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
    commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/solaris/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/temps.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c
    commons/sandbox/runtime/trunk/src/main/native/shared/error.c
    commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c
    commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c
    commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Tue Aug 25 14:44:10 2009
@@ -202,6 +202,7 @@
 	$(SRCDIR)/os/hpux/os.$(OBJ)
 
 PPORT_OBJS=\
+	$(SRCDIR)/port/fnmatch.$(OBJ) \
 	$(SRCDIR)/port/rijndael.$(OBJ) \
 	$(SRCDIR)/port/strlcat.$(OBJ) \
 	$(SRCDIR)/port/strlcpy.$(OBJ) \

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Tue Aug 25 14:44:10 2009
@@ -123,6 +123,7 @@
 	$(SRCDIR)/os/win32/wusec.$(OBJ)
 
 PPORT_OBJS=\
+	$(SRCDIR)/port/fnmatch.$(OBJ) \
 	$(SRCDIR)/port/rijndael.$(OBJ) \
 	$(SRCDIR)/port/strlcat.$(OBJ) \
 	$(SRCDIR)/port/strlcpy.$(OBJ) \

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h Tue
Aug 25 14:44:10 2009
@@ -25,6 +25,7 @@
 #include <mach/machine.h>
 #include <mach-o/arch.h>
 #include <signal.h>
+#include <fnmatch.h>
 
 #ifdef __cplusplus
 extern "C" {

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h Tue
Aug 25 14:44:10 2009
@@ -44,6 +44,7 @@
 #define ACR_WANT_STRSIGNAL                  1
 #define ACR_WANT_STRLCAT                    1
 #define ACR_WANT_STRLCPY                    1
+#define ACR_WANT_FNMATCH                    1
 
 /**
  * Temporary APR flags

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h Tue
Aug 25 14:44:10 2009
@@ -21,6 +21,7 @@
  */
 #include <sys/stat.h>
 #include <sys/utsname.h>
+#include <fnmatch.h>
 
 #ifdef __cplusplus
 extern "C" {

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/solaris/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/solaris/acr_arch_private.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/solaris/acr_arch_private.h
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/solaris/acr_arch_private.h
Tue Aug 25 14:44:10 2009
@@ -42,6 +42,7 @@
  */
 #define ACR_WANT_STRLCAT                    1
 #define ACR_WANT_STRLCPY                    1
+#define ACR_WANT_FNMATCH                    1
 
 /**
  * Temporary APR flags

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h Tue Aug 25
14:44:10 2009
@@ -69,19 +69,6 @@
 #define ACR_IOH_FLAGS(H)    acr_ioh_tab[(H) & acr_ioh_mask].flags
 #define ACR_IOH(H)          acr_ioh_tab[(H) & acr_ioh_mask].h
 
-/**
- * Function prototypes for the portable layer
- */
-#if defined(ACR_WANT_STRSIGNAL)
-char *strsignal(int);
-#endif
-#if defined(ACR_WANT_STRLCAT)
-size_t strlcat(char *, const char *, size_t);
-#endif
-#if defined(ACR_WANT_STRLCPY)
-size_t strlcpy(char *, const char *, size_t);
-#endif
-
 static ACR_INLINE void x_free(void *p)
 {
     if (p != NULL) {

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h Tue Aug
25 14:44:10 2009
@@ -431,18 +431,6 @@
 #define SIG_SGE     (void (*)(int))3    /* signal gets error     */
 #define SIG_ACK     (void (*)(int))3    /* acknowledge           */
 
-/**
- * Function prototypes for the portable layer
- */
-#if defined(ACR_WANT_STRSIGNAL)
-char *strsignal(int);
-#endif
-#if defined(ACR_WANT_STRLCAT)
-size_t strlcat(char *, const char *, size_t);
-#endif
-#if defined(ACR_WANT_STRLCPY)
-size_t strlcpy(char *, const char *, size_t);
-#endif
 
 /*
  * ---------------------------------------------------------------------

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
Tue Aug 25 14:44:10 2009
@@ -83,6 +83,7 @@
 #define ACR_WANT_STRSIGNAL                  1
 #define ACR_WANT_STRLCAT                    1
 #define ACR_WANT_STRLCPY                    1
+#define ACR_WANT_FNMATCH                    1
 
 
 /**

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c Tue Aug 25 14:44:10 2009
@@ -21,6 +21,7 @@
 #include "acr.h"
 #include "acr_private.h"
 #include "acr_arch.h"
+#include "acr_port.h"
 #include "acr_clazz.h"
 #include "acr_error.h"
 #include "acr_memory.h"

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c Tue Aug 25 14:44:10 2009
@@ -21,6 +21,7 @@
 #include "acr.h"
 #include "acr_private.h"
 #include "acr_arch.h"
+#include "acr_port.h"
 #include "acr_clazz.h"
 #include "acr_error.h"
 #include "acr_memory.h"

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/temps.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/temps.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/temps.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/temps.c Tue Aug 25 14:44:10 2009
@@ -17,6 +17,7 @@
 #include "acr.h"
 #include "acr_private.h"
 #include "acr_arch.h"
+#include "acr_port.h"
 #include "acr_error.h"
 #include "acr_string.h"
 #include "acr_memory.h"

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c Tue Aug 25 14:44:10 2009
@@ -164,9 +164,13 @@
 
     if (!WideCharToMultiByte(CP_UTF8, 0, srcstr, -1, retstr, retlen, NULL, 0))
         return ACR_GET_OS_ERROR();
+    /* Translate all back to forward slashes.
+     * On Win32 for utf8 paths we always use the forwrd slashes.
+     * They are converted to backward on translatio from utf8
+     */
     for (; *retstr; retstr++) {
-        if (*retstr == '/')
-            *retstr = '\\';
+        if (*retstr == '\\')
+            *retstr = '/';
     }
     return 0;
 }

Added: commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c?rev=807655&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c Tue Aug 25 14:44:10 2009
@@ -0,0 +1,291 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Copyright (c) 1989, 1993, 1994
+ *  The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 THE REGENTS OR CONTRIBUTORS 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.
+ */
+
+/*
+ * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
+ * Compares a filename or pathname to a pattern.
+ */
+
+#include "acr.h"
+#include "acr_private.h"
+#include "acr_port.h"
+
+#if defined(ACR_WANT_FNMATCH)
+
+#define EOS             '\0'
+#define RANGE_MATCH       1
+#define RANGE_NOMATCH     0
+#define RANGE_ERROR     (-1)
+
+static int rangematch(const char *, char, int, char **);
+static int classmatch(const char *, char, int, const char **);
+
+static struct cclass {
+    const char *name;
+    int (*isctype)(int);
+} cclasses[] = {
+    { "alnum",  isalnum },
+    { "alpha",  isalpha },
+    { "blank",  isblank },
+    { "cntrl",  iscntrl },
+    { "digit",  isdigit },
+    { "graph",  isgraph },
+    { "lower",  islower },
+    { "print",  isprint },
+    { "punct",  ispunct },
+    { "space",  isspace },
+    { "upper",  isupper },
+    { "xdigit", isxdigit },
+    { NULL,     NULL }
+};
+
+#define NCCLASSES   (sizeof(cclasses) / sizeof(cclasses[0]) - 1)
+
+int
+fnmatch(const char *pattern, const char *string, int flags)
+{
+    const char *stringstart;
+    char *newp;
+    char c, test;
+
+    for (stringstart = string;;)
+        switch (c = *pattern++) {
+        case EOS:
+            if ((flags & FNM_LEADING_DIR) && *string == '/')
+                return (0);
+            return (*string == EOS ? 0 : FNM_NOMATCH);
+        case '?':
+            if (*string == EOS)
+                return (FNM_NOMATCH);
+            if (*string == '/' && (flags & FNM_PATHNAME))
+                return (FNM_NOMATCH);
+            if (*string == '.' && (flags & FNM_PERIOD) &&
+                (string == stringstart ||
+                ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+                return (FNM_NOMATCH);
+            ++string;
+            break;
+        case '*':
+            c = *pattern;
+            /* Collapse multiple stars. */
+            while (c == '*')
+                c = *++pattern;
+
+            if (*string == '.' && (flags & FNM_PERIOD) &&
+                (string == stringstart ||
+                ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+                return (FNM_NOMATCH);
+
+            /* Optimize for pattern with * at end or before /. */
+            if (c == EOS) {
+                if (flags & FNM_PATHNAME)
+                    return ((flags & FNM_LEADING_DIR) ||
+                        strchr(string, '/') == NULL ?
+                        0 : FNM_NOMATCH);
+                else
+                    return (0);
+            } else if (c == '/' && (flags & FNM_PATHNAME)) {
+                if ((string = strchr(string, '/')) == NULL)
+                    return (FNM_NOMATCH);
+                break;
+            }
+
+            /* General case, use recursion. */
+            while ((test = *string) != EOS) {
+                if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
+                    return (0);
+                if (test == '/' && (flags & FNM_PATHNAME))
+                    break;
+                ++string;
+            }
+            return (FNM_NOMATCH);
+        case '[':
+            if (*string == EOS)
+                return (FNM_NOMATCH);
+            if (*string == '/' && (flags & FNM_PATHNAME))
+                return (FNM_NOMATCH);
+            if (*string == '.' && (flags & FNM_PERIOD) &&
+                (string == stringstart ||
+                ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+                return (FNM_NOMATCH);
+
+            switch (rangematch(pattern, *string, flags, &newp)) {
+            case RANGE_ERROR:
+                /* not a good range, treat as normal text */
+                goto normal;
+            case RANGE_MATCH:
+                pattern = newp;
+                break;
+            case RANGE_NOMATCH:
+                return (FNM_NOMATCH);
+            }
+            ++string;
+            break;
+        case '\\':
+            if (!(flags & FNM_NOESCAPE)) {
+                if ((c = *pattern++) == EOS) {
+                    c = '\\';
+                    --pattern;
+                }
+            }
+            /* FALLTHROUGH */
+        default:
+        normal:
+            if (c != *string && !((flags & FNM_CASEFOLD) &&
+                 (tolower((unsigned char)c) ==
+                 tolower((unsigned char)*string))))
+                return (FNM_NOMATCH);
+            ++string;
+            break;
+        }
+    /* NOTREACHED */
+}
+
+static int
+rangematch(const char *pattern, char test, int flags, char **newp)
+{
+    int negate, ok, rv;
+    char c, c2;
+
+    /*
+     * A bracket expression starting with an unquoted circumflex
+     * character produces unspecified results (IEEE 1003.2-1992,
+     * 3.13.2).  This implementation treats it like '!', for
+     * consistency with the regular expression syntax.
+     * J.T. Conklin (conklin@ngai.kaleida.com)
+     */
+    if ((negate = (*pattern == '!' || *pattern == '^')))
+        ++pattern;
+
+    if (flags & FNM_CASEFOLD)
+        test = (char)tolower((unsigned char)test);
+
+    /*
+     * A right bracket shall lose its special meaning and represent
+     * itself in a bracket expression if it occurs first in the list.
+     * -- POSIX.2 2.8.3.2
+     */
+    ok = 0;
+    c = *pattern++;
+    do {
+        if (c == '[' && *pattern == ':') {
+            do {
+                rv = classmatch(pattern + 1, test,
+                    (flags & FNM_CASEFOLD), &pattern);
+                if (rv == RANGE_MATCH)
+                    ok = 1;
+                c = *pattern++;
+            } while (rv != RANGE_ERROR && c == '[' && *pattern == ':');
+            if (c == ']')
+                break;
+        }
+        if (c == '\\' && !(flags & FNM_NOESCAPE))
+            c = *pattern++;
+        if (c == EOS)
+            return (RANGE_ERROR);
+        if (c == '/' && (flags & FNM_PATHNAME))
+            return (RANGE_NOMATCH);
+        if ((flags & FNM_CASEFOLD))
+            c = (char)tolower((unsigned char)c);
+        if (*pattern == '-'
+            && (c2 = *(pattern+1)) != EOS && c2 != ']') {
+            pattern += 2;
+            if (c2 == '\\' && !(flags & FNM_NOESCAPE))
+                c2 = *pattern++;
+            if (c2 == EOS)
+                return (RANGE_ERROR);
+            if (flags & FNM_CASEFOLD)
+                c2 = (char)tolower((unsigned char)c2);
+            if (c <= test && test <= c2)
+                ok = 1;
+        } else if (c == test)
+            ok = 1;
+    } while ((c = *pattern++) != ']');
+
+    *newp = (char *)pattern;
+    return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH);
+}
+
+static int
+classmatch(const char *pattern, char test, int foldcase, const char **ep)
+{
+    struct cclass *cc;
+    const char *colon;
+    size_t len;
+    int rval = RANGE_NOMATCH;
+
+    if ((colon = strchr(pattern, ':')) == NULL || colon[1] != ']') {
+        *ep = pattern - 2;
+        return(RANGE_ERROR);
+    }
+    *ep = colon + 2;
+    len = (size_t)(colon - pattern);
+
+    if (foldcase && strncmp(pattern, "upper:]", 7) == 0)
+        pattern = "lower:]";
+    for (cc = cclasses; cc->name != NULL; cc++) {
+        if (!strncmp(pattern, cc->name, len) && cc->name[len] == '\0') {
+            if (cc->isctype((unsigned char)test))
+                rval = RANGE_MATCH;
+            break;
+        }
+    }
+    if (cc->name == NULL) {
+        /* invalid character class, return EOS */
+        *ep = colon + strlen(colon);
+        rval = RANGE_ERROR;
+    }
+    return(rval);
+}
+
+#else
+
+UNUSED_SOURCE_FILE(fnmatch);
+
+#endif /* ACR_WANT_FNMATCH */
+

Propchange: commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Tue Aug 25 14:44:10 2009
@@ -17,6 +17,7 @@
 #include "acr.h"
 #include "acr_private.h"
 #include "acr_arch.h"
+#include "acr_port.h"
 #include "acr_error.h"
 #include "acr_string.h"
 #include "acr_vm.h"

Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c Tue Aug 25 14:44:10
2009
@@ -35,7 +35,7 @@
 
 #include "acr.h"
 #include "acr_private.h"
-#include "acr_arch.h"
+#include "acr_port.h"
 
 #include "regex.h"
 

Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c Tue Aug 25 14:44:10
2009
@@ -36,7 +36,7 @@
 
 #include "acr.h"
 #include "acr_private.h"
-#include "acr_arch.h"
+#include "acr_port.h"
 #include "regex.h"
 
 #include "utils.h"

Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c?rev=807655&r1=807654&r2=807655&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c Tue Aug 25 14:44:10
2009
@@ -42,7 +42,7 @@
  */
 #include "acr.h"
 #include "acr_private.h"
-#include "acr_arch.h"
+#include "acr_port.h"
 #include "regex.h"
 
 #include "utils.h"



Mime
View raw message