S3 class for run-time type information of foreign C data types
typeinfo.Rd
S3 class for run-time type information of foreign C data types.
Usage
typeinfo(name, type = c("base","pointer","struct","union"),
size = NA, align = NA, basetype = NA, fields = NA,
signature = NA)
get_typeinfo(name, envir = parent.frame())
Arguments
- name
character string specifying the type name.
- type
character string specifying the type.
- size
integer, size of type in bytes.
- align
integer, alignment of type in bytes.
- basetype
character string, base type of 'pointer' types.
- signature
character string specifying the struct/union type signature.
- envir
the environment to look for type object.
- fields
data frame with type and offset information that specifies aggregate struct and union types.
Details
Type information objects are created at run-time to describe the concrete layout of foreign C data types on the host machine. While type signatures give an abstract information on e.g. the field types and names of aggregate structure types, these objects store concrete memory size, alignment and layout information about C data types.
Value
List object tagged as S3 class 'typeinfo' with the following named entries
- type
Type name.
- size
Size in bytes.
- align
Alignment in bytes.
- fields
Data frame for field information with the following columns:
type
type name offset
byte offset (starts counted from 0)
See also
cstruct
for details on the framework for handling foreign C
data types.