>>108352258
Here is example usage. It does what you expect
[include "util.scm"]
[import [chicken blob]]
#>
typedef struct C_Point {
int x;
int y;
} C_Point;
<#
[define-c-record C_Point [(int x) (int y)]]
[let [(p [make-C_Point 5 -9])]
[print [C_Point-x p]]
[print [C_Point-y p]]
[C_Point-x-set! p -22]
[C_Point-y-set! p 32]
[print [C_Point-x p]]
[print [C_Point-y p]]]
Keep in mind even though it uses record under the hood, the only record arg provided is a blob of memory.
See
[define-record ,record-sym buffer]
Pic related shows the other half of the macro.
>>108352272
Gemini to fix mistakes. Turn out it was largely unnecessary because there weren't many errors, the file just wasn't updating properly so I kept getting unbound variables. The macro was largely modeled after this example
https://wiki.call-cc.org/Wrapping%20simple%20c%20structs