createrepo_c library  0.7.4
C library for metadata manipulation
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules 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 <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 {
48  CR_XML_WARNING_SENTINEL,
50 
67 typedef int (*cr_XmlParserNewPkgCb)(cr_Package **pkg,
68  const char *pkgId,
69  const char *name,
70  const char *arch,
71  void *cbdata,
72  GError **err);
73 
80 typedef int (*cr_XmlParserPkgCb)(cr_Package *pkg,
81  void *cbdata,
82  GError **err);
83 
95  char *msg,
96  void *cbdata,
97  GError **err);
98 
115 int cr_xml_parse_primary(const char *path,
116  cr_XmlParserNewPkgCb newpkgcb,
117  void *newpkgcb_data,
118  cr_XmlParserPkgCb pkgcb,
119  void *pkgcb_data,
120  cr_XmlParserWarningCb warningcb,
121  void *warningcb_data,
122  int do_files,
123  GError **err);
124 
140 int cr_xml_parse_filelists(const char *path,
141  cr_XmlParserNewPkgCb newpkgcb,
142  void *newpkgcb_data,
143  cr_XmlParserPkgCb pkgcb,
144  void *pkgcb_data,
145  cr_XmlParserWarningCb warningcb,
146  void *warningcb_data,
147  GError **err);
148 
164 int cr_xml_parse_other(const char *path,
165  cr_XmlParserNewPkgCb newpkgcb,
166  void *newpkgcb_data,
167  cr_XmlParserPkgCb pkgcb,
168  void *pkgcb_data,
169  cr_XmlParserWarningCb warningcb,
170  void *warningcb_data,
171  GError **err);
172 
181 int
182 cr_xml_parse_repomd(const char *path,
183  cr_Repomd *repomd,
184  cr_XmlParserWarningCb warningcb,
185  void *warningcb_data,
186  GError **err);
187 
196 int
197 cr_xml_parse_updateinfo(const char *path,
198  cr_UpdateInfo *updateinfo,
199  cr_XmlParserWarningCb warningcb,
200  void *warningcb_data,
201  GError **err);
202 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 #endif /* __C_CREATEREPOLIB_XML_PARSER_H__ */
int(* cr_XmlParserNewPkgCb)(cr_Package **pkg, const char *pkgId, const char *name, const char *arch, void *cbdata, GError **err)
Definition: xml_parser.h:67
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_XmlParserPkgCb)(cr_Package *pkg, void *cbdata, GError **err)
Definition: xml_parser.h:80
int(* cr_XmlParserWarningCb)(cr_XmlParserWarningType type, char *msg, void *cbdata, GError **err)
Definition: xml_parser.h:94
int cr_xml_parse_updateinfo(const char *path, cr_UpdateInfo *updateinfo, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err)