Expand description
FFI callback functions invoked by the ReadStat C library during parsing.
The ReadStat C parser uses a callback-driven architecture: as it reads a .sas7bdat
file, it invokes registered callbacks for metadata, variables, and values. Each
callback receives a raw *mut c_void context pointer that is cast back to the
appropriate Rust struct (ReadStatMetadata or
ReadStatData) to accumulate parsed results.
Enumsยง
- Read
Stat ๐Handler - Return codes for
ReadStatC callback functions.
Constantsยง
- DAY_
SHIFT ๐ - SAS epoch (1960-01-01) to Unix epoch (1970-01-01) offset in days.
- ROUND_
SCALE ๐ - Scale factor for rounding:
10^DECIMAL_PLACES, computed once. - SEC_
SHIFT ๐ - SAS epoch to Unix epoch offset in seconds.
Functionsยง
- handle_
metadata ๐ - FFI callback that extracts file-level metadata from the
ReadStatC parser. - handle_
value ๐ - FFI callback that extracts a single cell value during row parsing.
- handle_
variable ๐ - FFI callback that extracts per-variable metadata from the
ReadStatC parser. - round_
decimal_ ๐f32 - Rounds an f32 to [
DECIMAL_PLACES] decimal places using pure arithmetic. - round_
decimal_ ๐f64 - Rounds an f64 to [
DECIMAL_PLACES] decimal places using pure arithmetic.