Re: Precisions on the forth SWIG architecture: return by value structs
Bernd Paysan <[email protected]> Wed, 14 Jun 2023 03:46:52 +0200
| Newsgroups | gmane.comp.lang.forth.gforth |
|---|---|
| Message-ID | <3204377.0WQXIW03uk@liubei> |
Am Dienstag, 13. Juni 2023, 02:17:43 CEST schrieb Bernd Paysan:
> I suggest this change here, then the type information is available and I can
> deal with it from libcc.fs.
If you want to try this, my fork of Gerald's swig code contains now all
necessary code to handle struct outputs,
https://github.com/forthy42/swig/
and Gforth git head's libcc.fs knows how to deal with it (as usual, a Debian
distribution will arrive on Thursday).
The stack effect of a C function returning a struct is then
( ptr param1 .. param_n -- )
assigning the stuct to ptr. Typical use
{ | buf[ struct-size ] }
buf[ param1 .. param_n function
What's missing is the code to adjust the stack effect for these C bindings.
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAmSJHA0ACgkQ9y2Uk5Mt oGciaQ/+OraqT9wFV/bJd4XZ4HiZD/zaDkS3ff2Ome67EkYwDnnuJntVMO4V+U9J s1s8Y45eMB25QnCr9WbaV45UCszaako/SkHzyKYUfjI1ZF7TpvPrjxRLBkT7qZOV FAN48ZgewbJlYYpyKyU/4ekGNcdi5e+Oe2lVYsQGCERmzwD3KXg2KCsTW9MD0VwO ZQ3p1Dq3t77c58Xdq6cjmNrCfvAShSBjc2jIa7h4g43LIMMRc/Q8o3iFcmJrApeC cqR7bUtbh7xUzehQxbIjSTXm0zIo5MJnEzcrC9PgynLavMGsNk6K+u3dhWLONX/v yEcuQGbry81LKLf0PhoaYHlOScvNjSWsi+ljkcvHyfdVvelfFkiT/pKrmpRNgUeh +gD8Ud1r7L9TFNAmtTwKBCw8inmPF12E0KpbwZxk65+EE9IJ6Y3BduQL4APmgG3m HoKbslqBUkul+xZue1N1ObDuteEY8UteTQx1SoPRsnqham7BfAZD1+04mAi1pAFT xkXc3dddH2L7/MDKPWbDUR2llSdEeMyBf25xXEgmwL3AiTcnN6YnrQNf7Ec/FSDd 2HA841ObyaY1XNFdrl5z9YuXNYJe8SQthLPZdH6ZK7eghLwIPGpXRnYcIo8hgZaP w0nYuuBzm7CMEJE6DzyK0wfV6Yj/zTDMjbeLaZWtT6/QOliN1S8= =P1cJ -----END PGP SIGNATURE-----