pat_rep.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <regex.h>
#include "pax.h"
#include "pat_rep.h"
#include "extern.h"

Include dependency graph for pat_rep.c:

Go to the source code of this file.

Defines

#define MAXSUBEXP   10

Functions

static int rep_name (char *, int *, int)
static int tty_rename (ARCHD *)
static int fix_path (char *, int *, char *, int)
static int fn_match (char *, char *, char **)
static char * range_match (char *, int)
static int resub (regex_t *, regmatch_t *, char *, char *, char *)
int rep_add (char *str)
int pat_add (char *str, char *chdnam)
void pat_chk (void)
int pat_sel (ARCHD *arcn)
int pat_match (ARCHD *arcn)
int mod_name (ARCHD *arcn)
int set_dest (ARCHD *arcn, char *dest_dir, int dir_len)

Variables

static PATTERNpathead = NULL
static PATTERNpattail = NULL
static REPLACErephead = NULL
static REPLACEreptail = NULL


Define Documentation

#define MAXSUBEXP   10
 

Definition at line 63 of file pat_rep.c.

Referenced by rep_name().


Function Documentation

static int fix_path char *  ,
int *  ,
char *  ,
int 
[static]
 

Definition at line 794 of file pat_rep.c.

References PAXPATHLEN, paxwarn(), and start.

Referenced by set_dest().

static int fn_match char *  ,
char *  ,
char ** 
[static]
 

Definition at line 492 of file pat_rep.c.

References c, dflag, NULL, and test.

Referenced by pat_match().

int mod_name ARCHD arcn  ) 
 

Definition at line 608 of file pat_rep.c.

References iflag, archd::ln_name, archd::ln_nlen, memmove(), archd::name, archd::nlen, NULL, PAX_HLK, PAX_HRG, PAX_SLK, paxwarn(), rep_name(), rephead, rmleadslash, strlen(), sub_name(), tty_rename(), and archd::type.

Referenced by copy(), extract(), list(), and wr_archive().

int pat_add char *  str,
char *  chdnam
 

Definition at line 219 of file pat_rep.c.

References pattern::chdname, pattern::flgs, pattern::fow, malloc(), NULL, pathead, pattail, paxwarn(), pattern::pend, pattern::plen, pattern::pstr, and strlen().

Referenced by cpio_options(), and tar_options().

void pat_chk void   ) 
 

Definition at line 264 of file pat_rep.c.

References pattern::flgs, pattern::fow, if(), MTCH, NULL, pathead, and paxwarn().

Referenced by extract(), and list().

int pat_match ARCHD arcn  ) 
 

Definition at line 420 of file pat_rep.c.

References cflag, DIR_MTCH, pattern::flgs, fn_match(), pattern::fow, archd::name, nflag, NULL, archd::pat, pat_sel(), pathead, pattern::pend, pattern::plen, pattern::pstr, and strncmp().

Referenced by extract(), and list().

int pat_sel ARCHD arcn  ) 
 

Definition at line 301 of file pat_rep.c.

References dflag, DIR_MTCH, pattern::flgs, pattern::fow, free, MTCH, archd::name, nflag, NULL, archd::pat, pathead, PAX_DIR, paxwarn(), pattern::pend, pattern::plen, pattern::pstr, strdup(), strlen(), and archd::type.

Referenced by extract(), list(), and pat_match().

static char * range_match char *  ,
int 
[static]
 

Definition at line 565 of file pat_rep.c.

References c, NULL, and ok().

int rep_add char *  str  ) 
 

Definition at line 97 of file pat_rep.c.

References BUFSIZ, replace::flgs, replace::fow, free, GLOB, malloc(), replace::nstr, NULL, paxwarn(), PRNT, replace::rcmp, regcomp, regerror, regfree(), rephead, reptail, and strchr.

Referenced by pax_options(), and tar_options().

static int rep_name char *  ,
int *  ,
int 
[static]
 

Definition at line 857 of file pat_rep.c.

References buf1, c, endpt, replace::flgs, replace::fow, fprintf(), GLOB, l_strncpy(), MAXSUBEXP, replace::nstr, NULL, PAXPATHLEN, paxwarn(), PRNT, prog, replace::rcmp, regexec, rephead, resub(), regmatch_t::rm_eo, regmatch_t::rm_so, stderr, and strcpy().

Referenced by mod_name().

static int resub regex_t ,
regmatch_t ,
char *  ,
char *  ,
char * 
[static]
 

Definition at line 1072 of file pat_rep.c.

References c, l_strncpy(), regex_t::re_nsub, regmatch_t::rm_eo, and regmatch_t::rm_so.

Referenced by rep_name().

int set_dest ARCHD arcn,
char *  dest_dir,
int  dir_len
 

Definition at line 767 of file pat_rep.c.

References fix_path(), archd::ln_name, archd::ln_nlen, archd::name, archd::nlen, PAX_HLK, PAX_HRG, and archd::type.

Referenced by copy().

static int tty_rename ARCHD  )  [static]
 

Definition at line 701 of file pat_rep.c.

References argv0, ls_tty(), PAXPATHLEN, strcmp, strlen(), tmpname, tty_prnt(), and tty_read().

Referenced by mod_name().


Variable Documentation

PATTERN* pathead = NULL [static]
 

Definition at line 64 of file pat_rep.c.

Referenced by pat_add(), pat_chk(), pat_match(), and pat_sel().

PATTERN* pattail = NULL [static]
 

Definition at line 65 of file pat_rep.c.

Referenced by pat_add().

REPLACE* rephead = NULL [static]
 

Definition at line 66 of file pat_rep.c.

Referenced by mod_name(), rep_add(), and rep_name().

REPLACE* reptail = NULL [static]
 

Definition at line 67 of file pat_rep.c.

Referenced by rep_add().


Generated on Fri Apr 14 23:05:47 2006 for minix by  doxygen 1.4.6