rpm
5.4.10
|
Handle ar(1) archives. More...
#include "system.h"
#include <rpmio_internal.h>
#include <rpmmacro.h>
#include <ugid.h>
#include <ar.h>
#include <iosm.h>
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | _IOSM_INTERNAL |
#define | _IOSMRC(_rc) if ((_rc) <= 0) return ((_rc) ? (int) -rc : IOSMERR_HDR_TRAILER) |
Functions | |
static int | strntoul (const char *str, char **endptr, int base, size_t num) |
Convert string to unsigned integer (with buffer size check). | |
static ssize_t | arRead (void *_iosm, void *buf, size_t count) |
int | arHeaderRead (void *_iosm, struct stat *st) |
Read ar(1) header. | |
static ssize_t | arWrite (void *_iosm, const void *buf, size_t count) |
int | arHeaderWrite (void *_iosm, struct stat *st) |
Write ar(1) header. | |
int | arTrailerWrite (void *_iosm) |
Write ar(1) trailer. |
Variables | |
int | _ar_debug = 0 |
Handle ar(1) archives.
Definition in file ar.c.
#define _IOSMRC | ( | _rc | ) | if ((_rc) <= 0) return ((_rc) ? (int) -rc : IOSMERR_HDR_TRAILER) |
Definition at line 56 of file ar.c.
Referenced by arHeaderRead(), arHeaderWrite(), and arTrailerWrite().
int arHeaderRead | ( | void * | _iosm, |
struct stat * | st | ||
) |
Read ar(1) header.
_iosm | file path and stat info |
st |
Definition at line 92 of file ar.c.
References _ar_debug, _iosmNext, _IOSMRC, AR_MAGIC, AR_MARKER, arRead(), iosm_s::cfd, fdGetCpioPos(), arHeader_s::filesize, arHeader_s::gid, IOSM_POS, IOSMERR_BAD_MAGIC, iosm_s::lmtab, iosm_s::lmtablen, iosm_s::lmtaboff, arHeader_s::marker, arHeader_s::mode, arHeader_s::mtime, arHeader_s::name, iosm_s::path, strntoul(), arHeader_s::uid, iosm_s::wrbuf, xisdigit(), and xstrdup().
Referenced by fsmSetup(), and iosmSetup().
int arHeaderWrite | ( | void * | _iosm, |
struct stat * | st | ||
) |
Write ar(1) header.
_iosm | file path and stat info |
st |
Definition at line 235 of file ar.c.
References _ar_debug, _iosmNext, _IOSMRC, AR_MAGIC, AR_MARKER, arWrite(), iosm_s::cfd, fdGetCpioPos(), arHeader_s::filesize, arHeader_s::gid, IOSM_PAD, iosm_s::lmtab, iosm_s::lmtablen, iosm_s::lmtaboff, arHeader_s::marker, arHeader_s::mode, arHeader_s::mtime, arHeader_s::name, iosm_s::path, iosm_s::rdbuf, snprintf(), and arHeader_s::uid.
Referenced by fsmSetup(), and iosmSetup().
|
static |
Definition at line 59 of file ar.c.
References _ar_debug, _iosmNext, IOSM_DREAD, IOSMERR_HDR_TRAILER, IOSMERR_READ_FAILED, iosm_s::rdnb, iosm_s::wrbuf, and iosm_s::wrlen.
Referenced by arHeaderRead().
int arTrailerWrite | ( | void * | _iosm | ) |
Write ar(1) trailer.
_iosm | file path and stat info |
Definition at line 309 of file ar.c.
References _ar_debug, _iosmNext, _IOSMRC, arWrite(), and IOSM_PAD.
Referenced by fsmSetup(), and iosmSetup().
|
static |
Definition at line 199 of file ar.c.
References _ar_debug, _iosmNext, IOSM_DWRITE, IOSM_PAD, IOSMERR_WRITE_FAILED, iosm_s::rdbuf, iosm_s::rdnb, and iosm_s::wrnb.
Referenced by arHeaderWrite(), and arTrailerWrite().
|
static |
Convert string to unsigned integer (with buffer size check).
str | input string |
*endptr | 1st character not processed |
base | numerical conversion base |
num | max no. of bytes to read |
Definition at line 33 of file ar.c.
References alloca().
Referenced by arHeaderRead().
int _ar_debug = 0 |
Definition at line 23 of file ar.c.
Referenced by arHeaderRead(), arHeaderWrite(), arRead(), arTrailerWrite(), and arWrite().