// Init package parser
cr_package_parser_init();
- cr_dumper_init();
+ cr_xml_dump_init();
// Thread pool - User data initialization
g_thread_pool_free(pool, FALSE, TRUE);
g_message("Pool finished");
- cr_dumper_cleanup();
+ cr_xml_dump_cleanup();
cr_puts(user_data.pri_f, "</metadata>");
cr_puts(user_data.fil_f, "</filelists>");
#include "xml_dump.h"
#include "xml_dump_internal.h"
-#undef MODULE
-#define MODULE "xml_dump: "
-
void
-cr_dumper_init()
+cr_xml_dump_init()
{
xmlInitParser();
}
void
-cr_dumper_cleanup()
+cr_xml_dump_cleanup()
{
xmlCleanupParser();
}
void
-cr_dump_files(xmlNodePtr node, cr_Package *package, int primary)
+cr_xml_dump_files(xmlNodePtr node, cr_Package *package, int primary)
{
if (!node || !package->files) {
return;
}
-
struct cr_XmlStruct
cr_xml_dump(cr_Package *pkg)
{
#include "package.h"
/** \defgroup xml_dump XML dump API.
+ * \addtogroup xml_dump
+ * @{
*/
-/**@{*/
/** Default namespace for primary.xml */
#define CR_XML_COMMON_NS "http://linux.duke.edu/metadata/common"
/** Default namespace for filelists.xml */
#define CR_XML_OTHER_NS "http://linux.duke.edu/metadata/other"
/** Namespace used in primary.xml */
#define CR_XML_RPM_NS "http://linux.duke.edu/metadata/rpm"
-/**@}*/
-/** \ingroup xml_dump
- * Xml chunks for primary.xml, filelists.xml and other.xml.
+/** Xml chunks for primary.xml, filelists.xml and other.xml.
*/
struct cr_XmlStruct {
char *primary; /*!< XML chunk for primary.xml */
char *other; /*!< XML chunk for other.xml */
};
-/** \ingroup xml_dump
- * Initialize dumping part of library (Initialize libxml2).
+/** Initialize dumping part of library (Initialize libxml2).
*/
-void cr_dumper_init();
+void cr_xml_dump_init();
-/** \ingroup xml_dump
- * Cleanup initialized dumping part of library
+/** Cleanup initialized dumping part of library
*/
-void cr_dumper_cleanup();
+void cr_xml_dump_cleanup();
-/** \ingroup xml_dump
- * Generate primary xml chunk from cr_Package.
+/** Generate primary xml chunk from cr_Package.
* @param package cr_Package
* @return xml chunk string or NULL on error
*/
char *cr_xml_dump_primary(cr_Package *package);
-/** \ingroup xml_dump
- * Generate filelists xml chunk from cr_Package.
+/** Generate filelists xml chunk from cr_Package.
* @param package cr_Package
* @return xml chunk string or NULL on error
*/
char *cr_xml_dump_filelists(cr_Package *package);
-/** \ingroup xml_dump
- * Generate other xml chunk from cr_Package.
+/** Generate other xml chunk from cr_Package.
* @param package cr_Package
* @return xml chunk string or NULL on error
*/
char *cr_xml_dump_other(cr_Package *package);
-/** \ingroup xml_dump
- * Generate all three xml chunks (primary, filelists, other) from cr_Package.
+/** Generate all three xml chunks (primary, filelists, other) from cr_Package.
* @param package cr_Package
* @return cr_XmlStruct
*/
struct cr_XmlStruct cr_xml_dump(cr_Package *package);
+/** @} */
+
#ifdef __cplusplus
}
#endif
#include "xml_dump.h"
#include "xml_dump_internal.h"
-#undef MODULE
-#define MODULE "xml_dump_filelists: "
-
#define FORMAT_XML 1
#define FORMAT_LEVEL 0
void
-dump_filelists_items(xmlNodePtr root, cr_Package *package)
+cr_xml_dump_filelists_items(xmlNodePtr root, cr_Package *package)
{
/***********************************
Element: package
// Files dump
- cr_dump_files(root, package, 0);
+ cr_xml_dump_files(root, package, 0);
}
// Dump IT!
- dump_filelists_items(root, package);
+ cr_xml_dump_filelists_items(root, package);
char *result;
xmlBufferPtr buf = xmlBufferCreate();
if (buf == NULL) {
- g_critical(MODULE"%s: Error creating the xml buffer", __func__);
+ g_critical("%s: Error creating the xml buffer", __func__);
return NULL;
}
// Seems to be little bit faster than xmlDocDumpFormatMemory
* @param primary process only primary files (see cr_is_primary() function
* in the misc module)
*/
-void cr_dump_files(xmlNodePtr node, cr_Package *package, int primary);
+void cr_xml_dump_files(xmlNodePtr node, cr_Package *package, int primary);
#ifdef __cplusplus
}
#include "package.h"
#include "xml_dump.h"
-#undef MODULE
-#define MODULE "xml_dump_other: "
-
#define FORMAT_XML 1
#define FORMAT_LEVEL 0
void
-dump_changelog(xmlNodePtr root, cr_Package *package)
+cr_xml_dump_other_changelog(xmlNodePtr root, cr_Package *package)
{
if (!package->changelogs) {
return;
void
-dump_other_items(xmlNodePtr root, cr_Package *package)
+cr_xml_dump_other_items(xmlNodePtr root, cr_Package *package)
{
/***********************************
Element: package
// Changelog dump
- dump_changelog(root, package);
+ cr_xml_dump_other_changelog(root, package);
}
// Dump IT!
- dump_other_items(root, package);
+ cr_xml_dump_other_items(root, package);
char *result;
xmlBufferPtr buf = xmlBufferCreate();
if (buf == NULL) {
- g_critical(MODULE"%s: Error creating the xml buffer", __func__);
+ g_critical("%s: Error creating the xml buffer", __func__);
return NULL;
}
// Seems to be little bit faster than xmlDocDumpFormatMemory
#include "xml_dump.h"
#include "xml_dump_internal.h"
-#undef MODULE
-#define MODULE "xml_dump_primary: "
-
#define PROVIDES 0
#define CONFLICTS 1
#define OBSOLETES 2
void
-dump_pco(xmlNodePtr root, cr_Package *package, int pcotype)
+cr_xml_dump_primary_dump_pco(xmlNodePtr root, cr_Package *package, int pcotype)
{
const char *elem_name;
GSList *files = NULL;
void
-dump_base_items(xmlNodePtr root, cr_Package *package)
+cr_xml_dump_primary_base_items(xmlNodePtr root, cr_Package *package)
{
/***********************************
Element: package
// Files dump
- dump_pco(format, package, PROVIDES);
- dump_pco(format, package, REQUIRES);
- dump_pco(format, package, CONFLICTS);
- dump_pco(format, package, OBSOLETES);
- cr_dump_files(format, package, 1);
+ cr_xml_dump_primary_dump_pco(format, package, PROVIDES);
+ cr_xml_dump_primary_dump_pco(format, package, REQUIRES);
+ cr_xml_dump_primary_dump_pco(format, package, CONFLICTS);
+ cr_xml_dump_primary_dump_pco(format, package, OBSOLETES);
+ cr_xml_dump_files(format, package, 1);
}
// Dump IT!
- dump_base_items(root, package);
+ cr_xml_dump_primary_base_items(root, package);
char *result;
xmlBufferPtr buf = xmlBufferCreate();
if (buf == NULL) {
- g_critical(MODULE"%s: Error creating the xml buffer", __func__);
+ g_critical("%s: Error creating the xml buffer", __func__);
return NULL;
}
// Seems to be little bit faster than xmlDocDumpFormatMemory