createrepo_c library  0.2.1
C library for metadata manipulation
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
xml_parser.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_PARSER_H__
21 #define __C_CREATEREPOLIB_XML_PARSER_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "package.h"
28 #include "repomd.h"
29 
35 #define CR_CB_RET_OK 0
36 #define CR_CB_RET_ERR 1
40 typedef enum {
46  CR_XML_WARNING_SENTINEL,
48 
65 typedef int (*cr_XmlParserNewPkgCb)(cr_Package **pkg,
66  const char *pkgId,
67  const char *name,
68  const char *arch,
69  void *cbdata,
70  GError **err);
71 
78 typedef int (*cr_XmlParserPkgCb)(cr_Package *pkg,
79  void *cbdata,
80  GError **err);
81 
93  char *msg,
94  void *cbdata,
95  GError **err);
96 
113 int cr_xml_parse_primary(const char *path,
114  cr_XmlParserNewPkgCb newpkgcb,
115  void *newpkgcb_data,
116  cr_XmlParserPkgCb pkgcb,
117  void *pkgcb_data,
118  cr_XmlParserWarningCb warningcb,
119  void *warningcb_data,
120  int do_files,
121  GError **err);
122 
138 int cr_xml_parse_filelists(const char *path,
139  cr_XmlParserNewPkgCb newpkgcb,
140  void *newpkgcb_data,
141  cr_XmlParserPkgCb pkgcb,
142  void *pkgcb_data,
143  cr_XmlParserWarningCb warningcb,
144  void *warningcb_data,
145  GError **err);
146 
162 int cr_xml_parse_other(const char *path,
163  cr_XmlParserNewPkgCb newpkgcb,
164  void *newpkgcb_data,
165  cr_XmlParserPkgCb pkgcb,
166  void *pkgcb_data,
167  cr_XmlParserWarningCb warningcb,
168  void *warningcb_data,
169  GError **err);
170 
179 int
180 cr_xml_parse_repomd(const char *path,
181  cr_Repomd *repomd,
182  cr_XmlParserWarningCb warningcb,
183  void *warningcb_data,
184  GError **err);
185 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif /* __C_CREATEREPOLIB_XML_PARSER_H__ */