chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] How to deal with bit sets in chicken?


From: Anthony Carrico
Subject: [Chicken-users] How to deal with bit sets in chicken?
Date: Sat, 30 May 2009 13:36:02 -0400
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

For example, according epoll_ctl(2) on the Linux AMD64 platform, the
following are __uint32_t.

(foreign-declare "#include <sys/epoll.h>\n")
(define-foreign-variable _EPOLLET unsigned-integer32 "EPOLLET")
(define EPOLLET _EPOLLET)
(define-foreign-variable _EPOLLONESHOT unsigned-integer32 "EPOLLONESHOT")
(define EPOLLONESHOT _EPOLLONESHOT)

#;2> EPOLLET
1.84467440715621e+19
#;3> EPOLLONESHOT
1073741824
#;4>

Here I declare them as int:

(define-foreign-variable _EPOLLET int "EPOLLET")
(define EPOLLET _EPOLLET)
(define-foreign-variable _EPOLLONESHOT int "EPOLLONESHOT")
(define EPOLLONESHOT _EPOLLONESHOT)

#;8> EPOLLET
-2147483648
#;9> EPOLLONESHOT
1073741824
#;10>

It seems like I can only get fixnums or flonums, is there a way to deal
with genuine 32-bit integers? What is the best way to declare and
manipulate these in Chicken?

Thank you.

-- 
Anthony Carrico

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]