createrepo_c library  0.17.5
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;
85  gint64 timestamp;
86  gint64 size;
87  gint64 size_open;
88  gint64 size_header;
89  int db_ver;
91  GStringChunk *chunk;
93 
96 typedef struct {
97  gchar *cpeid;
98  gchar *val;
99 } cr_DistroTag;
100 
103 typedef struct {
104  gchar *revision;
105  gchar *repoid;
106  gchar *repoid_type;
107  gchar *contenthash;
109  GSList *repo_tags;
110  GSList *content_tags;
111  GSList *distro_tags;
112  GSList *records;
114  GStringChunk *chunk;
117 } cr_Repomd;
118 
123 cr_RepomdRecord *cr_repomd_record_new(const char *type, const char *path);
124 
131 
137 
151  cr_ChecksumType checksum_type,
152  GError **err);
153 
167  cr_RepomdRecord *compressed_record,
168  cr_ChecksumType checksum_type,
169  cr_CompressionType compression,
170  const char *zck_dict_dir,
171  GError **err);
172 
179 
184 void cr_repomd_record_set_timestamp(cr_RepomdRecord *record, gint64 timestamp);
185 
192  cr_ContentStat *stats);
193 
200  cr_ContentStat *stats);
201 
205 
211 
217 
222 void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision);
223 
230  const char *repoid,
231  const char *type);
232 
239  const char *hash,
240  const char *type);
241 
248  const char *cpeid,
249  const char *tag);
250 
255 void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag);
256 
261 void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag);
262 
268 cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
269 
277 
282 void cr_repomd_remove_record(cr_Repomd *repomd, const char *type);
283 
290 
294 void cr_repomd_free(cr_Repomd *repomd);
295 
298 #ifdef __cplusplus
299 }
300 #endif
301 
302 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */
cr_ChecksumType
Definition: checksum.h:43
cr_CompressionType
void cr_repomd_free(cr_Repomd *repomd)
void cr_repomd_set_repoid(cr_Repomd *repomd, const char *repoid, const char *type)
void cr_repomd_remove_record(cr_Repomd *repomd, const char *type)
void cr_repomd_record_load_contentstat(cr_RepomdRecord *record, cr_ContentStat *stats)
cr_Repomd * cr_repomd_new()
int cr_repomd_record_fill(cr_RepomdRecord *record, cr_ChecksumType checksum_type, GError **err)
void cr_repomd_detach_record(cr_Repomd *repomd, cr_RepomdRecord *rec)
cr_Repomd * cr_repomd_copy(cr_Repomd *repomd)
void cr_repomd_record_set_timestamp(cr_RepomdRecord *record, gint64 timestamp)
void cr_repomd_record_free(cr_RepomdRecord *record)
cr_RepomdRecord * cr_repomd_get_record(cr_Repomd *repomd, const char *type)
cr_RepomdRecord * cr_repomd_record_new(const char *type, const char *path)
void cr_repomd_record_load_zck_contentstat(cr_RepomdRecord *record, cr_ContentStat *stats)
int cr_repomd_record_compress_and_fill(cr_RepomdRecord *record, cr_RepomdRecord *compressed_record, cr_ChecksumType checksum_type, cr_CompressionType compression, const char *zck_dict_dir, GError **err)
void cr_repomd_add_distro_tag(cr_Repomd *repomd, const char *cpeid, const char *tag)
void cr_repomd_set_revision(cr_Repomd *repomd, const char *revision)
void cr_repomd_set_record(cr_Repomd *repomd, cr_RepomdRecord *record)
void cr_repomd_sort_records(cr_Repomd *repomd)
void cr_repomd_set_contenthash(cr_Repomd *repomd, const char *hash, const char *type)
int cr_repomd_record_rename_file(cr_RepomdRecord *record, GError **err)
void cr_repomd_add_content_tag(cr_Repomd *repomd, const char *tag)
void cr_repomd_add_repo_tag(cr_Repomd *repomd, const char *tag)
cr_RepomdRecord * cr_repomd_record_copy(const cr_RepomdRecord *orig)
gchar * val
Definition: repomd.h:98
gchar * cpeid
Definition: repomd.h:97
GSList * records
Definition: repomd.h:112
gchar * contenthash_type
Definition: repomd.h:108
GStringChunk * chunk
Definition: repomd.h:114
GSList * content_tags
Definition: repomd.h:110
gchar * repoid
Definition: repomd.h:105
gchar * revision
Definition: repomd.h:104
GSList * distro_tags
Definition: repomd.h:111
gchar * repoid_type
Definition: repomd.h:106
gchar * contenthash
Definition: repomd.h:107
GSList * repo_tags
Definition: repomd.h:109
char * checksum_type
Definition: repomd.h:80
gint64 size
Definition: repomd.h:86
gint64 size_open
Definition: repomd.h:87
char * type
Definition: repomd.h:75
char * checksum_header
Definition: repomd.h:83
gint64 size_header
Definition: repomd.h:88
char * checksum
Definition: repomd.h:79
GStringChunk * chunk
Definition: repomd.h:91
char * checksum_open
Definition: repomd.h:81
char * location_href
Definition: repomd.h:77
char * checksum_open_type
Definition: repomd.h:82
gint64 timestamp
Definition: repomd.h:85
char * checksum_header_type
Definition: repomd.h:84
char * location_real
Definition: repomd.h:76
char * location_base
Definition: repomd.h:78