00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __C_CREATEREPOLIB_REPOMD_H__
00021 #define __C_CREATEREPOLIB_REPOMD_H__
00022
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026
00027 #include "checksum.h"
00028 #include "compression_wrapper.h"
00029 #include "package.h"
00030
00073 typedef struct {
00074 char *type;
00075 char *location_real;
00076 char *location_href;
00077 char *location_base;
00078 char *checksum;
00079 char *checksum_type;
00080 char *checksum_open;
00081 char *checksum_open_type;
00082 gint64 timestamp;
00083 gint64 size;
00084 gint64 size_open;
00085 int db_ver;
00087 GStringChunk *chunk;
00088 } cr_RepomdRecord;
00089
00092 typedef struct {
00093 gchar *cpeid;
00094 gchar *val;
00095 } cr_DistroTag;
00096
00099 typedef struct {
00100 gchar *revision;
00101 gchar *repoid;
00102 gchar *repoid_type;
00103 GSList *repo_tags;
00104 GSList *content_tags;
00105 GSList *distro_tags;
00106 GSList *records;
00108 GStringChunk *chunk;
00111 } cr_Repomd;
00112
00117 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
00118
00124 void cr_repomd_record_free(cr_RepomdRecord *record);
00125
00130 cr_RepomdRecord *cr_repomd_record_copy(const cr_RepomdRecord *orig);
00131
00144 int cr_repomd_record_fill(cr_RepomdRecord *record,
00145 cr_ChecksumType checksum_type,
00146 GError **err);
00147
00159 int cr_repomd_record_compress_and_fill(cr_RepomdRecord *record,
00160 cr_RepomdRecord *compressed_record,
00161 cr_ChecksumType checksum_type,
00162 cr_CompressionType compression,
00163 GError **err);
00164
00170 int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err);
00171
00177 void cr_repomd_record_load_contentstat(cr_RepomdRecord *record,
00178 cr_ContentStat *stats);
00179
00182 cr_Repomd *cr_repomd_new();
00183
00188 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
00189
00194 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
00195
00201 void cr_repomd_set_repoid(cr_Repomd *repomd,
00202 const char *repoid,
00203 const char *type);
00204
00210 void cr_repomd_add_distro_tag(cr_Repomd *repomd,
00211 const char *cpeid,
00212 const char *tag);
00213
00218 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
00219
00224 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
00225
00229 void cr_repomd_free(cr_Repomd *repomd);
00230
00233 #ifdef __cplusplus
00234 }
00235 #endif
00236
00237 #endif