diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-07-26 07:12:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-07-26 07:12:50 -0700 |
commit | 55c2dbb134edce8835cf94c2425b80db256bccf2 (patch) | |
tree | d0e506c324e0e2c4f907da61c4e5f7f2740b0ddc /txr.1 | |
parent | 6560fc0563a891294a808e880f201663365af1bd (diff) | |
download | txr-55c2dbb134edce8835cf94c2425b80db256bccf2.tar.gz txr-55c2dbb134edce8835cf94c2425b80db256bccf2.tar.bz2 txr-55c2dbb134edce8835cf94c2425b80db256bccf2.zip |
FFI: allow member type reference using referencing dot.
* ffi.c (ffi_type_compile): New case handling qref_s symbol.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -62971,6 +62971,49 @@ These additional FFI types for common C language types are provided as .code typedef aliases. +.coNP FFI type @ qref +.synb +.mets (qref < struct-type < member1 >> [ member2 ...]) +.syne +.desc +The FFI type operator +.code qref +provides a way to reference the type of a member of a struct or union. +The +.meta struct-type +argument must be a type expression denoting a struct or union. +The +.meta member1 +argument and any additional arguments must be symbols. + +If +.code S +is a struct or union type, and +.code M +is a member, then +.code "(qref S M)" +is a type expression denoting the type of +.codn M . +Moreover, if +.code M +itself is a struct or union, which has a member named +.code N +then the type of +.code N +can be denoted by the expression +.codn "(qref S M N)" . +Similarly, additional symbols reference through additional struct/union +nestings. + +Note: the referencing dot syntax can be used to write +.code qref +expressions. +For instance, +.code "(qref S M N)" +can be written as +.code S.M.N +instead. + .coNP FFI types @, blkcnt-t @, blksize-t @, clockid-t @, dev-t @, fsblkcnt-t @, fsfilcnt-t @, gid-t @, id-t @, ino-t @, key-t @, loff-t @, mode-t @, nlink-t @, off-t @, pid-t @ ssize-t and @ uid-t The additional names of various common POSIX types may also be available, depending on platform. They are provided as |