createrepo_c library  0.4.0
C library for metadata manipulation
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 "checksum.h"
28 #include "compression_wrapper.h"
29 #include "package.h"
30 
73 typedef struct {
74  char *type;
75  char *location_real;
76  char *location_href;
77  char *location_base;
78  char *checksum;
79  char *checksum_type;
80  char *checksum_open;
82  gint64 timestamp;
83  gint64 size;
84  gint64 size_open;
85  int db_ver;
87  GStringChunk *chunk;
89 
92 typedef struct {
93  gchar *cpeid;
94  gchar *val;
95 } cr_DistroTag;
96 
99 typedef struct {
100  gchar *revision;
101  gchar *repoid;
102  gchar *repoid_type;
103  gchar *contenthash;
105  GSList *repo_tags;
106  GSList *content_tags;
107  GSList *distro_tags;
108  GSList *records;
110  GStringChunk *chunk;
113 } cr_Repomd;
114 
119 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
120 
127 
133 
147  cr_ChecksumType checksum_type,
148  GError **err);
149 
162  cr_RepomdRecord *compressed_record,
163  cr_ChecksumType checksum_type,
164  cr_CompressionType compression,
165  GError **err);
166 
172 int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err);
173 
180  cr_ContentStat *stats);
181 
185 
190 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
191 
196 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
197 
203 void cr_repomd_set_repoid(cr_Repomd *repomd,
204  const char *repoid,
205  const char *type);
206 
213  const char *hash,
214  const char *type);
215 
222  const char *cpeid,
223  const char *tag);
224 
229 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
230 
235 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
236 
242 cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
243 
251 
257 void cr_repomd_sort_records(cr_Repomd *repomd);
258 
262 void cr_repomd_free(cr_Repomd *repomd);
263 
266 #ifdef __cplusplus
267 }
268 #endif
269 
270 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */
cr_RepomdRecord * cr_repomd_get_record(cr_Repomd *repomd, const char *type)
GStringChunk * chunk
Definition: repomd.h:110
cr_ChecksumType
Definition: checksum.h:41
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:102
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:81
gchar * repoid
Definition: repomd.h:101
gchar * revision
Definition: repomd.h:100
GSList * content_tags
Definition: repomd.h:106
int cr_repomd_record_fill(cr_RepomdRecord *record, cr_ChecksumType checksum_type, GError **err)
char * location_base
Definition: repomd.h:77
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:75
gint64 size
Definition: repomd.h:83
void cr_repomd_free(cr_Repomd *repomd)
gint64 size_open
Definition: repomd.h:84
gchar * contenthash
Definition: repomd.h:103
gchar * cpeid
Definition: repomd.h:93
GStringChunk * chunk
Definition: repomd.h:87
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:104
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:94
void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record)
char * checksum
Definition: repomd.h:78
void cr_repomd_sort_records(cr_Repomd *repomd)
GSList * distro_tags
Definition: repomd.h:107
void cr_repomd_record_free(cr_RepomdRecord *record)
char * type
Definition: repomd.h:74
char * checksum_type
Definition: repomd.h:79
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:80
gint64 timestamp
Definition: repomd.h:82
char * location_href
Definition: repomd.h:76
GSList * records
Definition: repomd.h:108
cr_Repomd * cr_repomd_new()
GSList * repo_tags
Definition: repomd.h:105