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 <glib.h>
00028 #include "checksum.h"
00029 #include "compression_wrapper.h"
00030 #include "package.h"
00031
00074 typedef struct {
00075 char *type;
00076 char *location_real;
00077 char *location_href;
00078 char *location_base;
00079 char *checksum;
00080 char *checksum_type;
00081 char *checksum_open;
00082 char *checksum_open_type;
00083 gint64 timestamp;
00084 gint64 size;
00085 gint64 size_open;
00086 int db_ver;
00088 GStringChunk *chunk;
00089 } cr_RepomdRecord;
00090
00093 typedef struct {
00094 gchar *cpeid;
00095 gchar *val;
00096 } cr_DistroTag;
00097
00100 typedef struct {
00101 gchar *revision;
00102 gchar *repoid;
00103 gchar *repoid_type;
00104 gchar *contenthash;
00105 gchar *contenthash_type;
00106 GSList *repo_tags;
00107 GSList *content_tags;
00108 GSList *distro_tags;
00109 GSList *records;
00111 GStringChunk *chunk;
00114 } cr_Repomd;
00115
00120 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
00121
00127 void cr_repomd_record_free(cr_RepomdRecord *record);
00128
00133 cr_RepomdRecord *cr_repomd_record_copy(const cr_RepomdRecord *orig);
00134
00147 int cr_repomd_record_fill(cr_RepomdRecord *record,
00148 cr_ChecksumType checksum_type,
00149 GError **err);
00150
00162 int cr_repomd_record_compress_and_fill(cr_RepomdRecord *record,
00163 cr_RepomdRecord *compressed_record,
00164 cr_ChecksumType checksum_type,
00165 cr_CompressionType compression,
00166 GError **err);
00167
00173 int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err);
00174
00180 void cr_repomd_record_load_contentstat(cr_RepomdRecord *record,
00181 cr_ContentStat *stats);
00182
00185 cr_Repomd *cr_repomd_new();
00186
00191 cr_Repomd *cr_repomd_copy(cr_Repomd *repomd);
00192
00197 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
00198
00203 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
00204
00210 void cr_repomd_set_repoid(cr_Repomd *repomd,
00211 const char *repoid,
00212 const char *type);
00213
00219 void cr_repomd_set_contenthash(cr_Repomd *repomd,
00220 const char *hash,
00221 const char *type);
00222
00228 void cr_repomd_add_distro_tag(cr_Repomd *repomd,
00229 const char *cpeid,
00230 const char *tag);
00231
00236 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
00237
00242 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
00243
00249 cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
00250
00257 void cr_repomd_detach_record(cr_Repomd *repomd, cr_RepomdRecord *rec);
00258
00263 void cr_repomd_remove_record(cr_Repomd *repomd, const char *type);
00264
00270 void cr_repomd_sort_records(cr_Repomd *repomd);
00271
00275 void cr_repomd_free(cr_Repomd *repomd);
00276
00279 #ifdef __cplusplus
00280 }
00281 #endif
00282
00283 #endif