[plt-scheme] two tricky types

From: Hans Oesterholt (hdnews at gawab.com)
Date: Mon Sep 12 05:33:00 EDT 2005

Shouldn't someone be writing a FFI backend for SWIG?


Pupeno schreef:

>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;
>typedef unsigned long long my_ulonglong;
>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.
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.