diff options
author | defanor <defanor@uberspace.net> | 2020-11-20 20:09:28 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2020-11-20 20:09:28 +0300 |
commit | 29002b52c9c031efaebfddef74ef8ceed6fd0157 (patch) | |
tree | ed22eaf06307eb6ffeb4a1606037392200f76242 /src/rexmpp.h | |
parent | 896304f7e00221fac40825d8072bc0bbc6fae1b0 (diff) |
Add rexmpp_xml_parse
This is intended mostly for language bindings, which may prefer to
avoid libxml2, and to rely on serialized XML for bridging.
Diffstat (limited to 'src/rexmpp.h')
-rw-r--r-- | src/rexmpp.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/rexmpp.h b/src/rexmpp.h index e1cfe0e..fa8e8bd 100644 --- a/src/rexmpp.h +++ b/src/rexmpp.h @@ -430,6 +430,14 @@ struct timeval *rexmpp_timeout (rexmpp_t *s, int rexmpp_fds (rexmpp_t *s, fd_set *read_fds, fd_set *write_fds); /** + @brief A helper function for XML parsing. + @param[in] str A string to parse. + @param[in] str_len String length. + @returns Parsed XML, or NULL on failure. +*/ +xmlNodePtr rexmpp_xml_parse (const char *str, int str_len); + +/** @brief A helper function for XML serialisation. @param[in] node An XML node. @returns A string (must be freed by the caller). @@ -490,6 +498,15 @@ xmlNodePtr rexmpp_xml_find_child (xmlNodePtr node, const char *namespace, const char *name); +/** + @brief Finds a PEP event. + @param[in] s ::rexmpp + @param[in] from JID. + @param[in] node PEP node. + @param[out] prev_event The event preceding the returned one. + @returns A pointer to the message announcing an event, or NULL on + failure. +*/ xmlNodePtr rexmpp_find_event (rexmpp_t *s, const char *from, const char *node, |