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