[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Map C bit-field to Gambas datatype


On 3/14/24 16:12, Jussi Lahtinen wrote:
I suppose for usage in external functions there would be nothing special, just create structure with matching variables. But if you want the memory behaviour in Gambas, then you must implement it by yourself.

Jussi

Thank you for the response, Jussi.

So then, for this structure [https://mongoose.ws/documentation/#struct-mg_connection] (which would be received by a Gambas Sub as an event handler/callback in this example [https://mongoose.ws/documentation/tutorials/http-server/#a-minimal-static-server], I could simply declare the unsigned integers as Integers or even Bytes?

Or, should I declare the connection parameter not as a structure but as a pointer and just pass it along as is, and IF I need to access it's fields use pointer arithmetic based on the SizeOf the datatypes?


On Thu, Mar 14, 2024 at 6:38 PM T Lee Davidson <t.lee.davidson@xxxxxxxxx <mailto:t.lee.davidson@xxxxxxxxx>> wrote:

    As in the subject, is it possible?

--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: Map C bit-field to Gambas datatypeBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Map C bit-field to Gambas datatypeJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
References:
Map C bit-field to Gambas datatypeT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: Map C bit-field to Gambas datatypeJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>