rpm 5.3.7
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

tools/rpmmtree.c File Reference

#include "system.h"
#include <fnmatch.h>
#include <signal.h>
#include <stdarg.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

Defines

#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
#define VIS_CSTYLE   0x02
#define VIS_SP   0x04
#define VIS_TAB   0x08
#define VIS_NL   0x10
#define VIS_WHITE   (VIS_SP | VIS_TAB | VIS_NL)
#define VIS_SAFE   0x20
#define VIS_NOSLASH   0x40
#define UNVIS_VALID   1
#define UNVIS_VALIDPUSH   2
#define UNVIS_NOCHAR   3
#define UNVIS_SYNBAD   -1
#define UNVIS_ERROR   -2
#define UNVIS_END   1
#define isoctal(c)   (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
#define isvisible(c)
#define S_GROUND   0
#define S_START   1
#define S_META   2
#define S_META1   3
#define S_CTRL   4
#define S_OCTAL2   5
#define S_OCTAL3   6
#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 = (_KFB( 0 ) | 0x40000000), MTREE_FLAGS_WARN = (_KFB( 1 ) | 0x40000000), MTREE_FLAGS_CREATE = (_KFB( 2 ) | 0x40000000),
  MTREE_FLAGS_DIRSONLY = (_KFB( 3 ) | 0x40000000), MTREE_FLAGS_IGNORE = (_KFB( 4 ) | 0x40000000), MTREE_FLAGS_INDENT = (_KFB( 5 ) | 0x40000000), MTREE_FLAGS_LOOSE = (_KFB( 6 ) | 0x40000000),
  MTREE_FLAGS_NOCOMMENT = (_KFB( 7 ) | 0x40000000), MTREE_FLAGS_REMOVE = (_KFB( 8 ) | 0x40000000), MTREE_FLAGS_SEEDED = (_KFB( 9 ) | 0x40000000), MTREE_FLAGS_TOUCH = (_KFB( 10 ) | 0x40000000),
  MTREE_FLAGS_UPDATE = (_KFB( 11 ) | 0x40000000), MTREE_FLAGS_MISMATCHOK = (_KFB( 12 ) | 0x40000000)
}
 

Bit field enum for mtree CLI options.

More...
enum  mtreeKeys_e {
  MTREE_KEYS_NONE = 0, MTREE_KEYS_CKSUM = _KFB( 0), MTREE_KEYS_DONE = _KFB( 1), MTREE_KEYS_GID = _KFB( 2),
  MTREE_KEYS_GNAME = _KFB( 3), MTREE_KEYS_IGN = _KFB( 4), MTREE_KEYS_MAGIC = _KFB( 5), MTREE_KEYS_MODE = _KFB( 6),
  MTREE_KEYS_NLINK = _KFB( 7), MTREE_KEYS_SIZE = _KFB( 8), MTREE_KEYS_SLINK = _KFB( 9), MTREE_KEYS_TIME = _KFB(10),
  MTREE_KEYS_TYPE = _KFB(11), MTREE_KEYS_UID = _KFB(12), MTREE_KEYS_UNAME = _KFB(13), MTREE_KEYS_VISIT = _KFB(14),
  MTREE_KEYS_FLAGS = _KFB(15), MTREE_KEYS_NOCHANGE = _KFB(16), MTREE_KEYS_OPT = _KFB(17), MTREE_KEYS_DIGEST = _KFB(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 []

Define Documentation

#define __getlogin   getlogin

Definition at line 3643 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 2346 of file rpmmtree.c.

Referenced by mtreeVisitD().

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

Definition at line 89 of file rpmmtree.c.

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

Definition at line 90 of file rpmmtree.c.

#define _MTREE_INTERNAL

Definition at line 86 of file rpmmtree.c.

#define COMPAREINDENTNAMELEN   8

Definition at line 2033 of file rpmmtree.c.

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

Referenced by crc().

#define CWALKINDENTNAMELEN   15

Definition at line 2487 of file rpmmtree.c.

Referenced by mtreeVisitF(), and output().

#define F_BLOCK   0x001

block special

Definition at line 158 of file rpmmtree.c.

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

#define F_CHAR   0x002

char special

Definition at line 159 of file rpmmtree.c.

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

#define F_DIR   0x004

directory

Definition at line 160 of file rpmmtree.c.

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

#define F_FIFO   0x008

fifo

Definition at line 161 of file rpmmtree.c.

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

#define F_FILE   0x010

regular file

Definition at line 162 of file rpmmtree.c.

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

#define F_LINK   0x020

symbolic link

Definition at line 163 of file rpmmtree.c.

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

#define F_SOCK   0x040

socket

Definition at line 164 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 1762 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 1766 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 1764 of file rpmmtree.c.

Referenced by compare_nodes().

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

Definition at line 604 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 605 of file rpmmtree.c.

Referenced by vis().

#define KEYDEFAULT
#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 2034 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 2488 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 268 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 260 of file rpmmtree.c.

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

#define MISMATCHEXIT   2

Definition at line 266 of file rpmmtree.c.

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

#define NEEDVALUE   0xffffffff

Definition at line 330 of file rpmmtree.c.

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

Definition at line 70 of file rpmmtree.c.

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

Definition at line 68 of file rpmmtree.c.

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

Definition at line 72 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 83 of file rpmmtree.c.

Referenced by mtreeCheckExcludes().

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

Definition at line 66 of file rpmmtree.c.

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

Definition at line 76 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 78 of file rpmmtree.c.

Referenced by mtreeReadExcludes().

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

Definition at line 74 of file rpmmtree.c.

#define S_CTRL   4

Definition at line 791 of file rpmmtree.c.

Referenced by unvis().

#define S_GROUND   0

Definition at line 787 of file rpmmtree.c.

Referenced by unvis().

#define S_META   2

Definition at line 789 of file rpmmtree.c.

Referenced by unvis().

#define S_META1   3

Definition at line 790 of file rpmmtree.c.

Referenced by unvis().

#define S_OCTAL2   5

Definition at line 792 of file rpmmtree.c.

Referenced by unvis().

#define S_OCTAL3   6

Definition at line 793 of file rpmmtree.c.

Referenced by unvis().

#define S_START   1

Definition at line 788 of file rpmmtree.c.

Referenced by unvis().

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

Definition at line 2031 of file rpmmtree.c.

Referenced by mtreeVisitD(), and mtreeVWalk().

#define UNVIS_END   1

Definition at line 587 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define UNVIS_ERROR   -2

Definition at line 582 of file rpmmtree.c.

#define UNVIS_NOCHAR   3

Definition at line 580 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define UNVIS_SYNBAD   -1

Definition at line 581 of file rpmmtree.c.

Referenced by unvis().

#define UNVIS_VALID   1

Definition at line 578 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define UNVIS_VALIDPUSH   2

Definition at line 579 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

#define VIS_CSTYLE   0x02

Definition at line 558 of file rpmmtree.c.

Referenced by vis().

#define VIS_NL   0x10

Definition at line 566 of file rpmmtree.c.

#define VIS_NOSLASH   0x40

Definition at line 573 of file rpmmtree.c.

Referenced by vis().

#define VIS_OCTAL   0x01

Definition at line 557 of file rpmmtree.c.

Referenced by mtreeVisitF(), and vis().

#define VIS_SAFE   0x20

Definition at line 568 of file rpmmtree.c.

#define VIS_SP   0x04

Definition at line 564 of file rpmmtree.c.

#define VIS_TAB   0x08

Definition at line 565 of file rpmmtree.c.

#define VIS_WHITE   (VIS_SP | VIS_TAB | VIS_NL)

Definition at line 567 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 115 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 95 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 121 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 515 of file rpmmtree.c.

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

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

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

Definition at line 2811 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 1700 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 1718 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 375 of file rpmmtree.c.

References name.

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 1825 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 2791 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 3236 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 1933 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 2002 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 2492 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 382 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 2017 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 956 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 715 of file rpmmtree.c.

References vis().

Referenced by mtreeVisitF().

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

Definition at line 1559 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 618 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 271 of file rpmmtree.c.

rpmfts _rpmfts = &__rpmfts [static]

Definition at line 273 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 453 of file rpmmtree.c.

struct rpmop_s dc_digestops [static]

Definition at line 295 of file rpmmtree.c.

struct rpmop_s dc_readops [static]

Definition at line 292 of file rpmmtree.c.

struct rpmop_s dc_totalops [static]

Definition at line 289 of file rpmmtree.c.

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

Definition at line 336 of file rpmmtree.c.

Referenced by parsekey().

struct exclude* lh_first

Definition at line 286 of file rpmmtree.c.

enum mtreeFlags_e mtreeFlags = MTREE_FLAGS_NONE [static]

Definition at line 276 of file rpmmtree.c.

Referenced by main().

struct poptOption optionsTable[] [static]

Definition at line 3537 of file rpmmtree.c.

Referenced by main().