| tcc_container_of | R Documentation |
Creates a function that recovers the parent struct pointer from a pointer to one of its members. This is the classic Linux kernel container_of macro made accessible from R.
tcc_container_of(ffi, struct_name, member_name)
ffi |
A tcc_ffi object |
struct_name |
Struct name |
member_name |
Member field name to compute offset from |
Updated tcc_ffi object
## Not run:
ffi <- tcc_ffi() |>
tcc_struct("student", list(id = "i32", marks = "i32")) |>
tcc_container_of("student", "marks") # Creates struct_student_from_marks()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.