Skip to main content

raise_error_streamed

Function raise_error_streamed 

Source
pub unsafe fn raise_error_streamed(
    ctxt: *mut c_void,
    domain: c_int,
    code: c_int,
    level: c_int,
    file: *const c_char,
    line: c_int,
    col: c_int,
    str1: *const c_char,
    str2: *const c_char,
    str3: *const c_char,
    int1: c_int,
    msg: *const c_char,
    source_window: Option<(&[u8], usize)>,
    enc_bytes: Option<[u8; 4]>,
    delivery: GenericDelivery,
)
Expand description

Raise an error with upstream’s full routing (error.c 2.15 xmlVRaiseError): update the last error, then deliver to the structured handler or the selected generic channel — never both.

file/line/source_window feed the generic fragment stream (the structured handler receives the complete xmlError instead). col is the 1-based byte column (upstream input->colerr->int2); str1.. str3/int1 are the upstream extra fields; enc_bytes feeds the XML_ERR_INVALID_ENCODING “Bytes:” fragment.

§UPSTREAM-PARITY (ownership)

Like upstream xmlVSetError, every string field of the stored error is owned (xmlStrdup): file/str1/str2/str3 are heap copies, so the caller may pass transient C strings.

§SAFETY

  • ctxt may be NULL.
  • msg, file, str1, str2, str3 must be valid C strings or NULL.
  • source_window bytes must be valid for the duration of the call.