rpm  5.4.14
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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
 

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)
 
void mtree_error (const char *fmt,...)
 
 mtree_error ("unknown keyword %s", name)
 
static const char * switch (algo)
 
 while ((nr=Fread(buf, sizeof(buf[0]), sizeof(buf), fd))!=0)
 
 for (;len!=0;len >>=8)
 
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)
 
 for (;(kw=strtok(t,"= \t\n"))!=NULL;t=NULL)
 
 while ((p=strtok(t,"\n\t "))!=NULL)
 
 while (0)
 
 if (!(argv==NULL||argv[0]==NULL))
 
 if (((mtreeFlags &((MTREE_FLAGS_LOOSE)&~0x40000000))!=MTREE_FLAGS_NONE)&&((mtreeFlags &((MTREE_FLAGS_UPDATE)&~0x40000000))!=MTREE_FLAGS_NONE))
 
 if (fts->paths==NULL||fts->paths[0]==NULL)
 
 for (i=0;fts->paths[i]!=NULL;i++)
 
 if (((mtreeFlags &((MTREE_FLAGS_CREATE)&~0x40000000))!=MTREE_FLAGS_NONE))
 
 if (_rpmsw_stats)
 
 if (fts->spec2!=NULL &&fileno(fts->spec2) > 2)
 

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 void
 
static KEY keylist []
 
static int
 
static unsigned
 
needvaluep = 0
 
 return
 
tmp name = name
 
 k
 
return k val
 
return tagname
 
static const uint32_t crctab []
 
uint32_t len = 0
 
_rpmfts crc_total = 0xffffffff
 
size_t nr { uint8_t buf[16 * 1024]
 
clen = len
 
cval = (crc ^ 0xffffffff)
 
poptContext optCon = rpmioInit(argc, argv, optionsTable)
 
int rc = 1
 
int i
 
 __progname = "mtree"
 
 do { (( ( &excludes ) )->lh_first) = NULL
 
fts keys = (MTREE_KEYS_GID | MTREE_KEYS_MODE | MTREE_KEYS_NLINK | MTREE_KEYS_SIZE | MTREE_KEYS_SLINK | MTREE_KEYS_TIME | MTREE_KEYS_UID)
 
fts maxg = 5000
 
fts maxu = 5000
 
fts maxm = ( (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) + 1)
 
 argv = (char **) poptGetArgs(optCon)
 
 else
 
exit __pad0__
 
fts spec1 = NULL
 
fts paths = argvFree(fts->paths)
 
fts g = _free(fts->g)
 
fts m = _free(fts->m)
 
fts u = _free(fts->u)
 
fts fullpath = _free(fts->fullpath)
 

Macro Definition Documentation

#define __getlogin   getlogin

Definition at line 3648 of file rpmmtree.c.

Referenced by if().

#define _FTSCALLOC (   _p,
  _n 
)
Value:
if ((_n) > 0) { \
(_p) = _free(_p); (_p) = xcalloc((_n), sizeof(*(_p))); \
}
void * xcalloc(size_t nmemb, size_t size)
Definition: rpmmalloc.c:300
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
Definition: rpmiotypes.h:647
#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
#define COMPUTE (   var,
  ch 
)    (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)]

Definition at line 522 of file rpmmtree.c.

Referenced by for(), and while().

#define CWALKINDENTNAMELEN   15
#define F_BLOCK   0x001

block special

Definition at line 158 of file rpmmtree.c.

Referenced by for().

#define F_CHAR   0x002

char special

Definition at line 159 of file rpmmtree.c.

Referenced by for().

#define F_DIR   0x004

directory

Definition at line 160 of file rpmmtree.c.

Referenced by for().

#define F_FIFO   0x008

fifo

Definition at line 161 of file rpmmtree.c.

Referenced by for().

#define F_FILE   0x010

regular file

Definition at line 162 of file rpmmtree.c.

Referenced by for().

#define F_LINK   0x020

symbolic link

Definition at line 163 of file rpmmtree.c.

Referenced by for().

#define F_SOCK   0x040

socket

Definition at line 164 of file rpmmtree.c.

Referenced by for().

#define FF (   a,
  b,
  c,
 
)    (((a)->flags & (c)) && ((b)->flags & (c)) && ((a)->d) != ((b)->d))
#define FM (   a,
  b,
  c,
 
)    (((a)->flags & (c)) && ((b)->flags & (c)) && memcmp(&(a)->d,&(b)->d, sizeof (a)->d))
#define FS (   a,
  b,
  c,
 
)    (((a)->flags & (c)) && ((b)->flags & (c)) && strcmp((a)->d,(b)->d))
#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')))
#define VIS_SP
Definition: rpmmtree.c:564
#define VIS_SAFE
Definition: rpmmtree.c:568
#define VIS_TAB
Definition: rpmmtree.c:565
static unsigned
Definition: rpmmtree.c:386
static const char *char c
Return text between pl and matching pr characters.
Definition: macro.c:470
#define VIS_NL
Definition: rpmmtree.c:566

Definition at line 605 of file rpmmtree.c.

Referenced by vis().

#define KEYDEFAULT
#define KF_ISSET (   _keys,
  _KEY 
)    ((_keys) & (MTREE_KEYS_##_KEY))

Referenced by if().

#define LABEL
Value:
if (!label++) { \
(void) printf(_("%s changed\n"), SKIPDOTSLASH(p->fts_path)); \
tab = "\t"; \
}
#define SKIPDOTSLASH(_f)
char * p
Definition: macro.c:413
static void
Definition: rpmmtree.c:306
#define _(Text)
Definition: system.h:29
#define MAGIC   "?*["
#define MATCH (   g,
  n 
)    (fnmatch((g), (n), FNM_PATHNAME) == 0)
#define MAXLINELEN   80
#define MBITS   (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)

Definition at line 268 of file rpmmtree.c.

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

Definition at line 260 of file rpmmtree.c.

Referenced by if().

#define MISMATCHEXIT   2

Definition at line 266 of file rpmmtree.c.

#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.

#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.

#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)
#define RPM_LIST_NEXT(elm, field)
Definition: rpmmtree.c:74
return NULL
Definition: poptALL.c:613
#define RPM_LIST_FIRST(head)
Definition: rpmmtree.c:72

Definition at line 78 of file rpmmtree.c.

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

Definition at line 74 of file rpmmtree.c.

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

Definition at line 791 of file rpmmtree.c.

Referenced by unvis().

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

Definition at line 787 of file rpmmtree.c.

Referenced by unvis().

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

Definition at line 789 of file rpmmtree.c.

Referenced by unvis().

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

Definition at line 790 of file rpmmtree.c.

Referenced by unvis().

#define S_OCTAL2   5 /* octal digit 2 */

Definition at line 792 of file rpmmtree.c.

Referenced by unvis().

#define S_OCTAL3   6 /* octal digit 3 */

Definition at line 793 of file rpmmtree.c.

Referenced by unvis().

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

Definition at line 788 of file rpmmtree.c.

Referenced by unvis().

#define SKIPDOTSLASH (   _f)    ((_f)[0] == '.' && (_f)[1] == '/' ? (_f) + 2 : (_f))
#define UNVIS_END   1 /* no more characters */

Definition at line 587 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

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

Definition at line 582 of file rpmmtree.c.

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

Definition at line 580 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

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

Definition at line 581 of file rpmmtree.c.

Referenced by unvis().

#define UNVIS_VALID   1 /* character valid */

Definition at line 578 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

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

Definition at line 579 of file rpmmtree.c.

Referenced by strunvis(), and unvis().

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

Definition at line 558 of file rpmmtree.c.

Referenced by vis().

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

Definition at line 566 of file rpmmtree.c.

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

Definition at line 573 of file rpmmtree.c.

Referenced by vis().

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

Definition at line 557 of file rpmmtree.c.

Referenced by vis().

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

Definition at line 568 of file rpmmtree.c.

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

Definition at line 564 of file rpmmtree.c.

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

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.

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

for ( ;len!  = 0; len >>= 8)

Definition at line 542 of file rpmmtree.c.

References COMPUTE, and rpmfts_s::crc_total.

for ( ;(kw=strtok(t,"= \t\n"))!  = NULLt = NULL)
for ( i  = 0; fts->paths[i] != NULLi++)
if ( argv==NULL||argv[0]==NULL)

Definition at line 3680 of file rpmmtree.c.

References exit.

if ( ((mtreeFlags &((MTREE_FLAGS_LOOSE)&~0x40000000))!=MTREE_FLAGS_NONE)&&((mtreeFlags &((MTREE_FLAGS_UPDATE)&~0x40000000))!=MTREE_FLAGS_NONE)  )

Definition at line 3685 of file rpmmtree.c.

if ( fts->  paths = NULL || fts->paths[0] == NULL)

Definition at line 3702 of file rpmmtree.c.

References rpmfts_s::paths, xcalloc(), and xstrdup().

if ( ((mtreeFlags &((MTREE_FLAGS_CREATE)&~0x40000000))!=MTREE_FLAGS_NONE)  )
if ( _rpmsw_stats  )

Definition at line 3801 of file rpmmtree.c.

References rpmswPrint().

if ( fts->spec2!  = NULL && fileno(fts->spec2),
 
)

Definition at line 3818 of file rpmmtree.c.

References NULL, rpmfts_s::spec2, and void.

void mtree_error ( const char *  fmt,
  ... 
)

Definition at line 309 of file rpmmtree.c.

References _, __progname, exit, EXIT_FAILURE, fprintf(), rpmfts_s::lineno, NULL, and void.

Referenced by for().

mtree_error ( "unknown keyword %s ,
name   
)
static int mtreeCWalk ( rpmfts  fts)
static

Referenced by if().

static void mtreeMiss ( rpmfts  fts,
NODE p,
char *  tail 
)
static
static NODE* mtreeSpec ( rpmfts  fts,
FILE *  fp 
)
static
static int mtreeVSpec ( rpmfts  fts)
static
static int mtreeVWalk ( rpmfts  fts)
static
int strunvis ( char *  dst,
const char *  src 
)
static

Definition at line 956 of file rpmmtree.c.

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

Referenced by for().

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

Definition at line 715 of file rpmmtree.c.

References c, int, and vis().

static const char* switch ( algo  )
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 int, isoctal, isvisible, VIS_CSTYLE, VIS_NOSLASH, and VIS_OCTAL.

Referenced by strvis().

while ( (nr=Fread(buf, sizeof(buf[0]), sizeof(buf), fd))!  = 0)

Definition at line 528 of file rpmmtree.c.

References COMPUTE, rpmfts_s::crc_total, and p.

while ( (p=strtok(t,"\n\t "))!  = NULL)

< directory

< directory

Definition at line 1565 of file rpmmtree.c.

while ( )

Variable Documentation

exit __pad0__

Definition at line 3815 of file rpmmtree.c.

__progname = "mtree"

Definition at line 3663 of file rpmmtree.c.

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.

argv = (char **) poptGetArgs(optCon)
* clen = len

Definition at line 539 of file rpmmtree.c.

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.

fts crc_total = 0xffffffff

Definition at line 524 of file rpmmtree.c.

const uint32_t crctab[]
static

Definition at line 453 of file rpmmtree.c.

* cval = (crc ^ 0xffffffff)

Definition at line 547 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.

void rpmswExit & dc_totalops
static

Definition at line 289 of file rpmmtree.c.

do { (( ( &excludes ) )->lh_first) = NULL

Definition at line 3665 of file rpmmtree.c.

else
Initial value:
{
if (fts->spec2 != NULL) {
} else {
fts->root = mtreeSpec(fts, fts->spec1);
mtreeMiss(fts, fts->root, fts->path);
fts->path = _free(fts->path);
(void) fprintf(stderr, _("%s: %s checksum: %u\n"), __progname,
fts->fullpath, (unsigned) fts->crc_total);
}
}
if (((mtreeFlags & ((MTREE_FLAGS_MISMATCHOK ) & ~0x40000000)) != MTREE_FLAGS_NONE) && (rc == 2 ))
rc = 0
#define __progname
Definition: system.h:363
int rc
Definition: poptALL.c:670
static void mtreeMiss(rpmfts fts, NODE *p, char *tail)
#define MAXPATHLEN
s fts
Definition: rpmfts-py.c:99
fprintf(stderr,"--> %s(%p,%p,%p) sig %p sigp %p\n", __FUNCTION__, dig, t, rsactx, sig, sigp)
static void
Definition: rpmmtree.c:306
static NODE * mtreeSpec(rpmfts fts, FILE *fp)
static int mtreeVWalk(rpmfts fts)
static unsigned
Definition: rpmmtree.c:386
static enum mtreeFlags_e mtreeFlags
Definition: rpmmtree.c:276
return NULL
Definition: poptALL.c:613
static int mtreeVSpec(rpmfts fts)
#define _(Text)
Definition: system.h:29
#define xmalloc
Definition: system.h:32
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
Definition: rpmiotypes.h:647

Definition at line 3781 of file rpmmtree.c.

struct { ... } excludes
fts fullpath = _free(fts->fullpath)

Definition at line 3829 of file rpmmtree.c.

Referenced by for(), rpmrepoInitPopt(), and rpmrepoRealpath().

fts g = _free(fts->g)

Definition at line 3826 of file rpmmtree.c.

int i

Definition at line 3661 of file rpmmtree.c.

int
static
Initial value:
{
return strcmp(((KEY *)a)->name, ((KEY *)b)->name)
Definition: db3.c:181
return strcmp(ame->name, bme->name)
static const char * name
char * b
Definition: macro.c:746

Definition at line 377 of file rpmmtree.c.

k
Initial value:
= (KEY *)bsearch(&tmp, keylist, sizeof(keylist) / sizeof(keylist[0]),
sizeof(keylist[0]), keycompare)
static KEY keylist[]
Definition: rpmmtree.c:336
Definition: db3.c:181

Definition at line 394 of file rpmmtree.c.

Referenced by dbiMireKeys(), doFoo(), htAddEntry(), isDoc(), miFreeHeader(), removePackage(), rpmdbAdd(), rpmdbCount(), rpmdbRemove(), rpmfiFNBF(), rpmFreeRpmrc(), rpmmiCount(), rpmmiInit(), rpmmiNext(), rpmmiPrune(), rpmtsFindBaseNamesInDB(), and showQueryPackage().

KEY keylist[]
static

Definition at line 336 of file rpmmtree.c.

uint32_t len = 0

Definition at line 520 of file rpmmtree.c.

struct exclude* lh_first

Definition at line 286 of file rpmmtree.c.

fts m = _free(fts->m)
fts maxg = 5000

Definition at line 3667 of file rpmmtree.c.

fts maxm = ( (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) + 1)

Definition at line 3669 of file rpmmtree.c.

fts maxu = 5000

Definition at line 3668 of file rpmmtree.c.

mtreeFlags = MTREE_FLAGS_NONE
static

Definition at line 276 of file rpmmtree.c.

tmp name = name

Definition at line 393 of file rpmmtree.c.

* needvaluep = 0

Definition at line 390 of file rpmmtree.c.

size_t nr { uint8_t buf[16 * 1024]

Definition at line 526 of file rpmmtree.c.

Referenced by parseRCPOT(), and rpmrepoReadHeader().

optCon = rpmioInit(argc, argv, optionsTable)

Definition at line 3659 of file rpmmtree.c.

fts paths = argvFree(fts->paths)

Definition at line 3822 of file rpmmtree.c.

Referenced by filestatTag(), and rpmdcCWalk().

return rc = 1

Definition at line 3660 of file rpmmtree.c.

return

Definition at line 392 of file rpmmtree.c.

fts spec1 = NULL

Definition at line 3816 of file rpmmtree.c.

return tagname

Definition at line 433 of file rpmmtree.c.

fts u = _free(fts->u)
unsigned
static
return k val
static void
static
Initial value:
{
char *kw

Definition at line 306 of file rpmmtree.c.

Referenced by for(), if(), and mtree_error().