c-for-go
c-for-go copied to clipboard
PtrTips "sref" not behaving as expected for fundamental data types
I found this issue trying to wrap a library that returns a pointer to allocated memory through an unsigned char** parameter, and boiled it down to the following minimal sample:
Function being wrapped
void test_sref(unsigned char** char_val, int** int_val, test_struct_t** struct_val);
Relevant section of yml config
TRANSLATOR:
PtrTips:
function:
- {target: ^test_sref$, tips: [sref,sref,sref]}
Expected Output:
func test_sref(char_val **byte, int_val **int32, struct_val **test_struct_t) { ... }
Actual Output:
func test_sref(char_val []*byte, int_val []*int32, struct_val **test_struct_t) { ... }
Please advise if there is a way to tweak the yml file to produce the expected output.