rpm  5.4.15
Macros | Typedefs | Functions | Variables
rpmxar.h File Reference

Structure(s)and methods for a XAR archive wrapper format. More...

#include <rpmiotypes.h>
Include dependency graph for rpmxar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define rpmxarUnlink(_xar, _msg)   ((rpmxar)rpmioUnlinkPoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__))
 
#define rpmxarLink(_xar, _msg)   ((rpmxar)rpmioLinkPoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__))
 
#define rpmxarFree(_xar, _msg)   ((rpmxar)rpmioFreePoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__))
 

Typedefs

typedef struct rpmxar_s * rpmxar
 

Functions

rpmxar rpmxarUnlink (rpmxar xar, const char *msg)
 Unreference a xar archive instance. More...
 
rpmxar rpmxarLink (rpmxar xar, const char *msg)
 Reference a xar archive instance. More...
 
rpmxar rpmxarFree (rpmxar xar, const char *msg)
 Destroy a xar archive instance. More...
 
rpmxar rpmxarNew (const char *fn, const char *fmode)
 Create a xar archive instance. More...
 
int rpmxarNext (rpmxar xar)
 Iterate a xar archive instance. More...
 
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. More...
 
int rpmxarStat (rpmxar xar, struct stat *st)
 Return stat(2) of current archive member. More...
 

Variables

int _xar_debug
 

Detailed Description

Structure(s)and methods for a XAR archive wrapper format.

Definition in file rpmxar.h.

Macro Definition Documentation

#define rpmxarFree (   _xar,
  _msg 
)    ((rpmxar)rpmioFreePoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__))

Definition at line 79 of file rpmxar.h.

#define rpmxarLink (   _xar,
  _msg 
)    ((rpmxar)rpmioLinkPoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__))

Definition at line 66 of file rpmxar.h.

#define rpmxarUnlink (   _xar,
  _msg 
)    ((rpmxar)rpmioUnlinkPoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__))

Definition at line 54 of file rpmxar.h.

Typedef Documentation

typedef struct rpmxar_s* rpmxar

Definition at line 14 of file rpmxar.h.

Function Documentation

rpmxar rpmxarFree ( rpmxar  xar,
const char *  msg 
)

Destroy a xar archive instance.

Parameters
xarxar archive
msg
Returns
NULL on last dereference

Referenced by fdFini(), rdLead(), rdXAR(), rpmwfScrub(), and wrXAR().

rpmxar rpmxarLink ( rpmxar  xar,
const char *  msg 
)

Reference a xar archive instance.

Parameters
xarxar archive
msg
Returns
new xar archive reference

Referenced by fdSetXAR(), and 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, flags, READ, rpmxarGetPool(), rpmxarLink(), WRITE, xar_iter_new, and xar_open.

Referenced by rdLead(), rdXAR(), and wrXAR().

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(), rdXAR(), 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 
)
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(), _xar_debug, and b.

Referenced by rdLead(), rpmwfPullXAR(), and xarRead().

rpmxar rpmxarUnlink ( rpmxar  xar,
const char *  msg 
)

Unreference a xar archive instance.

Parameters
xarxar archive
msg
Returns
NULL on last dereference
ssize_t xarRead ( void *  cookie,
char *  buf,
size_t  count 
)

Definition at line 229 of file rpmxar.c.

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

Referenced by __fdRead().

Variable Documentation

int _xar_debug