summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-27 06:56:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-27 06:56:58 -0700
commit4d47909dbe082a6a8313f888290543cb0765b969 (patch)
treee452bf485ae61bcd48e129b8fefee62932ffcb82 /txr.1
parent52870f75e9423ae12ac9b3254e4097520c20af86 (diff)
downloadtxr-4d47909dbe082a6a8313f888290543cb0765b969.tar.gz
txr-4d47909dbe082a6a8313f888290543cb0765b969.tar.bz2
txr-4d47909dbe082a6a8313f888290543cb0765b969.zip
ffi: new enumed type operator: enums with base type.
* ffi.c (enumed_s): New symbol variable. (ffi_type_compile): New case for enumed type op. (ffi_init): Initialize enumed_s. * ffi.h (enumed_s): Declared. * txr.1: enumed documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.126
1 files changed, 26 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 42c6bb0f..5cc0d178 100644
--- a/txr.1
+++ b/txr.1
@@ -54492,6 +54492,32 @@ that integer value itself rather than a symbol. If an integer value occurs
which is assigned to multiple enumeration symbols, it is not specified which
of those symbols is produced.
+.meIP (enumed < type < name >> {( sym << value ) | << sym }*)
+The
+.code enumed
+type operator is a generalization of
+.code enum
+which allows the base integer type of the enumeration to be specified.
+The following equivalence holds:
+
+.cblk
+ (enum n a b c ...) <--> (enumed int n a b c ...)
+.cble
+
+Any integer type or
+.meta typedef
+name may be specified for
+.metn type ,
+including any one of the endian types. The enumeration inherits its
+size, alignment and other foreign representation details from
+.metn type .
+
+The values associated with the enumeration symbols must be in
+the representation range of
+.metn type ,
+which is not checked until the conversion of a symbol
+through the enumeration is is attempted at run time.
+
.meIP (struct < name >> {( slot << type )}*)
The FFI
.code struct