Returns the byte offset of a field within a structure, accounting for alignment requirements. Similar to C's offsetof() macro.
Details
For packed structures (created with pack parameter), this function computes
the offset using the specified packing alignment rather than natural alignment.
Examples
if (FALSE) { # \dontrun{
Point <- ffi_struct(x = ffi_int(), y = ffi_double())
ffi_offsetof(Point, "x") # 0
ffi_offsetof(Point, "y") # 8 (aligned to 8-byte boundary)
# Packed struct example
Packed <- ffi_struct(a = ffi_uint8(), b = ffi_int32(), .pack = 1)
ffi_offsetof(Packed, "b") # 1 (no padding with .pack=1)
} # }