createrepo_c library
0.9.1
C library for metadata manipulation
|
Macros | |
#define | CR_CB_RET_OK 0 |
#define | CR_CB_RET_ERR 1 |
Typedefs | |
typedef int(* | cr_XmlParserNewPkgCb) (cr_Package **pkg, const char *pkgId, const char *name, const char *arch, void *cbdata, GError **err) |
typedef int(* | cr_XmlParserPkgCb) (cr_Package *pkg, void *cbdata, GError **err) |
typedef int(* | cr_XmlParserWarningCb) (cr_XmlParserWarningType type, char *msg, void *cbdata, GError **err) |
Enumerations | |
enum | cr_XmlParserWarningType { CR_XML_WARNING_UNKNOWNTAG, CR_XML_WARNING_MISSINGATTR, CR_XML_WARNING_UNKNOWNVAL, CR_XML_WARNING_BADATTRVAL, CR_XML_WARNING_MISSINGVAL, CR_XML_WARNING_BADMDTYPE, CR_XML_WARNING_SENTINEL } |
Functions | |
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_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_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) |
int | cr_xml_parse_repomd (const char *path, cr_Repomd *repomd, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err) |
int | cr_xml_parse_updateinfo (const char *path, cr_UpdateInfo *updateinfo, cr_XmlParserWarningCb warningcb, void *warningcb_data, GError **err) |
#define CR_CB_RET_ERR 1 |
Return value for callbacks signalizing error
Definition at line 38 of file xml_parser.h.
#define CR_CB_RET_OK 0 |
Return value for callbacks signalizing success
Definition at line 37 of file xml_parser.h.
typedef int(* cr_XmlParserNewPkgCb) (cr_Package **pkg, const char *pkgId, const char *name, const char *arch, void *cbdata, GError **err) |
Callback for XML parser wich is called when a new package object parsing is started. This function has to set *pkg to package object which will be populated by parser. The object could be empty, or already partially filled (by other XML parsers) package object. If the pointer is set to NULL, current package will be skiped. Note: For the primary.xml file pkgId, name and arch are NULL!
pkg | Package that will be populated. |
pkgId | pkgId (hash) of the new package (in case of filelists.xml or other.xml) or package type ("rpm" in case of primary.xml). |
name | Name of the new package. |
arch | Arch of the new package. |
cbdata | User data. |
err | GError ** |
Definition at line 68 of file xml_parser.h.
typedef int(* cr_XmlParserPkgCb) (cr_Package *pkg, void *cbdata, GError **err) |
Callback for XML parser wich is called when a package element is parsed.
pkg | Currently parsed package. |
cbdata | User data. |
err | GError ** |
Definition at line 81 of file xml_parser.h.
typedef int(* cr_XmlParserWarningCb) (cr_XmlParserWarningType type, char *msg, void *cbdata, GError **err) |
Callback for XML parser warnings. All reported warnings are non-fatal, and ignored by default. But if callback return CR_CB_RET_ERR instead of CR_CB_RET_OK then parsing is immediately interrupted.
type | Type of warning |
msg | Warning msg. The message is destroyed after the call. If you want touse the message later, you have to copy it. |
cbdata | User data. |
err | GError ** |
Definition at line 95 of file xml_parser.h.
Type of warnings reported by parsers by the warning callback.
Definition at line 42 of file xml_parser.h.
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 | ||
) |
Parse filelists.xml. File could be compressed.
path | Path to filelists.xml |
newpkgcb | Callback for new package (Called when new package xml chunk is found and package object to store the data is needed). If NULL cr_newpkgcb is used. |
newpkgcb_data | User data for the newpkgcb. |
pkgcb | Package callback. (Called when complete package xml chunk is parsed.). Could be NULL if newpkgcb is not NULL. |
pkgcb_data | User data for the pkgcb. |
warningcb | Callback for warning messages. |
warningcb_data | User data for the warningcb. |
err | GError ** |
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 | ||
) |
Parse other.xml. File could be compressed.
path | Path to other.xml |
newpkgcb | Callback for new package (Called when new package xml chunk is found and package object to store the data is needed). If NULL cr_newpkgcb is used. |
newpkgcb_data | User data for the newpkgcb. |
pkgcb | Package callback. (Called when complete package xml chunk is parsed.). Could be NULL if newpkgcb is not NULL. |
pkgcb_data | User data for the pkgcb. |
warningcb | Callback for warning messages. |
warningcb_data | User data for the warningcb. |
err | GError ** |
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 | ||
) |
Parse primary.xml. File could be compressed.
path | Path to filelists.xml |
newpkgcb | Callback for new package (Called when new package xml chunk is found and package object to store the data is needed). If NULL cr_newpkgcb is used. |
newpkgcb_data | User data for the newpkgcb. |
pkgcb | Package callback. (Called when complete package xml chunk is parsed.). Could be NULL if newpkgcb is not NULL. |
pkgcb_data | User data for the pkgcb. |
warningcb | Callback for warning messages. |
warningcb_data | User data for the warningcb. |
do_files | 0 - Ignore file tags in primary.xml. |
err | GError ** |
int cr_xml_parse_repomd | ( | const char * | path, |
cr_Repomd * | repomd, | ||
cr_XmlParserWarningCb | warningcb, | ||
void * | warningcb_data, | ||
GError ** | err | ||
) |
Parse repomd.xml. File could be compressed.
path | Path to repomd.xml |
repomd | cr_Repomd object. |
warningcb | Callback for warning messages. |
warningcb_data | User data for the warningcb. |
err | GError ** |
int cr_xml_parse_updateinfo | ( | const char * | path, |
cr_UpdateInfo * | updateinfo, | ||
cr_XmlParserWarningCb | warningcb, | ||
void * | warningcb_data, | ||
GError ** | err | ||
) |
Parse updateinfo.xml. File could be compressed.
path | Path to updateinfo.xml |
updateinfo | cr_UpdateInfo object. |
warningcb | Callback for warning messages. |
warningcb_data | User data for the warningcb. |
err | GError ** |