createrepo_c library 1.2.1 C library for metadata manipulation

xml_dump.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_XML_DUMP_H__
21 #define __C_CREATEREPOLIB_XML_DUMP_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <glib.h>
28 #include "deltarpms.h"
29 #include "package.h"
30 #include "repomd.h"
31 #include "updateinfo.h"
32
66 #define CR_XML_COMMON_NS "http://linux.duke.edu/metadata/common"
67
68 #define CR_XML_FILELISTS_NS "http://linux.duke.edu/metadata/filelists"
69
70 #define CR_XML_FILELISTS_EXT_NS "http://linux.duke.edu/metadata/filelists-ext"
71
72 #define CR_XML_OTHER_NS "http://linux.duke.edu/metadata/other"
73
74 #define CR_XML_REPOMD_NS "http://linux.duke.edu/metadata/repo"
75
76 #define CR_XML_RPM_NS "http://linux.duke.edu/metadata/rpm"
77
78
81 struct cr_XmlStruct {
82 char *primary;
83 char *filelists;
84 char *filelists_ext;
85 char *other;
86 };
87
90 typedef enum {
91 CR_XML_DUMP_DO_PRETTY_PRINT, /* do a pretty print when dumping the XML */
92
93 CR_XML_DUMP_OPTION_COUNT,
94 CR_XML_DUMP_OPTION_MAX = 1024
95 } cr_dump_parameter;
96
102 void cr_xml_dump_init();
103
106 void cr_xml_dump_set_parameter(cr_dump_parameter param, int value);
107
110 int cr_xml_dump_get_parameter(cr_dump_parameter param);
111
114 void cr_xml_dump_cleanup();
115
121 char *cr_xml_dump_primary(cr_Package *package, GError **err);
122
128 char *cr_xml_dump_filelists(cr_Package *package, GError **err);
129
135 char *cr_xml_dump_filelists_ext(cr_Package *package, GError **err);
136
142 char *cr_xml_dump_other(cr_Package *package, GError **err);
143
149 struct cr_XmlStruct cr_xml_dump(cr_Package *package, GError **err);
150
156 struct cr_XmlStruct cr_xml_dump_ext(cr_Package *package, GError **err);
157
163 char *cr_xml_dump_repomd(cr_Repomd *repomd, GError **err);
164
170 char *cr_xml_dump_updateinfo(cr_UpdateInfo *updateinfo, GError **err);
171
177 char *cr_xml_dump_updaterecord(cr_UpdateRecord *rec, GError **err);
178
184 char *cr_xml_dump_deltapackage(cr_DeltaPackage *dpkg, GError **err);
185
195 void cr_latin1_to_utf8(const unsigned char *in,
196 unsigned char *out) __attribute__ ((hot));
197
205 gboolean cr_hascontrollchars(const unsigned char *str);
206
213 gchar *cr_prepend_protocol(const gchar *url);
214
221 gboolean cr_Package_contains_forbidden_control_chars(cr_Package *pkg);
222
229 gboolean cr_GSList_of_cr_Dependency_contains_forbidden_control_chars(GSList *deps);
230
233 #ifdef __cplusplus
234 }
235 #endif
236
237 #endif /* __C_CREATEREPOLIB_XML_DUMP_H__ */
cr_latin1_to_utf8
void cr_latin1_to_utf8(const unsigned char *in, unsigned char *out) __attribute__((hot))
cr_dump_parameter
cr_dump_parameter
Definition: xml_dump.h:90
cr_xml_dump_set_parameter
void cr_xml_dump_set_parameter(cr_dump_parameter param, int value)
cr_xml_dump_deltapackage
char * cr_xml_dump_deltapackage(cr_DeltaPackage *dpkg, GError **err)
cr_UpdateInfo
Definition: updateinfo.h:105
cr_Package_contains_forbidden_control_chars
gboolean cr_Package_contains_forbidden_control_chars(cr_Package *pkg)
cr_xml_dump_other
char * cr_xml_dump_other(cr_Package *package, GError **err)
cr_XmlStruct::other
char * other
Definition: xml_dump.h:85
cr_xml_dump_ext
struct cr_XmlStruct cr_xml_dump_ext(cr_Package *package, GError **err)
cr_XmlStruct::filelists_ext
char * filelists_ext
Definition: xml_dump.h:84
cr_Repomd
Definition: repomd.h:103
cr_xml_dump_init
void cr_xml_dump_init()
cr_xml_dump_updateinfo
char * cr_xml_dump_updateinfo(cr_UpdateInfo *updateinfo, GError **err)
cr_xml_dump_updaterecord
char * cr_xml_dump_updaterecord(cr_UpdateRecord *rec, GError **err)
cr_GSList_of_cr_Dependency_contains_forbidden_control_chars
gboolean cr_GSList_of_cr_Dependency_contains_forbidden_control_chars(GSList *deps)
cr_XmlStruct::primary
char * primary
Definition: xml_dump.h:82
cr_xml_dump_repomd
char * cr_xml_dump_repomd(cr_Repomd *repomd, GError **err)
cr_XmlStruct::filelists
char * filelists
Definition: xml_dump.h:83
cr_prepend_protocol
gchar * cr_prepend_protocol(const gchar *url)
cr_xml_dump_primary
char * cr_xml_dump_primary(cr_Package *package, GError **err)
cr_xml_dump
struct cr_XmlStruct cr_xml_dump(cr_Package *package, GError **err)
cr_xml_dump_filelists
char * cr_xml_dump_filelists(cr_Package *package, GError **err)
cr_xml_dump_cleanup
void cr_xml_dump_cleanup()
cr_Package
Definition: package.h:84
cr_xml_dump_filelists_ext
char * cr_xml_dump_filelists_ext(cr_Package *package, GError **err)
cr_xml_dump_get_parameter
int cr_xml_dump_get_parameter(cr_dump_parameter param)
cr_hascontrollchars
gboolean cr_hascontrollchars(const unsigned char *str)
cr_UpdateRecord
Definition: updateinfo.h:81
cr_DeltaPackage
Definition: deltarpms.h:43
cr_XmlStruct
Definition: xml_dump.h:81