- match.c, match.h: removed collapse()
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Wed, 31 Dec 2014 15:07:49 +0000 (15:07 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Wed, 31 Dec 2014 15:07:49 +0000 (15:07 +0000)
- inet.h: moved poll.h header include to libopm.c

git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5232 82007160-df01-0410-b94d-b575c5fd34c7

src/libopm/src/inet.h
src/libopm/src/libopm.c
src/match.c
src/match.h

index a9ebe79c9d308d224d600f81df7dfc497a318fe1..d7d03d8ce7e38a7f379eae747759de033caa3437 100644 (file)
 #endif
 #include <sys/types.h>
 
-#ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-#endif
-
 typedef struct _opm_sockaddr opm_sockaddr;
 typedef struct _opm_inaddr opm_inaddr;
 
index 9dd7b534d3120fa59f904fc2da39bb63c2d94044..9a1d77cba553696e12da3b64a2da0ac560099334 100644 (file)
@@ -44,9 +44,9 @@
 #  include <time.h>
 # endif
 #endif
-
 #include <unistd.h>
 #include <string.h>
+#include <poll.h>
 
 
 static OPM_PROTOCOL_CONFIG_T *libopm_protocol_config_create(void);
index a342ca429b85bf687b5b48a1bb8f210e9b335a25..83fcdfcc1d13e0273aaf55c2d4fa9449d63f9ec5 100644 (file)
@@ -156,68 +156,3 @@ match(const char *mask, const char *name)
 
   return 1;
 }
-
-/*
- * collapse()
- * Collapse a pattern string into minimal components.
- * This particular version is "in place", so that it changes the pattern
- * which is to be reduced to a "minimal" size.
- *
- * (C) Carlo Wood - 6 Oct 1998
- * Speedup rewrite by Andrea Cocito, December 1998.
- * Note that this new optimized algorithm can *only* work in place.
- */
-
-/*! \brief Collapse a mask string to remove redundancies.
- * Specifically, it replaces a sequence of '*' followed by additional
- * '*' or '?' with the same number of '?'s as the input, followed by
- * one '*'.  This minimizes useless backtracking when matching later.
- * \param mask Mask string to collapse.
- * \return Pointer to the start of the string.
- */
-char *
-collapse(char *mask)
-{
-  unsigned int star = 0;
-  char *m = mask;
-  char *b = NULL;
-
-  if (m)
-  {
-    do
-    {
-      if ((*m == '*') && (*(m + 1) == '*' || *(m + 1) == '?'))
-      {
-        b = m;
-
-        do
-        {
-          if (*m == '*')
-            star = 1;
-          else
-          {
-            if (star && (*m != '?'))
-            {
-              *b++ = '*';
-              star = 0;
-            }
-
-            *b++ = *m;
-
-            if ((*m == '\\') && (*(m + 1) == '*' || *(m + 1) == '?'))
-              *b++ = *++m;
-          }
-        } while (*m++);
-
-        break;
-      }
-      else
-      {
-        if ((*m == '\\') && (*(m + 1) == '*' || *(m + 1) == '?'))
-          ++m;
-      }
-    } while (*m++);
-  }
-
-  return mask;
-}
index 7a2487ee9e473616d69cdcb5b180a4e4ed579f07..8f4d9973468fbe20fe71117b68ab24e9939ac185 100644 (file)
@@ -30,5 +30,4 @@
 #define EmptyString(x) (!(x) || (*(x) == '\0'))
 
 extern int match(const char *, const char *);
-extern char *collapse(char *);
 #endif