Example:
"repodata/rpm.rpm", NULL, 10, NULL);
printf("Primary XML chunk:\n%s\n", xml.primary);
printf("Filelists XML chunk:\n%s\n", xml.filelists);
printf("Other XML chunk:\n%s\n", xml.other);
free(xml.primary);
free(xml.filelists);
free(xml.other);
#define CR_XML_COMMON_NS "http://linux.duke.edu/metadata/common" |
Default namespace for primary.xml
Definition at line 64 of file xml_dump.h.
#define CR_XML_FILELISTS_NS "http://linux.duke.edu/metadata/filelists" |
Default namespace for filelists.xml
Definition at line 66 of file xml_dump.h.
#define CR_XML_OTHER_NS "http://linux.duke.edu/metadata/other" |
Default namespace for other.xml
Definition at line 68 of file xml_dump.h.
#define CR_XML_REPOMD_NS "http://linux.duke.edu/metadata/repo" |
Default namespace for repomd.xml
Definition at line 70 of file xml_dump.h.
#define CR_XML_RPM_NS "http://linux.duke.edu/metadata/rpm" |
Namespace for rpm (used in primary.xml and repomd.xml)
Definition at line 72 of file xml_dump.h.
void cr_latin1_to_utf8 |
( |
const unsigned char * |
in, |
|
|
unsigned char * |
out |
|
) |
| |
Prepare string to xml dump. If string is not utf8 it is converted (source encoding is supposed to be iso-8859-1).
- Parameters
-
in | input string. |
out | output string. space of output string must be at least (strlen(in) * 2 + 1) * sizeof(char) |
void cr_xml_dump_cleanup |
( |
) | |
|
Cleanup initialized dumping part of library
char* cr_xml_dump_filelists |
( |
cr_Package * |
package, |
|
|
GError ** |
err |
|
) |
| |
Generate filelists xml chunk from cr_Package.
- Parameters
-
- Returns
- xml chunk string or NULL on error
void cr_xml_dump_init |
( |
) | |
|
Initialize dumping part of library (Initialize libxml2).
char* cr_xml_dump_other |
( |
cr_Package * |
package, |
|
|
GError ** |
err |
|
) |
| |
Generate other xml chunk from cr_Package.
- Parameters
-
- Returns
- xml chunk string or NULL on error
char* cr_xml_dump_primary |
( |
cr_Package * |
package, |
|
|
GError ** |
err |
|
) |
| |
Generate primary xml chunk from cr_Package.
- Parameters
-
- Returns
- xml chunk string or NULL on error
char* cr_xml_dump_repomd |
( |
cr_Repomd * |
repomd, |
|
|
GError ** |
err |
|
) |
| |
Generate xml representation of cr_Repomd.
- Parameters
-
- Returns
- repomd.xml content