cpio.h File Reference
PAYLOAD.

Structures used for cpio(1) archives. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | cpioCrcPhysicalHeader_s
| Cpio archive header information. More...

## Macros

#define | CPIO_NEWC_MAGIC "070701"
#define | CPIO_CRC_MAGIC "070702"
#define | CPIO_TRAILER "TRAILER!!!"
#define | PHYS_HDR_SIZE 110 /* Don't depend on sizeof(struct) */

## Typedefs

typedef struct cpioCrcPhysicalHeader_s * | cpioHeader

## Functions

int | cpioHeaderRead (void *_iosm, struct stat *st)
| Read cpio header. More...
int | cpioHeaderWrite (void *_iosm, struct stat *st)
| Write cpio header. More...
int | cpioTrailerWrite (void *_iosm)
| Write cpio trailer. More...

## Variables

int | _cpio_debug

## Detailed Description

Structures used for cpio(1) archives.

Definition in file cpio.h.

## Macro Definition Documentation

#define CPIO_CRC_MAGIC "070702"

Definition at line 15 of file cpio.h.

Referenced by cpioHeaderRead().

#define CPIO_NEWC_MAGIC "070701"

Definition at line 14 of file cpio.h.

Referenced by cpioHeaderRead(), cpioHeaderWrite(), and cpioTrailerWrite().

#define CPIO_TRAILER "TRAILER!!!"

Definition at line 16 of file cpio.h.

Referenced by cpioTrailerWrite(), and iosmStage().

#define PHYS_HDR_SIZE 110 /* Don't depend on sizeof(struct) */

Definition at line 18 of file cpio.h.

Referenced by cpioHeaderRead(), cpioHeaderWrite(), and cpioTrailerWrite().

## Typedef Documentation

typedef struct cpioCrcPhysicalHeader_s* cpioHeader

Definition at line 11 of file cpio.h.

## Function Documentation

int cpioHeaderRead | ( | void * | _iosm,
|  | struct stat * | st
| ) |  |

Read cpio header.

Return values

  _iosm | file path and stat info
  st |

Returns
  0 on success

Definition at line 95 of file cpio.c.

References _cpio_debug, _free(), _iosmNext, _IOSMRC, CPIO_CRC_MAGIC, CPIO_NEWC_MAGIC, cpioRead(), cpioCrcPhysicalHeader_s::devMajor, cpioCrcPhysicalHeader_s::devMinor, cpioCrcPhysicalHeader_s::filesize, GET_NUM_FIELD, cpioCrcPhysicalHeader_s::gid, cpioCrcPhysicalHeader_s::inode, IOSM_POS, cpioCrcPhysicalHeader_s::magic, major, Makedev, minor, cpioCrcPhysicalHeader_s::mode, cpioCrcPhysicalHeader_s::mtime, cpioCrcPhysicalHeader_s::namesize, cpioCrcPhysicalHeader_s::nlink, PHYS_HDR_SIZE, cpioCrcPhysicalHeader_s::rdevMajor, cpioCrcPhysicalHeader_s::rdevMinor, S_ISLNK, cpioCrcPhysicalHeader_s::uid, and xmalloc().

Referenced by fsmSetup(), and iosmSetup().

int cpioHeaderWrite | ( | void * | _iosm,
|  | struct stat * | st
| ) |  |

Write cpio header.

Return values

  _iosm | file path and stat info

Parameters

  st |

Returns
  0 on success

Definition at line 224 of file cpio.c.

References _cpio_debug, _iosmNext, _IOSMRC, cpioCrcPhysicalHeader_s::checksum, CPIO_NEWC_MAGIC, cpioWrite(), cpioCrcPhysicalHeader_s::devMajor, cpioCrcPhysicalHeader_s::devMinor, cpioCrcPhysicalHeader_s::filesize, cpioCrcPhysicalHeader_s::gid, cpioCrcPhysicalHeader_s::inode, IOSM_PAD, cpioCrcPhysicalHeader_s::magic, major, minor, cpioCrcPhysicalHeader_s::mode, cpioCrcPhysicalHeader_s::mtime, cpioCrcPhysicalHeader_s::namesize, cpioCrcPhysicalHeader_s::nlink, PHYS_HDR_SIZE, cpioCrcPhysicalHeader_s::rdevMajor, cpioCrcPhysicalHeader_s::rdevMinor, S_ISLNK, SET_NUM_FIELD, and cpioCrcPhysicalHeader_s::uid.

Referenced by fsmSetup(), and iosmSetup().

int cpioTrailerWrite | ( | void * | _iosm | ) |

Write cpio trailer.

Return values

  _iosm | file path and stat info

Returns
  0 on success

Definition at line 278 of file cpio.c.

References _cpio_debug, _iosmNext, _IOSMRC, CPIO_NEWC_MAGIC, CPIO_TRAILER, cpioWrite(), IOSM_PAD, cpioCrcPhysicalHeader_s::magic, cpioCrcPhysicalHeader_s::namesize, cpioCrcPhysicalHeader_s::nlink, and PHYS_HDR_SIZE.

Referenced by fsmSetup(), and iosmSetup().

## Variable Documentation

int _cpio_debug

Definition at line 20 of file cpio.c.