createrepo_c library
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 
37 
41 typedef struct _cr_Repomd * cr_Repomd;
42 
47  const char *location_href;
48  char *checksum;
49  char *checksum_type;
50  char *checksum_open;
52  long timestamp;
53  long size;
54  long size_open;
55  int db_ver;
57  GStringChunk *chunk;
58 };
59 
63 struct _cr_Repomd {
64  cr_RepomdRecord pri_xml;
65  cr_RepomdRecord fil_xml;
66  cr_RepomdRecord oth_xml;
67  cr_RepomdRecord pri_sql;
68  cr_RepomdRecord fil_sql;
69  cr_RepomdRecord oth_sql;
70  cr_RepomdRecord groupfile;
71  cr_RepomdRecord cgroupfile;
72  cr_RepomdRecord updateinfo;
73  GSList *repo_tags;
74  GSList *distro_tags;
75  GSList *content_tags;
76  gchar *revision;
77 };
78 
82 typedef enum {
83  CR_MD_PRIMARY_XML,
84  CR_MD_FILELISTS_XML,
85  CR_MD_OTHER_XML,
86  CR_MD_PRIMARY_SQLITE,
87  CR_MD_FILELISTS_SQLITE,
88  CR_MD_OTHER_SQLITE,
89  CR_MD_GROUPFILE,
90  CR_MD_COMPRESSED_GROUPFILE,
91  CR_MD_UPDATEINFO
93 
98 cr_RepomdRecord cr_new_repomdrecord(const char *path);
99 
106 void cr_free_repomdrecord(cr_RepomdRecord record);
107 
116 int cr_fill_repomdrecord(const char *base_path,
117  cr_RepomdRecord record,
118  cr_ChecksumType *checksum_type);
119 
132 void cr_process_groupfile_repomdrecord(const char *base_path,
133  cr_RepomdRecord groupfile,
134  cr_RepomdRecord compressed_groupfile,
135  cr_ChecksumType *checksum_type,
136  cr_CompressionType compression);
137 
144 void cr_rename_repomdrecord_file(const char *base_path, cr_RepomdRecord record);
145 
149 cr_Repomd cr_new_repomd();
150 
157 void cr_repomd_set_record(cr_Repomd repomd,
158  cr_RepomdRecord record,
159  cr_RepomdRecordType type);
160 
166 void cr_repomd_set_revision(cr_Repomd repomd, const char *revision);
167 
174 void cr_repomd_add_distro_tag(cr_Repomd repomd,
175  const char *cpeid,
176  const char *tag);
177 
183 void cr_repomd_add_repo_tag(cr_Repomd repomd, const char *tag);
184 
190 void cr_repomd_add_content_tag(cr_Repomd repomd, const char *tag);
191 
196 void cr_free_repomd(cr_Repomd repomd);
197 
198 
204 gchar *cr_generate_repomd_xml(cr_Repomd repomd);
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */