createrepo_c library  0.1.17
C library for metadata manipulation
 Vše Třídy Funkce Proměnné Definice typů Výčty Hodnoty výčtu Skupiny Stránky
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 "compression_wrapper.h"
28 #include "package.h"
29 
69 
72 typedef struct _cr_Repomd * cr_Repomd;
73 
77  char *location_real;
78  char *location_href;
79  char *checksum;
80  char *checksum_type;
81  char *checksum_open;
83  long timestamp;
84  long size;
85  long size_open;
86  int db_ver;
88  GStringChunk *chunk;
89 };
90 
93 struct _cr_Repomd {
94  GHashTable *records;
95  GSList *repo_tags;
96  GSList *distro_tags;
97  GSList *content_tags;
98  gchar *revision;
99 };
100 
104 cr_RepomdRecord cr_repomd_record_new(const char *path);
105 
111 void cr_repomd_record_free(cr_RepomdRecord record);
112 
119 int cr_repomd_record_fill(cr_RepomdRecord record,
120  cr_ChecksumType checksum_type);
121 
132 void cr_repomd_record_groupfile(cr_RepomdRecord groupfile,
133  cr_RepomdRecord compressed_groupfile,
134  cr_ChecksumType checksum_type,
135  cr_CompressionType compression);
136 
140 void cr_repomd_record_rename_file(cr_RepomdRecord record);
141 
144 cr_Repomd cr_repomd_new();
145 
151 void cr_repomd_set_record(cr_Repomd repomd,
152  cr_RepomdRecord record,
153  const char *type);
154 
159 void cr_repomd_set_revision(cr_Repomd repomd, const char *revision);
160 
166 void cr_repomd_add_distro_tag(cr_Repomd repomd,
167  const char *cpeid,
168  const char *tag);
169 
174 void cr_repomd_add_repo_tag(cr_Repomd repomd, const char *tag);
175 
180 void cr_repomd_add_content_tag(cr_Repomd repomd, const char *tag);
181 
185 void cr_repomd_free(cr_Repomd repomd);
186 
187 
193 gchar *cr_repomd_xml_dump(cr_Repomd repomd);
194 
197 #ifdef __cplusplus
198 }
199 #endif
200 
201 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */