Skip to main content

VarLookupFunc

Type Alias VarLookupFunc 

Source
pub type VarLookupFunc = unsafe extern "C" fn(*mut c_void, *const xmlChar, *const xmlChar) -> *mut _xmlXPathObject;
Expand description

C callback for variable lookup.

SAFETY: This is called from C ABI boundaries (e.g. when libxml2’s XPath evaluator invokes the variable lookup hook). The implementation must not panic and must handle null pointers gracefully.

  • data — user-supplied data pointer (the var_lookup_data field).
  • ns — namespace URI of the variable (may be null for no namespace).
  • name — local part of the variable name.

Returns a pointer to an _xmlXPathObject that the caller takes ownership of, or null if the variable is not found.