pub(crate) extern "C" fn handle_variable(
index: c_int,
variable: *mut readstat_variable_t,
val_labels: *const c_char,
ctx: *mut c_void,
) -> c_intExpand description
FFI callback that extracts per-variable metadata from the ReadStat C parser.
Called once for each variable (column) in the dataset. Populates a
ReadStatVarMetadata entry in the ReadStatMetadata::vars map
with the variable’s name, type, label, and SAS format classification.
§Safety
variablemust be a valid pointer to areadstat_variable_tproduced by the C parser.ctxmust be a valid pointer to aReadStatMetadatainstance that outlives this call.- This function must only be called by the
ReadStatC library as a registered callback.