]> git.sur5r.net Git - bacula/bacula/commitdiff
Parameterize the LaTeX Makefile a bit and add all files
authorKern Sibbald <kern@sibbald.com>
Wed, 12 Jan 2005 13:44:43 +0000 (13:44 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 12 Jan 2005 13:44:43 +0000 (13:44 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1801 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/fnmatch.c
bacula/src/lib/fnmatch.h

index 729373ced3fac9a0c26e45fe3978d355f2e6764d..7b11a9a196474fdcc496a6416ef680db57b91210 100644 (file)
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "bacula.h"
-
-/* Enable GNU extensions in fnmatch.h. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE   1
-#endif
-
 #include "fnmatch.h"
 
 
@@ -68,22 +61,22 @@ fnmatch (const char *pattern, const char *string, int flags)
 
       switch (c)
        {
-       case '?':
-         if (*n == '\0')
+        case '?':
+          if (*n == '\0')
            return FNM_NOMATCH;
-         else if ((flags & FNM_FILE_NAME) && *n == '/')
+          else if ((flags & FNM_FILE_NAME) && *n == '/')
            return FNM_NOMATCH;
-         else if ((flags & FNM_PERIOD) && *n == '.' &&
-                  (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+          else if ((flags & FNM_PERIOD) && *n == '.' &&
+                   (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
            return FNM_NOMATCH;
          break;
 
-       case '\\':
+        case '\\':
          if (!(flags & FNM_NOESCAPE))
            {
              c = *p++;
-             if (c == '\0')
-               /* Trailing \ loses.  */
+              if (c == '\0')
+                /* Trailing \ loses.  */
                return FNM_NOMATCH;
              c = FOLD (c);
            }
@@ -91,56 +84,56 @@ fnmatch (const char *pattern, const char *string, int flags)
            return FNM_NOMATCH;
          break;
 
-       case '*':
-         if ((flags & FNM_PERIOD) && *n == '.' &&
-             (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+        case '*':
+          if ((flags & FNM_PERIOD) && *n == '.' &&
+              (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
            return FNM_NOMATCH;
 
-         for (c = *p++; c == '?' || c == '*'; c = *p++)
+          for (c = *p++; c == '?' || c == '*'; c = *p++)
            {
-             if ((flags & FNM_FILE_NAME) && *n == '/')
+              if ((flags & FNM_FILE_NAME) && *n == '/')
                /* A slash does not match a wildcard under FNM_FILE_NAME.  */
                return FNM_NOMATCH;
-             else if (c == '?')
+              else if (c == '?')
                {
                  /* A ? needs to match one character.  */
-                 if (*n == '\0')
-                   /* There isn't another character; no match.  */
+                  if (*n == '\0')
+                    /* There isn't another character; no match.  */
                    return FNM_NOMATCH;
                  else
                    /* One character of the string is consumed in matching
-                      this ? wildcard, so *??? won't match if there are
+                       this ? wildcard, so *??? won't match if there are
                       less than three characters.  */
                    ++n;
                }
            }
 
-         if (c == '\0')
+          if (c == '\0')
            return 0;
 
          {
-           char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
+            char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
            c1 = FOLD (c1);
-           for (--p; *n != '\0'; ++n)
-             if ((c == '[' || FOLD (*n) == c1) &&
+            for (--p; *n != '\0'; ++n)
+              if ((c == '[' || FOLD (*n) == c1) &&
                  fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
                return 0;
            return FNM_NOMATCH;
          }
 
-       case '[':
+        case '[':
          {
            /* Nonzero if the sense of the character class is inverted.  */
            register int nnot;
 
-           if (*n == '\0')
+            if (*n == '\0')
              return FNM_NOMATCH;
 
-           if ((flags & FNM_PERIOD) && *n == '.' &&
-               (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+            if ((flags & FNM_PERIOD) && *n == '.' &&
+                (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
              return FNM_NOMATCH;
 
-           nnot = (*p == '!' || *p == '^');
+            nnot = (*p == '!' || *p == '^');
            if (nnot)
              ++p;
 
@@ -149,32 +142,32 @@ fnmatch (const char *pattern, const char *string, int flags)
              {
                register char cstart = c, cend = c;
 
-               if (!(flags & FNM_NOESCAPE) && c == '\\')
+                if (!(flags & FNM_NOESCAPE) && c == '\\')
                  {
-                   if (*p == '\0')
+                    if (*p == '\0')
                      return FNM_NOMATCH;
                    cstart = cend = *p++;
                  }
 
                cstart = cend = FOLD (cstart);
 
-               if (c == '\0')
+                if (c == '\0')
                  /* [ (unterminated) loses.  */
                  return FNM_NOMATCH;
 
                c = *p++;
                c = FOLD (c);
 
-               if ((flags & FNM_FILE_NAME) && c == '/')
+                if ((flags & FNM_FILE_NAME) && c == '/')
                  /* [/] can never match.  */
                  return FNM_NOMATCH;
 
-               if (c == '-' && *p != ']')
+                if (c == '-' && *p != ']')
                  {
                    cend = *p++;
-                   if (!(flags & FNM_NOESCAPE) && cend == '\\')
+                    if (!(flags & FNM_NOESCAPE) && cend == '\\')
                      cend = *p++;
-                   if (cend == '\0')
+                    if (cend == '\0')
                      return FNM_NOMATCH;
                    cend = FOLD (cend);
 
@@ -184,7 +177,7 @@ fnmatch (const char *pattern, const char *string, int flags)
                if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
                  goto matched;
 
-               if (c == ']')
+                if (c == ']')
                  break;
              }
            if (!nnot)
@@ -193,16 +186,16 @@ fnmatch (const char *pattern, const char *string, int flags)
 
          matched:;
            /* Skip the rest of the [...] that already matched.  */
-           while (c != ']')
+            while (c != ']')
              {
-               if (c == '\0')
+                if (c == '\0')
                  /* [... (unterminated) loses.  */
                  return FNM_NOMATCH;
 
                c = *p++;
-               if (!(flags & FNM_NOESCAPE) && c == '\\')
+                if (!(flags & FNM_NOESCAPE) && c == '\\')
                  {
-                   if (*p == '\0')
+                    if (*p == '\0')
                      return FNM_NOMATCH;
                    /* XXX 1003.2d11 is unclear if this is right.  */
                    ++p;
index af1dcf523bfa2af40f009bb01ec04366f6e20c8c..07a5d44ffed4b8bb5e46eb8edb62c5cbe4b97d57 100644 (file)
@@ -15,11 +15,11 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
 
-#ifndef        _FNMATCH_H
+#ifndef _FNMATCH_H
 
-#define        _FNMATCH_H      1
+#define _FNMATCH_H     1
 
 #ifdef __cplusplus
 extern "C" {
@@ -27,10 +27,10 @@ extern "C" {
 
 #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
 #undef __P
-#define        __P(protos)     protos
+#define __P(protos)    protos
 #else /* Not C++ or ANSI C.  */
 #undef __P
-#define        __P(protos)     ()
+#define __P(protos)    ()
 /* We can get away without defining `const' here only because in this file
    it is used only inside the prototype for `fnmatch', which is elided in
    non-ANSI C where `const' is problematical.  */
@@ -44,18 +44,18 @@ extern "C" {
 #undef FNM_PERIOD
 
 /* Bits set in the FLAGS argument to `fnmatch'.  */
-#define        FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
-#define        FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
-#define        FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
-
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
-#define        FNM_FILE_NAME   FNM_PATHNAME /* Preferred GNU name.  */
-#define        FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
-#define        FNM_CASEFOLD    (1 << 4) /* Compare without regard to case.  */
-#endif
+#define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
+#define FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
+#define FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
+
+/* #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) */
+#define FNM_FILE_NAME  FNM_PATHNAME /* Preferred GNU name.  */
+#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
+#define FNM_CASEFOLD   (1 << 4) /* Compare without regard to case.  */
+/* #endif -- kes 12Jan05 */
 
 /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
-#define        FNM_NOMATCH     1
+#define FNM_NOMATCH    1
 
 /* Match STRING against the filename pattern PATTERN,
    returning zero if it matches, FNM_NOMATCH if not.  */