Skip to main content

xmlStringLenDecodeEntities

Function xmlStringLenDecodeEntities 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn xmlStringLenDecodeEntities( ctxt: *mut _xmlParserCtxt, str: *const xmlChar, len: c_int, what: c_int, end: xmlChar, end2: xmlChar, end3: xmlChar, ) -> *mut xmlChar
Expand description

Expand general entity references in a string with a known length (upstream parser.c xmlStringLenDecodeEntities).

§UPSTREAM-PARITY

xmlChar *xmlStringLenDecodeEntities(xmlParserCtxt *ctxt,
                                    const xmlChar *str, int len,
                                    int what, xmlChar end,
                                    xmlChar end2, xmlChar end3);

Returns NULL when ctxt/str is NULL, len < 0, str[len] != 0, or any end marker is non-zero (the git-version contract). what is ignored, matching upstream where it is marked ATTRIBUTE_UNUSED. Otherwise returns a freshly allocated string with references expanded (numeric references and predefined/general entities; see expand_entity_into for the simplifications).

§SAFETY

  • ctxt must be a valid xmlParserCtxt* or NULL.
  • str must point to a buffer of at least len + 1 readable bytes with str[len] == 0 (upstream reads str[len] unconditionally).