rpm  5.2.1
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
rpmmtree.c File Reference
#include "system.h"
#include <fnmatch.h>
#include <signal.h>
#include <stdarg.h>
#include "asprintf.h"
#include <rpmio_internal.h>
#include <fts.h>
#include <ugid.h>
#include <poptIO.h>
#include "debug.h"
Include dependency graph for rpmmtree.c:

Go to the source code of this file.

Data Structures

struct  _node
 
struct  rpmfts_s
 
struct  exclude
 
struct  _key
 

Macros

#define RPM_LIST_HEAD(name, type)   struct name { struct type *lh_first; }
 
#define RPM_LIST_ENTRY(type)   struct { struct type *le_next;struct type **le_prev; }
 
#define RPM_LIST_EMPTY(head)   ((head)->lh_first == NULL)
 
#define RPM_LIST_FIRST(head)   ((head)->lh_first)
 
#define RPM_LIST_NEXT(elm, field)   ((elm)->field.le_next)
 
#define RPM_LIST_INIT(head)   do { RPM_LIST_FIRST((head)) = NULL; } while (0)
 
#define RPM_LIST_INSERT_HEAD(head, elm, field)
 
#define RPM_LIST_FOREACH(var, head, field)   for ((var) = RPM_LIST_FIRST((head)); (var); (var) = RPM_LIST_NEXT((var), field))
 
#define _MTREE_INTERNAL
 
#define _KFB(n)   (1U << (n))
 
#define _MFB(n)   (_KFB(n) | 0x40000000)
 
#define F_BLOCK   0x001
 
#define F_CHAR   0x002
 
#define F_DIR   0x004
 
#define F_FIFO   0x008
 
#define F_FILE   0x010
 
#define F_LINK   0x020
 
#define F_SOCK   0x040
 
#define MF_ISSET(_FLAG)   ((mtreeFlags & ((MTREE_FLAGS_##_FLAG) & ~0x40000000)) != MTREE_FLAGS_NONE)
 
#define KEYDEFAULT
 
#define MISMATCHEXIT   2
 
#define MBITS   (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)
 
#define NEEDVALUE   0xffffffff
 
#define COMPUTE(var, ch)   (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)]
 
#define VIS_OCTAL   0x01 /* use octal \ddd format */
 
#define VIS_CSTYLE   0x02 /* use \[nrft0..] where appropriate */
 
#define VIS_SP   0x04 /* also encode space */
 
#define VIS_TAB   0x08 /* also encode tab */
 
#define VIS_NL   0x10 /* also encode newline */
 
#define VIS_WHITE   (VIS_SP | VIS_TAB | VIS_NL)
 
#define VIS_SAFE   0x20 /* only encode "unsafe" characters */
 
#define VIS_NOSLASH   0x40 /* inhibit printing '\' */
 
#define UNVIS_VALID   1 /* character valid */
 
#define UNVIS_VALIDPUSH   2 /* character valid, push back passed char */
 
#define UNVIS_NOCHAR   3 /* valid sequence, no character produced */
 
#define UNVIS_SYNBAD   -1 /* unrecognized escape sequence */
 
#define UNVIS_ERROR   -2 /* decoder in unknown state (unrecoverable) */
 
#define UNVIS_END   1 /* no more characters */
 
#define isoctal(c)   (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
 
#define isvisible(c)
 
#define S_GROUND   0 /* haven't seen escape char */
 
#define S_START   1 /* start decoding special sequence */
 
#define S_META   2 /* metachar started (M) */
 
#define S_META1   3 /* metachar more, regular char (-) */
 
#define S_CTRL   4 /* control char started (^) */
 
#define S_OCTAL2   5 /* octal digit 2 */
 
#define S_OCTAL3   6 /* octal digit 3 */
 
#define KF_ISSET(_keys, _KEY)   ((_keys) & (MTREE_KEYS_##_KEY))
 
#define MAGIC   "?*["
 
#define FF(a, b, c, d)   (((a)->flags & (c)) && ((b)->flags & (c)) && ((a)->d) != ((b)->d))
 
#define FS(a, b, c, d)   (((a)->flags & (c)) && ((b)->flags & (c)) && strcmp((a)->d,(b)->d))
 
#define FM(a, b, c, d)   (((a)->flags & (c)) && ((b)->flags & (c)) && memcmp(&(a)->d,&(b)->d, sizeof (a)->d))
 
#define SKIPDOTSLASH(_f)   ((_f)[0] == '.' && (_f)[1] == '/' ? (_f) + 2 : (_f))
 
#define COMPAREINDENTNAMELEN   8
 
#define LABEL
 
#define _FTSCALLOC(_p, _n)
 
#define CWALKINDENTNAMELEN   15
 
#define MAXLINELEN   80
 
#define MATCH(g, n)   (fnmatch((g), (n), FNM_PATHNAME) == 0)
 
#define __getlogin   getlogin
 

Typedefs

typedef struct rpmfts_srpmfts
 
typedef struct _node NODE
 
typedef struct _key KEY
 

Enumerations

enum  mtreeFlags_e {
  MTREE_FLAGS_NONE = 0, MTREE_FLAGS_QUIET = ((1U << ( 0 )) | 0x40000000), MTREE_FLAGS_WARN = ((1U << ( 1 )) | 0x40000000), MTREE_FLAGS_CREATE = ((1U << ( 2 )) | 0x40000000),
  MTREE_FLAGS_DIRSONLY = ((1U << ( 3 )) | 0x40000000), MTREE_FLAGS_IGNORE = ((1U << ( 4 )) | 0x40000000), MTREE_FLAGS_INDENT = ((1U << ( 5 )) | 0x40000000), MTREE_FLAGS_LOOSE = ((1U << ( 6 )) | 0x40000000),
  MTREE_FLAGS_NOCOMMENT = ((1U << ( 7 )) | 0x40000000), MTREE_FLAGS_REMOVE = ((1U << ( 8 )) | 0x40000000), MTREE_FLAGS_SEEDED = ((1U << ( 9 )) | 0x40000000), MTREE_FLAGS_TOUCH = ((1U << ( 10 )) | 0x40000000),
  MTREE_FLAGS_UPDATE = ((1U << ( 11 )) | 0x40000000), MTREE_FLAGS_MISMATCHOK = ((1U << ( 12 )) | 0x40000000)
}
 Bit field enum for mtree CLI options. More...
 
enum  mtreeKeys_e {
  MTREE_KEYS_NONE = 0, MTREE_KEYS_CKSUM = (1U << ( 0 )), MTREE_KEYS_DONE = (1U << ( 1 )), MTREE_KEYS_GID = (1U << ( 2 )),
  MTREE_KEYS_GNAME = (1U << ( 3 )), MTREE_KEYS_IGN = (1U << ( 4 )), MTREE_KEYS_MAGIC = (1U << ( 5 )), MTREE_KEYS_MODE = (1U << ( 6 )),
  MTREE_KEYS_NLINK = (1U << ( 7 )), MTREE_KEYS_SIZE = (1U << ( 8 )), MTREE_KEYS_SLINK = (1U << ( 9 )), MTREE_KEYS_TIME = (1U << ( 10 )),
  MTREE_KEYS_TYPE = (1U << ( 11 )), MTREE_KEYS_UID = (1U << ( 12 )), MTREE_KEYS_UNAME = (1U << ( 13 )), MTREE_KEYS_VISIT = (1U << ( 14 )),
  MTREE_KEYS_FLAGS = (1U << ( 15 )), MTREE_KEYS_NOCHANGE = (1U << ( 16 )), MTREE_KEYS_OPT = (1U << ( 17 )), MTREE_KEYS_DIGEST = (1U << ( 18 ))
}
 Bit field enum for mtree keys. More...
 

Functions

static NODEmtreeSpec (rpmfts fts, FILE *fp)
 
static int mtreeVSpec (rpmfts fts)
 
static int mtreeCWalk (rpmfts fts)
 
static int mtreeVWalk (rpmfts fts)
 
static void mtreeMiss (rpmfts fts, NODE *p, char *tail)
 
static void mtree_error (const char *fmt,...)
 
static int keycompare (const void *a, const void *b)
 
static unsigned parsekey (char *name, uint32_t *needvaluep)
 
static const char * algo2tagname (uint32_t algo)
 
static int crc (FD_t fd, uint32_t *cval, uint32_t *clen)
 
static char * vis (char *dst, int c, int flag, int nextc)
 
static int strvis (char *dst, const char *src, int flag)
 
static int strunvis (char *dst, const char *src)
 
static int unvis (char *cp, char c, int *astate, int flag)
 
static void set (char *t, NODE *ip)
 
static void unset (char *t, NODE *ip)
 
static const char * ftype (unsigned type)
 
static const char * inotype (mode_t mode)
 
static void shownode (NODE *n, enum mtreeKeys_e keys, const char *path)
 
static int mismatch (NODE *n1, NODE *n2, enum mtreeKeys_e differ, const char *path)
 
static int compare_nodes (NODE *n1, NODE *n2, const char *path)
 
static int mtreeSWalk (NODE *t1, NODE *t2, const char *path)
 
static const char * rlink (const char *name)
 
static const char * algo2name (uint32_t algo)
 
static int compare (rpmfts fts, NODE *const s)
 
static int mtreeVisitD (rpmfts fts)
 
static void output (int indent, int *offset, const char *fmt,...)
 
static void mtreeVisitF (rpmfts fts)
 
static void mtreeReadExcludes (const char *fn)
 
static int mtreeCheckExcludes (const char *fname, const char *path)
 
static int dsort (const FTSENT **a, const FTSENT **b)
 
static void mtreeArgCallback (poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, void *data)
 
int main (int argc, char *argv[])
 

Variables

static const char copyright []
 
static struct rpmfts_s __rpmfts
 
static rpmfts _rpmfts = &__rpmfts
 
static enum mtreeFlags_e mtreeFlags = MTREE_FLAGS_NONE
 
struct {
   struct exclude *   lh_first
 
excludes
 
static struct rpmop_s dc_totalops
 
static struct rpmop_s dc_readops
 
static struct rpmop_s dc_digestops
 
static KEY keylist []
 
static const uint32_t crctab []
 
static struct poptOption optionsTable []
 

Macro Definition Documentation

#define __getlogin   getlogin

Definition at line 3656 of file rpmmtree.c.

Referenced by main().

#define _FTSCALLOC (   _p,
  _n 
)
Value:
if ((_n) > 0) { \
(_p) = _free(_p); (_p) = xcalloc((_n), sizeof(*(_p))); \
}

Definition at line 2359 of file rpmmtree.c.

Referenced by mtreeVisitD().

#define _KFB (   n)    (1U << (n))

Definition at line 103 of file rpmmtree.c.

#define _MFB (   n)    (_KFB(n) | 0x40000000)

Definition at line 104 of file rpmmtree.c.

#define _MTREE_INTERNAL

Definition at line 100 of file rpmmtree.c.

#define COMPAREINDENTNAMELEN   8

Definition at line 2050 of file rpmmtree.c.

#define COMPUTE (   var,
  ch 
)    (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)]

Referenced by crc().

#define CWALKINDENTNAMELEN   15

Definition at line 2500 of file rpmmtree.c.

Referenced by mtreeVisitF(), and output().

#define F_BLOCK   0x001

block special

Definition at line 172 of file rpmmtree.c.

Referenced by compare(), ftype(), and set().

#define F_CHAR   0x002

char special

Definition at line 173 of file rpmmtree.c.

Referenced by compare(), ftype(), and set().

#define F_DIR   0x004

directory

Definition at line 174 of file rpmmtree.c.

Referenced by compare(), ftype(), mtreeMiss(), mtreeSpec(), mtreeSWalk(), mtreeVWalk(), and set().

#define F_FIFO   0x008

fifo

Definition at line 175 of file rpmmtree.c.

Referenced by compare(), ftype(), and set().

#define F_FILE   0x010

regular file

Definition at line 176 of file rpmmtree.c.

Referenced by compare(), ftype(), and set().

#define F_LINK   0x020

symbolic link

Definition at line 177 of file rpmmtree.c.

Referenced by compare(), compare_nodes(), ftype(), mtreeMiss(), and set().

#define F_SOCK   0x040

socket

Definition at line 178 of file rpmmtree.c.

Referenced by compare(), ftype(), and set().

#define FF (   a,
  b,
  c,
 
)    (((a)->flags & (c)) && ((b)->flags & (c)) && ((a)->d) != ((b)->d))

Definition at line 1779 of file rpmmtree.c.

Referenced by compare_nodes().

#define FM (   a,
  b,
  c,
 
)    (((a)->flags & (c)) && ((b)->flags & (c)) && memcmp(&(a)->d,&(b)->d, sizeof (a)->d))

Definition at line 1783 of file rpmmtree.c.

Referenced by compare_nodes().

#define FS (   a,
  b,
  c,
 
)    (((a)->flags & (c)) && ((b)->flags & (c)) && strcmp((a)->d,(b)->d))

Definition at line 1781 of file rpmmtree.c.

Referenced by compare_nodes().

#define isoctal (   c)    (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')

Definition at line 621 of file rpmmtree.c.

Referenced by unvis(), and vis().

#define isvisible (   c)
Value:
(((unsigned)(c) <= (unsigned)UCHAR_MAX && isascii((unsigned char)(c)) && \
isgraph((unsigned char)(c))) \
|| ((flag & VIS_SP) == 0 && (c) == (int)' ') \
|| ((flag & VIS_TAB) == 0 && (c) == (int)'\t') \
|| ((flag & VIS_NL) == 0 && (c) == (int)'\n') \
|| ((flag & VIS_SAFE) \
&& ((c) == (int)'\b' || (c) == (int)'\007' || (c) == (int)'\r')))

Definition at line 622 of file rpmmtree.c.

Referenced by vis().

#define KEYDEFAULT
Value:

Definition at line 276 of file rpmmtree.c.

Referenced by main().

#define KF_ISSET (   _keys,
  _KEY 
)    ((_keys) & (MTREE_KEYS_##_KEY))
#define LABEL
Value:
if (!label++) { \
(void) printf(_("%s changed\n"), SKIPDOTSLASH(p->fts_path)); \
tab = "\t"; \
}

Definition at line 2051 of file rpmmtree.c.

Referenced by compare().

#define MAGIC   "?*["

Referenced by mtreeSpec(), and mtreeVWalk().

#define MATCH (   g,
 
)    (fnmatch((g), (n), FNM_PATHNAME) == 0)

Referenced by mtreeCheckExcludes().

#define MAXLINELEN   80

Definition at line 2501 of file rpmmtree.c.

Referenced by mtreeVisitF(), and output().

#define MBITS   (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)

Definition at line 285 of file rpmmtree.c.

Referenced by compare(), main(), mtreeVisitD(), and mtreeVisitF().

#define MF_ISSET (   _FLAG)    ((mtreeFlags & ((MTREE_FLAGS_##_FLAG) & ~0x40000000)) != MTREE_FLAGS_NONE)

Definition at line 274 of file rpmmtree.c.

Referenced by compare(), main(), mtreeCWalk(), mtreeMiss(), mtreeVisitD(), mtreeVisitF(), and mtreeVWalk().

#define MISMATCHEXIT   2

Definition at line 280 of file rpmmtree.c.

Referenced by main(), mtreeVSpec(), and mtreeVWalk().

#define NEEDVALUE   0xffffffff

Definition at line 347 of file rpmmtree.c.

#define RPM_LIST_EMPTY (   head)    ((head)->lh_first == NULL)

Definition at line 84 of file rpmmtree.c.

#define RPM_LIST_ENTRY (   type)    struct { struct type *le_next;struct type **le_prev; }

Definition at line 82 of file rpmmtree.c.

#define RPM_LIST_FIRST (   head)    ((head)->lh_first)

Definition at line 86 of file rpmmtree.c.

#define RPM_LIST_FOREACH (   var,
  head,
  field 
)    for ((var) = RPM_LIST_FIRST((head)); (var); (var) = RPM_LIST_NEXT((var), field))

Definition at line 97 of file rpmmtree.c.

Referenced by mtreeCheckExcludes().

#define RPM_LIST_HEAD (   name,
  type 
)    struct name { struct type *lh_first; }

Definition at line 80 of file rpmmtree.c.

#define RPM_LIST_INIT (   head)    do { RPM_LIST_FIRST((head)) = NULL; } while (0)

Definition at line 90 of file rpmmtree.c.

Referenced by main().

#define RPM_LIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { if ((RPM_LIST_NEXT((elm), field) = RPM_LIST_FIRST((head))) != NULL) \
RPM_LIST_FIRST((head))->field.le_prev = &RPM_LIST_NEXT((elm), field);\
RPM_LIST_FIRST((head)) = (elm); \
(elm)->field.le_prev = &RPM_LIST_FIRST((head)); } while (0)

Definition at line 92 of file rpmmtree.c.

Referenced by mtreeReadExcludes().

#define RPM_LIST_NEXT (   elm,
  field 
)    ((elm)->field.le_next)

Definition at line 88 of file rpmmtree.c.

#define S_CTRL   4 /* control char started (^) */

Definition at line 808 of file rpmmtree.c.

Referenced by unvis().

#define S_GROUND   0 /* haven't seen escape char */

Definition at line 804 of file rpmmtree.c.

Referenced by unvis().

#define S_META   2 /* metachar started (M) */

Definition at line 806 of file rpmmtree.c.

Referenced by unvis().

#define S_META1   3 /* metachar more, regular char (-) */

Definition at line 807 of file rpmmtree.c.

Referenced by unvis().

#define S_OCTAL2   5 /* octal digit 2 */

Definition at line 809 of file rpmmtree.c.

Referenced by unvis().

#define S_OCTAL3   6 /* octal digit 3 */

Definition at line 810 of file rpmmtree.c.

Referenced by unvis().

#define S_START   1 /* start decoding special sequence */

Definition at line 805 of file rpmmtree.c.

Referenced by unvis().

#define SKIPDOTSLASH (   _f)    ((_f)[0] == '.' && (_f)[1] == '/' ? (_f) + 2 : (_f))

Definition at line 2048 of file rpmmtree.c.

Referenced by mtreeVisitD(), and mtreeVWalk().

#define UNVIS_END   1 /* no more characters */

Definition at line 604 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define UNVIS_ERROR   -2 /* decoder in unknown state (unrecoverable) */

Definition at line 599 of file rpmmtree.c.

#define UNVIS_NOCHAR   3 /* valid sequence, no character produced */

Definition at line 597 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define UNVIS_SYNBAD   -1 /* unrecognized escape sequence */

Definition at line 598 of file rpmmtree.c.

Referenced by unvis().

#define UNVIS_VALID   1 /* character valid */

Definition at line 595 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define UNVIS_VALIDPUSH   2 /* character valid, push back passed char */

Definition at line 596 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define VIS_CSTYLE   0x02 /* use \[nrft0..] where appropriate */

Definition at line 575 of file rpmmtree.c.

Referenced by vis().

#define VIS_NL   0x10 /* also encode newline */

Definition at line 583 of file rpmmtree.c.

#define VIS_NOSLASH   0x40 /* inhibit printing '\' */

Definition at line 590 of file rpmmtree.c.

Referenced by vis().

#define VIS_OCTAL   0x01 /* use octal \ddd format */

Definition at line 574 of file rpmmtree.c.

Referenced by mtreeVisitF(), and vis().

#define VIS_SAFE   0x20 /* only encode "unsafe" characters */

Definition at line 585 of file rpmmtree.c.

#define VIS_SP   0x04 /* also encode space */

Definition at line 581 of file rpmmtree.c.

#define VIS_TAB   0x08 /* also encode tab */

Definition at line 582 of file rpmmtree.c.

#define VIS_WHITE   (VIS_SP | VIS_TAB | VIS_NL)

Definition at line 584 of file rpmmtree.c.

Referenced by mtreeVisitF().

Typedef Documentation

typedef struct _key KEY
typedef struct _node NODE
typedef struct rpmfts_s* rpmfts

Definition at line 129 of file rpmmtree.c.

Enumeration Type Documentation

Bit field enum for mtree CLI options.

Enumerator
MTREE_FLAGS_NONE 
MTREE_FLAGS_QUIET 

-q,–quiet ...

MTREE_FLAGS_WARN 

-w,–warn ...

MTREE_FLAGS_CREATE 

-c,–create ...

MTREE_FLAGS_DIRSONLY 

-d,–dirs ...

MTREE_FLAGS_IGNORE 

-e,–ignore ...

MTREE_FLAGS_INDENT 

-i,–indent ...

MTREE_FLAGS_LOOSE 

-l,–loose ...

MTREE_FLAGS_NOCOMMENT 

-n,–nocomment ...

MTREE_FLAGS_REMOVE 

-r,–remove ...

MTREE_FLAGS_SEEDED 

-s,–seed ...

MTREE_FLAGS_TOUCH 

-t,–touch ...

MTREE_FLAGS_UPDATE 

-u,–update ...

MTREE_FLAGS_MISMATCHOK 

-U,–mismatch ...

Definition at line 109 of file rpmmtree.c.

Bit field enum for mtree keys.

Enumerator
MTREE_KEYS_NONE 
MTREE_KEYS_CKSUM 

checksum

MTREE_KEYS_DONE 

directory done

MTREE_KEYS_GID 

gid

MTREE_KEYS_GNAME 

group name

MTREE_KEYS_IGN 

ignore

MTREE_KEYS_MAGIC 

name has magic chars

MTREE_KEYS_MODE 

mode

MTREE_KEYS_NLINK 

number of links

MTREE_KEYS_SIZE 

size

MTREE_KEYS_SLINK 

link count

MTREE_KEYS_TIME 

modification time

MTREE_KEYS_TYPE 

file type

MTREE_KEYS_UID 

uid

MTREE_KEYS_UNAME 

user name

MTREE_KEYS_VISIT 

file visited

MTREE_KEYS_FLAGS 

file flags

MTREE_KEYS_NOCHANGE 

do not change owner/mode

MTREE_KEYS_OPT 

existence optional

MTREE_KEYS_DIGEST 

digest

Definition at line 135 of file rpmmtree.c.

Function Documentation

static const char* algo2name ( uint32_t  algo)
static
static const char* algo2tagname ( uint32_t  algo)
static
static int compare ( rpmfts  fts,
NODE *const  s 
)
static
static int compare_nodes ( NODE n1,
NODE n2,
const char *  path 
)
static
static int crc ( FD_t  fd,
uint32_t *  cval,
uint32_t *  clen 
)
static

Definition at line 532 of file rpmmtree.c.

References COMPUTE, rpmfts_s::crc_total, Ferror(), and Fread().

Referenced by __crc32(), __crc64(), compare(), mtreeVisitF(), pgpCRC(), and pgpReadPkts().

static int dsort ( const FTSENT **  a,
const FTSENT **  b 
)
static

Definition at line 2824 of file rpmmtree.c.

Referenced by mtreeCWalk().

static const char* ftype ( unsigned  type)
static

< block special

< char special

< directory

< fifo

< regular file

< symbolic link

< socket

Definition at line 1717 of file rpmmtree.c.

References F_BLOCK, F_CHAR, F_DIR, F_FIFO, F_FILE, F_LINK, and F_SOCK.

Referenced by compare(), rpmfcClassify(), and shownode().

static const char* inotype ( mode_t  mode)
static

Definition at line 1735 of file rpmmtree.c.

References S_IFSOCK.

Referenced by compare(), and mtreeVisitF().

static int keycompare ( const void *  a,
const void *  b 
)
static

Definition at line 392 of file rpmmtree.c.

Referenced by parsekey().

int main ( int  argc,
char *  argv[] 
)
static int mismatch ( NODE n1,
NODE n2,
enum mtreeKeys_e  differ,
const char *  path 
)
static

Definition at line 1842 of file rpmmtree.c.

References rpmfts_s::keys, and shownode().

Referenced by compare_nodes().

void mtree_error ( const char *  fmt,
  ... 
)
static
static void mtreeArgCallback ( poptContext  con,
enum poptCallbackReason  reason,
const struct poptOption *  opt,
const char *  arg,
void *  data 
)
static
static int mtreeCheckExcludes ( const char *  fname,
const char *  path 
)
static

Definition at line 2804 of file rpmmtree.c.

References exclude::glob, MATCH, exclude::pathname, and RPM_LIST_FOREACH.

Referenced by mtreeCWalk(), and mtreeVWalk().

int mtreeCWalk ( rpmfts  fts)
static
void mtreeMiss ( rpmfts  fts,
NODE p,
char *  tail 
)
static

< directory

< directory

< symbolic link

< symbolic link

< symbolic link

Definition at line 3249 of file rpmmtree.c.

References _, _node::child, Chmod(), Chown(), errno, F_DIR, F_LINK, _node::flags, KF_ISSET, lchown, MF_ISSET, Mkdir(), MTREE_KEYS_VISIT, _node::name, _node::next, rpmfts_s::path, _node::sb, _node::slink, Stat(), Symlink(), and _node::type.

Referenced by main().

static void mtreeReadExcludes ( const char *  fn)
static
NODE * mtreeSpec ( rpmfts  fts,
FILE *  fp 
)
static
static int mtreeSWalk ( NODE t1,
NODE t2,
const char *  path 
)
static

< directory

< directory

< directory

< directory

< directory

< directory

< directory

< directory

Definition at line 1950 of file rpmmtree.c.

References _node::child, compare_nodes(), F_DIR, _node::name, _node::next, and _node::type.

Referenced by mtreeVSpec().

static int mtreeVisitD ( rpmfts  fts)
static
static void mtreeVisitF ( rpmfts  fts)
static
int mtreeVSpec ( rpmfts  fts)
static

Definition at line 2019 of file rpmmtree.c.

References compare_nodes(), MISMATCHEXIT, mtreeSpec(), mtreeSWalk(), rpmfts_s::spec1, and rpmfts_s::spec2.

Referenced by main().

int mtreeVWalk ( rpmfts  fts)
static
static void output ( int  indent,
int *  offset,
const char *  fmt,
  ... 
)
static

Definition at line 2505 of file rpmmtree.c.

References CWALKINDENTNAMELEN, indent, MAXLINELEN, and vsnprintf().

Referenced by mtreeVisitF().

static unsigned parsekey ( char *  name,
uint32_t *  needvaluep 
)
static

Definition at line 399 of file rpmmtree.c.

References keycompare(), keylist, mtree_error(), name, and key_s::name.

Referenced by mtreeArgCallback(), set(), and unset().

static const char* rlink ( const char *  name)
static

Definition at line 2034 of file rpmmtree.c.

References errno, MAXPATHLEN, mtree_error(), and Readlink().

Referenced by compare(), and mtreeVisitF().

static void set ( char *  t,
NODE ip 
)
static
static void shownode ( NODE n,
enum mtreeKeys_e  keys,
const char *  path 
)
static
int strunvis ( char *  dst,
const char *  src 
)
static

Definition at line 973 of file rpmmtree.c.

References unvis(), UNVIS_END, UNVIS_NOCHAR, UNVIS_VALID, and UNVIS_VALIDPUSH.

Referenced by mtreeSpec(), and set().

int strvis ( char *  dst,
const char *  src,
int  flag 
)
static

Definition at line 732 of file rpmmtree.c.

References vis().

Referenced by mtreeVisitF().

static void unset ( char *  t,
NODE ip 
)
static

Definition at line 1576 of file rpmmtree.c.

References _node::flags, and parsekey().

Referenced by mtreeSpec().

int unvis ( char *  cp,
char  c,
int *  astate,
int  flag 
)
static
char * vis ( char *  dst,
int  c,
int  flag,
int  nextc 
)
static

Definition at line 635 of file rpmmtree.c.

References isoctal, isvisible, VIS_CSTYLE, VIS_NOSLASH, and VIS_OCTAL.

Referenced by strvis().

Variable Documentation

struct rpmfts_s __rpmfts
static

Definition at line 288 of file rpmmtree.c.

rpmfts _rpmfts = &__rpmfts
static

Definition at line 290 of file rpmmtree.c.

Referenced by main().

const char copyright[]
static
Initial value:
=
"@(#) Copyright (c) 1989, 1990, 1993\n\
The Regents of the University of California. All rights reserved.\n"

Definition at line 35 of file rpmmtree.c.

const uint32_t crctab[]
static

Definition at line 470 of file rpmmtree.c.

struct rpmop_s dc_digestops
static

Definition at line 312 of file rpmmtree.c.

struct rpmop_s dc_readops
static

Definition at line 309 of file rpmmtree.c.

struct rpmop_s dc_totalops
static

Definition at line 306 of file rpmmtree.c.

struct { ... } excludes
KEY keylist[]
static

Definition at line 353 of file rpmmtree.c.

Referenced by parsekey().

struct exclude* lh_first

Definition at line 303 of file rpmmtree.c.

enum mtreeFlags_e mtreeFlags = MTREE_FLAGS_NONE
static

Definition at line 293 of file rpmmtree.c.

Referenced by main().

struct poptOption optionsTable[]
static

Definition at line 3550 of file rpmmtree.c.

Referenced by main().