[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/25] Document define-foreign-bitmask macro
From: |
KAction |
Subject: |
[PATCH 19/25] Document define-foreign-bitmask macro |
Date: |
Mon, 18 Jul 2016 18:17:42 +0300 |
From: Dmitry Bogatov <address@hidden>
---
doc/ref/api-foreign.texi | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi
index 605dbed..6b0e34c 100644
--- a/doc/ref/api-foreign.texi
+++ b/doc/ref/api-foreign.texi
@@ -1124,6 +1124,22 @@ Here are some examples of @code{define-foreign-function}
usage:
@end example
@end deffn
address@hidden {Scheme Macro} define-foreign-bitmask name ((symbol value) ...)
+
+Define @code{name} to foreign-type record, that converts back and forth
+between C integer value and Scheme list of symbols. For example,
address@hidden
+(define-foreign-bitmask both: ((this #b01) (that #b10) (both #b11)))
+;; 0 = #b00 <-> '()
+;; 1 = #b01 <-> '(this)
+;; 2 = #b10 <-> '(that)
+;; 3 = #b11 <-> '(this that both)
address@hidden example
+
+As demonstrated by example, values can be arbitrary, but in most common
+each value have only one bit set.
address@hidden deffn
+
@c Local Variables:
@c TeX-master: "guile.texi"
@c End:
--
I may be not subscribed. Please, keep me in carbon copy.
- [PATCH 14/25] foreign/declarative: mirror more primitive types, (continued)
- [PATCH 14/25] foreign/declarative: mirror more primitive types, KAction, 2016/07/18
- [PATCH 15/25] New macro: with-pointer, KAction, 2016/07/18
- [PATCH 16/25] Configure emacs file-local indention, KAction, 2016/07/18
- [PATCH 17/25] system/foreign/declarative: unexport internal macro, KAction, 2016/07/18
- [PATCH 18/25] write documentation for (system foreign declarative), KAction, 2016/07/18
[PATCH 20/25] Document with-pointer macro, KAction, 2016/07/18
[PATCH 19/25] Document define-foreign-bitmask macro,
KAction <=
[PATCH 21/25] new module: (ice-9 xattr), KAction, 2016/07/18
[PATCH 22/25] ice-9/xattr: implement `xattr-get' function, KAction, 2016/07/18
[PATCH 24/25] Refactor defining foreign libattr function, KAction, 2016/07/18
[PATCH 25/25] ice9/attr: implement xattr-list procedure, KAction, 2016/07/18
[PATCH 23/25] Do not throw exception on missing xattr, KAction, 2016/07/18