wget2: XML parsing functions

| wget2 2.0.0

- Main Page
- Modules
- Data Structures
- Files

Functions
XML parsing functions

## 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)

## Detailed Description

## Function Documentation

## ◆ wget_xml_parse_buffer()

int wget_xml_parse_buffer | ( | const char * | buf,
|  | wget_xml_callback * | callback,
|  | void * | user_ctx,
|  | int | hints
| ) |  |

Parameters

  [in] | buf | Zero-terminated XML or HTML input data
  [in] | callback | Function called for each token scan result
  [in] | user_ctx | User-defined context variable, handed to `callback`
  [in] | hints | Flags to influence parsing

This function scans the XML input from `buf` and calls `callback` for each token found. `user_ctx` is a user-defined context variable and given to each call of `callback`.

`hints` may be 0 or any combination of XML_HINT_REMOVE_EMPTY_CONTENT and XML_HINT_HTML.

XML_HINT_REMOVE_EMPTY_CONTENT reduces the number of calls to `callback` by ignoring empty content and superfluous spaces.

XML_HINT_HTML turns on HTML scanning.

## ◆ wget_html_parse_buffer()

void wget_html_parse_buffer | ( | const char * | buf,
|  | wget_xml_callback * | callback,
|  | void * | user_ctx,
|  | int | hints
| ) |  |

Parameters

  [in] | buf | Zero-terminated HTML input data
  [in] | callback | Function called for each token scan result
  [in] | user_ctx | User-defined context variable, handed to `callback`
  [in] | hints | Flags to influence parsing

Convenience function that calls wget_xml_parse_buffer() with HTML parsing turned on.

## ◆ wget_xml_parse_file()

void wget_xml_parse_file | ( | const char * | fname,
|  | wget_xml_callback * | callback,
|  | void * | user_ctx,
|  | int | hints
| ) |  |

Parameters

  [in] | fname | Name of XML or HTML input file
  [in] | callback | Function called for each token scan result
  [in] | user_ctx | User-defined context variable, handed to `callback`
  [in] | hints | Flags to influence parsing

Convenience function that calls wget_xml_parse_buffer() with the file content.

If `fname` is `-`, the data is read from stdin.

## ◆ wget_html_parse_file()

void wget_html_parse_file | ( | const char * | fname,
|  | wget_xml_callback * | callback,
|  | void * | user_ctx,
|  | int | hints
| ) |  |

Parameters

  [in] | fname | Name of XML or HTML input file
  [in] | callback | Function called for each token scan result
  [in] | user_ctx | User-defined context variable, handed to `callback`
  [in] | hints | Flags to influence parsing

Convenience function that calls wget_xml_parse_file() with HTML parsing turned on.

If `fname` is `-`, the data is read from stdin.