createrepo_c library  0.7.4
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 <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 
191 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
192 
197 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
198 
204 void cr_repomd_set_repoid(cr_Repomd *repomd,
205  const char *repoid,
206  const char *type);
207 
214  const char *hash,
215  const char *type);
216 
223  const char *cpeid,
224  const char *tag);
225 
230 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
231 
236 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
237 
243 cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
244 
252 
258 void cr_repomd_sort_records(cr_Repomd *repomd);
259 
263 void cr_repomd_free(cr_Repomd *repomd);
264 
267 #ifdef __cplusplus
268 }
269 #endif
270 
271 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */