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}