rpm
5.4.14
|
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). More... | |
static ssize_t | arRead (void *_iosm, void *buf, size_t count) |
int | arHeaderRead (void *_iosm, struct stat *st) |
Read ar(1) header. More... | |
static ssize_t | arWrite (void *_iosm, const void *buf, size_t count) |
int | arHeaderWrite (void *_iosm, struct stat *st) |
Write ar(1) header. More... | |
int | arTrailerWrite (void *_iosm) |
Write ar(1) trailer. More... | |
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().
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, fprintf(), arHeader_s::gid, i, if(), 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, nb, NULL, iosm_s::path, rc, strntoul(), t, te, arHeader_s::uid, iosm_s::wrbuf, xisdigit(), and xstrdup().
Referenced by fsmSetup(), and iosmSetup().
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(), assert(), iosm_s::cfd, fdGetCpioPos(), arHeader_s::filesize, fprintf(), arHeader_s::gid, int, IOSM_PAD, iosm_s::lmtab, iosm_s::lmtablen, iosm_s::lmtaboff, arHeader_s::marker, memset(), arHeader_s::mode, arHeader_s::mtime, arHeader_s::name, nb, NULL, iosm_s::path, path, rc, iosm_s::rdbuf, snprintf(), sprintf(), strncpy(), t, te, and arHeader_s::uid.
Referenced by fsmSetup(), and iosmSetup().
Definition at line 59 of file ar.c.
References _ar_debug, _iosmNext, count, fprintf(), IOSM_DREAD, IOSMERR_HDR_TRAILER, IOSMERR_READ_FAILED, nb, rc, iosm_s::rdnb, t, iosm_s::wrbuf, and iosm_s::wrlen.
Referenced by arHeaderRead().
Definition at line 199 of file ar.c.
References _ar_debug, _iosmNext, count, fprintf(), IOSM_DWRITE, IOSM_PAD, IOSMERR_WRITE_FAILED, nb, rc, iosm_s::rdbuf, iosm_s::rdnb, s, and iosm_s::wrnb.
Referenced by arHeaderWrite(), and arTrailerWrite().
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(), buf, NULL, ret, and strncpy().
Referenced by arHeaderRead().
int _ar_debug = 0 |
Definition at line 23 of file ar.c.
Referenced by arHeaderRead(), arHeaderWrite(), arRead(), arTrailerWrite(), and arWrite().