From 5e4158a3905211572f9c040fc893afd863c910fb Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 18 Dec 2011 13:14:22 +0900 Subject: [PATCH] Adding define-c-const documentation. --- doc/chibi.scrbl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/chibi.scrbl b/doc/chibi.scrbl index d3b23a10..6ac9acfb 100755 --- a/doc/chibi.scrbl +++ b/doc/chibi.scrbl @@ -885,7 +885,7 @@ keyword. ((link addrinfo) ai_next address-info-next)) } -@subsection{Function Interface} +@subsection{Function and Constant Interface} C functions are defined with: @@ -904,6 +904,19 @@ conversion as discussed below. (define-c int connect (int sockaddr int)) } +Constants can be defined with: + +@scheme{(define-c-const type name-space)} + +where @var{name-space} is the same form as in @scheme{define-c}. This +defines a Scheme variable with the same value as the C constant. + +@schemeblock{ +;; Example: define address family constants in Scheme +(define-c-const int (address-family/unix "AF_UNIX")) +(define-c-const int (address-family/inet "AF_INET")) +} + @subsection{C Types} @subsubsection{Basic Types}