Re: :pointer-self and LispWorks

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Tue, 12 Aug 2003 07:33:53 -0600
Newsgroups gmane.lisp.uffi.general
Message-ID <[email protected]>
--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Edi Weitz wrote:
> It looks to me like :pointer-self doesn't work with LW. (LW is 4.2.7
> pro on Linux, UFFI is 1.2.21.)

The compile error occurs when trying to allocate the structure in
TEST.

You can see what UFFI is doing by expanding the macros:
> (macroexpand-1 '(def-struct foo (bar :pointer-self)))
(FLI:DEFINE-C-STRUCT FOO (BAR (* FOO)))

Then trying to allocate the foreign object:
> (fli:with-dynamic-foreign-objects ((p foo)) )
Error: Illegal foreign type (* FOO).
=20
>   (def-struct foo
>     (bar foo-ptr))
> ...everything works fine. So, the forward reference from the

Actually, I get the same sort of error trying this:

 > (uffi:def-struct foo2 (bar :foo-ptr2))
(:STRUCT FOO2)
                                                                           =
  =20
> (uffi:def-foreign-type foo-ptr2 (* foo2))
FOO-PTR2

> (fli:with-dynamic-foreign-objects ((p foo2)) )
Error: Illegal foreign type :FOO-PTR2.

The expansion of the def-struct in this case is:
> (macroexpand-1 '(uffi:def-struct foo2  (bar :foo-ptr2)))
(FLI:DEFINE-C-STRUCT FOO2 (BAR :FOO-PTR2))

This is with LWL 4.2.7. So, I'm unsure of how to define a foreign structure=
 in
lispworks that contains a pointer. If you can let me know the
Lispworks syntax for that, then I can modify UFFI's def-struct macro
to emit the compliant code.

--=20
Kevin Rosenberg
kevin-HJRc7zDS/[email protected]

--VbJkn9YxBvnuCH5J
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/OOzBES7N8sSjgj4RAr6EAKCLY0swv26T6N7sIB1I0/SG4Vu4VgCdFj+T
GuLHq2xc7s/jGJ3Z7p6dEBM=
=6uug
-----END PGP SIGNATURE-----

--VbJkn9YxBvnuCH5J--