createrepo_c library 1.2.1 C library for metadata manipulation

Functions
Package parser API.

## Functions
void | cr_package_parser_init ()
void | cr_package_parser_cleanup ()
cr_Package * | cr_package_from_rpm_base (const char *filename, int changelog_limit, cr_HeaderReadingFlags flags, GError **err)
cr_Package * | cr_package_from_rpm (const char *filename, cr_ChecksumType checksum_type, const char *location_href, const char *location_base, int changelog_limit, struct stat *stat_buf, cr_HeaderReadingFlags flags, GError **err)
struct cr_XmlStruct | cr_xml_from_rpm (const char *filename, cr_ChecksumType checksum_type, const char *location_href, const char *location_base, int changelog_limit, struct stat *stat_buf, GError **err)
struct cr_XmlStruct | cr_xml_from_rpm_ext (const char *filename, cr_ChecksumType checksum_type, const char *location_href, const char *location_base, int changelog_limit, struct stat *stat_buf, GError **err)

## Detailed Description

## Function Documentation

## ◆ cr_package_from_rpm()

cr_Package* cr_package_from_rpm | ( | const char * | filename,
|  | cr_ChecksumType | checksum_type,
|  | const char * | location_href,
|  | const char * | location_base,
|  | int | changelog_limit,
|  | struct stat * | stat_buf,
|  | cr_HeaderReadingFlags | flags,
|  | GError ** | err
| ) |  |

Generate a package object from a package file.

Parameters

  filename | filename
  checksum_type | type of checksum to be used
  location_href | package location inside repository
  location_base | location (url) of repository
  changelog_limit | number of changelog entries
  stat_buf | struct stat of the filename (optional - could be NULL)
  flags | Flags for header reading
  err | GError **

Returns
  cr_Package or NULL on error

## ◆ cr_package_from_rpm_base()

cr_Package* cr_package_from_rpm_base | ( | const char * | filename,
|  | int | changelog_limit,
|  | cr_HeaderReadingFlags | flags,
|  | GError ** | err
| ) |  |

Generate a package object from a package file. Some attributes like pkgId (checksum), checksum_type, time_file, location_href, location_base, rpm_header_start, rpm_header_end are not filled.

Parameters

  filename | filename
  changelog_limit | number of changelogs that will be loaded
  flags | Flags for header reading
  err | GError **

Returns
  cr_Package or NULL on error

## ◆ cr_package_parser_cleanup()

void cr_package_parser_cleanup | ( |  | ) |

Free global structures for package parsing.

## ◆ cr_package_parser_init()

void cr_package_parser_init | ( |  | ) |

Initialize global structures for package parsing. This function call rpmReadConfigFiles() and create global transaction set. This function should be called only once! This function is not thread safe!

## ◆ cr_xml_from_rpm()

struct cr_XmlStruct cr_xml_from_rpm | ( | const char * | filename,
|  | cr_ChecksumType | checksum_type,
|  | const char * | location_href,
|  | const char * | location_base,
|  | int | changelog_limit,
|  | struct stat * | stat_buf,
|  | GError ** | err
| ) |  |

Generate XML for the specified package.

Parameters

  filename | rpm filename
  checksum_type | type of checksum to be used
  location_href | package location inside repository
  location_base | location (url) of repository
  changelog_limit | number of changelog entries
  stat_buf | struct stat of the filename (optional - could be NULL)
  err | GError **

Returns
  struct cr_XmlStruct with primary, filelists and other xmls

## ◆ cr_xml_from_rpm_ext()

struct cr_XmlStruct cr_xml_from_rpm_ext | ( | const char * | filename,
|  | cr_ChecksumType | checksum_type,
|  | const char * | location_href,
|  | const char * | location_base,
|  | int | changelog_limit,
|  | struct stat * | stat_buf,
|  | GError ** | err
| ) |  |

Generate XML, including filelists-ext, for the specified package.

Parameters

  filename | rpm filename
  checksum_type | type of checksum to be used
  location_href | package location inside repository
  location_base | location (url) of repository
  changelog_limit | number of changelog entries
  stat_buf | struct stat of the filename (optional - could be NULL)
  err | GError **

Returns
  struct cr_XmlStruct with primary, filelists[-ext] and other xmls