createrepo_c library  0.9.1
C library for metadata manipulation
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 <glib.h>
28 #include "package.h"
29 #include "repomd.h"
30 #include "updateinfo.h"
31 
37 #define CR_CB_RET_OK 0
38 #define CR_CB_RET_ERR 1
42 typedef enum {
49  CR_XML_WARNING_SENTINEL,
51 
68 typedef int (*cr_XmlParserNewPkgCb)(cr_Package **pkg,
69  const char *pkgId,
70  const char *name,
71  const char *arch,
72  void *cbdata,
73  GError **err);
74 
81 typedef int (*cr_XmlParserPkgCb)(cr_Package *pkg,
82  void *cbdata,
83  GError **err);
84 
96  char *msg,
97  void *cbdata,
98  GError **err);
99 
116 int cr_xml_parse_primary(const char *path,
117  cr_XmlParserNewPkgCb newpkgcb,
118  void *newpkgcb_data,
119  cr_XmlParserPkgCb pkgcb,
120  void *pkgcb_data,
121  cr_XmlParserWarningCb warningcb,
122  void *warningcb_data,
123  int do_files,
124  GError **err);
125 
141 int cr_xml_parse_filelists(const char *path,
142  cr_XmlParserNewPkgCb newpkgcb,
143  void *newpkgcb_data,
144  cr_XmlParserPkgCb pkgcb,
145  void *pkgcb_data,
146  cr_XmlParserWarningCb warningcb,
147  void *warningcb_data,
148  GError **err);
149 
165 int cr_xml_parse_other(const char *path,
166  cr_XmlParserNewPkgCb newpkgcb,
167  void *newpkgcb_data,
168  cr_XmlParserPkgCb pkgcb,
169  void *pkgcb_data,
170  cr_XmlParserWarningCb warningcb,
171  void *warningcb_data,
172  GError **err);
173 
182 int
183 cr_xml_parse_repomd(const char *path,
184  cr_Repomd *repomd,
185  cr_XmlParserWarningCb warningcb,
186  void *warningcb_data,
187  GError **err);
188 
197 int
198 cr_xml_parse_updateinfo(const char *path,
199  cr_UpdateInfo *updateinfo,
200  cr_XmlParserWarningCb warningcb,
201  void *warningcb_data,
202  GError **err);
203 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif /* __C_CREATEREPOLIB_XML_PARSER_H__ */
int cr_xml_parse_other(const char *path, cr_XmlParserNewPkgCb newpkgcb, void *newpkgcb_data, cr_XmlParserPkgCb pkgcb, void *pkgcb_data, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err)
cr_XmlParserWarningType
Definition: xml_parser.h:42
int cr_xml_parse_primary(const char *path, cr_XmlParserNewPkgCb newpkgcb, void *newpkgcb_data, cr_XmlParserPkgCb pkgcb, void *pkgcb_data, cr_XmlParserWarningCb warningcb, void *warningcb_data, int do_files, GError **err)
int cr_xml_parse_repomd(const char *path, cr_Repomd *repomd, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err)
int cr_xml_parse_filelists(const char *path, cr_XmlParserNewPkgCb newpkgcb, void *newpkgcb_data, cr_XmlParserPkgCb pkgcb, void *pkgcb_data, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err)
int(* cr_XmlParserWarningCb)(cr_XmlParserWarningType type, char *msg, void *cbdata, GError **err)
Definition: xml_parser.h:95
int(* cr_XmlParserNewPkgCb)(cr_Package **pkg, const char *pkgId, const char *name, const char *arch, void *cbdata, GError **err)
Definition: xml_parser.h:68
int(* cr_XmlParserPkgCb)(cr_Package *pkg, void *cbdata, GError **err)
Definition: xml_parser.h:81
int cr_xml_parse_updateinfo(const char *path, cr_UpdateInfo *updateinfo, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err)