[BACK]Return to function.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / find

Diff for /src/usr.bin/find/function.c between version 1.27 and 1.28

version 1.27, 2003/06/10 22:20:46 version 1.28, 2003/06/26 07:27:29
Line 59 
Line 59 
 #include <unistd.h>  #include <unistd.h>
   
 #include "find.h"  #include "find.h"
   #include "extern.h"
   
 #define COMPARE(a, b) {                                                 \  #define COMPARE(a, b) {                                                 \
         switch (plan->flags) {                                          \          switch (plan->flags) {                                          \
Line 74 
Line 75 
 }  }
   
 static PLAN *palloc(enum ntype, int (*)(PLAN *, FTSENT *));  static PLAN *palloc(enum ntype, int (*)(PLAN *, FTSENT *));
   static long find_parsenum(PLAN *plan, char *option, char *vp, char *endch);
   static PLAN *palloc(enum ntype t, int (*f)(PLAN *, FTSENT *));
   
   int     f_amin(PLAN *, FTSENT *);
   int     f_atime(PLAN *, FTSENT *);
   int     f_cmin(PLAN *, FTSENT *);
   int     f_ctime(PLAN *, FTSENT *);
   int     f_always_true(PLAN *, FTSENT *);
   int     f_empty(PLAN *, FTSENT *);
   int     f_exec(PLAN *, FTSENT *);
   int     f_execdir(PLAN *, FTSENT *);
   int     f_flags(PLAN *, FTSENT *);
   int     f_fstype(PLAN *, FTSENT *);
   int     f_group(PLAN *, FTSENT *);
   int     f_inum(PLAN *, FTSENT *);
   int     f_empty(PLAN *, FTSENT *);
   int     f_links(PLAN *, FTSENT *);
   int     f_ls(PLAN *, FTSENT *);
   int     f_maxdepth(PLAN *, FTSENT *);
   int     f_mindepth(PLAN *, FTSENT *);
   int     f_mtime(PLAN *, FTSENT *);
   int     f_mmin(PLAN *, FTSENT *);
   int     f_name(PLAN *, FTSENT *);
   int     f_iname(PLAN *, FTSENT *);
   int     f_newer(PLAN *, FTSENT *);
   int     f_anewer(PLAN *, FTSENT *);
   int     f_cnewer(PLAN *, FTSENT *);
   int     f_nogroup(PLAN *, FTSENT *);
   int     f_nouser(PLAN *, FTSENT *);
   int     f_path(PLAN *, FTSENT *);
   int     f_perm(PLAN *, FTSENT *);
   int     f_print(PLAN *, FTSENT *);
   int     f_print0(PLAN *, FTSENT *);
   int     f_prune(PLAN *, FTSENT *);
   int     f_size(PLAN *, FTSENT *);
   int     f_type(PLAN *, FTSENT *);
   int     f_user(PLAN *, FTSENT *);
   int     f_expr(PLAN *, FTSENT *);
   int     f_not(PLAN *, FTSENT *);
   int     f_or(PLAN *, FTSENT *);
   
 extern int dotfd;  extern int dotfd;
 extern time_t now;  extern time_t now;
 extern FTS *tree;  extern FTS *tree;
Line 150 
Line 191 
 }  }
   
 PLAN *  PLAN *
 c_amin(arg)  c_amin(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 180 
Line 220 
 }  }
   
 PLAN *  PLAN *
 c_atime(arg)  c_atime(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 211 
Line 250 
 }  }
   
 PLAN *  PLAN *
 c_cmin(arg)  c_cmin(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 241 
Line 279 
 }  }
   
 PLAN *  PLAN *
 c_ctime(arg)  c_ctime(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 270 
Line 307 
 }  }
   
 PLAN *  PLAN *
 c_depth(void)  c_depth(char *ignore, char ***ignored, int unused)
 {  {
         isdepth = 1;          isdepth = 1;
   
Line 312 
Line 349 
 }  }
   
 PLAN *  PLAN *
 c_empty(void)  c_empty(char *ignore, char ***ignored, int unused)
 {  {
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
Line 377 
Line 414 
  *      strings, but also flags meaning that the string has to be massaged.   *      strings, but also flags meaning that the string has to be massaged.
  */   */
 PLAN *  PLAN *
 c_exec(argvp, isok)  c_exec(char *unused, char ***argvp, int isok)
         char ***argvp;  
         int isok;  
 {  {
         PLAN *new;                      /* node returned */          PLAN *new;                      /* node returned */
         int cnt;          int cnt;
Line 498 
Line 533 
  *      strings, but also flags meaning that the string has to be massaged.   *      strings, but also flags meaning that the string has to be massaged.
  */   */
 PLAN *  PLAN *
 c_execdir(argvp)  c_execdir(char *ignored, char ***argvp, int unused)
         char ***argvp;  
 {  {
         PLAN *new;                      /* node returned */          PLAN *new;                      /* node returned */
         int cnt;          int cnt;
Line 567 
Line 601 
 }  }
   
 PLAN *  PLAN *
 c_flags(flags_str)  c_flags(char *flags_str, char ***ignored, int unused)
         char *flags_str;  
 {  {
         PLAN *new;          PLAN *new;
         u_int32_t flags, notflags;          u_int32_t flags, notflags;
Line 597 
Line 630 
  *      basis.   *      basis.
  */   */
 PLAN *  PLAN *
 c_follow(void)  c_follow(char *ignore, char ***ignored, int unused)
 {  {
         ftsoptions &= ~FTS_PHYSICAL;          ftsoptions &= ~FTS_PHYSICAL;
         ftsoptions |= FTS_LOGICAL;          ftsoptions |= FTS_LOGICAL;
Line 672 
Line 705 
 }  }
   
 PLAN *  PLAN *
 c_fstype(arg)  c_fstype(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 718 
Line 750 
 }  }
   
 PLAN *  PLAN *
 c_group(gname)  c_group(char *gname, char ***ignored, int unused)
         char *gname;  
 {  {
         PLAN *new;          PLAN *new;
         struct group *g;          struct group *g;
Line 754 
Line 785 
 }  }
   
 PLAN *  PLAN *
 c_inum(arg)  c_inum(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 780 
Line 810 
 }  }
   
 PLAN *  PLAN *
 c_links(arg)  c_links(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 807 
Line 836 
 }  }
   
 PLAN *  PLAN *
 c_ls(void)  c_ls(char *ignore, char ***ignored, int unused)
 {  {
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
         isoutput = 1;          isoutput = 1;
Line 833 
Line 862 
 }  }
   
 PLAN *  PLAN *
 c_maxdepth(arg)  c_maxdepth(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 859 
Line 887 
 }  }
   
 PLAN *  PLAN *
 c_mindepth(arg)  c_mindepth(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 886 
Line 913 
 }  }
   
 PLAN *  PLAN *
 c_mtime(arg)  c_mtime(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 917 
Line 943 
 }  }
   
 PLAN *  PLAN *
 c_mmin(arg)  c_mmin(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 945 
Line 970 
 }  }
   
 PLAN *  PLAN *
 c_name(pattern)  c_name(char *pattern, char ***ignored, int unused)
         char *pattern;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 970 
Line 994 
 }  }
   
 PLAN *  PLAN *
 c_iname(pattern)  c_iname(char *pattern, char ***ignored, int unused)
         char *pattern;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 999 
Line 1022 
 }  }
   
 PLAN *  PLAN *
 c_newer(filename)  c_newer(char *filename, char ***ignored, int unused)
         char *filename;  
 {  {
         PLAN *new;          PLAN *new;
         struct stat sb;          struct stat sb;
Line 1033 
Line 1055 
 }  }
   
 PLAN *  PLAN *
 c_anewer(filename)  c_anewer(char *filename, char ***ignored, int unused)
         char *filename;  
 {  {
         PLAN *new;          PLAN *new;
         struct stat sb;          struct stat sb;
Line 1067 
Line 1088 
 }  }
   
 PLAN *  PLAN *
 c_cnewer(filename)  c_cnewer(char *filename, char ***ignored, int unused)
         char *filename;  
 {  {
         PLAN *new;          PLAN *new;
         struct stat sb;          struct stat sb;
Line 1097 
Line 1117 
 }  }
   
 PLAN *  PLAN *
 c_nogroup(void)  c_nogroup(char *ignore, char ***ignored, int unused)
 {  {
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
Line 1119 
Line 1139 
 }  }
   
 PLAN *  PLAN *
 c_nouser(void)  c_nouser(char *ignore, char ***ignored, int unused)
 {  {
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
Line 1141 
Line 1161 
 }  }
   
 PLAN *  PLAN *
 c_path(pattern)  c_path(char *pattern, char ***ignored, int unused)
         char *pattern;  
 {  {
         PLAN *new;          PLAN *new;
   
Line 1175 
Line 1194 
 }  }
   
 PLAN *  PLAN *
 c_perm(perm)  c_perm(char *perm, char ***ignored, int unused)
         char *perm;  
 {  {
         PLAN *new;          PLAN *new;
         mode_t *set;          mode_t *set;
Line 1225 
Line 1243 
 }  }
   
 PLAN *  PLAN *
 c_print(void)  c_print(char *ignore, char ***ignored, int unused)
 {  {
         isoutput = 1;          isoutput = 1;
   
Line 1233 
Line 1251 
 }  }
   
 PLAN *  PLAN *
 c_print0(void)  c_print0(char *ignore, char ***ignored, int unused)
 {  {
         isoutput = 1;          isoutput = 1;
   
Line 1257 
Line 1275 
 }  }
   
 PLAN *  PLAN *
 c_prune(void)  c_prune(char *ignore, char ***ignored, int unused)
 {  {
         return (palloc(N_PRUNE, f_prune));          return (palloc(N_PRUNE, f_prune));
 }  }
Line 1285 
Line 1303 
 }  }
   
 PLAN *  PLAN *
 c_size(arg)  c_size(char *arg, char ***ignored, int unused)
         char *arg;  
 {  {
         PLAN *new;          PLAN *new;
         char endch;          char endch;
Line 1317 
Line 1334 
 }  }
   
 PLAN *  PLAN *
 c_type(typestring)  c_type(char *typestring, char ***ignored, int unused)
         char *typestring;  
 {  {
         PLAN *new;          PLAN *new;
         mode_t  mask;          mode_t  mask;
Line 1379 
Line 1395 
 }  }
   
 PLAN *  PLAN *
 c_user(username)  c_user(char *username, char ***ignored, int unused)
         char *username;  
 {  {
         PLAN *new;          PLAN *new;
         struct passwd *p;          struct passwd *p;
Line 1408 
Line 1423 
  *      different device ID (st_dev, see stat() S5.6.2 [POSIX.1])   *      different device ID (st_dev, see stat() S5.6.2 [POSIX.1])
  */   */
 PLAN *  PLAN *
 c_xdev(void)  c_xdev(char *ignore, char ***ignored, int unused)
 {  {
         ftsoptions |= FTS_XDEV;          ftsoptions |= FTS_XDEV;
   
Line 1439 
Line 1454 
  * to a N_EXPR node containing the expression and the ')' node is discarded.   * to a N_EXPR node containing the expression and the ')' node is discarded.
  */   */
 PLAN *  PLAN *
 c_openparen(void)  c_openparen(char *ignore, char ***ignored, int unused)
 {  {
         return (palloc(N_OPENPAREN, (int (*)())-1));          return (palloc(N_OPENPAREN, (int (*)(PLAN *, FTSENT *))-1));
 }  }
   
 PLAN *  PLAN *
 c_closeparen(void)  c_closeparen(char *ignore, char ***ignored, int unused)
 {  {
         return (palloc(N_CLOSEPAREN, (int (*)())-1));          return (palloc(N_CLOSEPAREN, (int (*)(PLAN *, FTSENT *))-1));
 }  }
   
 /*  /*
Line 1469 
Line 1484 
 }  }
   
 PLAN *  PLAN *
 c_not(void)  c_not(char *ignore, char ***ignored, int unused)
 {  {
         return (palloc(N_NOT, f_not));          return (palloc(N_NOT, f_not));
 }  }
Line 1500 
Line 1515 
 }  }
   
 PLAN *  PLAN *
 c_or(void)  c_or(char *ignore, char ***ignored, int unused)
 {  {
         return (palloc(N_OR, f_or));          return (palloc(N_OR, f_or));
 }  }
   
 static PLAN *  static PLAN *
 palloc(t, f)  palloc(enum ntype t, int (*f)(PLAN *, FTSENT *))
         enum ntype t;  
         int (*f)(PLAN *, FTSENT *);  
 {  {
         PLAN *new;          PLAN *new;
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28