Skip to main content

xmlStringCurrentChar

Function xmlStringCurrentChar 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn xmlStringCurrentChar( ctxt: *mut _xmlParserCtxt, cur: *const xmlChar, len: *mut c_int, ) -> c_int
Expand description

Decode the current character starting at cur (upstream parserInternals.c xmlStringCurrentChar).

§UPSTREAM-PARITY

int xmlStringCurrentChar(xmlParserCtxt *ctxt, const xmlChar *cur, int *len);

Returns the character value (as a UCS-4 code point) and sets *len to the number of bytes consumed. Returns 0 (with *len = 0) on error or NULL arguments. The upstream implementation ignores ctxt (it only influences encoding detection, and the candidate is UTF-8 only), so it is unused here as well.

§SAFETY

  • cur must be a valid pointer into a NUL-terminated byte string (a single NUL-terminated buffer suffices; the byte length is probed through *len, initialized to 4 as upstream).
  • len must be a valid int*.