rpm 5.3.12
Defines | Functions | Variables
rpmio/rpmxar.c File Reference
#include "system.h"
#include <rpmxar.h>
#include <rpmio_internal.h>
#include <rpmhash.h>
#include <ugid.h>
#include "debug.h"
Include dependency graph for rpmxar.c:

Go to the source code of this file.

Defines

#define READ   0
#define WRITE   1
#define xar_open(_fn, _f)   (NULL)
#define xar_close(_x)   (1)
#define xar_iter_new()   (NULL)
#define xar_iter_free(_i)
#define xar_file_first(_x, _i)   (NULL)
#define xar_file_next(_i)   (NULL)
#define xar_add_frombuffer(_x, _parent, _fn, _b, _bsize)   (NULL)
#define xar_extract_tobuffersz(_x, _f, _b, _bsize)   (1)
#define xar_get_path(_f)   "*No XAR*"
#define xar_opt_set(_a1, _a2, _a3)   (1)
#define XAR_OPT_COMPRESSION   0
#define XAR_OPT_VAL_NONE   0
#define XAR_OPT_VAL_GZIP   0
#define _RPMXAR_INTERNAL

Functions

static void rpmxarFini (void *_xar)
static rpmxar rpmxarGetPool (rpmioPool pool)
rpmxar rpmxarNew (const char *fn, const char *fmode)
 Create a xar archive instance.
int rpmxarNext (rpmxar xar)
 Iterate a xar archive instance.
int rpmxarPush (rpmxar xar, const char *fn, unsigned char *b, size_t bsize)
int rpmxarPull (rpmxar xar, const char *fn)
int rpmxarSwapBuf (rpmxar xar, unsigned char *b, size_t bsize, unsigned char **obp, size_t *obsizep)
ssize_t xarRead (void *cookie, char *buf, size_t count)
const char * rpmxarPath (rpmxar xar)
 Return path of current archive member.
static mode_t xarMode (rpmxar xar)
static dev_t xarDev (rpmxar xar)
static long long xarSize (rpmxar xar)
static uid_t xarUid (rpmxar xar)
static gid_t xarGid (rpmxar xar)
static void xarTime (rpmxar xar, const char *tprop, struct timeval *tv)
int rpmxarStat (rpmxar xar, struct stat *st)
 Return stat(2) of current archive member.

Variables

int _xar_debug = 0
rpmioPool _xarPool

Define Documentation

#define _RPMXAR_INTERNAL

Definition at line 59 of file rpmxar.c.

#define READ   0

Definition at line 42 of file rpmxar.c.

Referenced by rpmxarNew().

#define WRITE   1

Definition at line 43 of file rpmxar.c.

Referenced by rpmxarNew().

#define xar_add_frombuffer (   _x,
  _parent,
  _fn,
  _b,
  _bsize 
)    (NULL)

Definition at line 50 of file rpmxar.c.

Referenced by rpmxarPush().

#define xar_close (   _x)    (1)

Definition at line 45 of file rpmxar.c.

Referenced by rpmxarFini().

#define xar_extract_tobuffersz (   _x,
  _f,
  _b,
  _bsize 
)    (1)

Definition at line 51 of file rpmxar.c.

Referenced by rpmxarPull().

#define xar_file_first (   _x,
  _i 
)    (NULL)

Definition at line 48 of file rpmxar.c.

Referenced by rpmxarNext().

#define xar_file_next (   _i)    (NULL)

Definition at line 49 of file rpmxar.c.

Referenced by rpmxarNext().

#define xar_get_path (   _f)    "*No XAR*"

Definition at line 52 of file rpmxar.c.

Referenced by rpmxarPath(), and rpmxarPull().

#define xar_iter_free (   _i)

Definition at line 47 of file rpmxar.c.

Referenced by rpmxarFini().

#define xar_iter_new ( )    (NULL)

Definition at line 46 of file rpmxar.c.

Referenced by rpmxarNew().

#define xar_open (   _fn,
  _f 
)    (NULL)

Definition at line 44 of file rpmxar.c.

Referenced by rpmxarNew().

#define XAR_OPT_COMPRESSION   0

Definition at line 54 of file rpmxar.c.

Referenced by rpmxarPush().

#define xar_opt_set (   _a1,
  _a2,
  _a3 
)    (1)

Definition at line 53 of file rpmxar.c.

Referenced by rpmxarPush().

#define XAR_OPT_VAL_GZIP   0

Definition at line 56 of file rpmxar.c.

Referenced by rpmxarPush().

#define XAR_OPT_VAL_NONE   0

Definition at line 55 of file rpmxar.c.

Referenced by rpmxarPush().


Function Documentation

static void rpmxarFini ( void *  _xar) [static]

Definition at line 76 of file rpmxar.c.

References _free(), xar_close, and xar_iter_free.

Referenced by rpmxarGetPool().

static rpmxar rpmxarGetPool ( rpmioPool  pool) [static]

Definition at line 96 of file rpmxar.c.

References _xar_debug, _xarPool, rpmioGetPool(), rpmioNewPool(), and rpmxarFini().

Referenced by rpmxarNew().

rpmxar rpmxarNew ( const char *  fn,
const char *  fmode 
)

Create a xar archive instance.

Parameters:
fnxar file
fmode"r" for reading, "w" for writing
Returns:
new xar instance

Definition at line 112 of file rpmxar.c.

References _xar_debug, READ, rpmxarGetPool(), rpmxarLink(), WRITE, xar_iter_new, and xar_open.

Referenced by rdLead().

int rpmxarNext ( rpmxar  xar)

Iterate a xar archive instance.

Parameters:
xarxar archive
Returns:
0 on SUCCESS, 1 on end-of-iteration

Definition at line 128 of file rpmxar.c.

References _xar_debug, xar_file_first, and xar_file_next.

Referenced by rdLead(), rdSignature(), readFile(), rpmReadHeader(), and xarRead().

const char* rpmxarPath ( rpmxar  xar)

Return path of current archive member.

Parameters:
xarxar archive
Returns:
path of xar member

Definition at line 260 of file rpmxar.c.

References _xar_debug, and xar_get_path.

Referenced by rpmxarStat().

int rpmxarPull ( rpmxar  xar,
const char *  fn 
)

Definition at line 168 of file rpmxar.c.

References _free(), _xar_debug, xar_extract_tobuffersz, and xar_get_path.

Referenced by rdLead(), rdSignature(), readFile(), rpmReadHeader(), and xarRead().

int rpmxarPush ( rpmxar  xar,
const char *  fn,
unsigned char *  b,
size_t  bsize 
)
int rpmxarStat ( rpmxar  xar,
struct stat *  st 
)

Return stat(2) of current archive member.

Parameters:
xarxar archive
Return values:
*ststat(2) of current member
Returns:
0 on success

Definition at line 395 of file rpmxar.c.

References _free(), _xar_debug, hashFunctionString(), rpmxarPath(), xarDev(), xarGid(), xarMode(), xarSize(), xarTime(), and xarUid().

int rpmxarSwapBuf ( rpmxar  xar,
unsigned char *  b,
size_t  bsize,
unsigned char **  obp,
size_t *  obsizep 
)

Definition at line 203 of file rpmxar.c.

References _free(), and _xar_debug.

Referenced by rdLead(), and xarRead().

static dev_t xarDev ( rpmxar  xar) [static]

Definition at line 304 of file rpmxar.c.

References major, makedev, and minor.

Referenced by rpmxarStat().

static gid_t xarGid ( rpmxar  xar) [static]

Definition at line 359 of file rpmxar.c.

References gnameToGid().

Referenced by rpmxarStat().

static mode_t xarMode ( rpmxar  xar) [static]

Definition at line 268 of file rpmxar.c.

References S_IFSOCK.

Referenced by rpmxarStat().

ssize_t xarRead ( void *  cookie,
char *  buf,
size_t  count 
)

Definition at line 229 of file rpmxar.c.

References _xar_debug, fdGetXAR(), RPMRC_FAIL, rpmxarNext(), rpmxarPull(), and rpmxarSwapBuf().

Referenced by __fdRead().

static long long xarSize ( rpmxar  xar) [static]

Definition at line 324 of file rpmxar.c.

References _free(), and L.

Referenced by rpmxarStat().

static void xarTime ( rpmxar  xar,
const char *  tprop,
struct timeval *  tv 
) [static]

Definition at line 375 of file rpmxar.c.

Referenced by rpmxarStat().

static uid_t xarUid ( rpmxar  xar) [static]

Definition at line 343 of file rpmxar.c.

References unameToUid().

Referenced by rpmxarStat().


Variable Documentation

int _xar_debug = 0

Definition at line 73 of file rpmxar.c.

Referenced by rpmioClean(), and rpmxarGetPool().