createrepo_c library  0.9.1
C library for metadata manipulation
repomd.h
1 /* createrepo_c - Library of routines for manipulation with repodata
2  * Copyright (C) 2012 Tomas Mlcoch
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17  * USA.
18  */
19 
20 #ifndef __C_CREATEREPOLIB_REPOMD_H__
21 #define __C_CREATEREPOLIB_REPOMD_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <glib.h>
28 #include "checksum.h"
29 #include "compression_wrapper.h"
30 #include "package.h"
31 
74 typedef struct {
75  char *type;
76  char *location_real;
77  char *location_href;
78  char *location_base;
79  char *checksum;
80  char *checksum_type;
81  char *checksum_open;
83  gint64 timestamp;
84  gint64 size;
85  gint64 size_open;
86  int db_ver;
88  GStringChunk *chunk;
90 
93 typedef struct {
94  gchar *cpeid;
95  gchar *val;
96 } cr_DistroTag;
97 
100 typedef struct {
101  gchar *revision;
102  gchar *repoid;
103  gchar *repoid_type;
104  gchar *contenthash;
106  GSList *repo_tags;
107  GSList *content_tags;
108  GSList *distro_tags;
109  GSList *records;
111  GStringChunk *chunk;
114 } cr_Repomd;
115 
120 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
121 
128 
134 
148  cr_ChecksumType checksum_type,
149  GError **err);
150 
163  cr_RepomdRecord *compressed_record,
164  cr_ChecksumType checksum_type,
165  cr_CompressionType compression,
166  GError **err);
167 
173 int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err);
174 
181  cr_ContentStat *stats);
182 
186 
192 
197 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
198 
203 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
204 
210 void cr_repomd_set_repoid(cr_Repomd *repomd,
211  const char *repoid,
212  const char *type);
213 
220  const char *hash,
221  const char *type);
222 
229  const char *cpeid,
230  const char *tag);
231 
236 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
237 
242 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
243 
249 cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
250 
258 
263 void cr_repomd_remove_record(cr_Repomd *repomd, const char *type);
264 
270 void cr_repomd_sort_records(cr_Repomd *repomd);
271 
275 void cr_repomd_free(cr_Repomd *repomd);
276 
279 #ifdef __cplusplus
280 }
281 #endif
282 
283 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */
cr_RepomdRecord * cr_repomd_get_record(cr_Repomd *repomd, const char *type)
GStringChunk * chunk
Definition: repomd.h:111
cr_ChecksumType
Definition: checksum.h:43
cr_CompressionType
int cr_repomd_record_compress_and_fill(cr_RepomdRecord *record, cr_RepomdRecord *compressed_record, cr_ChecksumType checksum_type, cr_CompressionType compression, GError **err)
void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision)
gchar * repoid_type
Definition: repomd.h:103
void cr_repomd_add_distro_tag(cr_Repomd *repomd, const char *cpeid, const char *tag)
void cr_repomd_set_repoid(cr_Repomd *repomd, const char *repoid, const char *type)
char * checksum_open_type
Definition: repomd.h:82
gchar * repoid
Definition: repomd.h:102
gchar * revision
Definition: repomd.h:101
GSList * content_tags
Definition: repomd.h:107
int cr_repomd_record_fill(cr_RepomdRecord *record, cr_ChecksumType checksum_type, GError **err)
char * location_base
Definition: repomd.h:78
void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag)
void cr_repomd_set_contenthash(cr_Repomd *repomd, const char *hash, const char *type)
char * location_real
Definition: repomd.h:76
gint64 size
Definition: repomd.h:84
void cr_repomd_free(cr_Repomd *repomd)
gint64 size_open
Definition: repomd.h:85
gchar * contenthash
Definition: repomd.h:104
gchar * cpeid
Definition: repomd.h:94
void cr_repomd_remove_record(cr_Repomd *repomd, const char *type)
GStringChunk * chunk
Definition: repomd.h:88
cr_RepomdRecord * cr_repomd_record_new(const char *type, const char *path)
void cr_repomd_detach_record(cr_Repomd *repomd, cr_RepomdRecord *rec)
gchar * contenthash_type
Definition: repomd.h:105
cr_Repomd * cr_repomd_copy(cr_Repomd *repomd)
void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag)
cr_RepomdRecord * cr_repomd_record_copy(const cr_RepomdRecord *orig)
gchar * val
Definition: repomd.h:95
void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record)
char * checksum
Definition: repomd.h:79
void cr_repomd_sort_records(cr_Repomd *repomd)
GSList * distro_tags
Definition: repomd.h:108
void cr_repomd_record_free(cr_RepomdRecord *record)
char * type
Definition: repomd.h:75
char * checksum_type
Definition: repomd.h:80
int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err)
void cr_repomd_record_load_contentstat(cr_RepomdRecord *record, cr_ContentStat *stats)
char * checksum_open
Definition: repomd.h:81
gint64 timestamp
Definition: repomd.h:83
char * location_href
Definition: repomd.h:77
GSList * records
Definition: repomd.h:109
cr_Repomd * cr_repomd_new()
GSList * repo_tags
Definition: repomd.h:106