createrepo_c library 0.20.1
C library for metadata manipulation
Loading...
Searching...
No Matches
xml_file.h
1/* createrepo_c - Library of routines for manipulation with repodata
2 * Copyright (C) 2013 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_XML_FILE_H__
21#define __C_CREATEREPOLIB_XML_FILE_H__
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <glib.h>
28#include "compression_wrapper.h"
29#include "package.h"
30
38typedef enum {
46
49typedef struct {
54 int header;
56 int footer;
58 long pkgs;
61
68#define cr_xmlfile_open_primary(FILENAME, COMTYPE, ERR) \
69 cr_xmlfile_open(FILENAME, CR_XMLFILE_PRIMARY, COMTYPE, ERR)
70
78#define cr_xmlfile_sopen_primary(FILENAME, COMTYPE, STAT, ERR) \
79 cr_xmlfile_sopen(FILENAME, CR_XMLFILE_PRIMARY, COMTYPE, STAT, ERR)
80
87#define cr_xmlfile_open_filelists(FILENAME, COMTYPE, ERR) \
88 cr_xmlfile_open(FILENAME, CR_XMLFILE_FILELISTS, COMTYPE, ERR)
89
97#define cr_xmlfile_sopen_filelists(FILENAME, COMTYPE, STAT, ERR) \
98 cr_xmlfile_sopen(FILENAME, CR_XMLFILE_FILELISTS, COMTYPE, STAT, ERR)
99
106#define cr_xmlfile_open_other(FILENAME, COMTYPE, ERR) \
107 cr_xmlfile_open(FILENAME, CR_XMLFILE_OTHER, COMTYPE, ERR)
108
116#define cr_xmlfile_sopen_other(FILENAME, COMTYPE, STAT, ERR) \
117 cr_xmlfile_sopen(FILENAME, CR_XMLFILE_OTHER, COMTYPE, STAT, ERR)
118
125#define cr_xmlfile_open_prestodelta(FILENAME, COMTYPE, ERR) \
126 cr_xmlfile_open(FILENAME, CR_XMLFILE_PRESTODELTA, COMTYPE, ERR)
127
135#define cr_xmlfile_sopen_prestodelta(FILENAME, COMTYPE, STAT, ERR) \
136 cr_xmlfile_sopen(FILENAME, CR_XMLFILE_PRESTODELTA, COMTYPE, STAT, ERR)
137
144#define cr_xmlfile_open_updateinfo(FILENAME, COMTYPE, ERR) \
145 cr_xmlfile_open(FILENAME, CR_XMLFILE_UPDATEINFO, COMTYPE, ERR)
146
154#define cr_xmlfile_sopen_updateinfo(FILENAME, COMTYPE, STAT, ERR) \
155 cr_xmlfile_sopen(FILENAME, CR_XMLFILE_UPDATEINFO, COMTYPE, STAT, ERR)
156
166#define cr_xmlfile_open(FILENAME, TYPE, COMTYPE, ERR) \
167 cr_xmlfile_sopen(FILENAME, TYPE, COMTYPE, NULL, ERR)
168
179cr_XmlFile *cr_xmlfile_sopen(const char *filename,
180 cr_XmlFileType type,
181 cr_CompressionType comtype,
182 cr_ContentStat *stat,
183 GError **err);
184
193int cr_xmlfile_set_num_of_pkgs(cr_XmlFile *f, long num, GError **err);
194
201int cr_xmlfile_add_pkg(cr_XmlFile *f, cr_Package *pkg, GError **err);
202
215int cr_xmlfile_add_chunk(cr_XmlFile *f, const char *chunk, GError **err);
216
222int cr_xmlfile_close(cr_XmlFile *f, GError **err);
223
234void cr_rewrite_header_package_count(gchar *original_filename,
235 cr_CompressionType xml_compression,
236 int package_count,
237 int task_count,
238 cr_ContentStat *file_stat,
239 gchar *zck_dict_file,
240 GError **err);
241
242
245#ifdef __cplusplus
246}
247#endif
248
249#endif /* __C_CREATEREPOLIB_XML_FILE_H__ */
cr_CompressionType
int cr_xmlfile_set_num_of_pkgs(cr_XmlFile *f, long num, GError **err)
void cr_rewrite_header_package_count(gchar *original_filename, cr_CompressionType xml_compression, int package_count, int task_count, cr_ContentStat *file_stat, gchar *zck_dict_file, GError **err)
int cr_xmlfile_add_pkg(cr_XmlFile *f, cr_Package *pkg, GError **err)
cr_XmlFile * cr_xmlfile_sopen(const char *filename, cr_XmlFileType type, cr_CompressionType comtype, cr_ContentStat *stat, GError **err)
cr_XmlFileType
Definition: xml_file.h:38
int cr_xmlfile_close(cr_XmlFile *f, GError **err)
int cr_xmlfile_add_chunk(cr_XmlFile *f, const char *chunk, GError **err)
@ CR_XMLFILE_PRIMARY
Definition: xml_file.h:39
@ CR_XMLFILE_PRESTODELTA
Definition: xml_file.h:42
@ CR_XMLFILE_SENTINEL
Definition: xml_file.h:44
@ CR_XMLFILE_UPDATEINFO
Definition: xml_file.h:43
@ CR_XMLFILE_FILELISTS
Definition: xml_file.h:40
@ CR_XMLFILE_OTHER
Definition: xml_file.h:41
CR_FILE * f
Definition: xml_file.h:50
long pkgs
Definition: xml_file.h:58
int footer
Definition: xml_file.h:56
int header
Definition: xml_file.h:54
cr_XmlFileType type
Definition: xml_file.h:52