createrepo_c library  0.1.17
C library for metadata manipulation
 Vše Třídy Funkce Proměnné Definice typů Výčty Hodnoty výčtu Skupiny Stránky
Repomd API.

Datové struktry

struct  _cr_RepomdRecord
 
struct  _cr_Repomd
 

Definice typů

typedef struct _cr_RepomdRecordcr_RepomdRecord
 
typedef struct _cr_Repomdcr_Repomd
 

Funkce

cr_RepomdRecord cr_repomd_record_new (const char *path)
 
void cr_repomd_record_free (cr_RepomdRecord record)
 
int cr_repomd_record_fill (cr_RepomdRecord record, cr_ChecksumType checksum_type)
 
void cr_repomd_record_groupfile (cr_RepomdRecord groupfile, cr_RepomdRecord compressed_groupfile, cr_ChecksumType checksum_type, cr_CompressionType compression)
 
void cr_repomd_record_rename_file (cr_RepomdRecord record)
 
cr_Repomd cr_repomd_new ()
 
void cr_repomd_set_record (cr_Repomd repomd, cr_RepomdRecord record, const char *type)
 
void cr_repomd_set_revision (cr_Repomd repomd, const char *revision)
 
void cr_repomd_add_distro_tag (cr_Repomd repomd, const char *cpeid, const char *tag)
 
void cr_repomd_add_repo_tag (cr_Repomd repomd, const char *tag)
 
void cr_repomd_add_content_tag (cr_Repomd repomd, const char *tag)
 
void cr_repomd_free (cr_Repomd repomd)
 
gchar * cr_repomd_xml_dump (cr_Repomd repomd)
 

Detailní popis

Module for generating repomd.xml.

Example:

char *xml;
// Set some repomd stuff
cr_repomd_add_repo_tag(md, "repotag");
cr_repomd_add_content_tag(md, "contenttag");
cr_repomd_add_distro_tag(md, "foocpeid", "data");
// Create record for new metadata file
rec = cr_repomd_record_new("/foo/bar/repodata/primary.xml.xz");
// Calculate all needed parameters (uncompresed size, checksum, ...)
// Rename source file - insert checksum into the filename
// Append the record into the repomd
// Get repomd.xml content
// Note: cr_xml_dump_init() shoud be once called before dump

Dokumentace definic typů

typedef struct _cr_Repomd* cr_Repomd

cr_Repomd - object representing repomd.xml

Definice je uvedena na řádku 72 v souboru repomd.h.

cr_RepomdRecord - object representing an item from repomd.xml

Definice je uvedena na řádku 68 v souboru repomd.h.

Dokumentace funkcí

void cr_repomd_add_content_tag ( cr_Repomd  repomd,
const char *  tag 
)

Add content tag.

Parametry
repomdcr_Repomd object
tagcontent tag
void cr_repomd_add_distro_tag ( cr_Repomd  repomd,
const char *  cpeid,
const char *  tag 
)

Add distro tag.

Parametry
repomdcr_Repomd object
cpeidcpeid string (could be NULL)
tagdistro tag string
void cr_repomd_add_repo_tag ( cr_Repomd  repomd,
const char *  tag 
)

Add repo tag.

Parametry
repomdcr_Repomd object
tagrepo tag
void cr_repomd_free ( cr_Repomd  repomd)

Frees cr_Repomd object and all its cr_RepomdRecord objects

Parametry
repomdcr_Repomd object
cr_Repomd cr_repomd_new ( )

Create new empty cr_Repomd object wich represents content of repomd.xml.

int cr_repomd_record_fill ( cr_RepomdRecord  record,
cr_ChecksumType  checksum_type 
)

Fill unfilled items in the cr_RepomdRecord (calculate checksums, get file size before/after compression, etc.). Note: For groupfile you shoud use cr_repomd_record_groupfile function.

Parametry
recordcr_RepomdRecord object
checksum_typetype of checksum to use
void cr_repomd_record_free ( cr_RepomdRecord  record)

Destroy cr_RepomdRecord object. NOTE: Do NOT use this function on objects attached to cr_Repomd (by cr_repomd_set_record).

Parametry
recordcr_RepomdRecord object
void cr_repomd_record_groupfile ( cr_RepomdRecord  groupfile,
cr_RepomdRecord  compressed_groupfile,
cr_ChecksumType  checksum_type,
cr_CompressionType  compression 
)

Analogue of cr_repomd_record_fill but for groupfile. Groupfile must be set with the path to existing non compressed groupfile. Compressed group file will be created and compressed_groupfile record updated.

Parametry
groupfilecr_RepomdRecord initialized to an existing groupfile
compressed_groupfileempty cr_RepomdRecord object that will by filled
checksum_typetype of checksums
compressiontype of compression
cr_RepomdRecord cr_repomd_record_new ( const char *  path)

Creates (alloc) new cr_RepomdRecord object

Parametry
pathpath to the compressed file
void cr_repomd_record_rename_file ( cr_RepomdRecord  record)

Add a hash as prefix to the filename.

Parametry
recordcr_RepomdRecord of file to be renamed
void cr_repomd_set_record ( cr_Repomd  repomd,
cr_RepomdRecord  record,
const char *  type 
)

Set cr_Repomd record into cr_Repomd object.

Parametry
repomdcr_Repomd object
recordcr_RepomdRecord object
typetype of record ("primary, "groupfile", ...)
void cr_repomd_set_revision ( cr_Repomd  repomd,
const char *  revision 
)

Set custom revision string of repomd.

Parametry
repomdcr_Repomd object
revisionrevision string
gchar* cr_repomd_xml_dump ( cr_Repomd  repomd)

Generate repomd.xml content. Don't forget to use cr_xml_dump_init() before call this function.

Parametry
repomdcr_Repomd object
Návratová hodnota
string with repomd.xml content