{#get apath#}
A get hook supports accessing a member value of a C structure. The hook itself yields a function that, when given the address of a structure of the right type, performs the structure access. The member that is to be extracted is specified by the access path apath. Access paths are formed as follows (following a subset of the C expression syntax):
struct
tag.*
apath denotes dereferencing of
the pointer yielded by accessing the access path apath..
cid specifies that the
value of the struct
member called cid should be accessed.->
cid, as in
C, specifies a combination of dereferencing and member selection.For example, we may have
visualGetType :: Visual -> IO VisualType
visualGetType (Visual vis) = liftM cToEnum $ {#get Visual->type#} vis