# lib/package.c File Reference

`#include "system.h"`
`#include <netinet/in.h>`
`#include <rpmlib.h>`
`#include "misc.h"`
`#include "rpmlead.h"`
`#include "signature.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines

#define | alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s))

## Functions

void | headerMergeLegacySigs (Header h, const Header sig)
| Translate and merge legacy signature tags into header.
Header | headerRegenSigHeader (const Header h)
| Regenerate signature header.
static rpmRC | readPackageHeaders (FD_t fd, struct rpmlead *leadPtr, Header *sigs, Header *hdrPtr)
| Retrieve package components from file handle.
rpmRC | rpmReadPackageInfo (FD_t fd, Header *sigp, Header *hdrp)
| Return package signatures and header from file handle.
rpmRC | rpmReadPackageHeader (FD_t fd, Header *hdrp, int *isSource, int *major, int *minor)
| Return package header and lead info from file handle.

## Detailed Description

Definition in file package.c.

## Define Documentation

#define alloca_strdup | ( | _s |  | ) | strcpy(alloca(strlen(_s)+1), (_s))

Definition at line 16 of file package.c.

## Function Documentation

static rpmRC readPackageHeaders | ( | FD_t | fd,
|  | struct rpmlead * | leadPtr,
|  | Header * | sigs,
|  | Header * | hdrPtr |
| ) |  |  | `[static]`

Retrieve package components from file handle.

Parameters:

  | fd | file handle
  | leadPtr | address of lead (or NULL)
  | sigs | address of signatures (or NULL)
  | hdrPtr | address of header (or NULL)

Returns:
  rpmRC return code

Definition at line 128 of file package.c.

rpmRC rpmReadPackageHeader | ( | FD_t | fd,
|  | Header * | hdrp,
|  | int * | isSource,
|  | int * | major,
|  | int * | minor |
| ) |  |  |

Return package header and lead info from file handle.

Parameters:

  | fd | file handle

Return values:

  | hdrp | address of header (or NULL)
  | isSource | address to return lead source flag (or NULL)
  | major | address to return lead major (or NULL)
  | minor | address to return lead minor (or NULL)

Returns:
  rpmRC return code

Definition at line 249 of file package.c.

rpmRC rpmReadPackageInfo | ( | FD_t | fd,
|  | Header * | sigp,
|  | Header * | hdrp |
| ) |  |  |

Return package signatures and header from file handle.

Deprecated:
  Signature tags are appended to header in rpm-4.0.2.

Todo:
  Eliminate.

Parameters:

  | fd | file handle

Return values:

  | sigp | address of signature header (or NULL)
  | hdrp | address of header (or NULL)

Returns:
  rpmRC return code

Definition at line 237 of file package.c.