createrepo_c library  0.9.1
C library for metadata manipulation
Package parser API.

Functions

void cr_package_parser_init ()
 
void cr_package_parser_cleanup ()
 
cr_Packagecr_package_from_rpm_base (const char *filename, int changelog_limit, cr_HeaderReadingFlags flags, GError **err)
 
cr_Packagecr_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)
 

Detailed Description

Function Documentation

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
filenamefilename
checksum_typetype of checksum to be used
location_hrefpackage location inside repository
location_baselocation (url) of repository
changelog_limitnumber of changelog entries
stat_bufstruct stat of the filename (optional - could be NULL)
flagsFlags for header reading
errGError **
Returns
cr_Package or NULL on error
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
filenamefilename
changelog_limitnumber of changelogs that will be loaded
flagsFlags for header reading
errGError **
Returns
cr_Package or NULL on error
void cr_package_parser_cleanup ( )

Free global structures for package parsing.

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!

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
filenamerpm filename
checksum_typetype of checksum to be used
location_hrefpackage location inside repository
location_baselocation (url) of repository
changelog_limitnumber of changelog entries
stat_bufstruct stat of the filename (optional - could be NULL)
errGError **
Returns
struct cr_XmlStruct with primary, filelists and other xmls