libwget-xml(3)
π NAME π
libwget-xml β XML parsing functions, bestie π
okay so this is the libwget xml page, it lives in the Library Functions Manual, and it's giving "everything you need to read XML and HTML without losing your mind" β¨
π SYNOPSIS π
β¨ Functions β¨
int wget_xml_parse_buffer (const char *buf, wget_xml_callback *callback, void *user_ctx, int hints)
void wget_html_parse_buffer (const char *buf, wget_xml_callback *callback, void *user_ctx, int hints)
void wget_xml_parse_file (const char *fname, wget_xml_callback *callback, void *user_ctx, int hints)
void wget_html_parse_file (const char *fname, wget_xml_callback *callback, void *user_ctx, int hints)
char * wget_xml_decode_entities_inline (char *src)
π¦ Detailed Description π¦
(no cap, this section is literally just the title, the actual tea is all down in the function docs π)
π Function Documentation π
π int wget_xml_parse_buffer (const char * buf, wget_xml_callback * callback, void * user_ctx, int hints)
πΈ Parameters πΈ
bufβ zero-terminated XML or HTML input data, feed it the goodscallbackβ the function that gets called for each token scan resultuser_ctxβ your own user-defined context variable, it gets handed to the callbackhintsβ flags to influence parsing π
This one scans the XML input from buf and calls callback for each token it finds. user_ctx is your own user-defined context variable and it's given to every single call of callback. iykyk.
hints may be 0 or any combination of XML_HINT_REMOVE_EMPTY_CONTENT and XML_HINT_HTML.
XML_HINT_REMOVE_EMPTY_CONTENTβ this one reduces the number of calls tocallbackby ignoring empty content and superfluous spaces. less spam, more slay β¨XML_HINT_HTMLβ turns on HTML scanning π
π void wget_html_parse_buffer (const char * buf, wget_xml_callback * callback, void * user_ctx, int hints)
πΈ Parameters πΈ
bufβ zero-terminated HTML input datacallbackβ function called for each token scan resultuser_ctxβ user-defined context variable, handed to callbackhintsβ flags to influence parsing
It's the convenience function, bestie β it literally just calls wget_xml_parse_buffer() with HTML parsing turned on. so easy. periodt. π
π void wget_xml_parse_file (const char * fname, wget_xml_callback * callback, void * user_ctx, int hints)
πΈ Parameters πΈ
fnameβ name of XML or HTML input filecallbackβ function called for each token scan resultuser_ctxβ user-defined context variable, handed to callbackhintsβ flags to influence parsing
Another convenience function β this one calls wget_xml_parse_buffer() with the file content. it's giving "I don't wanna read the file myself" energy and honestly, valid π«Ά
Iffnameis-, the data is read fromstdin. yes, the classic dash move π
π void wget_html_parse_file (const char * fname, wget_xml_callback * callback, void * user_ctx, int hints)
πΈ Parameters πΈ
fnameβ name of XML or HTML input filecallbackβ function called for each token scan resultuser_ctxβ user-defined context variable, handed to callbackhintsβ flags to influence parsing
Convenience function that calls wget_xml_parse_file() with HTML parsing turned on. so if you wanted HTML from a file, this is your main character moment π
Iffnameis-, the data is read fromstdin. same dash, same vibe π
π char * wget_xml_decode_entities_inline (char * src)
πΈ Parameters πΈ
srcβ a string
πΈ Returns πΈ
- A pointer to
src, after the XML entities have been converted
Decode XML entities from src. π
β οΈ okay so listen β the transformation is done inline, sosrcwill be modified after this function returns. it's not a copy situation, it's an in-place situation. If no XML entities have been found,srcis left untouched.
Also ngl, only a small subset of available XML entities is currently recognized. not all of them, bestie. keep that in mind π
π Author π
Generated automatically by Doxygen for wget2 from the source code. (not a human, just a robot doing its little thing π€β¨)
and that's the whole page!! this is libwget-xml(3) from wget2, Version 2.3.0 π go parse something iconic, bestie π¦π
π¦ where this page comes from
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms