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  char *location_real;
48  char *location_href;
49  char *checksum;
50  char *checksum_type;
51  char *checksum_open;
53  long timestamp;
54  long size;
55  long size_open;
56  int db_ver;
58  GStringChunk *chunk;
59 };
60 
64 struct _cr_Repomd {
65  cr_RepomdRecord pri_xml;
66  cr_RepomdRecord fil_xml;
67  cr_RepomdRecord oth_xml;
68  cr_RepomdRecord pri_sql;
69  cr_RepomdRecord fil_sql;
70  cr_RepomdRecord oth_sql;
71  cr_RepomdRecord groupfile;
72  cr_RepomdRecord cgroupfile;
73  cr_RepomdRecord updateinfo;
74  cr_RepomdRecord pkgorigins;
75  GSList *repo_tags;
76  GSList *distro_tags;
77  GSList *content_tags;
78  gchar *revision;
79 };
80 
84 typedef enum {
85  CR_MD_PRIMARY_XML,
86  CR_MD_FILELISTS_XML,
87  CR_MD_OTHER_XML,
88  CR_MD_PRIMARY_SQLITE,
89  CR_MD_FILELISTS_SQLITE,
90  CR_MD_OTHER_SQLITE,
91  CR_MD_GROUPFILE,
92  CR_MD_COMPRESSED_GROUPFILE,
93  CR_MD_UPDATEINFO,
94  CR_MD_PKGORIGINS
96 
101 cr_RepomdRecord cr_new_repomdrecord(const char *path);
102 
109 void cr_free_repomdrecord(cr_RepomdRecord record);
110 
118 int cr_fill_repomdrecord(cr_RepomdRecord record,
119  cr_ChecksumType checksum_type);
120 
132 void cr_process_groupfile_repomdrecord(cr_RepomdRecord groupfile,
133  cr_RepomdRecord compressed_groupfile,
134  cr_ChecksumType checksum_type,
135  cr_CompressionType compression);
136 
141 void cr_rename_repomdrecord_file(cr_RepomdRecord record);
142 
146 cr_Repomd cr_new_repomd();
147 
154 void cr_repomd_set_record(cr_Repomd repomd,
155  cr_RepomdRecord record,
156  cr_RepomdRecordType type);
157 
163 void cr_repomd_set_revision(cr_Repomd repomd, const char *revision);
164 
171 void cr_repomd_add_distro_tag(cr_Repomd repomd,
172  const char *cpeid,
173  const char *tag);
174 
180 void cr_repomd_add_repo_tag(cr_Repomd repomd, const char *tag);
181 
187 void cr_repomd_add_content_tag(cr_Repomd repomd, const char *tag);
188 
193 void cr_free_repomd(cr_Repomd repomd);
194 
195 
201 gchar *cr_generate_repomd_xml(cr_Repomd repomd);
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */