dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/csant Makefile.am,1.4,1.5 csant_dir.c,1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/csant Makefile.am,1.4,1.5 csant_dir.c,1.3,1.4 csant_fileset.c,1.12,1.13
Date: Sat, 14 Dec 2002 17:56:58 -0500

Update of /cvsroot/dotgnu-pnet/pnet/csant
In directory subversions:/tmp/cvs-serv408/csant

Modified Files:
        Makefile.am csant_dir.c csant_fileset.c 
Log Message:


Modify csant and ilfind to use the builtin pnet regex routines.


Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/csant/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Makefile.am 4 Jul 2002 04:59:12 -0000       1.4
--- Makefile.am 14 Dec 2002 22:56:56 -0000      1.5
***************
*** 10,14 ****
                                 csant_prop.c \
                                 csant_task.c
! csant_LDADD    = ../support/libILSupport.a $(REGEXLIBS)
  
  AM_CFLAGS = -I$(top_srcdir)/include
--- 10,14 ----
                                 csant_prop.c \
                                 csant_task.c
! csant_LDADD    = ../support/libILSupport.a
  
  AM_CFLAGS = -I$(top_srcdir)/include

Index: csant_dir.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/csant/csant_dir.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** csant_dir.c 13 Dec 2002 11:24:46 -0000      1.3
--- csant_dir.c 14 Dec 2002 22:56:56 -0000      1.4
***************
*** 20,30 ****
  
  #include "csant_defs.h"
  #include <dirent.h>
  #ifdef HAVE_SYS_TYPES_H
  #include <sys/types.h>
  #endif
- #ifdef HAVE_REGEX_H
- #include <regex.h>
- #endif
  #ifdef HAVE_SYS_CYGWIN_H
  #include <sys/cygwin.h>
--- 20,28 ----
  
  #include "csant_defs.h"
+ #include "il_regex.h"
  #include <dirent.h>
  #ifdef HAVE_SYS_TYPES_H
  #include <sys/types.h>
  #endif
  #ifdef HAVE_SYS_CYGWIN_H
  #include <sys/cygwin.h>
***************
*** 43,49 ****
        int     useRegex;
        char   *name;
- #ifdef HAVE_REGCOMP
        regex_t regexState;
- #endif
  };
  
--- 41,45 ----
***************
*** 133,156 ****
        if(regex)
        {
! #ifdef HAVE_REGCOMP
!               /* POSIX-style regular expression library */
!               if(regcomp(&(dir->regexState), regex, REG_EXTENDED | REG_NOSUB) 
!= 0)
                {
                        fprintf(stderr, "Invalid regular expression\n");
                        exit(1);
                }
- #else
- #ifdef HAVE_RE_COMP
-               /* BSD-style regular expression library */
-               if(re_comp(regex) != 0)
-               {
-                       fprintf(stderr, "Invalid regular expression\n");
-                       exit(1);
-               }
- #else
-               fprintf(stderr, "Regular expression library not present - 
aborting\n");
-               exit(1);
- #endif
- #endif
                ILFree(regex);
                dir->useRegex = 1;
--- 129,137 ----
        if(regex)
        {
!               if(IL_regcomp(&(dir->regexState), regex, REG_EXTENDED | 
REG_NOSUB) != 0)
                {
                        fprintf(stderr, "Invalid regular expression\n");
                        exit(1);
                }
                ILFree(regex);
                dir->useRegex = 1;
***************
*** 172,181 ****
                ILFree(dir->name);
        }
- #ifdef HAVE_REGCOMP
        if(dir->useRegex)
        {
!               regfree(&(dir->regexState));
        }
- #endif
        ILFree(dir);
  }
--- 153,160 ----
                ILFree(dir->name);
        }
        if(dir->useRegex)
        {
!               IL_regfree(&(dir->regexState));
        }
        ILFree(dir);
  }
***************
*** 206,224 ****
                if(dir->useRegex)
                {
!               #ifdef HAVE_REGCOMP
!                       if(regexec(&(dir->regexState), name, 0, 0, 0) != 0)
!                       {
!                               ILFree(entry);
!                               continue;
!                       }
!               #else
!               #ifdef HAVE_RE_COMP
!                       if(!re_exec(name))
                        {
                                ILFree(entry);
                                continue;
                        }
-               #endif
-               #endif
                }
  
--- 185,193 ----
                if(dir->useRegex)
                {
!                       if(IL_regexec(&(dir->regexState), name, 0, 0, 0) != 0)
                        {
                                ILFree(entry);
                                continue;
                        }
                }
  

Index: csant_fileset.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/csant/csant_fileset.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** csant_fileset.c     13 Dec 2002 11:24:46 -0000      1.12
--- csant_fileset.c     14 Dec 2002 22:56:56 -0000      1.13
***************
*** 21,30 ****
  #include "csant_defs.h"
  #include "csant_fileset.h"
  #ifdef HAVE_SYS_TYPES_H
  #include <sys/types.h>
  #endif
- #ifdef HAVE_REGEX_H
- #include <regex.h>
- #endif
  #ifdef HAVE_SYS_STAT_H
  #include <sys/stat.h>
--- 21,28 ----
  #include "csant_defs.h"
  #include "csant_fileset.h"
+ #include "il_regex.h"
  #ifdef HAVE_SYS_TYPES_H
  #include <sys/types.h>
  #endif
  #ifdef HAVE_SYS_STAT_H
  #include <sys/stat.h>
***************
*** 87,95 ****
   * Returns non-zero if recursion into sub-directories is specified.
   */
- #ifdef HAVE_REGCOMP
  typedef regex_t RegexState;
- #else
- typedef int RegexState;
- #endif
  static int BuildIncludeRegex(CSAntTask *node, const char *name,
                                                         RegexState *state)
--- 85,89 ----
***************
*** 249,274 ****
  
        /* Compile the register expression and exit */
! #ifdef HAVE_REGCOMP
!       /* POSIX-style regular expression library */
!       if(regcomp(state, regex, REG_EXTENDED | REG_NOSUB) != 0)
        {
                fprintf(stderr, "Invalid regular expression: %s\n", regex);
                exit(1);
        }
- #else
- #ifdef HAVE_RE_COMP
-       /* BSD-style regular expression library */
-       if(re_comp(regex) != 0)
-       {
-               fprintf(stderr, "Invalid regular expression: %s\n", regex);
-               exit(1);
-       }
-       *state = 0;
- #else
-       fprintf(stderr, "Regular expression library not present - aborting\n");
-       exit(1);
-       *state = 0;
- #endif
- #endif
        ILFree(regex);
        return recursive;
--- 243,251 ----
  
        /* Compile the register expression and exit */
!       if(IL_regcomp(state, regex, REG_EXTENDED | REG_NOSUB) != 0)
        {
                fprintf(stderr, "Invalid regular expression: %s\n", regex);
                exit(1);
        }
        ILFree(regex);
        return recursive;
***************
*** 280,292 ****
  static int MatchInclude(char *pathname, RegexState *state)
  {
! #ifdef HAVE_REGCOMP
!       return (regexec(state, pathname, 0, 0, 0) == 0);
! #else
! #ifdef HAVE_RE_COMP
!       return (re_exec(pathname) != 0);
! #else
!       return 0;
! #endif
! #endif
  }
  
--- 257,261 ----
  static int MatchInclude(char *pathname, RegexState *state)
  {
!       return (IL_regexec(state, pathname, 0, 0, 0) == 0);
  }
  
***************
*** 466,472 ****
  
        /* Free the regular expression state */
! #ifdef HAVE_REGCOMP
!       regfree(&state);
! #endif
  
        /* Construct a new regular expression for the "excludes" list */
--- 435,439 ----
  
        /* Free the regular expression state */
!       IL_regfree(&state);
  
        /* Construct a new regular expression for the "excludes" list */
***************
*** 516,522 ****
  
        /* Free the regular expression state */
! #ifdef HAVE_REGCOMP
!       regfree(&state);
! #endif
  
        /* Done */
--- 483,487 ----
  
        /* Free the regular expression state */
!       IL_regfree(&state);
  
        /* Done */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]