You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Duncan Jones edited this page Nov 8, 2018
·
2 revisions
Void pointers are challenging because we have no idea what type is being referenced, so we can't automatically create a corresponding Go type and copy across the data.
To tackle this, a TOML configuration file should be supplied that specifies a mapping from each void pointer instance to a C type.
For example, this input file has two void pointers that we need to map:
If we know that a1 is always a pointer to a TypeA and that we want to treat val1 as a TypeB, we can pass a config file to header2go containing this information:
In this case, we reference the C types using replaceWith = "<typedef-name>". If we need to reference a struct name instead, then we should use replaceWith = "struct <struct-name>".
A config file can have multiple voidParam and voidField tables.