handle_metadata

Function handle_metadata 

Source
pub(crate) extern "C" fn handle_metadata(
    metadata: *mut readstat_metadata_t,
    ctx: *mut c_void,
) -> c_int
Expand description

FFI callback that extracts file-level metadata from the ReadStat C parser.

Called once during parsing. Populates the ReadStatMetadata struct (accessed via the ctx pointer) with row/variable counts, encoding, timestamps, compression, and endianness.

ยงSafety

  • metadata must be a valid pointer to a readstat_metadata_t produced by the C parser.
  • ctx must be a valid pointer to a ReadStatMetadata instance that outlives this call.
  • This function must only be called by the ReadStat C library as a registered callback.