dpkg 1.21.11
Data Structures | Macros | Functions
Ar archive handling
Collaboration diagram for Ar archive handling:

Data Structures

struct  dpkg_ar_hdr
 An on-disk archive header. More...
 
struct  dpkg_ar
 An archive (Unix ar) file. More...
 
struct  dpkg_ar_member
 In-memory archive member information. More...
 

Macros

#define DPKG_AR_MAGIC   "!<arch>\n"
 
#define DPKG_AR_FMAG   "`\n"
 

Functions

struct dpkg_ardpkg_ar_fdopen (const char *filename, int fd)
 
struct dpkg_ardpkg_ar_open (const char *filename)
 
struct dpkg_ardpkg_ar_create (const char *filename, mode_t mode)
 
void dpkg_ar_set_mtime (struct dpkg_ar *ar, intmax_t mtime)
 
void dpkg_ar_close (struct dpkg_ar *ar)
 
void dpkg_ar_normalize_name (struct dpkg_ar_hdr *arh)
 
bool dpkg_ar_member_is_illegal (struct dpkg_ar_hdr *arh)
 
void dpkg_ar_put_magic (struct dpkg_ar *ar)
 
void dpkg_ar_member_put_header (struct dpkg_ar *ar, struct dpkg_ar_member *member)
 
void dpkg_ar_member_put_file (struct dpkg_ar *ar, const char *name, int fd, off_t size)
 
void dpkg_ar_member_put_mem (struct dpkg_ar *ar, const char *name, const void *data, size_t size)
 
off_t dpkg_ar_member_get_size (struct dpkg_ar *ar, struct dpkg_ar_hdr *arh)
 

Detailed Description

Macro Definition Documentation

◆ DPKG_AR_FMAG

#define DPKG_AR_FMAG   "`\n"

◆ DPKG_AR_MAGIC

#define DPKG_AR_MAGIC   "!<arch>\n"

Function Documentation

◆ dpkg_ar_close()

void dpkg_ar_close ( struct dpkg_ar ar)

References _, dpkg_ar::fd, dpkg_ar::name, and ohshite().

Referenced by do_info(), and mustgetpartinfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpkg_ar_create()

struct dpkg_ar * dpkg_ar_create ( const char *  filename,
mode_t  mode 
)

References _, dpkg_ar_fdopen(), dpkg_ar::fd, dpkg_ar::mode, and ohshite().

Here is the call graph for this function:

◆ dpkg_ar_fdopen()

struct dpkg_ar * dpkg_ar_fdopen ( const char *  filename,
int  fd 
)

References _, dpkg_ar::fd, m_malloc(), dpkg_ar::mode, dpkg_ar::name, ohshite(), dpkg_ar::size, and dpkg_ar::time.

Referenced by dpkg_ar_create(), and dpkg_ar_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpkg_ar_member_get_size()

off_t dpkg_ar_member_get_size ( struct dpkg_ar ar,
struct dpkg_ar_hdr arh 
)

References _, dpkg_ar_hdr::ar_name, dpkg_ar_hdr::ar_size, dpkg_ar::name, ohshit(), and dpkg_ar::size.

Here is the call graph for this function:

◆ dpkg_ar_member_is_illegal()

bool dpkg_ar_member_is_illegal ( struct dpkg_ar_hdr arh)

◆ dpkg_ar_member_put_file()

void dpkg_ar_member_put_file ( struct dpkg_ar ar,
const char *  name,
int  fd,
off_t  size 
)

References _, ohshite(), and dpkg_ar_member::size.

Here is the call graph for this function:

◆ dpkg_ar_member_put_header()

void dpkg_ar_member_put_header ( struct dpkg_ar ar,
struct dpkg_ar_member member 
)

References _, dpkg_ar::fd, fd_write(), dpkg_ar_member::gid, dpkg_ar_member::mode, dpkg_ar::name, dpkg_ar_member::name, ohshit(), ohshite(), dpkg_ar_member::size, dpkg_ar_member::time, and dpkg_ar_member::uid.

Here is the call graph for this function:

◆ dpkg_ar_member_put_mem()

void dpkg_ar_member_put_mem ( struct dpkg_ar ar,
const char *  name,
const void *  data,
size_t  size 
)

◆ dpkg_ar_normalize_name()

void dpkg_ar_normalize_name ( struct dpkg_ar_hdr arh)

◆ dpkg_ar_open()

struct dpkg_ar * dpkg_ar_open ( const char *  filename)

References _, dpkg_ar_fdopen(), dpkg_ar::fd, and ohshite().

Referenced by do_info(), and mustgetpartinfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpkg_ar_put_magic()

void dpkg_ar_put_magic ( struct dpkg_ar ar)

References _, DPKG_AR_MAGIC, dpkg_ar::fd, fd_write(), dpkg_ar::name, and ohshite().

Here is the call graph for this function:

◆ dpkg_ar_set_mtime()

void dpkg_ar_set_mtime ( struct dpkg_ar ar,
intmax_t  mtime 
)

References dpkg_ar::time.