[gambit-list] Getting char*, uchar*, short*, unsigned short*, ...
Jeremie Lasalle Ratelle
pouexmachinax at gmail.com
Fri Apr 17 13:37:26 EDT 2009
If you want to play with fire :D.
Only use in a c-fonction where the pointer won't persist in c-land.
(c-declare #<<c-declare-end
typedef ___U32* U32PTR;
___SCMOBJ SCMOBJ_to_U32PTR (___SCMOBJ src, U32PTR *dst)
{
___SCMOBJ ___temp; // for U32VECTORP
___SCMOBJ ___err = ___FIX(___NO_ERR);
if (!___U32VECTORP(src))
___err = ___FIX(___UNKNOWN_ERR);
else
{
*dst = ___CAST(___U32*,___BODY_AS(src,___tSUBTYPED));
}
return ___err;
}
#define ___BEGIN_CFUN_SCMOBJ_to_U32PTR(src,dst,i) \
if ((___err = SCMOBJ_to_U32PTR (src, &dst)) == ___FIX(___NO_ERR)) {
#define ___END_CFUN_SCMOBJ_to_U32PTR(src,dst,i) }
#define ___BEGIN_CFUN_U32PTR_to_SCMOBJ(src,dst) \
if ((___err = ___FIX(___UNKNOWN_ERR)) == ___FIX(___NO_ERR)) {
#define ___END_CFUN_U32PTR_to_SCMOBJ(src,dst) }
#define ___BEGIN_SFUN_U32PTR_to_SCMOBJ(src,dst,i) \
if ((___err = U32PTR_to_SCMOBJ (src, &dst)) == ___FIX(___NO_ERR)) {
#define ___END_SFUN_U32PTR_to_SCMOBJ(src,dst,i) }
#define ___BEGIN_SFUN_SCMOBJ_to_U32PTR(src,dst) \
{ ___err = ___FIX(___UNKNOWN_ERR);
#define ___END_SFUN_SCMOBJ_to_U32PTR(src,dst) }
c-declare-end
)
(c-define-type U32PTR "U32PTR" "U32PTR_to_SCMOBJ" "SCMOBJ_to_U32PTR")
More information about the Gambit-list
mailing list