createrepo_c library  0.2.1
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  GSList *repo_tags;
104  GSList *content_tags;
105  GSList *distro_tags;
106  GSList *records;
108  GStringChunk *chunk;
111 } cr_Repomd;
112 
117 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
118 
125 
131 
145  cr_ChecksumType checksum_type,
146  GError **err);
147 
160  cr_RepomdRecord *compressed_record,
161  cr_ChecksumType checksum_type,
162  cr_CompressionType compression,
163  GError **err);
164 
170 int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err);
171 
178  cr_ContentStat *stats);
179 
183 
188 void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record);
189 
194 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
195 
201 void cr_repomd_set_repoid(cr_Repomd *repomd,
202  const char *repoid,
203  const char *type);
204 
211  const char *cpeid,
212  const char *tag);
213 
218 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
219 
224 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
225 
229 void cr_repomd_free(cr_Repomd *repomd);
230 
233 #ifdef __cplusplus
234 }
235 #endif
236 
237 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */