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 gchar *contenthash;
00104 gchar *contenthash_type;
00105 GSList *repo_tags;
00106 GSList *content_tags;
00107 GSList *distro_tags;
00108 GSList *records;
00110 GStringChunk *chunk;
00113 } cr_Repomd;
00114
00119 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
00120
00126 void cr_repomd_record_free(cr_RepomdRecord *record);
00127
00132 cr_RepomdRecord *cr_repomd_record_copy(const cr_RepomdRecord *orig);
00133
00146 int cr_repomd_record_fill(cr_RepomdRecord *record,
00147 cr_ChecksumType checksum_type,
00148 GError **err);
00149
00161 int cr_repomd_record_compress_and_fill(cr_RepomdRecord *record,
00162 cr_RepomdRecord *compressed_record,
00163 cr_ChecksumType checksum_type,
00164 cr_CompressionType compression,
00165 GError **err);
00166
00172 int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err);
00173
00179 void cr_repomd_record_load_contentstat(cr_RepomdRecord *record,
00180 cr_ContentStat *stats);
00181
00184 cr_Repomd *cr_repomd_new();
00185
00190 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
00191
00196 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
00197
00203 void cr_repomd_set_repoid(cr_Repomd *repomd,
00204 const char *repoid,
00205 const char *type);
00206
00212 void cr_repomd_set_contenthash(cr_Repomd *repomd,
00213 const char *hash,
00214 const char *type);
00215
00221 void cr_repomd_add_distro_tag(cr_Repomd *repomd,
00222 const char *cpeid,
00223 const char *tag);
00224
00229 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
00230
00235 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
00236
00242 cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
00243
00250 void cr_repomd_detach_record(cr_Repomd *repomd, cr_RepomdRecord *rec);
00251
00257 void cr_repomd_sort_records(cr_Repomd *repomd);
00258
00262 void cr_repomd_free(cr_Repomd *repomd);
00263
00266 #ifdef __cplusplus
00267 }
00268 #endif
00269
00270 #endif