Adding define-c-const documentation.

This commit is contained in:
Alex Shinn 2011-12-18 13:14:22 +09:00
parent e2cae1558c
commit 5e4158a390

View file

@ -885,7 +885,7 @@ keyword.
((link addrinfo) ai_next address-info-next)) ((link addrinfo) ai_next address-info-next))
} }
@subsection{Function Interface} @subsection{Function and Constant Interface}
C functions are defined with: C functions are defined with:
@ -904,6 +904,19 @@ conversion as discussed below.
(define-c int connect (int sockaddr int)) (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} @subsection{C Types}
@subsubsection{Basic Types} @subsubsection{Basic Types}