[plt-scheme] two tricky types

From: Pupeno (pupeno at pupeno.com)
Date: Mon Sep 12 00:20:31 EDT 2005

Hello,
I am writting some FFIs on PTL Scheme 299.400 and I encountered two tricky 
types on MySQL:

One is:
	typedef char my_bool;
which is similar to foreing's bool, but it uses char instead of bool (it seems 
the mysql guys want to save memory), so, I implemented it this way:
  (define _my_bool (make-ctype _byte
                              (lambda (x)
                                (if x 1 0))
                              (lambda (x)
                                (if (= x 0) #f #t))))
Is it all-rigth?

And the other one is a bit more tricky:

#if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong;
#elif defined (__WIN__)
typedef unsigned __int64 my_ulonglong;
#else
typedef unsigned long long my_ulonglong;
#endif

I do not care about Windows but I am not sure where NO_CLIENT_LONG_LONG comes 
from, so I did:
(define _my_ulongulong (make-ctype _ulong #f #f))
any ideas if that is ok ?
Thank you.
-- 
Pupeno <pupeno at pupeno.com> (http://pupeno.com)
Vendo: Gabinete tower: http://pupeno.com/spa/vendo/#Gabinete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20050912/742ea06d/attachment.sig>

Posted on the users mailing list.